/* =========================================================
   毛弋鑫 · 学术简历
   左侧栏（照片 / 联系方式 / 导航） + 右侧内容区
   深海军蓝 · 纯白 · 浅灰
   ========================================================= */

:root {
  --navy-900: #0B2138;
  --navy-800: #10314F;
  --navy-700: #17466F;
  --navy-soft: #EDF2F7;
  --navy-line: #D7E0E9;

  --bg: #FFFFFF;
  --bg-soft: #F5F7F9;

  --ink: #1B2430;
  --ink-body: #33404D;
  --muted: #5C6875;
  --faint: #8B96A2;
  --label: #A6B0BB;

  --line: #E2E6EA;
  --line-soft: #EDF0F2;

  --serif: "Source Serif 4", "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --sidebar-w: 268px;
  --sidebar-gap: 56px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------- App shell ------------------- */
.app {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 44px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--sidebar-gap);
  align-items: start;
}

/* ------------------- Sidebar ------------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 40px 0 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* 移动端顶部条（桌面隐藏） */
.sidebar__bar { display: none; }

.sidebar__panel { display: block; }

/* 照片 */
.sidebar__photos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo {
  margin: 0;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  line-height: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* 姓名 */
.sidebar__identity { margin-top: 18px; }

.sidebar__name {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: var(--navy-800);
}

.sidebar__latin {
  margin: 5px 0 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}

/* 联系方式 */
.sidebar__contact {
  margin: 14px 0 0;
  padding: 14px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.sidebar__contact li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.sidebar__contact li:last-child { margin-bottom: 0; }

.c-label {
  flex: 0 0 36px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--label);
}

.c-label--inline { flex: 0 0 auto; margin-right: 6px; }

.c-value {
  color: var(--muted);
  word-break: break-all;
  transition: color .18s ease;
}

a.c-value:hover { color: var(--navy-700); }

.contact-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.contact-split > span { display: inline-flex; align-items: baseline; }

/* 导航 */
.nav { margin-top: 20px; }

.nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: var(--ink-body);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav__item:hover { background: var(--bg-soft); color: var(--navy-700); }

.nav__item.is-active {
  background: var(--navy-soft);
  border-left-color: var(--navy-700);
  color: var(--navy-800);
  font-weight: 600;
}

.nav__en {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--label);
  white-space: nowrap;
}

.nav__item.is-active .nav__en { color: var(--navy-700); }

/* ------------------- Content ------------------- */
.content {
  padding: 54px 0 92px;
  min-width: 0;
  max-width: 900px;
}

/* 研究方向（仅主页） */
.direction {
  padding-bottom: 30px;
  border-bottom: 2px solid var(--navy-800);
}

.direction__eyebrow {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label);
}

.tags {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  color: var(--navy-700);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.tags--lg .tag {
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 模块 */
.section { margin-top: 52px; }

.section.is-first { margin-top: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.section__title {
  position: relative;
  margin: 0;
  padding-bottom: 12px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--navy-800);
}

.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34px;
  height: 2px;
  background: var(--navy-700);
}

.section__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--label);
  white-space: nowrap;
}

/* ------------------- Education ------------------- */
.edu { margin: 0; padding: 0; list-style: none; }

.edu__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.edu__item:first-child { border-top: 0; padding-top: 4px; }

.edu__school {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}

.edu__dept { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }

.edu__stats {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.edu__stats .metric { font-weight: 700; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--navy-line);
  border-radius: 3px;
  background: var(--navy-soft);
  color: var(--navy-700);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.badge--accent {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.badge--program {
  background: #fff;
  border-color: var(--navy-line);
  color: var(--navy-700);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.edu__degree {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-700);
  white-space: nowrap;
}

.edu__date {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------- Timeline ------------------- */
.timeline {
  margin: 0;
  padding: 0 0 0 26px;
  list-style: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 10px;
  width: 1px;
  background: var(--line);
}

.entry { position: relative; padding-bottom: 40px; }
.entry:last-child { padding-bottom: 0; }

.entry::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--navy-700);
}

.entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
}

.entry__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}

.entry__meta {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  white-space: nowrap;
  font-size: 13px;
}

.entry__role { font-weight: 600; color: var(--navy-700); }
.entry__date { color: var(--faint); font-variant-numeric: tabular-nums; }

.entry__sub { margin: 5px 0 0; font-size: 13px; color: var(--muted); }

.bullets { margin: 13px 0 0; padding: 0; list-style: none; }

.bullets li {
  position: relative;
  padding-left: 17px;
  margin-bottom: 9px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-body);
}

.bullets li:last-child { margin-bottom: 0; }

.bullets li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy-line);
}

sub { font-size: 0.72em; }

/* 关键量化数据 */
.metric {
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  padding: 0 1px;
}

/* ------------------- Achievements ------------------- */
.achievements {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.achievement {
  padding: 20px 24px;
  background: var(--bg-soft);
  border-left: 3px solid var(--navy-700);
  border-radius: 2px;
}

.achievement__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.achievement__chips { display: flex; gap: 8px; }

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  background: var(--navy-800);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.8;
  white-space: nowrap;
}

.chip--muted {
  background: transparent;
  border: 1px solid var(--navy-line);
  color: var(--navy-700);
}

