/* ============================================================
   CodeLab · 个人技术主页
   纯手写 CSS，无外部依赖
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #070b14;
  --bg-soft: #0b1220;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eef9;
  --text-soft: #c3cee1;
  --muted: #8d9bb5;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --danger: #f87171;
  --grad: linear-gradient(120deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  --grad-soft: linear-gradient(120deg, rgba(56, 189, 248, .16), rgba(129, 140, 248, .16));
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .65);
  --shadow-sm: 0 10px 30px -14px rgba(0, 0, 0, .55);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-h: 68px;
  --maxw: 1140px;
}

[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-soft: #ffffff;
  --surface: rgba(15, 23, 42, 0.035);
  --surface-strong: rgba(15, 23, 42, 0.055);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0d1526;
  --text-soft: #26334a;
  --muted: #5b6a83;
  --shadow: 0 24px 60px -30px rgba(15, 23, 42, .35);
  --shadow-sm: 0 10px 30px -18px rgba(15, 23, 42, .35);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: rgba(129, 140, 248, .35); color: #fff; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }

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

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2b3a55, #1c2740);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3b4c6b; }

/* ---------- 背景装饰 ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}

.blob-a {
  width: 520px; height: 520px;
  top: -160px; right: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, .55), transparent 65%);
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-b {
  width: 480px; height: 480px;
  left: -180px; top: 42%;
  background: radial-gradient(circle, rgba(129, 140, 248, .45), transparent 65%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

[data-theme="light"] .blob { opacity: .32; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

[data-theme="light"] .grid-overlay {
  background-image:
    linear-gradient(rgba(15, 23, 42, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .05) 1px, transparent 1px);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-40px, 40px, 0) scale(1.12); }
}

/* ---------- 滚动进度 ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  background: transparent;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(56, 189, 248, .7);
  transition: width .1s linear;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  color: #06111f;
  background: var(--grad);
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, .8);
}

.brand-text em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.nav-links a {
  position: relative;
  display: block;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .9rem;
  color: var(--muted);
  transition: color .2s ease, background .2s ease;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--surface-strong); }

.nav-links a.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
}

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

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

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.icon-btn:hover { background: var(--surface-strong); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn .icon { width: 19px; height: 19px; }

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

.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .3s ease;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) 0 56px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: 64px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .8rem;
  color: var(--text-soft);
  letter-spacing: .02em;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, .16); }
  50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, .04); }
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.1rem, 4.4vw, 3.45rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.grad-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shift 8s linear infinite;
  padding-right: .08em;
}

@keyframes grad-shift {
  to { background-position: 200% center; }
}

.hero-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--accent);
  min-height: 28px;
}

.hero-role .prompt { color: var(--accent-3); font-weight: 700; }

.caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  margin-left: 2px;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 34em;
  margin: 18px 0 30px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: .93rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; transition: transform .25s ease; }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  color: #06111f;
  background: var(--grad);
  box-shadow: 0 14px 30px -14px rgba(99, 102, 241, .85);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -16px rgba(99, 102, 241, .95);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.btn-sm { padding: 9px 18px; font-size: .86rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: .83rem;
  color: var(--muted);
}

.hero-meta li { display: inline-flex; gap: 7px; align-items: center; }
.hero-meta span { color: var(--accent); font-size: .7rem; }

/* 代码窗口 */
.hero-visual { position: relative; }

.code-window {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: linear-gradient(160deg, #0e1729 0%, #0a1120 60%, #0b1424 100%);
  box-shadow: 0 40px 80px -32px rgba(2, 8, 20, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-4deg) rotateX(1.5deg);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.code-window:hover { transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-4px); }

.code-window::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 85% -10%, rgba(56, 189, 248, .14), transparent 70%);
  pointer-events: none;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .02);
}

.code-bar .dot { width: 10px; height: 10px; box-shadow: none; animation: none; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-file {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: .76rem;
  color: #8fa2c0;
}

.code-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .12em;
  color: #7dd3fc;
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .22);
}

.code-body {
  margin: 0;
  padding: 20px 20px 16px;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.9;
  color: #c9d6ea;
  overflow-x: auto;
  tab-size: 4;
}

