/* ============================================================
   余洋 Yang Yu — 个人学术主页 · 2026 visual refinement
   固定侧栏 + 滚动正文；本地字体；低饱和蓝灰与藏青墨色
   ============================================================ */

@font-face { font-family: "Sentient"; src: url("assets/fonts/sentient-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sentient"; src: url("assets/fonts/sentient-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Sentient"; src: url("assets/fonts/sentient-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Sentient"; src: url("assets/fonts/sentient-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Sentient"; src: url("assets/fonts/sentient-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Variable"; src: url("assets/fonts/inter-latin-variable.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono Variable"; src: url("assets/fonts/geist-mono-latin-variable.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #e3e5e9;
  --surface: #ffffff;
  --ink: #002f5b;
  --ink-soft: rgba(0, 47, 91, 0.73);
  --ink-faint: rgba(0, 47, 91, 0.48);
  --accent: #007cff;
  --accent-2: #00a1ff;
  --accent-3: #00f6ff;
  --green: #18794e;
  --hairline: rgba(0, 47, 91, 0.13);
  --card-shadow: 0 1px 2px rgba(0, 47, 91, 0.04), 0 5px 18px rgba(0, 47, 91, 0.055);
  --card-shadow-hover: 0 3px 6px rgba(0, 47, 91, 0.06), 0 16px 38px rgba(0, 47, 91, 0.13);
  --serif: "Sentient", Georgia, "Times New Roman", serif;
  --sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

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

body {
  background:
    radial-gradient(1000px 640px at 92% 8%, rgba(0, 161, 255, 0.065), transparent 62%),
    radial-gradient(860px 560px at 2% 92%, rgba(0, 246, 255, 0.04), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(0, 124, 255, 0.22); }
.mono { font-family: var(--mono); font-feature-settings: "ss01"; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
a:hover { color: var(--accent-2); border-bottom-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- 动态背景层 ---------- */
.ascii-ocean { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: 0.78; }
.ascii-ocean canvas { display: block; width: 100%; height: 100%; }

/* 纯 CSS 鱼群：即使外部 JS 未执行，也能在静态页面中游动 */
.fish-ocean { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.canvas-fish-active .fish-ocean { display: none; }
.fish { position: absolute; left: 0; width: 150px; will-change: transform; animation: fish-swim 48s linear infinite; }
.fish-float { animation: fish-bob 5.5s ease-in-out infinite; }
.fish svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 5px 9px rgba(0, 47, 91, 0.06)); }
.fish-tail { transform-box: view-box; transform-origin: 42px 40px; animation: tail-wag 0.72s ease-in-out infinite alternate; }
.fish-one { top: 22%; color: rgba(0, 47, 91, 0.24); animation-duration: 48s; animation-delay: -19s; }
.fish-two { top: 56%; width: 112px; color: rgba(0, 124, 255, 0.19); animation-duration: 61s; animation-delay: -43s; }
.fish-two .fish-float { animation-delay: -2s; animation-duration: 6.8s; }
.fish-three { top: 78%; width: 84px; color: rgba(0, 47, 91, 0.16); animation-duration: 55s; animation-delay: -7s; }
.fish-three .fish-float { animation-delay: -4s; animation-duration: 4.8s; }
@keyframes fish-swim { from { transform: translateX(-25vw); } to { transform: translateX(125vw); } }
@keyframes fish-bob { 0%, 100% { transform: translateY(-8px) rotate(-1deg); } 50% { transform: translateY(10px) rotate(1.4deg); } }
@keyframes tail-wag { from { transform: rotate(-7deg); } to { transform: rotate(9deg); } }

.spotlight {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(580px circle at var(--mx, 50%) var(--my, 30%), rgba(0, 161, 255, 0.1), rgba(0, 246, 255, 0.04) 42%, transparent 70%);
}

/* ---------- 页面骨架 ---------- */
.layout {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1220px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ---------- 固定侧栏 ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(3rem, 9vh, 6rem) 0 clamp(2rem, 5vh, 3.5rem);
}
.eyebrow-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.6rem; margin-bottom: 0.9rem; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.065em; color: var(--ink-faint); line-height: 1.45; }
.eyebrow::before { content: "● "; color: var(--accent-2); }
.lang-toggle { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; white-space: nowrap; color: var(--ink-faint); border: none; padding: 0.15rem 0.1rem; }
.lang-toggle .lang-self { color: var(--accent); font-weight: 600; }
.lang-toggle:hover { color: var(--accent); }
.lang-sep { margin: 0 0.15rem; }

.identity { display: flex; align-items: center; gap: 1.1rem; margin: 1.3rem 0 0.9rem; }
.avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(0, 124, 255, 0.32); background: var(--surface);
  box-shadow: 0 6px 20px rgba(0, 47, 91, 0.15);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.avatar:hover { transform: scale(1.04); border-color: var(--accent); }
.identity-text { min-width: 0; }
.name { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; line-height: 1.06; letter-spacing: -0.01em; }
.name-sub { font-size: 0.92rem; color: var(--ink-faint); margin-top: 0.28rem; letter-spacing: 0.025em; }
.role { font-family: var(--serif); font-style: italic; font-size: 1.23rem; font-weight: 400; color: var(--accent); margin-top: 0.55rem; line-height: 1.45; }
.tagline { margin-top: 1.1rem; max-width: 34ch; color: var(--ink-soft); font-size: 0.96rem; line-height: 1.72; }
.sidebar-email { margin-top: 0.8rem; font-size: 0.8rem; letter-spacing: 0.01em; }

.nav { margin-top: clamp(2rem, 6vh, 3.5rem); }
.nav ul { list-style: none; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.52rem 0; color: var(--ink-faint); border: none; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.25s ease; }
.nav-num { font-size: 0.7rem; color: var(--accent-2); opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.25s; }
.nav-line { display: inline-block; width: 2rem; height: 1px; background: currentColor; transition: width 0.3s ease, background 0.3s ease; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link:hover .nav-line, .nav-link.active .nav-line { width: 3.5rem; background: var(--accent); }
.nav-link:hover .nav-num, .nav-link.active .nav-num { opacity: 1; transform: translateX(0); }

.sidebar-bottom { margin-top: 1.5rem; }
.social { list-style: none; display: flex; align-items: center; gap: 1.15rem; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--ink-soft); border: none; transition: color 0.2s ease, transform 0.2s ease; }
.social a:hover { color: var(--accent); transform: translateY(-2px); }
.social svg { display: block; }

/* ---------- 正文与标题 ---------- */
.content { padding: clamp(3rem, 9vh, 6rem) 0 2rem; min-width: 0; }
.section { margin-bottom: clamp(4.5rem, 11vh, 7.5rem); scroll-margin-top: 2.5rem; }
.section:first-of-type { margin-bottom: clamp(3rem, 7vh, 5rem); }
.sec-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 2rem; min-height: 2.6rem; }
.sec-head h2 { font-family: var(--serif); font-size: 1.95rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; }
.sec-num { color: var(--accent-2); font-size: 0.96rem; font-family: var(--mono); }
.sec-line { flex: 1; height: 1px; background: var(--hairline); }
.sec-note { font-size: 0.82rem; color: var(--ink-faint); margin: -0.8rem 0 1.35rem; }
.sub-title { font-family: var(--serif); font-size: 1.18rem; font-weight: 700; font-style: italic; margin: 1.9rem 0 0.9rem; color: var(--ink); }
.sub-title:first-child { margin-top: 0; }
.minor-title { font-size: 0.88rem; font-weight: 650; margin: 1.35rem 0 0.55rem; color: var(--ink); }
.section-copy { color: var(--ink-soft); font-size: 0.94rem; line-height: 1.78; max-width: 66ch; }

/* ---------- About ---------- */
.about-body p { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 64ch; line-height: 1.78; }
.about-body strong { color: var(--ink); font-weight: 650; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.chips li { font-size: 0.78rem; letter-spacing: 0.025em; color: var(--ink); background: rgba(255, 255, 255, 0.88); border: 1px solid var(--hairline); border-radius: 999px; padding: 0.32rem 0.85rem; box-shadow: var(--card-shadow); transition: transform 0.2s ease, border-color 0.2s ease; }
.chips li:hover { transform: translateY(-2px); border-color: var(--accent-2); }

.recognition { margin-top: 1.9rem; padding-top: 1.25rem; border-top: 1px solid var(--hairline); }
.recognition-label { font-size: 0.69rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.85rem; }
.recognition-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem; }
.recognition-item { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); font-size: 0.8rem; border: none; white-space: nowrap; }
.recognition-mark { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--hairline); color: var(--accent); font-size: 0.64rem; font-weight: 650; box-shadow: 0 2px 7px rgba(0, 47, 91, 0.05); }
.recognition-logo { width: 29px; height: 29px; flex-basis: 29px; border-radius: 50%; padding: 3px; background: rgba(255, 255, 255, 0.94); }
.recognition-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.recognition-copy { display: inline-flex; align-items: baseline; gap: 0.35rem; }
.recognition-copy strong { color: var(--ink); font-weight: 600; }
.recognition-copy span { color: var(--ink-faint); font-size: 0.75rem; }
a.recognition-item:hover strong, a.recognition-item:hover span { color: var(--accent); }

/* ---------- Research：2×2 方向卡片 ---------- */
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.05rem; }
.research-card { position: relative; height: 100%; padding: 1.25rem 1.3rem 1.3rem; background: rgba(255, 255, 255, 0.74); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--card-shadow); transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
.research-card:hover { transform: translateY(-3px); border-color: rgba(0, 124, 255, 0.3); box-shadow: var(--card-shadow-hover); }
.research-index { display: block; color: var(--accent-2); font-size: 0.72rem; letter-spacing: 0.08em; margin-bottom: 0.6rem; }
.research-card h3 { font-family: var(--serif); font-size: 1.16rem; font-weight: 700; line-height: 1.45; margin-bottom: 0.5rem; }
.research-card p { color: var(--ink-soft); font-size: 0.89rem; line-height: 1.72; }

/* ---------- Publications：按年份分组 ---------- */
.pub-list { list-style: none; }
.pub-year { display: flex; align-items: center; gap: 0.85rem; margin: 1.75rem 0 0.35rem; }
.pub-year:first-child { margin-top: 0; }
.pub-year h3 { font-family: var(--serif); font-size: 1.42rem; font-weight: 500; font-style: italic; line-height: 1; color: var(--ink); }
.pub-year > span { flex: 1; height: 1px; background: var(--hairline); }
.pub-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.85rem; margin: 2.4rem 0 0.4rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.pub-group h3 { font-family: var(--serif); font-size: 1.42rem; font-weight: 500; font-style: italic; line-height: 1.1; color: var(--ink); }
.pub-group > span { font-size: 0.8rem; color: var(--ink-faint); }
/* 论文列表：适度压缩行距，控制条目增多后的整体长度 */
.pub-item { padding: 0.9rem 0 0.95rem; border-top: 1px solid var(--hairline); }
.pub-year + .pub-item { border-top: none; }
.pub-title { font-size: 1rem; font-weight: 600; line-height: 1.5; overflow-wrap: break-word; }
.pub-title a { color: var(--ink); border: none; }
.pub-title a:hover { color: var(--accent); border-bottom: 1px solid currentColor; }
.pub-authors { margin-top: 0.24rem; font-size: 0.87rem; color: var(--ink-soft); line-height: 1.5; overflow-wrap: break-word; }
.pub-authors strong { color: var(--ink); font-weight: 700; }
.author-star { color: var(--accent); font-size: 0.76em; font-weight: 700; margin-left: 0.08em; line-height: 0; }
.pub-meta { margin-top: 0.28rem; font-family: var(--mono); font-size: 0.75rem; line-height: 1.5; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; }
.pub-status { color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 0.05em 0.5em; font-size: 0.92em; }
.pub-summary { margin-top: 0.36rem; font-size: 0.86rem; line-height: 1.58; color: var(--ink-faint); max-width: 64ch; }
.pub-links { margin-top: 0.42rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.pub-links a { font-family: var(--mono); font-size: 0.73rem; border-bottom: 1px solid rgba(0, 124, 255, 0.32); }

/* ---------- Projects ---------- */
.proj-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.proj-grid > li { display: flex; }
.proj-card { display: flex; flex-direction: column; width: 100%; min-height: 160px; background: rgba(255, 255, 255, 0.86); border: 1px solid var(--hairline); border-radius: 11px; padding: 1.2rem 1.3rem; color: var(--ink); box-shadow: var(--card-shadow); transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
.proj-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); border-color: rgba(0, 124, 255, 0.35); }
.proj-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.proj-folder { color: var(--accent-2); font-size: 0.9rem; font-family: var(--mono); }
.proj-arrow { color: var(--ink-faint); font-size: 0.95rem; transition: color 0.2s ease, transform 0.2s ease; }
.proj-card:hover .proj-arrow { color: var(--accent); transform: translate(2px, -2px); }
.proj-card h3 { font-size: 0.99rem; font-weight: 650; line-height: 1.58; }
.proj-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.65rem; margin-top: auto; padding-top: 1rem; font-size: 0.78rem; color: var(--ink-soft); }
.proj-role { color: var(--green); background: rgba(24, 121, 78, 0.08); border-radius: 999px; padding: 0.1rem 0.48rem; font-size: 0.72rem; }
.proj-list { list-style: none; }
.proj-item { padding: 0.85rem 0; border-top: 1px solid var(--hairline); }
.proj-item:first-child { border-top: none; }
.proj-title { font-size: 0.96rem; font-weight: 600; line-height: 1.58; }
.proj-meta { margin-top: 0.25rem; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); }
.proj-meta .proj-role { background: none; padding: 0; }
.sw-list { list-style: none; }
.sw-list li { padding: 0.5rem 0; font-size: 0.93rem; color: var(--ink-soft); }
.sw-list li a { font-weight: 600; }
.sw-list li a, .plain-list li a, .contact-value a { overflow-wrap: anywhere; }

/* ---------- Experience ---------- */
.xp-list { list-style: none; }
.xp-item { display: grid; grid-template-columns: 8.75rem minmax(0, 1fr); gap: 1.2rem; align-items: baseline; padding: 1rem 0; border-top: 1px solid var(--hairline); }
.xp-item:first-child { border-top: none; }
.xp-period { font-size: 0.75rem; color: var(--ink-faint); letter-spacing: 0.02em; font-family: var(--mono); line-height: 1.6; }
.xp-body h3 { font-size: 1rem; font-weight: 650; line-height: 1.5; margin-bottom: 0.3rem; }
.xp-body h3 .xp-org { color: var(--accent); font-weight: 650; }
.xp-points { list-style: none; }
.xp-points li { position: relative; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.65; padding-left: 1.1rem; margin-bottom: 0.22rem; }
.xp-points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent-2); }
.experience-sub { margin-top: 2.2rem; }

/* ---------- Teaching & Service：教学在上，学术服务在下 ---------- */
.teaching-stack { display: flex; flex-direction: column; gap: 1.8rem; }
.teaching-block, .service-block { min-width: 0; }
.service-block { border-top: 1px solid var(--hairline); padding-top: 1.1rem; }
.service-block .review-copy { margin-top: 1.1rem; }
.plain-list { list-style: none; }
.plain-list li { position: relative; color: var(--ink-soft); font-size: 0.89rem; line-height: 1.68; padding-left: 1.1rem; margin-bottom: 0.42rem; }
.plain-list li::before { content: "▹"; position: absolute; left: 0; color: var(--accent-2); }
.plain-list li strong { color: var(--ink); font-weight: 600; }

.review-block { margin-top: 1.6rem; padding-top: 0.2rem; border-top: 1px solid var(--hairline); }
.review-copy p { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.82; margin-bottom: 0.75rem; max-width: 70ch; }
.review-copy p:last-child { margin-bottom: 0; }
.review-copy strong { color: var(--ink); font-weight: 650; }

/* ---------- Students & Contact：通栏信息卡 + 全宽正文 ---------- */
.contact-layout { display: flex; flex-direction: column; gap: 1.75rem; }
.contact-panel { width: 100%; background: rgba(255, 255, 255, 0.82); border: 1px solid var(--hairline); border-radius: 12px; padding: 1.1rem 1.3rem; box-shadow: var(--card-shadow); }
.contact-panel .sub-title { margin-bottom: 0.55rem; }
.contact-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.contact-list li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.65rem; padding: 0.46rem 0; border-top: 1px solid var(--hairline); font-size: 0.88rem; }
.contact-list li:nth-child(-n + 2) { border-top: none; }
.contact-label { color: var(--ink-faint); font-size: 0.78rem; }
.contact-list .contact-value { color: var(--ink-soft); overflow-wrap: break-word; line-height: 1.55; }
.contact-panel .contact-value a[href^="mailto:"] { white-space: nowrap; font-size: 0.8rem; }
.contact-intro { max-width: 72ch; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding-top: 1.4rem; margin-top: 2rem; }
.footer p { font-size: 0.73rem; color: var(--ink-faint); letter-spacing: 0.025em; font-family: var(--mono); line-height: 1.7; }