.achievement__date {
  font-size: 12.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.achievement__title {
  margin: 14px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--ink);
}

.achievement__desc {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-body);
}

/* ------------------- Honors ------------------- */
.honors {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 44px;
}

.honors li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-body);
}

.honors li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy-700);
}

/* ------------------- Page transition ------------------- */
.fade-in { animation: fadeIn .42s cubic-bezier(.22,.61,.36,1) both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { animation: none; }
}

/* ------------------- Tablet / Mobile ------------------- */
@media (max-width: 980px) {
  .app {
    display: block;
    max-width: none;
    padding: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .sidebar__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 22px;
  }

  .sidebar__bar-name {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--navy-800);
  }

  .sidebar__toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
  }

  .sidebar__toggle:hover { border-color: var(--navy-line); background: var(--bg-soft); }

  .sidebar__toggle-bars,
  .sidebar__toggle-bars::before,
  .sidebar__toggle-bars::after {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--navy-800);
    transition: transform .22s ease, opacity .22s ease;
  }

  .sidebar__toggle-bars { position: relative; }

  .sidebar__toggle-bars::before,
  .sidebar__toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .sidebar__toggle-bars::before { top: -5px; }
  .sidebar__toggle-bars::after { top: 5px; }

  .sidebar.is-open .sidebar__toggle-bars { background: transparent; }
  .sidebar.is-open .sidebar__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
  .sidebar.is-open .sidebar__toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

  .sidebar__panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 34px rgba(11, 33, 56, 0.12);
    max-height: calc(100vh - 58px);
    overflow-y: auto;
  }

  .sidebar.is-open .sidebar__panel { display: block; }

  .sidebar__photos {
    flex-direction: row;
    gap: 10px;
    max-width: none;
    margin: 0;
  }

  .sidebar__photos .photo { width: 200px; max-width: 100%; aspect-ratio: 3 / 4; }
  .sidebar__photos .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

  .content {
    max-width: none;
    padding: 34px 22px 72px;
  }
}

@media (max-width: 640px) {
  .edu__item {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 15px 0;
  }
  .edu__item .edu__main { margin-bottom: 4px; }
  .edu__degree, .edu__date { white-space: normal; }

  .honors { grid-template-columns: 1fr; gap: 10px; }

  .section { margin-top: 44px; }
  .section__title { font-size: 21px; }

  .tags--lg .tag { padding: 8px 17px; font-size: 14px; }

  .entry__meta { white-space: normal; flex-wrap: wrap; gap: 4px 12px; }
}

@media (max-width: 420px) {
  .content { padding: 28px 18px 60px; }
  .achievement { padding: 18px; }
}

/* ------------------- 矮屏适配 ------------------- */
/* 视口较矮时压缩照片与间距，保证侧边栏导航完整可见 */
@media (min-width: 981px) and (max-height: 900px) {
  .sidebar { padding: 30px 0; }
  .sidebar__photos { max-width: 190px; gap: 10px; }
  .sidebar__identity { margin-top: 14px; }
  .sidebar__contact { margin-top: 12px; padding-top: 12px; }
  .nav { margin-top: 16px; }
}

@media (min-width: 981px) and (max-height: 800px) {
  .sidebar { padding: 22px 0; }
  .sidebar__photos { max-width: 150px; gap: 8px; }
  .sidebar__name { font-size: 21px; }
  .sidebar__latin { margin-top: 3px; }
  .sidebar__contact { margin-top: 10px; padding-top: 10px; }
  .sidebar__contact li { margin-bottom: 4px; }
  .nav { margin-top: 14px; }
  .nav__item { padding: 6px 11px; font-size: 13.5px; }
}
/* ------------------- Print ------------------- */
@media print {
  @page { size: A4; margin: 14mm 16mm; }

  .app { display: block; max-width: none; padding: 0; }

  .content { max-width: none; padding: 0; }

  [hidden] { display: block !important; }

  /* 打印时把侧边栏转为紧凑页眉：保留姓名与联系方式，去掉照片与导航 */
  .sidebar {
    display: block !important;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 10pt;
    margin-bottom: 18pt;
    border-bottom: 1px solid #C9D2DA;
  }

  .sidebar__bar,
  .sidebar__photos,
  .sidebar__latin,
  .nav { display: none !important; }

  .sidebar__panel { display: block !important; padding: 0; border: 0; box-shadow: none; position: static; }

  .sidebar__identity { margin: 0; }

  .sidebar__name { font-size: 19pt; }

  .sidebar__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 2pt 18pt;
    margin: 6pt 0 0;
    padding: 0;
    border-top: 0;
    font-size: 9.5pt;
  }

  .sidebar__contact li { margin: 0; }

  .contact-split { border-top: 0; margin: 0; padding: 0; }

  .direction { margin-bottom: 20pt; }

  body { font-size: 10.5pt; line-height: 1.6; color: #000; }

  .section { margin-top: 22pt; break-inside: avoid; }
  .entry { break-inside: avoid; }
  .achievement { break-inside: avoid; }

  .tag, .chip, .edu__item, .achievement,
  .section__title, .honors li::before, .bullets li::before,
 .entry::before, .timeline::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .fade-in { animation: none; }
}