/* =====================================================================
   夏汇川 个人学术网站 · 样式
   主色：北大红 #94070A  / 深灰文字 / 米白背景
   字体：思源宋体（标题）+ 思源黑体（正文）
   ===================================================================== */

:root {
  --pku-red: #94070A;
  --pku-red-dark: #740508;
  --pku-red-light: #b3171b;
  --ink: #1a1a1a;
  --ink-soft: #444;
  --ink-muted: #666;
  --bg: #faf8f5;
  --bg-panel: #ffffff;
  --bg-accent: #f4efe8;
  --line: #e6e0d8;
  --gold: #c9a227;
  --serif: "Noto Serif SC", "Source Serif 4", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,.08);
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

/* 英文模式切换字体 */
html[lang="en"] body {
  font-family: "Inter", "Source Serif 4", "Noto Sans SC", sans-serif;
}
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3,
html[lang="en"] .serif { font-family: "Source Serif 4", "Noto Serif SC", serif; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px;
}
.brand {
  font-family: var(--serif);
  font-weight: 700; font-size: 20px;
  color: var(--pku-red);
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
}
.brand::after {
  content: "";
  display: inline-block; vertical-align: 4px;
  margin-left: 10px; width: 1px; height: 18px;
  background: var(--line);
}
.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 15px; padding: 8px 14px; border-radius: 6px;
  transition: all .2s;
}
.nav a:hover { color: var(--pku-red); background: var(--bg-accent); }
.nav a.active { color: var(--pku-red); font-weight: 600; }

.topbar-right { display: flex; align-items: center; }
.lang-switch {
  border: 1px solid var(--line); background: var(--bg-panel);
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
  transition: all .2s;
}
.lang-switch:hover { border-color: var(--pku-red); color: var(--pku-red); }
.lang-switch .lang-sep { color: var(--line); }
.lang-switch.active-zh .lang-zh { color: var(--pku-red); font-weight: 700; }
.lang-switch.active-en .lang-en { color: var(--pku-red); font-weight: 700; }

/* ============ 通用布局 ============ */
main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
.section-head { margin-bottom: 40px; }
.section-eyebrow {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--pku-red); font-weight: 600; margin-bottom: 8px;
}
.section-title {
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  color: var(--ink); line-height: 1.3;
}
.section-title::after {
  content: ""; display: block; width: 48px; height: 3px;
  background: var(--pku-red); margin-top: 14px;
}

/* ============ 首页 Hero ============ */
.hero {
  position: relative;
  padding: 88px 0 64px;
  display: flex; align-items: center; gap: 48px;
}
.hero::before {
  content: ""; position: absolute; top: 0; right: -200px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(148,7,10,.06), transparent 70%);
  pointer-events: none;
}
.hero-avatar {
  flex: 0 0 auto;
  width: 168px; height: 168px; border-radius: 50%;
  background: #f4efe8 center/cover no-repeat;
  background-image: url('avatar.jpg');
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero-avatar::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, transparent 55%, rgba(148,7,10,.12) 100%);
  pointer-events: none;
}
.hero-avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 28%;
  display: block;
}
.hero-avatar::after {
  content: ""; position: absolute; inset: -6px;
  border-radius: 50%; border: 2px solid var(--line);
}
.hero-text { flex: 1 1 auto; }
.hero-name {
  font-family: var(--serif); font-size: 46px; font-weight: 700;
  color: var(--ink); line-height: 1.2; margin-bottom: 6px;
}
.hero-title {
  font-size: 19px; color: var(--pku-red); font-weight: 500; margin-bottom: 4px;
}
.hero-org { font-size: 16px; color: var(--ink-soft); margin-bottom: 16px; }
.hero-tagline {
  font-family: var(--serif); font-size: 17px; color: var(--ink-soft);
  font-style: italic; margin-bottom: 28px; max-width: 560px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 8px; text-decoration: none;
  font-size: 15px; font-weight: 600; transition: all .2s;
}
.btn-primary { background: var(--pku-red); color: #fff; }
.btn-primary:hover { background: var(--pku-red-dark); box-shadow: var(--shadow-md); }
.btn-ghost { border: 1.5px solid var(--pku-red); color: var(--pku-red); background: transparent; }
.btn-ghost:hover { background: var(--bg-accent); }

/* ============ 数据统计 ============ */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat {
  padding: 28px 20px; text-align: center;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--serif); font-size: 40px; font-weight: 700;
  color: var(--pku-red); line-height: 1;
}
.stat-unit { font-size: 15px; color: var(--ink-soft); margin-top: 8px; font-weight: 500; }
.stat-sub { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

/* ============ 卡片 ============ */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  transition: all .25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #d9cfc2; }
.card-icon {
  width: 46px; height: 46px; border-radius: 10px;
  background: var(--bg-accent); display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; color: var(--pku-red);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 12px; color: var(--ink); }
.card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.75; }

