/* myself.tiramisu-server.cc — 静默玻璃风格 */
/* 2026-08-11 r2 — 浅灰底 + 微妙磨砂玻璃 + 克制动效 */
/* 2026-09-17 r36 — 手机端适配：布局溢出修复、单行画廊、触摸拖动/惯性、弹窗与导航优化 */

:root {
  color-scheme: light;
  --bg: #f5f4f8;
  --bg-card: rgba(255, 255, 255, .58);
  --bg-card-hover: rgba(255, 255, 255, .72);
  --ink: #1a1a2a;
  --ink-soft: #54546e;
  --dim: #8c8c9e;
  --line: rgba(0, 0, 0, .06);
  --line-strong: rgba(0, 0, 0, .1);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, .04), 0 0 0 1px rgba(0, 0, 0, .03);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, .06), 0 0 0 1px rgba(107, 95, 212, .15);
  --accent: #6b5fd4;
  --accent-glow: rgba(107, 95, 212, .18);
  --accent-soft: #8b7fe0;
  --glass-blur: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif CJK SC', 'SimSun', serif;
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* —— 微妙背景纹理：让玻璃 blur 有物可糊 —— */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* 极淡网格 */
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0, 0, 0, .015) 39px, rgba(0, 0, 0, .015) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0, 0, 0, .015) 39px, rgba(0, 0, 0, .015) 40px);
}

/* 极淡光晕 */
body::after {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 25% 30%, rgba(107, 95, 212, .04), transparent 65%),
    radial-gradient(ellipse 40% 35% at 70% 60%, rgba(139, 127, 224, .03), transparent 65%);
  animation: bg-drift 28s var(--ease) infinite alternate;
}

@keyframes bg-drift {
  0%   { opacity: .6; transform: scale(1) rotate(0deg); }
  100% { opacity: 1; transform: scale(1.04) rotate(1.5deg); }
}

/* —— 进度条 —— */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 30;
  background: var(--accent);
}

/* ========== 顶栏 ========== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 28px;
  background: rgba(245, 244, 248, .78);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.brand-mark i {
  display: block;
  width: 2.5px;
  border-radius: 8px;
  background: var(--accent);
  transform: rotate(32deg);
}

.brand-mark i:nth-child(1) { height: 7px; opacity: .4; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 9px; opacity: .65; }

.topbar-note {
  color: var(--dim);
  font-size: .7rem;
  letter-spacing: .14em;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-note i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  vertical-align: middle;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.topnav a {
  position: relative;
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 0;
  transition: color .3s ease;
  white-space: nowrap;
}

.topnav a::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -1px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .35s var(--ease), left .35s var(--ease);
}

.topnav a:hover { color: var(--ink); }
.topnav a:hover::after, .topnav a.cur::after { width: 100%; left: 0; }
.topnav a.cur { color: var(--accent); }

/* ========== 页面区域 ========== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 96px 24px 72px;
}

/* 左右分布容器 — 静默玻璃卡片 */
.page-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  padding: clamp(40px, 5vw, 64px) clamp(32px, 5vw, 56px);
  background: var(--bg-card);
  border-radius: 20px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
  box-shadow: var(--shadow-card);
  transition: box-shadow .6s ease;
}

.page.in .page-inner {
  box-shadow: var(--shadow-card-hover);
}

/* 左侧：编号 + 大标题 */
.page-side { position: relative; }

.sec-num {
  display: block;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: .3em;
  color: #c8c4d6;
  margin-bottom: 14px;
  transition: color .6s var(--ease);
}

.page.in .sec-num { color: var(--accent); }

.page-title {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink);
  line-height: 1.2;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .8s var(--ease-out) .05s, transform .8s var(--ease-out) .05s;
}

.page.in .page-title { opacity: 1; transform: none; }

.side-note {
  margin-top: 18px;
  font-size: .78rem;
  letter-spacing: .14em;
  color: var(--dim);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .8s var(--ease-out) .2s, transform .8s var(--ease-out) .2s;
}

/* 画廊提示语：桌面显示“拖动”，触屏显示“滑动” */
.hint-mobile { display: none; }

.page.in .side-note { opacity: 1; transform: none; }