/* ---------- 中文排版：现代黑体，不使用楷体与斜体 ---------- */
html[lang="zh-CN"] {
  --serif: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
html[lang="zh-CN"] .name { font-weight: 650; letter-spacing: 0.035em; }
html[lang="zh-CN"] .role { font-style: normal; font-size: 1.13rem; font-weight: 600; letter-spacing: 0.02em; }
html[lang="zh-CN"] .sec-head h2 { font-weight: 700; letter-spacing: 0.025em; }
html[lang="zh-CN"] .sub-title { font-style: normal; font-weight: 650; letter-spacing: 0.015em; }
html[lang="zh-CN"] .research-card h3 { font-weight: 650; letter-spacing: 0.01em; }
html[lang="zh-CN"] .pub-year h3 { font-family: "Sentient", Georgia, serif; font-style: normal; font-weight: 500; }

/* ---------- 滚动显现：无 JS 时正文始终可见 ---------- */
html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.65s ease, transform 0.65s ease; }
html.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1060px) and (min-width: 921px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr); gap: 2.5rem; }
  .research-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; height: auto; min-width: 0; padding: 3.2rem 0 0; }
  .tagline { max-width: 50ch; }
  .nav { margin-top: 1.5rem; }
  .nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-bottom: 0.35rem; }
  .nav-link { white-space: nowrap; padding: 0.35rem 0.72rem; border: 1px solid var(--hairline); border-radius: 999px; background: rgba(255, 255, 255, 0.72); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: none; }
  .nav-line, .nav-num { display: none; }
  .nav-link.active { color: var(--accent); border-color: rgba(0, 124, 255, 0.4); }
  .sidebar-bottom { margin-top: 1.4rem; }
  .content { padding-top: 3rem; min-width: 0; }
  .teaching-stack { gap: 1.6rem; }
  .contact-layout { gap: 1.5rem; }
}

