/* =====================================================================
 *  style.css —— 全站样式
 * ---------------------------------------------------------------------
 *  想改主题色、字体、尺寸：只需修改第 1 节（浅色）和第 2 节（深色）的 CSS 变量。
 *
 *  目录
 *    1. 设计变量（颜色 / 字体 / 尺寸）
 *    2. 深色模式（跟随系统设置）
 *    3. 基础样式
 *    4. 顶部栏（标志 / 语言切换 / 导出按钮）
 *    5. 页面布局与导航
 *    6. Hero 个人信息区
 *    7. 板块通用样式（标题 / 条目 / 要点 / 标签）
 *    8. 各板块专属样式
 *    9. 页脚与其他
 *   10. 响应式（平板 / 手机）
 *   11. 打印样式（导出 PDF）
 * ===================================================================== */


/* =====================================================================
 * 1. 设计变量
 * ===================================================================== */
:root {
  /* —— 主题色（低饱和度的“学院蓝”）——————————————————————————
   * 想换颜色，改下面 5 行即可。几组可以直接替换的配色（主色 / 悬停 / 浅底 / 浅线）：
   *   墨绿  #2f5e4e  #244a3d  #e8f0ec  #c3d6cc
   *   酒红  #7a2e3a  #61242e  #f5eaec  #e0c5ca
   *   靛青  #3b4a7a  #2e3a61  #ebedf5  #c9cee3
   *   石墨  #3d4249  #2c3035  #eeeff0  #cfd2d5
   * 深色模式下的主题色在第 2 节单独设置。                                 */
  --accent: #2f5b7c;          /* 主题色：链接、高亮、装饰线 */
  --accent-hover: #244861;    /* 主题色悬停态（略深） */
  --accent-soft: #eaf0f5;     /* 主题色浅底：选中项、标签背景 */
  --accent-line: #c5d5e2;     /* 主题色浅线 */
  --on-accent: #ffffff;       /* 主题色背景上的文字 */

  /* —— 中性色 —— */
  --bg: #fafaf8;              /* 页面背景（略带暖调的白） */
  --surface: #ffffff;         /* 卡片、按钮背景 */
  --text: #1c2024;            /* 主要文字 */
  --text-2: #454b54;          /* 次要文字（正文段落） */
  --text-3: #6b7079;          /* 辅助文字（日期、说明） */
  --border: #e5e2dc;          /* 分隔线 */
  --border-strong: #d2cec6;   /* 较深的边框 */
  --header-bg: rgba(250, 250, 248, 0.86);   /* 顶部栏半透明背景 */
  --selection: rgba(47, 91, 124, 0.16);     /* 选中文字的背景 */

  /* —— 字体（全部为系统自带字体，不加载任何在线字体）——
   * --font-latin：英文无衬线；--font-cjk：中文；--font-serif：英文衬线（用于姓名和板块标题）
   * 中文页面会优先使用中文字体，英文页面优先使用英文字体（见第 3 节）。        */
  --font-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial;
  --font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC";
  --font-serif: Charter, "Bitstream Charter", "Sitka Text", "Iowan Old Style", Cambria, Georgia;

  /* —— 尺寸 —— */
  --header-h: 60px;           /* 顶部栏高度 */
  --sidebar-w: 176px;         /* 桌面端侧边导航宽度 */
  --content-w: 760px;         /* 正文最大宽度 */
  --col-gap: 72px;            /* 侧边导航与正文之间的距离 */
  --gutter: 24px;             /* 页面左右留白 */
  --avatar: 156px;            /* 头像尺寸 */
  --avatar-radius: 50%;       /* 头像圆角：50% 为圆形；改成 14px 则为圆角方形 */
  --radius: 10px;             /* 卡片圆角 */
  --layout-max: calc(var(--sidebar-w) + var(--col-gap) + var(--content-w) + var(--gutter) * 2);
}