/* ============ 时间线（教育/经历） ============ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--pku-red); border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--pku-red);
}
.tl-period { font-size: 13px; color: var(--pku-red); font-weight: 600; letter-spacing: .5px; }
.tl-title { font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 4px 0 2px; }
.tl-sub { font-size: 14.5px; color: var(--ink-muted); }

/* ============ 论文列表 ============ */
.pub-item {
  padding: 22px 0; border-bottom: 1px solid var(--line);
  display: flex; gap: 20px; align-items: flex-start;
}
.pub-item:last-child { border-bottom: none; }
.pub-type {
  flex: 0 0 130px; font-size: 12px; font-weight: 600; color: var(--pku-red);
  padding-top: 4px; letter-spacing: .5px;
}
.pub-body { flex: 1 1 auto; }
.pub-cite { font-size: 15px; color: var(--ink); line-height: 1.7; }
.pub-cite a { color: var(--pku-red); text-decoration: none; }
.pub-cite a:hover { text-decoration: underline; }
.pub-note {
  display: inline-block; margin-top: 8px; font-size: 12px;
  background: var(--bg-accent); color: var(--ink-muted);
  padding: 3px 10px; border-radius: 12px;
}

/* ============ 列表（项目/奖项/服务） ============ */
.check-list { list-style: none; }
.check-list li {
  position: relative; padding: 12px 0 12px 30px;
  border-bottom: 1px solid #f0ebe4; font-size: 15px; color: var(--ink-soft);
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
  content: ""; position: absolute; left: 4px; top: 20px;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--pku-red); opacity: .7;
}

/* ============ 引用块 ============ */
.quote-block {
  background: var(--bg-accent); border-left: 4px solid var(--pku-red);
  padding: 26px 30px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
}
.quote-block p { font-family: var(--serif); font-size: 17px; color: var(--ink); line-height: 1.8; }
.quote-block .quote-src { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }

/* ============ 课程表格 ============ */
.course-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.course-table th, .course-table td {
  text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.course-table th {
  background: var(--bg-accent); color: var(--ink); font-weight: 600;
  font-size: 14px; letter-spacing: .5px;
}
.course-table td:first-child { font-weight: 600; color: var(--ink); }

/* ============ 联系 ============ */
.contact-card {
  background: linear-gradient(135deg, var(--pku-red), var(--pku-red-dark));
  color: #fff; border-radius: var(--radius); padding: 44px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.contact-item h4 { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; margin-bottom: 8px; font-weight: 500; }
.contact-item p, .contact-item a { color: #fff; font-size: 16px; text-decoration: none; line-height: 1.6; }
.contact-item a:hover { text-decoration: underline; }

/* ============ CV 简历页 ============ */
.cv-sub { margin-top: 10px; color: var(--ink-muted); font-size: 14px; }
.cv-download {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 40px;
}
.cv-download-note { width: 100%; font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.cv-h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink);
  margin: 40px 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--line);
}
.cv-h3:first-of-type { margin-top: 0; }
.cv-pubs { list-style: decimal; padding-left: 22px; }
.cv-pubs li {
  font-size: 14.5px; line-height: 1.75; color: var(--ink-soft);
  margin-bottom: 10px; padding-left: 6px;
}
.cv-pubs li::marker { color: var(--pku-red); font-weight: 600; }
.cv-doi { color: var(--pku-red); text-decoration: none; font-size: 13px; white-space: nowrap; }
.cv-doi:hover { text-decoration: underline; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--line); background: var(--bg-panel);
  margin-top: 40px;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.footer-name { font-family: var(--serif); font-size: 18px; color: var(--ink); font-weight: 600; }
.footer-dept { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.footer-note { font-size: 12.5px; color: var(--ink-muted); margin-top: 14px; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; gap: 28px; padding-top: 56px; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .contact-card { grid-template-columns: 1fr; }
  .nav { display: none; }
}