@media (max-width: 640px) {
  .identity { gap: 0.9rem; }
  .avatar { width: 88px; height: 88px; }
  .name { font-size: 1.9rem; }
  .role { font-size: 1.1rem; }
  .sec-head h2 { font-size: 1.48rem; }
  .sub-title { font-size: 1.08rem; }
  .research-grid, .proj-grid { grid-template-columns: 1fr; }
  .research-card { padding: 1.15rem 1.15rem 1.2rem; }
  .xp-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .contact-list { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: 0.05rem; }
  .contact-list li:nth-child(-n + 2) { border-top: 1px solid var(--hairline); }
  .contact-list li:first-child { border-top: none; }
  .pub-item { padding: 1rem 0 1.1rem; }
  .pub-title { font-size: 0.98rem; }
  .recognition-list { gap: 0.65rem 0.9rem; }
  .recognition-item { white-space: normal; }
  .fish { width: 110px; }
  .fish-two { width: 84px; }
  .fish-three { width: 64px; }
}

@media (min-width: 921px) and (max-height: 720px) {
  .sidebar { padding-top: 2rem; padding-bottom: 1.25rem; }
  .identity { margin: 0.8rem 0 0.6rem; }
  .avatar { width: 84px; height: 84px; }
  .name { font-size: 2rem; }
  .role { margin-top: 0.35rem; font-size: 1.08rem; }
  .tagline { margin-top: 0.7rem; font-size: 0.9rem; }
  .nav { margin-top: 1.2rem; }
  .nav-link { padding: 0.4rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spotlight { display: none; }
  .fish, .fish-float, .fish-tail { animation: none; }
  .fish-one { transform: translateX(62vw); }
  .fish-two { transform: translateX(76vw); }
  .fish-three { transform: translateX(54vw); }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