/* =====================================================================
 * 2. 深色模式（跟随系统；打印时不会生效）
 * ===================================================================== */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --accent: #8db4d4;
    --accent-hover: #abc8e1;
    --accent-soft: #1c2935;
    --accent-line: #34506a;
    --on-accent: #0e1419;

    --bg: #121518;
    --surface: #181c20;
    --text: #e3e6e9;
    --text-2: #b6bcc4;
    --text-3: #8e959f;
    --border: #262b31;
    --border-strong: #363c44;
    --header-bg: rgba(18, 21, 24, 0.84);
    --selection: rgba(141, 180, 212, 0.25);
  }
}


/* =====================================================================
 * 3. 基础样式
 * ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-latin), var(--font-cjk), sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  font-kerning: normal;
  font-synthesis-style: none;    /* 中文没有斜体时不生成难看的“伪斜体” */
  text-autospace: normal;        /* 新版浏览器会在中英文之间自动加入细小间隙 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* 中文页面：中文字体优先，行高略大，字距略松 */
html[lang^="zh"] body {
  font-family: var(--font-cjk), var(--font-latin), sans-serif;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: var(--text);
}

::selection {
  background: var(--selection);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* 键盘用户的“跳到正文”链接：平时隐藏，按 Tab 时出现 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: var(--on-accent);
  text-decoration: none;
}

/* 仅打印时显示的元素 */
@media screen {
  .print-only {
    display: none !important;
  }
}

.sep {
  display: inline-block;
  margin: 0 0.5em;
  color: var(--text-3);
  opacity: 0.7;
}

/* 被“·”分隔的每一段整体换行 */
.part {
  display: inline-block;
}


/* =====================================================================
 * 4. 顶部栏
 * ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--border);
}

.topbar-inner {
  max-width: var(--layout-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-serif), var(--font-cjk), serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* 姓名在滚过 Hero 后才淡入显示 */
.brand-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.topbar.show-brand .brand-name {
  opacity: 1;
  transform: none;
}

.toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 语言切换：分段按钮 */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-3);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-solid:hover {
  background: var(--accent-hover);
}

.btn-label-short {
  display: none;
}


/* =====================================================================
 * 5. 页面布局与导航
 *    桌面端（≥ 1024px）：左侧固定目录 + 右侧正文
 *    平板 / 手机：目录变为 Hero 下方的横向导航条（见第 10 节）
 * ===================================================================== */
.layout {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.layout:focus {
  outline: none;
}

.content {
  min-width: 0;
  padding: 56px 0 96px;
}

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, var(--content-w));
    grid-template-areas:
      "hero hero"
      "nav  content";
    column-gap: var(--col-gap);
    justify-content: center;
  }

  .hero { grid-area: hero; }
  .sidenav { grid-area: nav; padding-top: 63px; }
  .content { grid-area: content; }

  .sidenav-inner {
    position: sticky;
    top: calc(var(--header-h) + 36px);
  }

  .sidenav-title {
    margin: 0 0 10px;
    padding-left: 16px;
    color: var(--text-3);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .nav-list {
    list-style: none;
    border-left: 1px solid var(--border);
  }

  .nav-list a {
    display: block;
    margin-left: -1px;
    padding: 6px 0 6px 16px;
    border-left: 2px solid transparent;
    color: var(--text-3);
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .nav-list a:hover {
    color: var(--text);
    text-decoration: none;
  }

  .nav-list a.is-active {
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
  }
}


/* =====================================================================
 * 6. Hero 个人信息区
 * ===================================================================== */
.hero {
  padding: 72px 0 60px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 28px 40px;
}

/* 桌面端：头像对齐左侧目录栏，文字对齐正文栏 */
@media (min-width: 1024px) {
  .hero-inner {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, var(--content-w));
    column-gap: var(--col-gap);
  }

  .hero--no-photo .hero-text {
    grid-column: 1 / -1;
  }
}

.hero-photo {
  flex: none;
  width: var(--avatar);
  height: var(--avatar);
  overflow: hidden;
  border-radius: var(--avatar-radius);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--border);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 头像图片加载失败时显示名字缩写 */
