/* ==========================================================================
   FrostUI / Web — 个人主页样式表
   设计语言来自 FrostUI（WPF 玻璃材质设计系统）：
   DWM 亚克力质感 · 细渐变描边 · 极光强调色 · 呼吸感留白
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --font-display: "Segoe UI Variable Display", "Microsoft YaHei UI", "PingFang SC",
                  "HarmonyOS Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Segoe UI Variable Text", "Microsoft YaHei UI", "PingFang SC",
             "HarmonyOS Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", Consolas,
               "SFMono-Regular", "Liberation Mono", monospace;

  --rail-w: 264px;
  --topbar-h: 68px;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --glass-blur: 28px;
  --now-k: 44px;

  /* 强调色（azure 为默认） */
  --accent: #84AEFF;
  --accent-rgb: 132 174 255;
  --accent-2: #B79CFF;
  --accent-2-rgb: 183 156 255;
  --accent-deep: #5E82F5;
  --accent-ink: #07101F;
  --teal: #63E6BE;
  --teal-rgb: 99 230 190;
  --amber: #FFC46B;
  --danger: #FF7E94;
}

/* 强调色主题 */
html[data-accent="mint"]   { --accent:#63E6BE; --accent-rgb:99 230 190;  --accent-2:#7FD8FF; --accent-2-rgb:127 216 255; --accent-deep:#2FBFA0; --accent-ink:#04140F; --teal:#84AEFF; --teal-rgb:132 174 255; }
html[data-accent="violet"] { --accent:#B79CFF; --accent-rgb:183 156 255; --accent-2:#FF9EB5; --accent-2-rgb:255 158 181; --accent-deep:#8A6BF0; --accent-ink:#120A24; --teal:#63E6BE; --teal-rgb:99 230 190; }
html[data-accent="sakura"] { --accent:#FF9EB5; --accent-rgb:255 158 181; --accent-2:#FFC46B; --accent-2-rgb:255 196 107; --accent-deep:#E86F8C; --accent-ink:#20080F; --teal:#63E6BE; --teal-rgb:99 230 190; }
html[data-accent="amber"]  { --accent:#FFC46B; --accent-rgb:255 196 107; --accent-2:#63E6BE; --accent-2-rgb:99 230 190;  --accent-deep:#D99A33; --accent-ink:#1C1204; --teal:#84AEFF; --teal-rgb:132 174 255; }

/* ---------- 2. 主题 ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070A12;
  --bg-2: #0B101B;
  --bg-3: #0E1524;

  --text: #F4F7FD;
  --text-2: #AAB6CB;
  --text-3: #748198;

  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  --card-a: rgba(255, 255, 255, .115);
  --card-b: rgba(255, 255, 255, .042);
  --card-border: rgba(255, 255, 255, .135);
  --card-border-hover: rgba(255, 255, 255, .24);
  --card-shadow: 0 34px 70px -34px rgba(0, 0, 0, .9), 0 2px 10px rgba(0, 0, 0, .25);
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, .10);

  --chip-bg: rgba(255, 255, 255, .06);
  --chip-border: rgba(255, 255, 255, .13);
  --chip-hover: rgba(255, 255, 255, .11);

  --nav-active: rgba(255, 255, 255, .10);
  --nav-active-border: rgba(255, 255, 255, .16);

  --input-bg: rgba(255, 255, 255, .07);
  --track: rgba(255, 255, 255, .10);

  --sheet-bg: rgba(13, 19, 31, .93);
  --sheet-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .12);

  --orb-opacity: .55;
  --grain-opacity: .05;
  --scrim: rgba(3, 6, 12, .6);

  --accent-text: var(--accent);
  --ok-text: var(--teal);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #EDF2FB;
  --bg-2: #F7FAFF;
  --bg-3: #FFFFFF;

  --text: #111827;
  --text-2: #4F5D73;
  --text-3: #7C8799;

  --line: rgba(17, 24, 39, .07);
  --line-2: rgba(17, 24, 39, .13);

  --card-a: rgba(255, 255, 255, .88);
  --card-b: rgba(255, 255, 255, .58);
  --card-border: rgba(255, 255, 255, .95);
  --card-border-hover: rgba(255, 255, 255, 1);
  --card-shadow: 0 28px 60px -32px rgba(28, 48, 88, .38), 0 2px 8px rgba(28, 48, 88, .05);
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, .9);

  --chip-bg: rgba(255, 255, 255, .7);
  --chip-border: rgba(17, 24, 39, .10);
  --chip-hover: rgba(255, 255, 255, .95);

  --nav-active: rgba(255, 255, 255, .9);
  --nav-active-border: rgba(255, 255, 255, 1);

  --input-bg: rgba(255, 255, 255, .85);
  --track: rgba(17, 24, 39, .08);

  --sheet-bg: rgba(255, 255, 255, .96);
  --sheet-shadow: 0 40px 90px -34px rgba(28, 48, 88, .45), inset 0 1px 0 rgba(255, 255, 255, 1);

  --orb-opacity: .5;
  --grain-opacity: .025;
  --scrim: rgba(24, 37, 60, .3);

  /* 浅色背景上的小号强调色文字需要更深，保证对比度 */
  --accent-text: #2F63D9;
  --ok-text: #0B7F68;
}

@supports (color: color-mix(in srgb, red, blue)) {
  html[data-theme="light"] {
    --accent-text: color-mix(in srgb, var(--accent) 52%, #0B1B3A);
    --ok-text: color-mix(in srgb, var(--teal) 52%, #04201A);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.nav-open, html.nav-open body { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.12; letter-spacing: -.02em; font-weight: 760; }
p { margin: 0; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; }
li { list-style: none; }

::selection { background: rgb(var(--accent-rgb) / .32); color: var(--text); }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.nowrap { white-space: nowrap; }

.skip-link {
  position: fixed; top: 12px; left: 50%; transform: translate(-50%, -160%);
  z-index: 200; padding: 10px 18px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- 4. 背景氛围 ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.orb {
  position: absolute; border-radius: 50%; opacity: var(--orb-opacity);
  filter: blur(10px);
  will-change: transform;
}
.orb--blue {
  width: 58vw; height: 58vw; max-width: 900px; max-height: 900px;
  top: -24vw; left: 8vw;
  background: radial-gradient(circle at 50% 50%, rgba(91, 143, 255, .55) 0%, rgba(91, 143, 255, .18) 45%, transparent 68%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.orb--violet {
  width: 52vw; height: 52vw; max-width: 820px; max-height: 820px;
  top: 18vh; right: -18vw;
  background: radial-gradient(circle at 50% 50%, rgba(187, 133, 255, .48) 0%, rgba(187, 133, 255, .14) 48%, transparent 70%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.orb--teal {
  width: 44vw; height: 44vw; max-width: 700px; max-height: 700px;
  bottom: -22vw; left: 22vw;
  background: radial-gradient(circle at 50% 50%, rgba(95, 227, 201, .34) 0%, rgba(95, 227, 201, .1) 48%, transparent 70%);
  animation: drift-c 38s var(--ease) infinite alternate;
}

.ambient__grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
}
.ambient__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(0, 0, 0, .28) 100%);
}
html[data-theme="light"] .ambient__vignette {
  background: radial-gradient(120% 80% at 50% 0%, transparent 45%, rgba(30, 52, 92, .10) 100%);
}

@keyframes drift-a { to { transform: translate3d(6vw, 4vh, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-5vw, 6vh, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(4vw, -5vh, 0) scale(1.06); } }

body.no-ambient .orb { animation: none; opacity: calc(var(--orb-opacity) * .45); }
body.no-ambient .ambient__grain { opacity: 0; }

/* ---------- 5. 侧边栏 ---------- */
.app { position: relative; z-index: 1; }

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--rail-w);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, rgba(10, 15, 26, .82), rgba(8, 12, 21, .72));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
}
html[data-theme="light"] .rail {
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .58));
}

.rail__body { flex: 1; overflow-y: auto; padding: 8px 2px 12px; scrollbar-width: thin; }

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand__mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb) / .28), rgba(var(--accent-2-rgb) / .16));
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgb(var(--accent-rgb) / .6);
}
.brand__mark svg {
  width: 19px; height: 19px; fill: none;
  stroke: var(--accent); stroke-width: 1.6;
  stroke-linecap: round;
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text b { font-size: 15px; letter-spacing: .02em; }
.brand__text small {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
  color: var(--text-3); white-space: nowrap;
}

.rail__label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; margin: 18px 0 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-3);
}
.rail__label .mono { opacity: .55; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.nav__item .i { width: 17px; height: 17px; opacity: .85; }
.nav__item:hover { background: var(--chip-bg); color: var(--text); }
.nav__item.is-active {
  background: var(--nav-active);
  border-color: var(--nav-active-border);
  color: var(--text);
  box-shadow: var(--card-highlight);
}
.nav__item.is-active::before {
  content: ""; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / .8);
}
.nav__count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px; font-style: normal;
  padding: 1px 6px; border-radius: 6px;
  background: rgb(var(--accent-rgb) / .14);
  color: var(--accent-text);
  border: 1px solid rgb(var(--accent-rgb) / .2);
}
.nav__ext { margin-left: auto; width: 13px !important; height: 13px !important; opacity: .45; }