/* —— Hero 区不做玻璃卡片 —— */
#hero .page-inner {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

/* —— 01 Hero —— */
.hero-kicker {
  font-size: .8rem;
  letter-spacing: .4em;
  color: var(--dim);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s var(--ease-out) .2s, transform 1s var(--ease-out) .2s;
}

.hero-name {
  font-size: clamp(3.6rem, 8.5vw, 6.4rem);
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.15;
  color: var(--ink);
}

.hero-name .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.6em);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

.hero-en {
  margin-top: 12px;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  letter-spacing: .5em;
  color: var(--dim);
  text-transform: uppercase;
  padding-left: .5em;
}

.hero-en .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.4em);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

.hero-sub {
  margin-top: 34px;
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 1s var(--ease-out) 1.2s;
}

.hero-tags {
  margin-top: 8px;
  font-size: .88rem;
  letter-spacing: .06em;
  color: var(--dim);
  opacity: 0;
  transition: opacity 1s var(--ease-out) 1.4s;
}

#hero.in .hero-kicker,
#hero.in .hero-sub,
#hero.in .hero-tags { opacity: 1; transform: none; }

#hero.in .hero-name .ch,
#hero.in .hero-en .ch { opacity: 1; transform: none; }

/* Hero 照片位 — 静默玻璃框 */
.hero-photo {
  aspect-ratio: 4 / 5;
  max-width: 420px;
  margin-left: auto;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out) .5s, transform 1s var(--ease-out) .5s, box-shadow .6s ease;
}

#hero.in .hero-photo {
  opacity: 1;
  transform: none;
}

.hero-photo:hover {
  box-shadow: var(--shadow-card-hover);
}

.hero-photo span {
  font-size: .88rem;
  letter-spacing: .16em;
  color: var(--dim);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 19px;
}

.hero-photo-cap {
  margin-top: 14px;
  text-align: right;
  font-size: .7rem;
  letter-spacing: .34em;
  color: var(--dim);
  opacity: 0;
  transition: opacity 1s var(--ease-out) .8s;
}

#hero.in .hero-photo-cap { opacity: 1; }

/* 滚动指示器 */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: .68rem;
  letter-spacing: .34em;
  color: var(--dim);
  opacity: 0;
  transition: opacity 1s var(--ease-out) 1.8s;
}

#hero.in .scroll-hint { opacity: 1; }

.scroll-hint span {
  width: 1px;
  height: 44px;
  background: rgba(0, 0, 0, .08);
  overflow: hidden;
  position: relative;
}

.scroll-hint span::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: drip 1.8s var(--ease) infinite;
}

@keyframes drip {
  0%   { top: -100%; }
  60%  { top: 0; }
  100% { top: 100%; }
}

/* —— 正文 —— */
.page-text {
  max-width: 560px;
  font-size: 1.02rem;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease-out) .15s, transform .8s var(--ease-out) .15s;
}

.page.in .page-text { opacity: 1; transform: none; }

/* 统计小卡片 — 关于页 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
  max-width: 580px;
}

.stat-card {
  background: rgba(255, 255, 255, .45);
  border-radius: 14px;
  padding: 18px 16px 14px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .03);
  border: 1px solid rgba(0, 0, 0, .04);
  transition: transform .3s var(--ease-out), box-shadow .3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

.stat-value {
  display: block;
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.stat-num {
  color: var(--accent);
}

.stat-unit {
  font-size: .9rem;
  font-weight: 450;
  color: var(--dim);
}

.stat-label {
  display: block;
  margin-top: 7px;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--dim);
}

/* 关于页 — 两个 1×2 窗口 */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
  max-width: 580px;
}

.about-card {
  background: rgba(255, 255, 255, .45);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .03);
  border: 1px solid rgba(0, 0, 0, .04);
  transition: transform .3s var(--ease-out), box-shadow .3s ease;
}

.about-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