.tok-c { color: #5b6b85; font-style: italic; }
.tok-k { color: #c084fc; }
.tok-t { color: #7dd3fc; }
.tok-f { color: #93c5fd; }
.tok-s { color: #86efac; }

.code-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid rgba(148, 163, 184, .12);
  background: rgba(255, 255, 255, .018);
  font-family: var(--mono);
  font-size: .66rem;
  color: #6d7f9c;
}

.code-ok { margin-left: auto; color: #34d399; }

.float-card {
  position: absolute;
  left: -26px;
  bottom: -26px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  animation: floaty 5.5s ease-in-out infinite;
}

.float-card strong {
  display: block;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.float-card p { font-size: .8rem; color: var(--text-soft); }

.ping {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent-3);
  flex: none;
}

.ping::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, .55);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}

@keyframes ping {
  0% { transform: scale(.6); opacity: 1; }
  80%, 100% { transform: scale(1.9); opacity: 0; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 数据条 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 68px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats li {
  text-align: center;
  border-left: 1px solid var(--border);
}
.stats li:first-child { border-left: 0; }

.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 2px;
  font-size: .79rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- 通用区块 ---------- */
.section { padding: 104px 0; }

.section-alt {
  background:
    radial-gradient(70% 100% at 50% 0%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg-soft) 55%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head { max-width: 720px; margin-bottom: 52px; }

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -.025em;
}

.section-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: .98rem;
  max-width: 60ch;
}

.link-underline {
  color: var(--text);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 88%;
  transition: color .2s ease, background-size .25s ease;
}
.link-underline:hover { color: var(--accent); background-size: 100% 4px; }

.br-mobile { display: none; }

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: start;
}

.about-text > p {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.95;
  margin-bottom: 16px;
}

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

.about-list {
  margin: 26px 0 30px;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.about-list li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  font-size: .93rem;
  color: var(--text-soft);
}

.about-list span {
  flex: none;
  width: 44px;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: .06em;
}

.about-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.profile-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(56, 189, 248, .07), transparent 45%),
    var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 160px; height: 160px;
  background: radial-gradient(circle at 100% 0, rgba(129, 140, 248, .16), transparent 70%);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 15px;
  background: var(--grad);
  color: #06111f;
  font-family: var(--mono);
  font-weight: 800;
  font-size: .95rem;
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .9);
  flex: none;
}

.profile-id { display: flex; flex-direction: column; line-height: 1.4; }
.profile-id strong { font-size: 1rem; letter-spacing: -.01em; }
.profile-id span { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

.profile-flag {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, .3);
  background: rgba(52, 211, 153, .1);
  color: var(--accent-3);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
}

.profile-code {
  margin: 18px 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, .16);
  background: #0a1222;
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.95;
  color: #b9c7dd;
  overflow-x: auto;
}

.profile-code .key { color: #7dd3fc; }
.profile-code .str { color: #86efac; }

.profile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--mono);
}

.profile-foot span:first-child { display: inline-flex; align-items: center; gap: 7px; }

.dot-live {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .15);
  flex: none;
}

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.skill-card {
  position: relative;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 160px at 15% 0%, rgba(56, 189, 248, .09), transparent 70%);
  opacity: 0;
  transition: opacity .3s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--surface-strong);
}

.skill-card:hover::before { opacity: 1; }

.skill-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--grad-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.skill-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.skill-card p { font-size: .87rem; color: var(--muted); margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chips li {
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  font-size: .76rem;
  color: var(--text-soft);
  font-family: var(--mono);
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.chips li:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--accent);
  transform: translateY(-1px);
}

.chips-lg li { padding: 7px 16px; font-size: .82rem; }

.learning-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 18px 24px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent-2) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 6%, transparent);
}

.learning-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}