.rail__foot { padding-top: 12px; border-top: 1px solid var(--line); }

.rail-status {
  margin-bottom: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
}
.rail-status__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 2px 0;
  font-size: 10.5px; color: var(--text-3);
}
.rail-status__row + .rail-status__row {
  margin-top: 3px; padding-top: 6px;
  border-top: 1px solid var(--line);
}
.rail-status__row b { font-weight: 600; font-size: 10.5px; color: var(--text-2); }

.mini {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}
.mini img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-2);
}
.mini__meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.mini__meta b { font-size: 12.5px; }
.mini__meta span {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text-3);
}
.icon-btn {
  width: 32px; height: 32px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-2);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { background: var(--chip-bg); color: var(--text); border-color: var(--chip-border); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .i { width: 17px; height: 17px; }
.mini .icon-btn { margin-left: auto; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: none; }
.dot--ok { background: var(--teal); box-shadow: 0 0 8px rgb(var(--teal-rgb) / .9); }

/* ---------- 6. 主区域与顶栏 ---------- */
.main { margin-left: var(--rail-w); min-height: 100svh; display: flex; flex-direction: column; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(8, 12, 21, .55);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  transition: border-color .3s, background .3s;
}
html[data-theme="light"] .topbar { background: rgba(247, 250, 255, .62); }
.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar__lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__menu { display: none; }
.crumb {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.crumb b { color: var(--text-2); font-weight: 600; }
.crumb span { opacity: .7; }

.topbar__tools { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .1em;
  color: var(--text-2);
  white-space: nowrap;
}
.pill--live { color: var(--ok-text); border-color: rgb(var(--teal-rgb) / .28); background: rgb(var(--teal-rgb) / .08); }
.pill--live .dot { animation: pulse 2.4s var(--ease) infinite; }
.pill--ok { color: var(--ok-text); border-color: rgb(var(--teal-rgb) / .3); background: rgb(var(--teal-rgb) / .1); }
.pill--sm { height: 22px; font-size: 9px; padding: 0 8px; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

.theme-icon { display: none; }
html[data-theme="dark"] .theme-icon--sun { display: block; }
html[data-theme="light"] .theme-icon--moon { display: block; }

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--teal));
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / .7);
}