.hero-photo.is-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-serif), var(--font-cjk), serif;
  font-size: calc(var(--avatar) * 0.3);
  font-weight: 600;
}

.hero-text {
  min-width: 0;
}

.hero-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.45em;
  color: var(--text);
  font-family: var(--font-serif), var(--font-cjk), serif;
  font-size: clamp(2.125rem, 1.6rem + 1.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

html[lang^="zh"] .name-primary {
  letter-spacing: 0.08em;
}

.name-secondary {
  color: var(--text-3);
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-affil {
  margin-top: 14px;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 500;
}

.hero-meta {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.9375rem;
}

.hero-tagline {
  max-width: 40em;
  margin-top: 14px;
  color: var(--text-2);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.4;
}

.contact .icon {
  width: 15px;
  height: 15px;
}

a.contact:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}


/* =====================================================================
 * 7. 板块通用样式
 * ===================================================================== */
.section {
  scroll-margin-top: calc(var(--header-h) + 28px);
}

.section + .section {
  margin-top: 64px;
}

/* 板块标题：文字 + 向右延伸的细线 */
.section-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
  color: var(--text);
  font-family: var(--font-serif), var(--font-cjk), serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

html[lang^="zh"] .section-title {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 简历式条目：左侧内容，右侧时间 */
.entry + .entry {
  margin-top: 30px;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
}

.entry-title {
  min-width: 0;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
}

.entry-date {
  flex: none;
  color: var(--text-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.entry-sub {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.entry-meta {
  color: var(--text-3);
  font-size: 0.9rem;
}

.entry-meta .label {
  color: var(--text-3);
}

.entry-body {
  margin-top: 10px;
}

.entry-desc {
  color: var(--text-2);
}

.entry-desc + .points {
  margin-top: 6px;
}

/* 要点列表 */
.points {
  list-style: none;
  color: var(--text-2);
}

.points li {
  position: relative;
  padding-left: 18px;
}

.points li + li {
  margin-top: 4px;
}

.points li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.8em;
  top: calc(0.5lh - 2.5px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

/* 段落中的链接加下划线，便于识别 */
.inline-link {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
}

.inline-link:hover {
  text-decoration-color: currentColor;
}

/* 技术标签 */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* 相关链接（代码 / PDF / arXiv 等） */
.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 500;
}

.link .icon {
  width: 14px;
  height: 14px;
}

/* 徽章：获奖级别、论文状态 */
.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--t1 {   /* 国际级 / 国家级：实心 */
  background: var(--accent);
  color: var(--on-accent);
}

.badge--t2 {   /* 省部级 / 市级 / 论文状态：浅底 */
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--t3 {   /* 校级 / 院级 / 其他：描边 */
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-3);
}


/* =====================================================================
 * 8. 各板块专属样式
 * ===================================================================== */

/* —— 个人简介 —— */
.prose {
  color: var(--text-2);
}

.prose p + p {
  margin-top: 0.9em;
}

/* —— 研究兴趣：卡片 —— */
.interest-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.interest {
  padding: 18px 18px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.interest::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: var(--accent);
}

.interest-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.interest-detail {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* —— 教育背景：成绩面板 —— */
.edu-panel {
  margin-top: 14px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.points + .edu-panel {
  margin-top: 12px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 44px;
}

.stat dt,
.courses-label {
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat dd {
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.courses {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.stats:empty + .courses,
.courses:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.courses-label {
  margin-bottom: 4px;
}

.course-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px 32px;
}

.course-list li {
  display: flex;
  align-items: baseline;
  align-items: last baseline;   /* 课程名换行时，成绩对齐最后一行 */
  gap: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.75;
}

.course-name {
  min-width: 0;
}

.course-leader {   /* 课程名与成绩之间的虚线 */
  flex: 1 1 auto;
  min-width: 12px;
  border-bottom: 1px dotted var(--border-strong);
  transform: translateY(-0.3em);
}

.course-score {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* —— 论文 —— */
.pub-list {
  list-style: none;
  counter-reset: pub;
}

.pub {
  position: relative;
  padding-left: 38px;
}

.pub + .pub {
  margin-top: 24px;
}

.pub::before {
  counter-increment: pub;
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  top: 0.1em;
  color: var(--text-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.pub-title {
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.pub-title a {
  color: inherit;
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.pub-authors .me {
  color: var(--text);
  font-weight: 700;
}

.pub-venue,
.pub-note {
  color: var(--text-3);
  font-size: 0.9rem;
}

.pub-venue {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.pub-venue-name {
  font-style: italic;
}

.pub .links {
  margin-top: 6px;
}

/* —— 获奖荣誉 —— */
.honor-list {
  list-style: none;
}

.honor {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.honor:first-child {
  padding-top: 2px;
  border-top: 0;
}

.honor-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.55;
}

.honor-sub {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.9rem;
}

/* —— 技能 —— */
.skill-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 16px 32px;
}

.skill-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
}

.skill-row dt {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.7;
}

.skill-lines {
  list-style: none;
  color: var(--text-2);
}

.skill-lines li + li {
  margin-top: 2px;
}


/* =====================================================================
 * 9. 页脚与其他
 * ===================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 28px var(--gutter) 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--text-3);
  font-size: 0.8125rem;
}

.footer-top {
  color: var(--text-3);
}

.footer-top:hover {
  color: var(--accent);
}

/* data.js 出错时的提示框 */
.data-error {
  padding: 20px 24px;
  border: 1px solid #e3b4b4;
  border-radius: var(--radius);
  background: #fdf3f3;
  color: #7a2424;
  font-size: 0.9375rem;
}

.data-error p + p {
  margin-top: 8px;
}

.data-error-title {
  font-weight: 700;
}

.data-error-detail {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.8125rem;
  opacity: 0.85;
}

.noscript {
  max-width: 640px;
  margin: 40px auto;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

/* 切换语言时的轻微淡入 */
.is-switching .hero-text,
.is-switching .content,
.is-switching .nav-list {
  animation: lang-fade 0.28s ease both;
}

@keyframes lang-fade {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* =====================================================================
 * 10. 响应式
 * ===================================================================== */

/* —— 平板 / 手机（< 1024px）：目录变为吸顶的横向导航条 —— */
@media (max-width: 1023.98px) {
  .sidenav {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    margin: 0 calc(var(--gutter) * -1);
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }

  .sidenav-title {
    display: none;
  }

  .nav-list {
    position: relative;
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 9px var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-list a {
    display: block;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--text-3);
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: nowrap;
  }

  .nav-list a:hover {
    color: var(--text);
    text-decoration: none;
  }

  .nav-list a.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .section {
    scroll-margin-top: calc(var(--header-h) + 52px + 20px);
  }

  .hero {
    padding: 56px 0 48px;
    border-bottom: 0;
  }

  .content {
    padding-top: 48px;
  }
}

/* —— 手机（< 640px） —— */
@media (max-width: 639.98px) {
  :root {
    --header-h: 56px;
    --gutter: 20px;
    --avatar: 104px;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-affil {
    font-size: 1rem;
  }

  .contact-list {
    gap: 6px;
    margin-top: 18px;
  }

  .contact {
    padding: 5px 11px;
    font-size: 0.8125rem;
  }

  .content {
    padding: 40px 0 72px;
  }

  .section + .section {
    margin-top: 52px;
  }

  .section-title {
    margin-bottom: 20px;
  }

  /* 时间改到标题下方 */
  .entry-head {
    flex-direction: column;
    gap: 0;
  }

  .entry-date {
    font-size: 0.8125rem;
    text-align: left;
  }

  .edu-panel {
    padding: 14px 16px;
  }

  .stats {
    gap: 8px 32px;
  }

  .pub {
    padding-left: 32px;
  }

  .skill-list,
  .skill-row {
    display: block;
  }

  .skill-row + .skill-row {
    margin-top: 16px;
  }

  .skill-row dt {
    margin-bottom: 6px;
  }

  .toolbar {
    gap: 8px;
  }

  .btn {
    padding: 0 13px;
  }

  .btn-label-long {
    display: none;
  }

  .btn-label-short {
    display: inline;
  }
}


/* =====================================================================
 * 11. 打印样式（导出 PDF）
 *     目标：A4 纸、像一份正式简历；隐藏导航和按钮；条目不跨页断开。
 *     每页页脚（主页网址 + 页码）由 main.js 根据 data.js 自动生成。
 * ===================================================================== */
@media print {
  @page {
    size: A4;
    margin: 14mm 15mm 15mm;
  }

  /* 打印时强制使用浅色，并让文字更黑、更清晰 */
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #111417;
    --text-2: #2c3137;
    --text-3: #5b6068;
    --border: #d4d4d4;
    --border-strong: #b9b9b9;
    color-scheme: light;
  }

  html {
    font-size: 10pt;
    scroll-behavior: auto;
  }

  body {
    background: #ffffff;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html[lang^="zh"] body {
    line-height: 1.5;
    letter-spacing: 0;
  }

  /* 隐藏导航、按钮、页脚等网页元素 */
  .topbar,
  .sidenav,
  .site-footer,
  .skip-link,
  .screen-only,
  .print-exclude,
  .noscript,
  .no-print-photo .hero-photo {
    display: none !important;
  }

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

  .content {
    padding: 0;
  }

  a,
  a:hover {
    color: inherit;
    text-decoration: none !important;
  }

  /* —— 抬头 —— */
  .hero {
    padding: 0 0 3mm;
    border-bottom: 1.2pt solid var(--accent);
    break-inside: avoid;
  }

  .hero-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6mm;
  }

  .hero-text {
    flex: 1 1 auto;
  }

  .hero-photo {   /* 打印时头像移到右上角，改为证件照比例 */
    order: 2;
    width: 22mm;
    height: 27.5mm;
    border-radius: 1.5pt;
    box-shadow: none;
  }

  .hero-name {
    gap: 0 3mm;
    font-size: 20pt;
  }

  .hero-affil {
    margin-top: 1.6mm;
    font-size: 10.5pt;
  }

  .hero-meta {
    margin-top: 0;
    font-size: 9.5pt;
  }

  .hero-tagline {
    max-width: none;
    margin-top: 1.4mm;
    font-size: 9.5pt;
  }

  .contact-list {
    gap: 0.8mm 5mm;
    margin-top: 2.4mm;
  }

  .contact {
    gap: 1.4mm;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--text-2);
    font-size: 9pt;
  }

  .contact .icon {
    width: 9pt;
    height: 9pt;
    color: var(--accent);
  }

  /* —— 板块 —— */
  .section,
  .section + .section {
    margin-top: 4.2mm;
  }

  .section-title {
    gap: 3mm;
    margin-bottom: 2mm;
    color: var(--accent);
    font-size: 12pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  html[lang^="zh"] .section-title {
    font-size: 11.5pt;
    letter-spacing: 0.12em;
  }

  .section-title::after {
    height: 0.6pt;
    background: var(--border-strong);
  }

  /* 条目内部不跨页断开 */
  .entry,
  .honor,
  .pub,
  .interest,
  .skill-row,
  .prose p {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .entry + .entry {
    margin-top: 2.6mm;
  }

  .entry-head {
    gap: 0 5mm;
  }

  .entry-title {
    font-size: 10.5pt;
  }

  .entry-date {
    color: var(--text-2);
    font-size: 9pt;
  }

  .entry-sub {
    margin-top: 0;
    font-size: 9.5pt;
  }

  .entry-meta {
    font-size: 9pt;
  }

  .entry-body {
    margin-top: 0.8mm;
  }

  .points li {
    padding-left: 3.6mm;
  }

  .points li + li {
    margin-top: 0.4mm;
  }

  .points li::before {
    left: 0.6mm;
    top: calc(0.5lh - 1.75pt);
    width: 3.5pt;
    height: 3.5pt;
    opacity: 0.7;
  }

  /* 标签与链接改为紧凑的纯文本 */
  .tags {
    display: block;
    margin-top: 0.6mm;
    color: var(--text-3);
    font-size: 8.5pt;
  }

  .tag {
    display: inline;
    padding: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    font-weight: 400;
  }

  .tag + .tag::before {
    content: " · ";
  }

  .links {
    display: block;
    margin-top: 0.5mm;
    font-size: 8.5pt;
  }

  .links li {
    display: inline;
  }

  .links li + li::before {
    content: "　|　";
    color: var(--border-strong);
  }

  .link {
    display: inline;
    color: var(--text-2);
    font-size: 8.5pt;
  }

  .link .icon {
    display: none;
  }

  .link-url {
    color: var(--text-3);
    font-weight: 400;
  }

  .badge {
    padding: 0.3mm 1.3mm;
    font-size: 7.5pt;
    vertical-align: 0.6pt;
  }

  /* —— 个人简介 —— */
  .prose p + p {
    margin-top: 1mm;
  }

  /* —— 研究兴趣：改为紧凑列表 —— */
  .interest-list {
    display: block;
  }

  .interest {
    position: relative;
    padding: 0 0 0 3.6mm;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .interest + .interest {
    margin-top: 0.4mm;
  }

  .interest::before {
    position: absolute;
    left: 0.6mm;
    top: calc(0.5lh - 1.75pt);
    width: 3.5pt;
    height: 3.5pt;
    margin: 0;
    border-radius: 50%;
    opacity: 0.7;
  }

  .interest-title,
  .interest-detail {
    display: inline;
  }

  .interest-detail {
    margin: 0;
    color: var(--text-2);
    font-size: 9.5pt;
  }

  .interest-detail::before {
    content: " — ";
    color: var(--text-3);
  }

  /* —— 教育背景：成绩改为一行文字 —— */
  .edu-panel,
  .points + .edu-panel {
    margin-top: 0.6mm;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .stats {
    gap: 0 6mm;
  }

  .stat,
  .stat dt,
  .stat dd {
    display: inline;
  }

  .stat dt,
  .courses-label {
    color: var(--text-2);
    font-size: 9pt;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .stat dt::after,
  .courses-label::after {
    content: ": ";
  }

  html[lang^="zh"] .stat dt::after,
  html[lang^="zh"] .courses-label::after {
    content: "：";
  }

  .stat dd {
    font-size: 9.5pt;
  }

  .courses {
    margin-top: 0.4mm;
    padding-top: 0;
    border-top: 0;
  }

  .courses-label,
  .course-list,
  .course-list li {
    display: inline;
  }

  .course-list li {
    font-size: 9pt;
  }

  .course-list li + li::before {
    content: " · ";
    color: var(--text-3);
  }

  .course-leader {
    display: none;
  }

  .course-score {
    margin-left: 0.3em;
  }

  /* —— 论文 —— */
  .pub {
    padding-left: 6.5mm;
  }

  .pub + .pub {
    margin-top: 2.2mm;
  }

  .pub::before {
    top: 0.15em;
    font-size: 8.5pt;
  }

  .pub-title {
    font-size: 10pt;
  }

  .pub-authors,
  .pub-venue,
  .pub-note {
    margin-top: 0;
    font-size: 9pt;
  }

  .pub .links {
    margin-top: 0;
  }

  /* —— 获奖荣誉 —— */
  .honor,
  .honor:first-child {
    padding: 0.5mm 0;
    border: 0;
  }

  .honor-title,
  .pub-venue {
    column-gap: 2mm;
  }

  .honor-title {
    font-size: 10pt;
  }

  .honor-sub {
    margin-top: 0;
    font-size: 9pt;
  }

  /* —— 技能 —— */
  .skill-list {
    gap: 0.8mm 5mm;
  }

  .skill-row dt {
    font-size: 9.5pt;
  }

  .chips {
    display: block;
  }

  .chip {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--text-2);
    font-size: 9.5pt;
  }

  .chip + .chip::before {
    content: " · ";
    color: var(--text-3);
  }

  .skill-lines li {
    font-size: 9.5pt;
  }
}