.about-card-label {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.about-card-desc {
  font-size: .78rem;
  color: var(--dim);
}

/* 课程轮播（嵌入 about-card） */
.course-roll-item {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity .3s ease, transform .3s ease;
}

/* 课程卡片可点击 */
.course-clickable {
  cursor: pointer;
  position: relative;
}

.course-clickable::after {
  content: '↗';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: .85rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
}

.course-clickable:hover::after {
  opacity: .6;
  transform: translate(2px, -2px);
}

/* 课程成绩弹窗 */
.course-modal-win {
  background: rgba(255, 255, 255, .88) !important;
}

.course-modal-body {
  padding: 28px 32px 30px;
  overflow-y: auto;
  scrollbar-width: none;
  max-height: 78vh;
  max-height: 78dvh;
}

.course-modal-body::-webkit-scrollbar { display: none; }

.course-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.course-col-title {
  font-size: .82rem;
  font-family: -apple-system, 'Segoe UI', sans-serif;
  letter-spacing: .12em;
  color: var(--accent);
  margin: 0 0 16px;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.course-col-title em {
  font-style: normal;
  font-size: .72rem;
  color: var(--dim);
  font-weight: 400;
  margin-left: 6px;
}

.course-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.course-tier {
  margin-bottom: 14px;
}

.course-tier-label {
  display: block;
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: .66rem;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: 6px;
}

.course-name {
  font-size: .86rem;
  color: var(--ink-soft);
  flex: 1;
  padding-right: 10px;
  line-height: 1.5;
}

.course-score {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: .86rem;
  font-weight: 650;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

/* —— 时间线 —— */
.timeline {
  position: relative;
  padding-left: 0;
  overflow: hidden;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5.5px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(0, 0, 0, .08);
}

/* —— 时间轴流光（JS 驱动）—— */
.timeline-js-glow {
  position: absolute;
  left: 5.5px;
  width: 1px;
  height: 20%;
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 1;
}


.tl-item { position: relative; margin-bottom: 24px; }
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: 2px;
  top: .55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  z-index: 2;
}

/* dot 在流光之上 */


.tl-body {
  padding-left: 26px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.dim {
  color: var(--dim);
  font-size: .84rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.proj-name {
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-desc {
  margin-top: 3px;
  font-size: .9rem;
  color: var(--dim);
}

.proj-name {
  font-weight: 600;
  color: var(--ink);
}

/* —— 项目页 —— */
#projects .page-inner {
  max-width: 1400px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 10fr);
  gap: clamp(32px, 4vw, 56px);
}

#projects .page-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* 画廊渐变遮罩 */
.hscroll-wrap { position: relative; }

.hscroll-wrap::before,
.hscroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 2;
  pointer-events: none;
}

.hscroll-wrap::before {
  left: -8px;
  background: linear-gradient(to right, rgba(245,244,248,.85) 10%, transparent);
}

.hscroll-wrap::after {
  right: -8px;
  background: linear-gradient(to left, rgba(245,244,248,.85) 10%, transparent);
}

.hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: 300px;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 8px 18px;
  margin: 0 -8px;
  cursor: grab;
  scrollbar-width: none;
  outline: none;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}

.hscroll::-webkit-scrollbar { display: none; }

.hscroll .ph img { -webkit-user-drag: none; user-select: none; }

.hscroll.dragging {
  cursor: grabbing;
  user-select: none;
}

.hscroll.dragging .card { pointer-events: none; }

/* —— 项目卡片 — 静默玻璃 —— */
.card {
  width: 100%;
  background: var(--bg-card);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition:
    transform .45s var(--ease-out),
    box-shadow .45s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.ph {
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, .02);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.ph span {
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--dim);
}

.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1s var(--ease-out);
}

.card:hover .ph img { transform: scale(1.04); }

.card-body { padding: 16px 18px 18px; }

.brief { margin-top: 6px; }

.card-idx {
  position: absolute;
  bottom: 12px;
  right: 16px;
  z-index: 3;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--accent);
  opacity: .75;
  pointer-events: none;
}

.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.tags span {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--accent);
  border: 1px solid rgba(107, 95, 212, .2);
  border-radius: 999px;
  padding: 2px 10px;
  transition: background .3s ease, color .3s ease;
}

.card:hover .tags span {
  background: var(--accent);
  color: #fff;
}

/* —— 弹窗 —— */
html.no-scroll { overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 30, .25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s ease;
}

.modal.open .modal-backdrop { opacity: 1; }