/* ---------- 7. 通用排版与组件 ---------- */
main { flex: 1; }

.section {
  width: 100%; max-width: 1220px; margin: 0 auto;
  padding: clamp(52px, 7vw, 96px) clamp(18px, 3.4vw, 44px);
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.section + .section { padding-top: clamp(18px, 2.4vw, 28px); }

.section__head { max-width: 660px; margin-bottom: clamp(24px, 3vw, 38px); }
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-text);
}
.section__head h2 { font-size: clamp(28px, 3.3vw, 42px); font-weight: 780; margin-bottom: 12px; }
.section__lede { color: var(--text-2); font-size: 14.5px; line-height: 1.8; max-width: 560px; }

.text-grad {
  background: linear-gradient(115deg, var(--accent), var(--accent-2) 60%, var(--teal));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: .06em;
}
html[data-theme="light"] .text-grad {
  background: linear-gradient(115deg, var(--accent-deep), #7A5BE0 62%, #0E9F82);
  -webkit-background-clip: text; background-clip: text;
}

/* 玻璃卡片 */
.card {
  position: relative;
  padding: clamp(20px, 2.2vw, 26px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background:
    linear-gradient(150deg, var(--card-a) 0%, var(--card-b) 52%, var(--card-a) 100%);
  box-shadow: var(--card-shadow), var(--card-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  overflow: hidden;
  transition: border-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, .10), transparent 62%
  );
  opacity: 0;
  transition: opacity .45s var(--ease);
}
html[data-theme="light"] .card::after {
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .85), transparent 65%);
}
body.sheen-on .card:hover::after { opacity: 1; }
.card:hover { border-color: var(--card-border-hover); }

.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card__head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.card__head p { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; color: var(--text-3); margin-top: 3px; }
.card__head .pill { margin-left: auto; }

