:root {
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --bg-page: #f4f4f5;
  --bg-card: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --success: #10b981;
  --success-soft: #d1fae5;
  --success-text: #047857;
  --tag-bg: #f4f4f5;
  --tag-text: #3f3f46;
  --tag-border: #e4e4e7;
  --badge-bg: #18181b;
  --badge-text: #fafafa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-page);
  padding: 2rem 1rem;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent-hover);
}

.resume-container {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ===== Profile：左对齐，头像在前 ===== */
.profile {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow:
    0 0 0 3px var(--bg-card),
    0 0 0 5px var(--accent-soft);
}
.profile-meta {
  flex: 1;
  min-width: 0;
}
.name {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* 状态/联系/技能行：全部左对齐 */
.status-row,
.contact-row,
.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.status-row {
  margin-bottom: 0.5rem;
}
.contact-row {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.skills-row {
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--success-soft);
  color: var(--success-text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.location {
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.divider {
  color: var(--text-tertiary);
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}
a.contact-item:hover {
  color: var(--accent);
  text-decoration: none;
}
.icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  padding: 0.32rem 0.8rem;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.skill-tag:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}
.skill-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ===== 主体 ===== */
.content {
  padding: 1.5rem 2rem;
}
section {
  margin-bottom: 1.75rem;
}
section:last-child {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-title::before {
  content: "";
  width: 3px;
  height: 0.95rem;
  background: var(--accent);
  border-radius: 2px;
}

.experience-item {
  margin-bottom: 1.25rem;
}
.experience-item:last-child {
  margin-bottom: 0;
}

/* 教育条目：左侧带学校 logo */
.edu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.edu-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.edu-content {
  flex: 1;
  min-width: 0;
}
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.15rem;
}
.company {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.position {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--text-primary);
  border: 1px solid var(--tag-border);
  font-weight: 500;
}
.tech-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 2px;
}

.project-item {
  margin-bottom: 0.6rem;
}
.project-item:last-child {
  margin-bottom: 0;
}
.project-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0.4rem 0 0.3rem;
  color: var(--text-primary);
}
.project-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.4rem;
}
.project-description ul,
.activity-items {
  list-style: disc;
  padding-left: 1.1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.project-description strong,
.activity-items strong {
  color: var(--text-primary);
  font-weight: 600;
}
.project-description li,
.activity-items li {
  margin-bottom: 0.2rem;
}
.project-description li::marker,
.activity-items li::marker {
  color: var(--text-tertiary);
}

.link-list {
  list-style: none;
  padding: 0;
}
.link-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.link-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.footer {
  padding: 0.75rem 2rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: right;
}

/* ===== PDF 导出按钮（固定右上角）===== */
.btn-print {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.btn-print:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-print:active {
  transform: translateY(0);
}
.btn-print svg {
  width: 14px;
  height: 14px;
}

/* ===== 暗色模式（跟随系统）===== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --bg-page: #09090b;
    --bg-card: #18181b;
    --border: #27272a;
    --border-strong: #3f3f46;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.15);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.16);
    --success-text: #6ee7b7;
    --tag-bg: #27272a;
    --tag-text: #d4d4d8;
    --tag-border: #3f3f46;
    --badge-bg: #fafafa;
    --badge-text: #18181b;
  }
  .resume-container {
    box-shadow: none;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  body {
    padding: 0;
  }
  .resume-container {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .profile {
    padding: 1.25rem 1rem;
    gap: 1rem;
  }
  .avatar {
    width: 56px;
    height: 56px;
  }
  .name {
    font-size: 1.35rem;
  }
  .content {
    padding: 1.25rem 1rem;
  }
  .footer {
    padding: 0.75rem 1rem;
  }
  .experience-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }
  .btn-print {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* ===== 打印样式（A4，强制亮色，PDF 友好）===== */
@media print {
  :root {
    --text-primary: #000;
    --text-secondary: #333;
    --text-tertiary: #666;
    --bg-page: #fff;
    --bg-card: #fff;
    --border: #ccc;
    --accent: #000;
    --accent-hover: #000;
    --accent-soft: transparent;
    --success: #000;
    --success-soft: transparent;
    --success-text: #000;
    --tag-bg: transparent;
    --tag-text: #000;
    --tag-border: #999;
    --badge-bg: #000;
    --badge-text: #fff;
  }
  .status-tag { border: 1px solid #000; border-radius: 2px; }
  .edu-logo { width: 38px; height: 38px; }
  .btn-print { display: none !important; }
  .avatar { box-shadow: none !important; }
  .skill-tag,
  .tech-tag {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    font-weight: 400 !important;
  }
  .status-tag::before { animation: none !important; box-shadow: none !important; }
  .section-title::before { background: #000 !important; }
  .tech-icon { display: none !important; }
  @page {
    size: A4;
    margin: 12mm 14mm;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    padding: 0;
    font-size: 10.5pt;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .resume-container {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
  }
  .profile {
    padding: 0 0 0.5rem;
    border-bottom: 1px solid #ccc;
  }
  .content {
    padding: 0.6rem 0;
  }
  .avatar {
    width: 56px;
    height: 56px;
  }
  .name {
    font-size: 16pt;
  }
  .section-title {
    font-size: 9pt;
    margin-bottom: 0.4rem;
    padding-bottom: 0.2rem;
  }
  section {
    margin-bottom: 0.9rem;
  }
  .experience-item {
    margin-bottom: 0.65rem;
    page-break-inside: avoid;
  }
  .company {
    font-size: 11pt;
  }
  .date,
  .position,
  .tech-tag,
  .skill-tag,
  .contact-row,
  .location,
  .project-description ul,
  .activity-items {
    font-size: 9.5pt;
  }
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  .resume-container,
  .skill-tag,
  .tech-tag,
  .status-tag {
    box-shadow: none !important;
    border-radius: 2px;
  }
  .footer {
    border-top: 1px solid #ccc;
    padding: 0.3rem 0;
    font-size: 8.5pt;
  }
}