.modal-win {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(920px, calc(100vw - 40px));
  max-height: 84vh;
  max-height: 84dvh;
  background: rgba(255, 255, 255, .85);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .12),
    0 0 0 1px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}

/* —— 弹窗左栏：图片区 —— */
.modal-gallery {
  flex: 0 0 420px;
  width: 420px;
  min-width: 420px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(0, 0, 0, .035);
  border-right: 1px solid var(--line);
}

.modal-ph {
  position: relative;
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, .045);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-ph span:not(.modal-count) {
  font-size: .88rem;
  letter-spacing: .14em;
  color: var(--dim);
}

.modal-ph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-img {
  transition: opacity .25s ease;
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}

.modal-arrow:hover {
  color: #fff;
  background: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.modal-prev { left: 14px; }
.modal-next { right: 14px; }

.modal-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .72rem;
  letter-spacing: .12em;
}

.modal-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, .5);
  border-top: 1px solid var(--line);
}

.modal-thumbs::-webkit-scrollbar { display: none; }

.modal-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: .62;
  transition: opacity .25s ease, border-color .25s ease, transform .25s ease;
}

.modal-thumb:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.modal-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 10px var(--accent-glow);
}

.modal-body {
  padding: 26px 32px 30px;
  overflow-y: auto;
  scrollbar-width: none;
  text-align: left;
}

.modal-body::-webkit-scrollbar { display: none; }

.modal-idx {
  font-size: 1.05rem;
  font-style: italic;
  letter-spacing: .2em;
  color: var(--accent);
}

.modal-name {
  margin-top: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  line-height: 1.4;
}

.modal-brief {
  margin-top: 10px;
  font-size: 1rem;
  color: var(--ink-soft);
}

.modal-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .93rem;
  color: var(--ink-soft);
  line-height: 1.9;
  white-space: pre-line;
}

.modal-doc, .modal-repo {
  display: inline-flex;
  margin-top: 18px;
  margin-right: 8px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: .82rem;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

.modal-doc[hidden], .modal-repo[hidden] {
  display: none;
}

.modal-doc:hover, .modal-repo:hover {
  background: var(--accent);
  color: #fff;
}

.modal-tags { margin-top: 16px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(6px);
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color .3s ease, transform .3s ease;
}

.modal-close:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

/* —— 技能 — 分类 —— */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
}