.badge {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: rgb(var(--accent-rgb) / .12);
  border: 1px solid rgb(var(--accent-rgb) / .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.badge .i { width: 18px; height: 18px; }
.badge--teal { color: var(--teal); background: rgb(var(--teal-rgb) / .12); border-color: rgb(var(--teal-rgb) / .24); }
.badge--violet { color: var(--accent-2); background: rgb(var(--accent-2-rgb) / .14); border-color: rgb(var(--accent-2-rgb) / .26); }
.badge--amber { color: var(--amber); background: rgba(255, 196, 107, .12); border-color: rgba(255, 196, 107, .26); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--tight { gap: 6px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-size: 12px; color: var(--text-2);
  white-space: nowrap;
}
.chip--sm { height: 22px; padding: 0 8px; font-size: 10.5px; }
.chip--accent {
  color: var(--accent);
  border-color: rgb(var(--accent-rgb) / .3);
  background: rgb(var(--accent-rgb) / .12);
}
.chip .i { width: 12px; height: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--chip-bg);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  letter-spacing: .01em;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .3s, filter .2s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--chip-hover); border-color: var(--card-border-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }

.btn--primary {
  color: var(--accent-ink);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px -10px rgb(var(--accent-rgb) / .85), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn--primary:hover {
  filter: brightness(1.06) saturate(1.05);
  box-shadow: 0 14px 32px -10px rgb(var(--accent-rgb) / .95), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn--ghost { background: transparent; }
.btn--sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: 10px; }

/* 语言切换按钮 */
.lang-btn {
  height: 30px; min-width: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.lang-btn:hover {
  color: var(--text);
  border-color: rgb(var(--accent-rgb) / .4);
  background: rgb(var(--accent-rgb) / .1);
}
.lang-btn:active { transform: scale(.96); }
html[data-lang="en"] .lang-btn {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .02em;
}

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent-text);
}
.link-arrow .i { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.link-arrow:hover .i { transform: translate(2px, -2px); }

/* ---------- 8. 首屏 ---------- */
.section--hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, .94fr);
  column-gap: clamp(28px, 4.5vw, 64px);
  row-gap: clamp(26px, 3.6vw, 40px);
  align-items: center;
  padding-top: clamp(36px, 6vw, 76px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.hero__copy { animation: rise .85s var(--ease-out) both; }
.profile { animation: rise .95s .1s var(--ease-out) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.hero__copy { max-width: 640px; }
.hero__copy > .eyebrow { margin-bottom: 22px; gap: 8px; }

.hero__title {
  font-size: clamp(42px, 5.2vw, 74px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.08;
  margin-bottom: 14px;
}
.hero__alias { font-size: clamp(15px, 1.4vw, 17px); color: var(--text-2); margin-bottom: 18px; }
.hero__alias b { color: var(--text); font-weight: 650; }

.hero__lede { max-width: 520px; color: var(--text-2); font-size: 15px; line-height: 1.85; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 24px; }

.hero__facts {
  display: flex; flex-direction: column; gap: 7px;
  padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-3);
  max-width: 520px;
}
.hero__facts li { display: flex; gap: 12px; align-items: baseline; }
.hero__facts .mono { font-size: 9.5px; letter-spacing: .16em; color: var(--accent-text); width: 42px; flex: none; }

/* 资料卡 */
.profile { position: relative; justify-self: end; width: 100%; max-width: 396px; }
.profile__inner {
  position: relative;
  padding: 20px 22px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  background: linear-gradient(155deg, var(--card-a), var(--card-b) 60%, var(--card-a));
  box-shadow: var(--card-shadow), var(--card-highlight);
  backdrop-filter: blur(calc(var(--glass-blur) + 6px)) saturate(160%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 6px)) saturate(160%);
  overflow: hidden;
}
.profile__inner::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 55% at 50% 12%, rgb(var(--accent-rgb) / .22), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgb(var(--accent-2-rgb) / .14), transparent 70%);
  pointer-events: none;
}
.profile__head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9.5px; letter-spacing: .16em; color: var(--text-3);
}
.profile__avatar {
  position: relative;
  width: 158px; height: 158px;
  margin: 22px auto 18px;
  display: grid; place-items: center;
  isolation: isolate;
}
.profile__orb {
  position: absolute; inset: -34px; border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, rgb(var(--accent-rgb) / .5), rgb(var(--accent-2-rgb) / .18) 45%, transparent 70%);
  filter: blur(18px);
  z-index: -1;
}
.profile__ring {
  position: absolute; inset: -7px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 90deg, var(--accent-2) 180deg, transparent 300deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.5px));
  animation: spin 16s linear infinite;
  opacity: .9;
}
@keyframes spin { to { transform: rotate(360deg); } }
.profile__avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), inset 0 0 0 4px rgba(255, 255, 255, .06);
  filter: saturate(.92) contrast(1.03);
}

