  /* ============================================================
     CSS 变量:冷色调浅灰白(浅色)与冷灰(深色)
     ============================================================ */
  :root,
  html[data-theme="light"] {
    --container-max: 760px;      /* 正文容器最大宽度（.container/.nav-inner/.top-ribbon/.back-to-top 共用） */
    --container-half: 380px;     /* = var(--container-max)/2（CSS calc 不支持除法，故显式给出） */
    --back-to-top-offset: calc(var(--container-half) + 12px);
    --bg: #F4F5F7;
    --bg-elevated: #FFFFFF;
    --bg-tag: #EDEFF2;
    --ink: #1F2328;
    --ink-secondary: #52585F;
    --ink-tertiary: #5F6670;
    --border: #E1E4E8;
    --border-strong: #CBD1D7;
    --accent: #4A6FA0;
    --accent-soft: rgba(74, 111, 160, 0.06);
    --accent-soft-strong: rgba(74, 111, 160, 0.12);
    --shadow: 0 1px 2px rgba(31, 35, 40, 0.05), 0 4px 16px rgba(31, 35, 40, 0.05);
    --shadow-hover: 0 2px 4px rgba(31, 35, 40, 0.06), 0 10px 24px rgba(31, 35, 40, 0.08);
  }

  html[data-theme="dark"] {
    --bg: #14161A;
    --bg-elevated: #1B1E23;
    --bg-tag: #22262C;
    --ink: #E7E9EC;
    --ink-secondary: #A3A9B2;
    --ink-tertiary: #8F96A0;
    --border: #262A31;
    --border-strong: #343A42;
    --accent: #8FB0D9;
    --accent-soft: rgba(143, 176, 217, 0.10);
    --accent-soft-strong: rgba(143, 176, 217, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.28);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.34), 0 14px 30px rgba(0, 0, 0, 0.32);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; font-size: 16px; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .nav-links { scroll-behavior: auto; }
    * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  }

  body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
  }

  .font-serif { font-family: Georgia, "Songti SC", "STSong", "SimSun", serif; }

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

  .container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

  section[id], header[id] { scroll-margin-top: 80px; }

  /* ============================================================
     顶部装饰渐变条 —— 宽度与正文对齐,不再撑满整屏
     ============================================================ */
  .top-ribbon-wrap { padding: 0 24px; }
  .top-ribbon {
    height: 4px;
    width: 100%;
    margin: 0 auto;
    /* 实际可见宽度与 .container 内容列一致（容器含 2×24px 内边距） */
    max-width: calc(var(--container-max) - 48px);
    background: linear-gradient(90deg, #AEC0D6 0%, #C7D3C7 33%, #D3CBE0 66%, #9FB8CC 100%);
    opacity: 0.55;
    border-radius: 0 0 3px 3px;
  }

  /* ============================================================
     吸顶导航
     ============================================================ */
  .nav-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-elevated); /* fallback for browsers without color-mix */
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(120%);
  }

  .nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  /* nav-links-wrap:渐隐提示层(.nav-fade)的定位参照,自己会随可用空间伸缩收窄 */
  .nav-links-wrap { position: relative; min-width: 0; flex: 1; }

  .nav-links { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-behavior: smooth; }
  .nav-links::-webkit-scrollbar { display: none; }

  /* 左右渐隐提示:默认透明,JS 检测到该方向还有没显示完的链接时才淡入,
     用来提示"这里还能横向滑动看更多",不用额外做汉堡菜单 */
  .nav-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .nav-fade-left { left: 0; background: linear-gradient(to right, var(--bg-elevated), transparent); }
  .nav-fade-right { right: 0; background: linear-gradient(to left, var(--bg-elevated), transparent); }
  .nav-links-wrap.can-scroll-left .nav-fade-left { opacity: 1; }
  .nav-links-wrap.can-scroll-right .nav-fade-right { opacity: 1; }

  .nav-links a {
    font-size: 13px;
    color: var(--ink-secondary);
    padding: 7px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .nav-links a:hover { color: var(--ink); text-decoration: none; background: var(--accent-soft); }
  .nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

  .nav-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

  /* 语言切换按钮:显示"将要切换到的语言" */
  .lang-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-secondary);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  }
  .lang-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }

  /* 深浅色切换按钮:纯图标,圆形 */
  .theme-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink-secondary);
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  }
  .theme-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
  .theme-btn svg { width: 15px; height: 15px; }

  /* ============================================================
     Header / 个人信息区
     ============================================================ */
  header.profile { position: relative; padding: 56px 0 34px; overflow: hidden; }

  header.profile::before {
    content: "";
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 640px;
    height: 300px;
    background: radial-gradient(ellipse at center, var(--accent-soft), transparent 70%);
    pointer-events: none;
  }

  .profile-inner { position: relative; }

  .profile-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 1em;
  }

  .profile-text { flex: 1; min-width: 0; }

  /* 头像:长方形(圆角矩形),更像证件照比例 */
  .avatar {
    position: relative;
    width: 112px;
    height: 144px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    background: var(--accent-soft);
  }
  .avatar img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
  }

  .name { font-size: 2.3rem; font-weight: 700; letter-spacing: 0.03em; margin-bottom: 0.3em; }
  .tagline { font-size: 1rem; color: var(--ink-secondary); }

  /* ============================================================
     通用板块 & 卡片
     ============================================================ */
  .section { padding: 40px 0; }
  .section + .section { border-top: 1px solid var(--border); }

  .section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 1.4em;
  }
  .section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.05em;
    border-radius: 2px;
    background: var(--accent);
    flex-shrink: 0;
  }

  .card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 22px 24px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }
  .card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  .card + .card { margin-top: 14px; }

  /* 两种标签胶囊:强调色(能力/类别标签)与中性色(事实性标签) */
  .tag {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    letter-spacing: 0.02em;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-tag);
    border: 1px solid var(--border);
    color: var(--ink-secondary);
  }
  .tag-accent {
    background: var(--accent-soft);
    border-color: transparent;
    color: #3E5F8C; /* 独立加深：12px 标签文字须满足 WCAG AA ≥ 4.5:1；深色主题下由下方规则覆盖 */
    font-weight: 600;
  }
  html[data-theme="dark"] .tag-accent {
    color: var(--accent);
  }
  .tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

  /* ============================================================
     教育背景
     ============================================================ */
  .edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-bottom: 0.2em;
  }
  .edu-school { font-family: Georgia, "Songti SC", serif; font-size: 1.12rem; font-weight: 700; }
  .edu-meta { font-size: 0.82rem; color: var(--ink-tertiary); }
  .edu-detail { font-size: 0.9rem; color: var(--ink-secondary); margin-bottom: 1em; }

  .dash-list { list-style: none; margin-bottom: 1.1em; }
  .dash-list li {
    font-size: 0.9rem;
    color: var(--ink-secondary);
    padding-left: 1.1em;
    position: relative;
    line-height: 1.9;
  }
  .dash-list li::before { content: "–"; position: absolute; left: 0; color: var(--ink-tertiary); }

  .sub-label {
    font-size: 0.8rem;
    color: var(--ink-tertiary);
    margin-bottom: 0.6em;
    font-weight: 600;
    letter-spacing: 0.03em;
  }

  /* ============================================================
     工作经历
     ============================================================ */
  .work-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-bottom: 0.9em;
  }
  .work-role { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.15em; }
  .work-company { font-size: 0.88rem; color: var(--ink-secondary); }
  .work-meta { font-size: 0.8rem; color: var(--ink-tertiary); white-space: nowrap; }

  /* ============================================================
     技能
     ============================================================ */
  .skill-category { margin-bottom: 1.1em; }
  .skill-category:last-child { margin-bottom: 0; }
  .skill-category-label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 0.55em; }

  /* ============================================================
     项目经历(带右下角虚化序号)
     ============================================================ */
  .project-entry { position: relative; overflow: hidden; }
  .project-index {
    position: absolute;
    right: 22px;
    top: 18px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 80px;
    font-weight: 700;
    color: var(--ink);
    opacity: 0.07;
    line-height: 1;
    pointer-events: none;
    user-select: none;
  }
  .project-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 0.2em; position: relative; padding-right: 76px; }
  .project-meta { font-size: 0.8rem; color: var(--ink-tertiary); margin-bottom: 0.7em; position: relative; }
  .project-desc { font-size: 0.9rem; color: var(--ink-secondary); margin-bottom: 0.9em; position: relative; max-width: 46ch; }
  .project-links { font-size: 0.85rem; position: relative; }
  .project-links a { margin-right: 1.3em; }

  /* ============================================================
     论文发表(卡片 + 类型徽章)
     ============================================================ */
  .pub-type { margin-bottom: 0.8em; }
  .pub-title {
    font-family: Georgia, "Songti SC", serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.35em;
    line-height: 1.5;
  }
  .pub-meta { font-size: 0.8rem; color: var(--ink-tertiary); margin-bottom: 0.7em; }
  .pub-desc { font-size: 0.88rem; color: var(--ink-secondary); }

  /* ============================================================
     联系方式
     ============================================================ */
  .contact-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 20px;
    margin-top: 0.6em;
  }
  .contact-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-secondary); }
  .contact-item a { color: var(--ink-secondary); }
  .contact-item a:hover { color: var(--accent); }
  .contact-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-tertiary); }

  /* ============================================================
     页脚
     ============================================================ */
  footer.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0 clamp(200px, 25vh, 300px);
    font-size: 0.8rem;
    color: var(--ink-tertiary);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5em;
  }

  /* ============================================================
     返回顶部按钮 + 阅读进度圆环
     ============================================================ */
  .back-to-top {
    position: fixed;
    /* 桌面端：紧贴主题内容(.container)右侧，12px 间距 */
    left: calc(50% + var(--back-to-top-offset));
    right: auto;
    bottom: 30px;
    z-index: 40;
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-elevated);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    visibility: hidden; /* 隐藏态退出 Tab 顺序，避免键盘聚焦不可见控件 */
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease, visibility 0s linear 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  .back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease, visibility 0s;
  }
  /* 不支持 :focus-visible 的浏览器（旧 Safari/Firefox）用普通 :focus 兜底 */
  .back-to-top:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  /* 键盘焦点可见（WCAG 2.4.7）：outline:none 后必须提供替代焦点指示 */
  .back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .back-to-top:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
  .back-to-top:active {
    transform: scale(0.94);
  }
  .back-to-top svg {
    width: 48px;
    height: 48px;
    display: block;
  }

  /* 轨道圆环（背景） */
  .back-to-top__track {
    stroke: var(--border-strong);
  }

  /* 进度圆环 */
  .back-to-top__progress {
    stroke: var(--accent);
    transition: stroke-dashoffset 0.15s linear;
  }

  /* 向上箭头 */
  .back-to-top__arrow {
    stroke: var(--accent);
  }

  /* ============================================================
     响应式
     ============================================================ */
  /* 平板端 */
  @media (max-width: 1024px) and (min-width: 641px) {
    .back-to-top {
      left: auto;
      right: 24px;
      bottom: 24px;
    }
    .contact-row {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 640px) {
    .container, .nav-inner { padding-left: 18px; padding-right: 18px; }
    .top-ribbon-wrap { padding: 0 18px; }
    .name { font-size: 1.85rem; }
    header.profile { padding: 40px 0 24px; }

    /* 导航链接与按钮的触控热区在手机端适当放大,更符合触屏最小可点击尺寸建议 */
    .nav-links a { font-size: 12px; padding: 9px 9px; }
    .theme-btn { width: 34px; height: 34px; }
    .lang-btn { padding: 8px 13px; }

    .avatar { width: 82px; height: 106px; }
    .avatar-fallback { font-size: 1.7rem; }
    .profile-header-row { gap: 14px; }
    .section-title { font-size: 1.35rem; }
    .project-index { font-size: 52px; right: 16px; top: 12px; }
    .project-title { padding-right: 54px; }

    /* 底部版权信息 + 更新时间：窄屏下两行文字并排容易挤在一起、
       space-between 会让它们别扭地贴在左边，改成居中竖排更舒服 */
    footer.site-footer { flex-direction: column; align-items: center; text-align: center; gap: 6px; }

    /* 返回顶部按钮 — 手机端适配，考虑 iPhone Safe Area */
    .back-to-top {
      left: auto;
      right: 16px;
      bottom: 20px; /* 渐进增强降级：不支持 max()/env() 时使用普通值 */
      bottom: max(20px, calc(20px + env(safe-area-inset-bottom)));
    }

    /* 联系方式 — 手机端单列 */
    .contact-row {
      grid-template-columns: 1fr;
    }
  }

  /* ============================================================
     skip-link: 键盘用户跳过导航直达正文（a11y）
     ============================================================ */
  .skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: 0 0 6px 0;
    text-decoration: none;
    font-size: 14px;
    transition: top 0.15s ease;
  }
  .skip-link:focus {
    top: 0;
    text-decoration: none;
  }
  /* 深色主题下 --accent 为浅蓝，白字对比度不足（WCAG AA 4.5:1），改用深色文字 */
  html[data-theme="dark"] .skip-link { color: #14161A; }