/* ---------- 作品 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s ease;
}

.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }

.filter-btn.is-active {
  color: #06111f;
  background: var(--grad);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 10px 26px -14px rgba(99, 102, 241, .9);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: var(--shadow);
}

.project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.project-card.is-hidden {
  display: none;
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9.5;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 18% 12%, color-mix(in srgb, var(--c1) 90%, #fff 10%), transparent 58%),
    linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
  transition: filter .3s ease;
}

.project-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(7, 11, 20, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 11, 20, .18) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(7, 11, 20, .55));
}

.thumb-glyph {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 800;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 10px 30px rgba(3, 8, 18, .45);
  letter-spacing: -.04em;
  transition: transform .4s ease;
}

.project-card:hover .thumb-glyph { transform: scale(1.08) rotate(-3deg); }

.thumb-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .22em;
  color: rgba(255, 255, 255, .78);
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 17px;
  flex: 1;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-top h3 { font-size: 1.02rem; letter-spacing: -.01em; }

.project-status {
  flex: none;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: .65rem;
  font-family: var(--mono);
  letter-spacing: .04em;
  white-space: nowrap;
}

.status-done { color: var(--accent-3); background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .25); }
.status-wip { color: #fbbf24; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .25); }

.project-body > p {
  font-size: .855rem;
  line-height: 1.7;
  color: var(--muted);
}

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

.tags li {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-strong);
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-soft);
}

.tags li::before { content: "#"; color: var(--accent); margin-right: 1px; opacity: .7; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
}

.project-link i {
  font-style: normal;
  transition: transform .25s ease;
}

.project-card:hover .project-link i { transform: translateX(4px); }

.projects-note {
  margin-top: 28px;
  font-size: .84rem;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
}

.projects-note::before { content: "// "; color: var(--accent); }

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 34px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), rgba(129, 140, 248, .35), transparent);
}

.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -30px;
  top: 28px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timeline-card {
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
}

.timeline-card:hover {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--surface-strong);
}

.timeline-year {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: .71rem;
  letter-spacing: .1em;
  color: var(--accent);
}

.timeline-card h3 { font-size: 1.02rem; margin-bottom: 7px; }
.timeline-card p { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }

/* ---------- 笔记 ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.note-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}

.note-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent-2) 34%, var(--border));
  background: var(--surface-strong);
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--mono);
}

.note-tag {
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--accent);
}

.note-card h3 { font-size: 1rem; line-height: 1.5; margin-top: 2px; }
.note-card p { font-size: .855rem; color: var(--muted); line-height: 1.7; }

.note-link {
  margin-top: auto;
  padding-top: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
}

.note-link i { font-style: normal; display: inline-block; transition: transform .25s ease; }
.note-card:hover .note-link i { transform: translateX(4px); }

/* ---------- 联系 ---------- */
.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
  padding: 52px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 140% at 0% 0%, rgba(56, 189, 248, .1), transparent 55%),
    radial-gradient(70% 120% at 100% 100%, rgba(192, 132, 252, .1), transparent 55%),
    var(--surface);
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(130deg, rgba(56, 189, 248, .45), transparent 35%, transparent 65%, rgba(192, 132, 252, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.contact-copy h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); letter-spacing: -.03em; }
.contact-copy .section-sub { margin-bottom: 28px; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.socials {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.socials a {
  font-size: .85rem;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.socials a:hover { color: var(--accent); border-color: var(--accent); }

.terminal {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #0a1120;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.2deg);
  transition: transform .4s ease;
}

.terminal:hover { transform: rotate(0); }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .025);
}

.terminal-bar .dot { width: 8px; height: 8px; box-shadow: none; animation: none; }
.terminal-title { margin-left: 6px; font-family: var(--mono); font-size: .68rem; color: #7f91ad; }

.terminal-body {
  padding: 16px 18px 18px;
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 2.05;
  color: #c3d0e4;
}

.t-prompt { color: var(--accent-3); margin-right: 6px; }
.t-out { color: #7f91ad; padding-left: 14px; }
.t-ok { color: #34d399; }

.t-caret {
  display: inline-block;
  width: 7px; height: 12px;
  vertical-align: -1px;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 46px 0 34px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 60%, transparent);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; }

.footer-nav a {
  font-size: .85rem;
  color: var(--muted);
  transition: color .2s ease;
}

.footer-nav a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  font-size: .78rem;
  color: var(--muted);
}

.footer-icp a { color: var(--muted); border-bottom: 1px dotted var(--border-strong); }
.footer-icp a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, border-color .2s ease;
  box-shadow: var(--shadow-sm);
}

.to-top svg { width: 18px; height: 18px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 16, .68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade-in .25s ease;
}

.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 34px 34px 30px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85);
  animation: modal-in .3s cubic-bezier(.2, .8, .2, 1);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.modal-close:hover { background: var(--surface-strong); border-color: var(--border-strong); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body .detail-kicker {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-body h3 { font-size: 1.45rem; padding-right: 40px; margin-bottom: 12px; }

.modal-body > p {
  font-size: .92rem;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 18px;
}

.modal-body h4 {
  font-size: .92rem;
  margin: 20px 0 10px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}

.modal-body ul { display: grid; gap: 7px; }

.modal-body ul li {
  position: relative;
  padding-left: 18px;
  font-size: .89rem;
  color: var(--muted);
  line-height: 1.7;
}

.modal-body ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .8rem;
}

/* ---------- 滚动入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity, transform;
}

.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 56px); }
  .hero-visual { max-width: 560px; width: 100%; }
  .code-window { transform: none; }
  .float-card { left: 12px; bottom: -22px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .profile-card { position: static; }
  .notes-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card { grid-template-columns: 1fr; padding: 40px; }
  .terminal { transform: none; max-width: 460px; }
}

@media (max-width: 820px) {
  .nav-links {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-soft) 96%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
  }

  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }

  .nav-links a { padding: 10px 14px; border-radius: 10px; font-size: .95rem; }
  .nav-links a.is-active::after { display: none; }

  .menu-btn { display: flex; }

  .section { padding: 76px 0; }
  .section-head { margin-bottom: 38px; }
  .br-mobile { display: block; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px 0; margin-top: 52px; }
  .stats li:nth-child(3) { border-left: 0; }

  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }

  .footer-top { flex-direction: column; align-items: flex-start; }
  .contact-card { padding: 32px 24px; border-radius: 20px; }
  .modal-panel { padding: 28px 22px 24px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero h1 { font-size: 1.95rem; }
  .hero-role { font-size: .82rem; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-meta { font-size: .78rem; gap: 6px 16px; }
  .code-body { font-size: .68rem; padding: 16px 14px; }
  .code-footer { font-size: .58rem; gap: 10px; }
  .float-card { left: 8px; bottom: -20px; padding: 10px 14px; }
  .stats { margin-top: 46px; }
  .contact-actions .btn { flex: 1 1 100%; }
  .to-top { right: 16px; bottom: 16px; }
  .timeline { padding-left: 26px; }
  .timeline-dot { left: -25px; }
}

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