.profile__name {
  position: relative;
  text-align: center;
  font-size: 25px; font-weight: 780; letter-spacing: -.02em;
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
}
.profile__name span {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; color: var(--text-3);
}
.profile__sub {
  position: relative;
  text-align: center; font-size: 11.5px; color: var(--text-3);
  margin-top: 5px; letter-spacing: .01em;
}

.profile__rows { position: relative; margin-top: 16px; border-top: 1px solid var(--line); }
.profile__rows > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.profile__rows dt { color: var(--text-3); letter-spacing: .04em; }
.profile__rows dd { color: var(--text-2); text-align: right; }

.profile__foot {
  position: relative;
  display: flex; justify-content: space-between;
  margin-top: 14px;
  font-size: 8.5px; letter-spacing: .16em; color: var(--text-3);
  opacity: .75;
}

.float-chip {
  position: absolute; z-index: 3;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(12, 18, 30, .55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-2);
  font-size: 9px; letter-spacing: .12em;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8);
  animation: bob 7s var(--ease) infinite;
  pointer-events: none;
}
html[data-theme="light"] .float-chip { background: rgba(255, 255, 255, .8); }
.float-chip--tr { top: -12px; right: 16px; }
.float-chip--bl { bottom: -34px; left: 26px; animation-delay: -3.5s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 数据条 */
.stats {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat {
  position: relative;
  padding: 16px 18px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: linear-gradient(150deg, var(--card-a), var(--card-b));
  box-shadow: var(--card-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  overflow: hidden;
}
.stat .mono { font-size: 9px; letter-spacing: .16em; color: var(--text-3); }
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 780; letter-spacing: -.03em;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stat p { font-size: 11.5px; color: var(--text-3); }
.stat__spark {
  position: absolute; right: 10px; bottom: 10px;
  width: 74px; height: 22px;
  fill: none; stroke: rgb(var(--accent-rgb) / .9); stroke-width: 1.6;
  opacity: .5;
}
.stat__spark--teal { stroke: rgb(var(--teal-rgb) / .9); }
.stat__spark--violet { stroke: rgb(var(--accent-2-rgb) / .9); }

/* Bento */
.bento {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card--about { grid-column: span 7; }
.card--now { grid-column: span 5; display: flex; flex-direction: column; }
.card--tools { grid-column: span 7; }
.card--certs { grid-column: span 5; }

.about__text { font-size: 14px; line-height: 1.85; color: var(--text-2); }
.about__text + .about__text { margin-top: 10px; }
.about__text--muted { color: var(--text-3); }
.card--about .chips { margin-top: 18px; }

.now-list { display: flex; flex-direction: column; flex: 1; }
.now-foot {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 8.5px; letter-spacing: .14em; color: var(--text-3);
}
.now-list li {
  display: grid; grid-template-columns: var(--now-k) minmax(0, 1fr); gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.now-list li:last-child { border-bottom: 0; }
.now-list__k {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  color: var(--accent-text); padding-top: 4px;
  white-space: nowrap;
}
.now-list li > span:last-child { text-align: start; min-width: 0; }

.tools { display: flex; flex-wrap: wrap; gap: 7px; }
.tools li {
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 9px; border-radius: 8px;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  transition: color .2s, border-color .2s, transform .2s;
}
.tools li:hover { color: var(--accent); border-color: rgb(var(--accent-rgb) / .35); transform: translateY(-1px); }

.certs { display: flex; flex-direction: column; gap: 8px; }
.certs li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.certs .i { width: 14px; height: 14px; color: var(--ok-text); }

/* ---------- 9. 技能 ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill-group__head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 20px; }
.skill-group__head .mono { font-size: 9px; letter-spacing: .18em; color: var(--accent-text); }
.skill-group__head h3 { font-size: 18px; font-weight: 720; }

.bars { display: flex; flex-direction: column; gap: 17px; }
.bar__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bar__top span { font-size: 13px; color: var(--text); }
.bar__top b { font-size: 12px; font-weight: 600; color: var(--text-2); }
.bar__top b span { font-size: 9px; opacity: .55; margin-left: 1px; }
.bar__track {
  position: relative; height: 6px; margin-top: 8px;
  border-radius: 99px;
  background: var(--track);
  border: 1px solid var(--line);
  overflow: hidden;
}
.bar__track i {
  display: block; height: 100%; width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / .55);
  transition: width 1.15s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in .bar__track i { width: var(--v); }
.bar__note { margin-top: 7px; font-size: 10.5px; color: var(--text-3); letter-spacing: .01em; }

.bars .bar:nth-child(2) i { --d: 90ms; }
.bars .bar:nth-child(3) i { --d: 180ms; }
.bars .bar:nth-child(4) i { --d: 270ms; }

.quote {
  position: relative;
  margin-top: 16px;
  padding: clamp(24px, 3vw, 34px) clamp(24px, 4vw, 44px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background:
    radial-gradient(80% 140% at 0% 0%, rgb(var(--accent-rgb) / .14), transparent 60%),
    linear-gradient(150deg, var(--card-a), var(--card-b));
  box-shadow: var(--card-highlight);
  overflow: hidden;
  text-align: center;
}
.quote__mark {
  position: absolute; top: -26px; left: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 130px; line-height: 1; color: rgb(var(--accent-rgb) / .18);
}
.quote p {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 22px); font-weight: 600;
  letter-spacing: .01em;
}
.quote .mono { display: block; margin-top: 8px; font-size: 9.5px; letter-spacing: .16em; color: var(--text-3); }

/* ---------- 10. 履历 ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 139px; top: 18px; bottom: 18px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2) 8%, var(--line-2) 92%, transparent);
}
.tl {
  position: relative;
  display: grid; grid-template-columns: 120px 40px minmax(0, 1fr);
  align-items: start;
}
.tl__when {
  grid-column: 1; grid-row: 1;
  text-align: right; padding-top: 26px;
  font-size: 10.5px; letter-spacing: .06em; color: var(--text-3);
}
.tl__dot {
  grid-column: 2; grid-row: 1;
  position: relative; z-index: 2;
  width: 9px; height: 9px; margin: 31px auto 0;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl__dot--accent {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 16px rgb(var(--accent-rgb) / .9);
}
.tl__body { grid-column: 3; grid-row: 1; padding: 18px 22px; }
.tl__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.tl__head h3 { font-size: 16px; font-weight: 700; }
.tl__body p { font-size: 13px; line-height: 1.8; color: var(--text-2); }

.card--accentline::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / .7);
}

/* ---------- 11. 项目 ---------- */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.work { display: flex; flex-direction: column; }
.work--wide { grid-column: 1 / -1; }
.work--wide::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 120% at 100% 0%, rgb(var(--accent-rgb) / .16), transparent 62%),
    radial-gradient(50% 100% at 0% 100%, rgb(var(--accent-2-rgb) / .10), transparent 62%);
}
.work:hover { transform: translateY(-3px); }

.work__top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.work__no { font-size: 10px; letter-spacing: .14em; color: var(--text-3); }
.work__time { margin-left: auto; font-size: 9.5px; letter-spacing: .1em; color: var(--text-3); white-space: nowrap; }
.work h3 { font-size: clamp(18px, 1.7vw, 21px); font-weight: 740; margin-bottom: 9px; }
.work--wide h3 { font-size: clamp(21px, 2.1vw, 26px); }
.work__desc { font-size: 13.5px; line-height: 1.8; color: var(--text-2); max-width: 660px; }

.work__metrics {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 18px 0 4px;
}
.work__metrics > div {
  flex: 1 1 110px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}
.work__metrics b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.work__metrics b span { font-size: 12px; opacity: .6; }
.work__metrics span { font-size: 10.5px; color: var(--text-3); }
.work__links { margin-top: 16px; display: flex; gap: 16px; }

.work[href], .work a { position: relative; z-index: 2; }

/* ---------- 12. 荣誉 ---------- */
.awards { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 960px; }
.award {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center; gap: 16px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  transition: background .25s var(--ease), padding-left .25s var(--ease);
}
.award:hover { background: var(--chip-bg); padding-left: 20px; }
.award__year { font-size: 11px; letter-spacing: .1em; color: var(--text-3); }
.award__body h3 { font-size: 14.5px; font-weight: 650; }
.award__body p { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.medal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; color: var(--accent-text);
  background: rgb(var(--accent-rgb) / .10);
  border: 1px solid rgb(var(--accent-rgb) / .24);
  white-space: nowrap;
}
.medal .i { width: 13px; height: 13px; }
.medal--silver {
  color: var(--text); border-color: var(--line-2);
  background: linear-gradient(120deg, rgba(210, 222, 240, .22), rgba(160, 180, 210, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
html[data-theme="light"] .medal--silver { background: linear-gradient(120deg, rgba(200, 215, 240, .5), rgba(230, 238, 250, .5)); }

/* ---------- 13. 联系 ---------- */
.contact {
  padding: clamp(26px, 4vw, 48px);
  border-radius: var(--radius-xl);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.contact__glow {
  position: absolute; inset: -40% -10% auto auto; width: 520px; height: 520px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / .22), rgb(var(--accent-2-rgb) / .08) 45%, transparent 68%);
  filter: blur(20px);
}
.contact__head .eyebrow { margin-bottom: 16px; }
.contact__head h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 780; letter-spacing: -.03em; }
.contact__lede { margin-top: 14px; font-size: 13.5px; line-height: 1.8; color: var(--text-2); max-width: 380px; }

.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.contact__item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  transition: transform .25s var(--ease), border-color .25s, background .25s;
  min-width: 0;
}
.contact__item:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--accent-rgb) / .38);
  background: rgb(var(--accent-rgb) / .07);
}
.contact__item .badge { width: 34px; height: 34px; border-radius: 10px; }
.contact__item .badge .i { width: 16px; height: 16px; }
.contact__link {
  display: flex; align-items: center; gap: 11px;
  flex: 1; min-width: 0; color: inherit;
}
.contact__copy { margin-left: auto; width: 30px; height: 30px; }
.contact__copy .i { width: 15px; height: 15px; }
.contact__meta { display: flex; flex-direction: column; min-width: 0; }
.contact__meta small { font-size: 8.5px; letter-spacing: .16em; color: var(--text-3); }
.contact__meta b {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact__go { margin-left: auto; width: 14px; height: 14px; color: var(--text-3); flex: none; }
.contact__foot {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 18px; margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 8.5px; letter-spacing: .16em; color: var(--text-3);
}

/* ---------- 14. 页脚 ---------- */
.footer {
  max-width: 1220px; width: 100%; margin: 0 auto;
  padding: 26px clamp(18px, 3.4vw, 44px) 44px;
  border-top: 1px solid var(--line);
}
.footer__quote {
  font-size: 11.5px; color: var(--text-3); line-height: 1.8;
  max-width: 720px; margin-bottom: 16px;
}
.footer__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--text-3);
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer__nav a { display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.footer__nav a:hover { color: var(--accent); }
.footer__nav .i { width: 13px; height: 13px; }

/* ---------- 15. 设置面板 ---------- */
.sheet {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 20px; z-index: 80;
  width: min(342px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--sheet-bg);
  backdrop-filter: blur(calc(var(--glass-blur) + 12px)) saturate(160%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 12px)) saturate(160%);
  box-shadow: var(--sheet-shadow);
  animation: sheet-in .28s var(--ease-out);
}
.sheet[hidden] { display: none; }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.sheet__head h2 { font-size: 15.5px; font-weight: 700; }
.sheet__head p { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; color: var(--text-3); margin-top: 4px; }

