/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding: 40px 20px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  overflow-x: auto;
}

/* ========== 页面容器 ========== */
.page {
  max-width: 210mm;
  width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  padding: 50px 55px;
  box-shadow: 0 0 20px rgba(0,0,0,0.08);
  border-radius: 4px;
}

/* ========== 头部 ========== */
.header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #2c5282;
}

.name {
  font-size: 32px;
  font-weight: 700;
  color: #1a365d;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.title {
  font-size: 18px;
  color: #4a5568;
  margin-bottom: 12px;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: 14px;
  color: #4a5568;
}

.contact-item {
  white-space: nowrap;
}

/* ========== 通用区块 ========== */
.section {
  margin-bottom: 22px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c5282;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

/* ========== 技能（分类行样式） ========== */
.skill-line {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 4px;
}

.skill-line:last-child {
  margin-bottom: 0;
}

.skill-cat {
  font-weight: 700;
  color: #2c5282;
}

.skill-items {
  color: #4a5568;
}

/* ========== 列表项通用 ========== */
.item {
  margin-bottom: 16px;
}

.item-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 6px;
}

.item-title {
  font-weight: 700;
  font-size: 16px;
  color: #1a202c;
}

.item-role {
  font-size: 14px;
  color: #4a5568;
}

.item-entity {
  font-size: 12px;
  color: #a0aec0;
  padding-left: 2px;
}

.item-period {
  font-size: 14px;
  color: #718096;
  margin-left: auto;
}

.item-link {
  font-size: 14px;
  color: #2c5282;
  margin-left: auto;
}
.item-link a {
  color: #2c5282;
  text-decoration: underline;
}
.item-link a:hover {
  color: #1a365d;
}

.item-desc {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.7;
}

.item-links {
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.6;
}
.item-links a {
  color: #2c5282;
  text-decoration: none;
  margin-left: 6px;
}
.item-links a:first-child {
  margin-left: 0;
}
.item-links a:hover {
  text-decoration: underline;
}

.item-list {
  list-style: none;
  padding-left: 0;
}

.item-list li {
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  color: #4a5568;
  line-height: 1.8;
}

.item-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #2c5282;
  font-weight: bold;
}

/* ========== 简介文本 ========== */
.summary {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.8;
  text-align: justify;
}

/* ========== 打印优化（核心） ========== */
@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .page {
    max-width: 100%;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  /* 避免元素被截断 */
  .section, .item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 标题和列表前避免孤行 */
  .section-title, .item-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* 确保头部不被截断 */
  .header {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 隐藏打印不需要的元素 */
  .no-print { display: none !important; }
}

/* ========== 导出按钮 ========== */
.print-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  background: #2c5282;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background 0.2s;
}
.print-btn:hover {
  background: #1a365d;
}

/* ========== 响应式 ========== */
@media screen and (max-width: 640px) {
  body {
    padding: 10px;
  }

  .page {
    min-height: auto;
    padding: 24px 20px;
  }

  .name {
    font-size: 24px;
    letter-spacing: 1px;
  }

  .title {
    font-size: 15px;
  }

  .contact {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
  }

  .contact-item {
    white-space: normal;
  }

  .section-title {
    font-size: 14px;
  }

  .item-header {
    flex-direction: column;
    gap: 2px;
  }

  .item-period {
    margin-left: 0;
  }

  .print-btn {
    bottom: 16px;
    right: 16px;
    padding: 8px 16px;
    font-size: 13px;
  }
}