.skill-group {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

.page.in .skill-group { opacity: 1; transform: none; }
.page.in .skill-group:nth-child(2) { transition-delay: .08s; }
.page.in .skill-group:nth-child(3) { transition-delay: .16s; }
.page.in .skill-group:nth-child(4) { transition-delay: .24s; }

.skill-cat {
  display: block;
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.skill-item {
  display: block;
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.7;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  transition: color .3s ease;
}

.skill-group:hover .skill-item { color: var(--ink); }

/* —— 联系 —— */
.contact-list {
  list-style: none;
  max-width: 560px;
}

.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 26px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

.contact-list li:last-child { border-bottom: none; }

.page.in .contact-list li { opacity: 1; transform: none; }
.page.in .contact-list li:nth-child(2) { transition-delay: .08s; }
.page.in .contact-list li:nth-child(3) { transition-delay: .16s; }

.c-label {
  flex: 0 0 84px;
  font-size: .78rem;
  letter-spacing: .2em;
  color: var(--dim);
}

.contact-list a {
  font-size: 1.08rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .3s ease, border-color .3s ease;
}

.contact-list a b {
  font-weight: 400;
  color: var(--accent);
  display: inline-block;
  transition: transform .35s var(--ease-out);
}

.contact-list a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.contact-list a:hover b { transform: translateX(4px); }

/* 复制反馈 */
.copy-email b {
  display: inline-block;
  transition: opacity .25s ease, transform .25s ease;
}

.copy-email.copied b {
  color: var(--accent);
}

/* ========== 页脚 ========== */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 28px;
  color: var(--dim);
  font-size: .7rem;
  letter-spacing: .12em;
  border-top: 1px solid var(--line);
  max-width: 1080px;
  margin: 0 auto;
}

.footer strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* —— 翻页动画 —— */
.page.pre { opacity: 0; }
.page { transition: opacity .6s ease; }

/* ========== 响应式 ========== */
@media (max-width: 1080px) {
  #projects .page-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .page-inner { padding: 32px 28px; }
}

@media (max-width: 860px) {
  .page-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-photo { margin-left: 0; max-width: 340px; }
  .page { padding: 104px 22px 64px; }
  .page-inner { padding: 28px 24px; border-radius: 16px; }
  /* 弹窗窄屏回退：上下布局 */
  .modal-win { flex-direction: column; }
  .modal-gallery { flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--line); }
  .modal-ph { flex: 0 0 260px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }

  /* 顶栏：收紧，保证品牌 + 6 个导航项在窄屏放得下 */
  .topbar { min-height: 56px; padding: 0 14px; }
  .topbar-note { display: none; }
  .brand { font-size: .72rem; gap: 8px; }
  .topnav { gap: 14px; }
  .topnav a { font-size: .72rem; padding: 6px 0; }

  /* 页面节奏：非首屏不再强制整屏高，收紧上下留白 */
  .page { min-height: auto; padding: 84px 18px 40px; }
  #hero { min-height: 100vh; min-height: 100svh; }
  .scroll-hint { position: static; transform: none; margin-top: 32px; }
  .page-inner { padding: 22px 18px; border-radius: 14px; }

  .page-title { letter-spacing: .06em; }
  .side-note { margin-top: 12px; }
  .hint-desktop { display: none; }
  .hint-mobile { display: inline; }

  /* 关于页 */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px 12px 12px; }
  .about-grid { grid-template-columns: 1fr; }
  .page-text { font-size: .98rem; }

  /* 经历：名称 / 时间改为上下排布，避免挤压截断 */
  .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .proj-name { white-space: normal; overflow: visible; text-overflow: clip; }
  .dim { white-space: normal; }
  .tl-desc { font-size: .88rem; }

  /* 项目画廊：单行滚动 + 露出下一张的窥探宽度 */
  .hscroll {
    grid-template-rows: auto;
    grid-auto-columns: min(300px, 82%);
    gap: 16px;
    padding: 8px 8px 12px;
  }
  .hscroll-wrap::before, .hscroll-wrap::after { width: 36px; }
  .card-body { padding: 14px 16px 16px; }

  /* 联系：标签 + 值 上下排布 */
  .contact-list li { flex-direction: column; gap: 2px; padding: 14px 0; }
  .c-label { flex: none; }
  .contact-list a { font-size: 1rem; overflow-wrap: anywhere; }

  /* 弹窗：更贴近屏幕边缘 */
  .modal-win { width: calc(100vw - 24px); border-radius: 16px; }
  .modal-ph { flex-basis: 240px; }
  .modal-body { padding: 20px 18px 24px; }
  .modal-name { font-size: 1.2rem; }
  .modal-thumb { width: 78px; height: 48px; }
  .modal-close { top: 10px; right: 10px; width: 40px; height: 40px; }
  .modal-arrow { width: 40px; height: 40px; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
  .course-modal-body { padding: 22px 18px 24px; max-height: 74vh; max-height: 74dvh; }
  .course-modal-grid { grid-template-columns: 1fr; gap: 20px; }

  .footer { flex-direction: column; gap: 8px; line-height: 1.8; padding: 26px 18px; }
}

@media (max-width: 400px) {
  .topbar { padding: 0 12px; }
  .brand { font-size: .68rem; gap: 6px; }
  .topnav { gap: 10px; }
  .topnav a { font-size: .68rem; }
  .page { padding: 78px 14px 36px; }
  .page-inner { padding: 20px 14px; }
  .stats-grid { gap: 8px; }
}

/* —— 无障碍 —— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after, .progress { display: none; }
  * { animation: none !important; transition: none !important; }
  .page, .page.pre { opacity: 1 !important; }
  .hero-kicker, .hero-sub, .hero-tags, .scroll-hint,
  .page-text, .page-title, .side-note,
  .skill-group, .contact-list li,
  .hero-photo, .hero-photo-cap,
  .hero-name .ch, .hero-en .ch {
    opacity: 1 !important;
    transform: none !important;
  }
  .modal-win { transform: none !important; opacity: 1 !important; }
}