.sheet__group { margin-bottom: 18px; }
.sheet__label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em;
  color: var(--text-3); margin-bottom: 9px;
}
.sheet__row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-bottom: 9px; }
.sheet__row output { color: var(--accent-text); font-size: 11px; }
.sheet__hint { margin-top: 8px; font-size: 10.5px; line-height: 1.6; color: var(--text-3); }
.sheet__reset { width: 100%; margin-top: 2px; }

.swatches { display: flex; gap: 10px; }
.swatch {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--s);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px -4px rgba(0, 0, 0, .6);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--s), 0 6px 16px -4px var(--s);
}

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 3px; border-radius: 11px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}
.segmented button {
  height: 30px; border-radius: 8px;
  font-size: 12px; color: var(--text-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: 0 4px 12px -4px rgb(var(--accent-rgb) / .8);
}

.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 70%), var(--track) var(--fill, 70%));
  outline: none; cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  cursor: grab;
}
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 1px solid rgba(0, 0, 0, .12); box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; cursor: pointer;
  font-size: 12.5px;
}
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { font-size: 10px; color: var(--text-3); }
.switch {
  -webkit-appearance: none; appearance: none;
  width: 40px; height: 23px; border-radius: 99px; flex: none;
  background: var(--track);
  border: 1px solid var(--line-2);
  position: relative; cursor: pointer;
  transition: background .25s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform .25s var(--ease);
}
.switch:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.switch:checked::after { transform: translateX(17px); }

/* ---------- 16. 移动端抽屉 / 遮罩 ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.scrim.is-on { opacity: 1; }

/* ---------- 17. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--card-border);
  background: var(--sheet-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--sheet-shadow);
  font-size: 12.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 18. 入场动画 ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease-out); }
.js .bento > .card:nth-child(2) { transition-delay: .06s; }
.js .bento > .card:nth-child(3) { transition-delay: .1s; }
.js .bento > .card:nth-child(4) { transition-delay: .14s; }
.js .skills > .card:nth-child(2) { transition-delay: .08s; }
.js .skills > .card:nth-child(3) { transition-delay: .16s; }
.js .works > .work:nth-child(2) { transition-delay: .06s; }
.js .works > .work:nth-child(4) { transition-delay: .06s; }
.js .stats > .stat:nth-child(2) { transition-delay: .05s; }
.js .stats > .stat:nth-child(3) { transition-delay: .1s; }
.js .stats > .stat:nth-child(4) { transition-delay: .15s; }
.js .awards > .award:nth-child(2n) { transition-delay: .04s; }

/* ---------- 20. 英文排版微调 ---------- */
html[data-lang="en"] { --now-k: 70px; }
html[data-lang="en"] .hero__title {
  font-size: clamp(38px, 4.6vw, 66px);
  letter-spacing: -.028em;
  line-height: 1.1;
}
html[data-lang="en"] .section__head h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.16;
}
html[data-lang="en"] .contact__head h2 { font-size: clamp(24px, 2.6vw, 34px); }
html[data-lang="en"] .hero__alias { letter-spacing: .01em; }
html[data-lang="en"] .hero__lede { max-width: 560px; }
html[data-lang="en"] .footer__quote { max-width: 780px; }

/* ---------- 21. 响应式 ---------- */
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--about, .card--now, .card--tools, .card--certs { grid-column: auto; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-group:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1080px) {
  .rail {
    width: 282px;
    z-index: 70;
    transform: translateX(-102%);
    transition: transform .36s var(--ease);
    box-shadow: 30px 0 80px -40px rgba(0, 0, 0, .9);
  }
  html[data-theme="light"] .rail { background: rgba(252, 253, 255, .94); }
  html.nav-open .rail { transform: none; }
  .main { margin-left: 0; }
  .topbar__menu { display: inline-grid; }
  .section { max-width: 1040px; }
}

@media (max-width: 980px) {
  .section--hero { grid-template-columns: 1fr; }
  .profile { justify-self: center; max-width: 430px; margin-top: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact { grid-template-columns: 1fr; }
  .contact__foot { grid-column: auto; }
  .timeline::before { left: 4px; }
  .float-chip { display: none; }
  .tl { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .tl__when { grid-column: 1; grid-row: auto; padding: 0 0 8px 26px; text-align: left; order: -1; }
  .tl__dot { grid-column: 1; grid-row: auto; position: absolute; left: 0; top: 30px; margin: 0; }
  .tl__body { grid-column: 1; grid-row: auto; margin-left: 26px; }
}

@media (max-width: 760px) {
  .section { padding-left: 16px; padding-right: 16px; }
  .hero__title { font-size: clamp(38px, 10vw, 52px); }
  .bento, .skills, .works { grid-template-columns: 1fr; }
  .skill-group:last-child { grid-column: auto; }
  .work--wide { grid-column: auto; }
  .topbar .pill--live { display: none; }
  .award { grid-template-columns: 48px minmax(0, 1fr); gap: 12px 10px; }
  .award .medal { grid-column: 2; justify-self: start; }
  .award:hover { padding-left: 14px; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .float-chip { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat__spark { width: 64px; }
  .hero__facts { flex-direction: column; }
  .topbar { padding: 0 12px; }
  .topbar__tools .btn--primary { display: none; }
  .contact__foot { flex-direction: column; gap: 4px; }
  .sheet {
    left: 12px; right: 12px; bottom: 12px; top: auto;
    width: auto;
    max-height: 82svh; overflow-y: auto;
  }
}

@media (max-width: 380px) {
  .crumb span { display: none; }
  .topbar { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme="dark"] {
    --card-a: rgba(22, 30, 46, .92);
    --card-b: rgba(14, 20, 32, .92);
    --sheet-bg: rgba(12, 18, 30, .98);
  }
  html[data-theme="light"] {
    --card-a: rgba(255, 255, 255, .96);
    --card-b: rgba(248, 251, 255, .96);
    --sheet-bg: rgba(255, 255, 255, .98);
  }
}

@media print {
  .rail, .topbar, .ambient, .sheet, .scrim, .toast, .scroll-progress { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; color: #111; }
  .card, .stat, .profile__inner { box-shadow: none; border-color: #ddd; }
}
