﻿/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, canvas, svg { max-width: 100%; }

/* ─── Dark theme (default) ─────────────────────────── */
:root {
  --bg:        #0d0f0f;
  --bg-1:      #0d1214;
  --bg-2:      #4361ee80;
  --surface:   #151819;
  --border:    #292e30;
  --text:      #d4e0e3;
  --text-2:    #88989e;
  --heading:   #ffffff;
  --accent:    #39D353;
  --accent-2:  #3a0ca3;
  --copper:    #c87941;
  --danger:    #E95351;
  --nav-bg:    rgba(13,15,15,0.92);
  /* Fixed nav gradient scrim (top of page) */
  --nav-grad-solid:  rgba(13, 15, 15, 0.97);
  --nav-grad-mid:    rgba(13, 15, 15, 0.72);
  --nav-grad-soft:   rgba(13, 15, 15, 0.22);
  --scan-op:   0.00;
  /* JetBrains first: Latin / digits; LXGW WenKai Mono: CJK fallback */
  --mono:      'JetBrains Mono', 'LXGW WenKai Mono', monospace;
  --sans:      'JetBrains Mono', 'LXGW WenKai Mono', monospace;
  --gap:       clamp(1rem, 3vw, 2rem);
  --hero-bg:   #09090b;
}

/* ─── Light theme ──────────────────────────────────── */
[data-theme="light"] {
  --bg:        #f0f4f8;
  --bg-1:      #e4ecf5;
  --bg-2:      #4361ee55;
  --surface:   #ffffff;
  --border:    #c8d0dc;
  --text:      #1a2236;
  --text-2:    #4a5a78;
  --heading:   #0d1528;
  --accent:    #39D353;
  --accent-2:  #5a3d8a;
  --copper:    #b56a2a;
  --danger:    #d93050;
  --nav-bg:    rgba(240,244,248,0.94);
  --nav-grad-solid:  rgba(240, 244, 248, 0.96);
  --nav-grad-mid:    rgba(240, 244, 248, 0.78);
  --nav-grad-soft:   rgba(240, 244, 248, 0.2);
  --scan-op:   0;
  --hero-bg:   #f0f4f8;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.35s, color 0.35s;
}

/* ─── 模糊过渡遮罩（backdrop-filter，不影响内容渲染 / 光标） ─── */
#blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: transparent;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  transition: opacity 0.45s ease-out, backdrop-filter 0.45s ease-out;
}

#blur-overlay.active {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
}

@keyframes overlayBlurIn {
  0%   { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 1; }
  100% { backdrop-filter: blur(0);    -webkit-backdrop-filter: blur(0);    opacity: 0; }
}

#blur-overlay.enter {
  animation: overlayBlurIn 0.5s ease-out forwards;
}

/* ─── Custom Cursor — Chip Probe / Microscope Reticle ─── */
#cursor-probe {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

/* Core contact dot — green, glowing */
.probe-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow:
    0 0 8px var(--accent),
    0 0 20px rgba(67, 97, 238, 0.18);
  /* x, y, xPercent, yPercent driven by GSAP */
}

/* Lottie alert-triangle container — shown on clickable elements */
.probe-lottie {
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 48px;
  pointer-events: none;
  display: none;
  filter: drop-shadow(0 0 6px #FFD700) drop-shadow(0 0 14px rgba(255,215,0,0.4));
  z-index: 1;
  /* x, y, xPercent driven by GSAP */
}
.probe-lottie svg { display: block; width: 100%; height: 100%; }

/* Outer probe box — 4 L-corners forming a crosshair frame */
.probe-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  pointer-events: none;
  will-change: transform, width, height, filter;
  /* x, y, xPercent, yPercent driven by GSAP */
}

/* Snapped state: green glow aura around the whole frame */
.probe-box.is-snapped {
  filter:
    drop-shadow(0 0 4px rgba(67, 97, 238, 0.95))
    drop-shadow(0 0 14px rgba(67, 97, 238, 0.70))
    drop-shadow(0 0 40px rgba(67, 97, 238, 0.35));
}

/* L-shaped silver-white corner brackets */
.probe-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(242, 244, 246, 0.88);
  border-style: solid;
  border-width: 0;
  will-change: transform, border-color;
  transition: border-color 0.3s ease;
}

/* Snapped: corners shift from silver-white to accent green */
.probe-box.is-snapped .probe-corner {
  border-color: var(--accent);
}
.probe-corner--tl {
  top: 0; left: 0;
  border-top-width: 1.5px;
  border-left-width: 1.5px;
}
.probe-corner--tr {
  top: 0; right: 0;
  border-top-width: 1.5px;
  border-right-width: 1.5px;
}
.probe-corner--bl {
  bottom: 0; left: 0;
  border-bottom-width: 1.5px;
  border-left-width: 1.5px;
}
.probe-corner--br {
  bottom: 0; right: 0;
  border-bottom-width: 1.5px;
  border-right-width: 1.5px;
}

/* ─── Scan-line overlay ─────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,var(--scan-op)) 2px,
    rgba(0,0,0,var(--scan-op)) 4px
  );
  pointer-events: none; z-index: 9000;
  transition: opacity 0.35s;
}

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* ─── Utility ───────────────────────────────────────── */
.mono { font-family: var(--mono); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--gap); }
section { padding: 6rem 0; }

/* ─── Fixed nav gradient scrim (content scrolls “into” the fade) ─── */
.nav-gradient {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 199;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.nav-gradient--top {
  top: 0;
  height: clamp(5.5rem, 18vh, 10rem);
  background: linear-gradient(
    to bottom,
    var(--nav-grad-solid) 0%,
    var(--nav-grad-mid) 42%,
    var(--nav-grad-soft) 78%,
    transparent 100%
  );
  opacity: 0.72;
}
.nav-gradient--bottom {
  display: none;
  bottom: 0;
  top: auto;
  height: clamp(6rem, 22vh, 12rem);
  background: linear-gradient(
    to top,
    var(--nav-grad-solid) 0%,
    var(--nav-grad-mid) 40%,
    var(--nav-grad-soft) 75%,
    transparent 100%
  );
  opacity: 0.7;
}

/* Stronger scrim after leaving hero; softer while hero fills the top */
html.nav-scrolled .nav-gradient--top {
  opacity: 0.96;
}
html.nav-at-hero .nav-gradient--top {
  opacity: 0.38;
}
html.nav-scrolled .nav-gradient--bottom {
  opacity: 0.88;
}
html.nav-at-hero .nav-gradient--bottom {
  opacity: 0.55;
}

/* ─── Floating pill nav + logo + controls ───────────── */
/* (nav-logo removed in refactor) */

#pill-nav {
  position: fixed; top: 0.85rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; align-items: center; gap: 0.06rem;
  max-width: min(780px, calc(100vw - 12rem));
  padding: 0.4rem 0.6rem;
  background: rgba(13, 18, 20, 0.40);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.35);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: background 0.35s, border-color 0.35s, top 0.3s, bottom 0.3s;
}
#pill-nav::-webkit-scrollbar { display: none; }

.pill-item {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-2); text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.pill-item:hover { color: var(--accent); }
.pill-item.active { background: rgba(242,244,246,0.12); color: #f2f4f6; }

#nav-controls-float {
  position: fixed; top: 0.85rem; right: var(--gap); z-index: 200;
  display: flex; align-items: center; gap: 0.5rem;
}
.nav-btn {
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--border);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
}
.nav-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-btn svg { display: block; width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Desktop: pill nav ×2 ── */
@media (min-width: 769px) {
  #pill-nav {
    top: 1.2rem;
    padding: 0.8rem 1.2rem;
    gap: 0.12rem;
    max-width: min(900px, calc(100vw - 6rem));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .pill-item {
    font-size: 1.1rem;
    padding: 0.9rem 1.7rem;
    letter-spacing: 0.08em;
  }
  #nav-controls-float {
    top: 1.4rem;
    gap: 0.8rem;
  }
  .nav-btn {
    font-size: 1rem;
    padding: 0.7rem 1.1rem;
  }
  .nav-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* ─── Fixed ghost watermark — section-bg之上, content之下 ── */
.page-watermark {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 var(--gap);
  font-family: var(--mono);
  font-size: clamp(5rem, 22vw, 16rem);
  font-weight: 900;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}
/* Each letter: cold-silver contour glow */
.page-watermark > span {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: 0.5px rgba(242, 244, 246, 0.15);
  text-shadow:
    0 0 5px  rgba(242, 244, 246, 0.33),
    0 0 14px rgba(242, 244, 246, 0.11),
    0 0 36px rgba(242, 244, 246, 0.04);
}
[data-theme="light"] .page-watermark > span {
  -webkit-text-stroke: 0.5px rgba(26, 46, 34, 0.30);
  text-shadow:
    0 0 5px  rgba(26, 46, 34, 0.57),
    0 0 14px rgba(26, 46, 34, 0.21),
    0 0 36px rgba(26, 46, 34, 0.08);
}
/* Ensure content sits above the watermark */
.container, footer, .github-grid, .contact-inner {
  position: relative;
  z-index: 1;
}

/* ─── Hero — Cinematic Minimalism ─────────────────────── */
#hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow-x: clip; padding: 0;
  background: var(--hero-bg);                  /* deep zinc black (dark) / light (theme) */
  transition: background 0.35s;
}

/* Soft fade-out at hero bottom so it blends smoothly into #about */
#hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: clamp(8rem, 25vh, 16rem);
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 3;
}

/* ── Atmosphere glow — breathing, like distant light at night ── */

.hero-glow {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  will-change: transform, opacity;
  border-radius: 50%;
}

/* Layer A — large diffuse cold-silver halo, centered behind text */
.hero-glow--a {
  width: min(100vw, 960px);
  height: min(85vh, 720px);
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at 50% 45%,
    rgba(215, 225, 235, 0.32)  0%,
    rgba(200, 212, 224, 0.14) 22%,
    rgba(190, 202, 215, 0.06) 42%,
    transparent               68%
  );
  filter: blur(110px);
  animation: glow-pulse-a 9s ease-in-out infinite alternate;
}

/* Layer B — smaller, warmer accent offset to lower-right */
.hero-glow--b {
  width: min(55vw, 480px);
  height: min(45vh, 340px);
  top: 58%;
  left: 28%;
  transform: translate(-28%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(195, 215, 240, 0.16) 0%,
    rgba(180, 200, 225, 0.07) 28%,
    transparent               60%
  );
  filter: blur(85px);
  animation: glow-pulse-b 12s ease-in-out infinite alternate;
}

@keyframes glow-pulse-a {
  0%   { opacity: 0.45; transform: translate(-50%, -50%) scale(1);    }
  100% { opacity: 1;    transform: translate(-50%, -50%) scale(1.30); }
}
@keyframes glow-pulse-b {
  0%   { opacity: 0.35; transform: translate(-28%, -50%) scale(1);    }
  100% { opacity: 0.75; transform: translate(-28%, -50%) scale(1.20); }
}

.hero-inner {
  position: relative; z-index: 2;
  padding: 0 var(--gap); width: 100%; max-width: 1100px; margin: 0 auto;
}

/* Badge — cold silver, muted */
.hero-badge {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.30); margin-bottom: 1.5rem; opacity: 0;
}

/* ── "HARPER" — full-bleed, evenly-spaced, gradient-dissolve ── */
.hero-name {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 var(--gap);
  opacity: 0;
  line-height: 1;
}

.hero-name-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  font-family: var(--mono);
  font-size: clamp(5rem, 22vw, 20rem);
  font-weight: 900;
  line-height: 1;
  /* ── Contour neon glow — cold silver (three layers) ── */
  filter:
    drop-shadow(0 0 3px  rgba(242, 244, 246, 0.80))
    drop-shadow(0 0 10px rgba(242, 244, 246, 0.30))
    drop-shadow(0 0 28px rgba(242, 244, 246, 0.13));
}

/* Gradient applied per-letter so background-clip: text works reliably */
.hero-name-text > span {
  display: inline-block;
  background-image: linear-gradient(
    to bottom,
    #f2f4f6 0%,
    #eef0f2 22%,
    rgba(238, 240, 242, 0.76) 38%,
    rgba(238, 240, 242, 0.48) 52%,
    rgba(238, 240, 242, 0.20) 66%,
    rgba(238, 240, 242, 0.05) 80%,
    transparent 92%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-font-smoothing: antialiased;
  /* Per-letter fade — prevents rectangular glow cutoff */
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 28%,
    transparent 90%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 28%,
    transparent 90%
  );
}

/* Typewriter row */
.hero-title {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  margin-top: 0.75rem; opacity: 0;
}
.hero-title .typed-cursor {
  color: rgba(255,255,255,0.55);
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Description — faint, receding */
.hero-desc {
  max-width: 520px; font-size: 0.95rem;
  color: rgba(255,255,255,0.30);
  margin-top: 1.5rem; line-height: 1.8; opacity: 0;
}

/* ── Minimalist CTA buttons — borderless frosted glass ── */
.hero-cta {
  display: flex; gap: 1rem; margin-top: 2.5rem; opacity: 0;
}
.hero-cta .btn {
  font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.8rem 2rem; text-decoration: none;
  border: none;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}
.hero-cta .btn:hover {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
}
.hero-cta .btn::before {
  display: none; /* kill old slide effect */
}
/* Ghost variant — transparent, receded */
.hero-cta .btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.30);
}
.hero-cta .btn-ghost:hover {
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.04);
}

/* ── Scroll hint ── */
.hero-scroll-hint {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  opacity: 0;
}
.hero-scroll-hint span {
  font-family: var(--mono); font-size: 0.65rem;
  color: rgba(255,255,255,0.18); letter-spacing: 0.15em; text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
  animation: scrollDrop 1.6s ease-in-out infinite;
}
@keyframes scrollDrop {
  0%   { transform: scaleY(0); transform-origin: top;    opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  61%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ── Hero cursor legend (bottom‑right) ── */
.hero-cursor-legend {
  position: absolute;
  bottom: 6rem;
  right: clamp(2rem, 6vw, 4rem);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  opacity: 0.7;
  pointer-events: none;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.legend-dot {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.legend-dot::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.legend-triangle {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12' y2='17'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 6px #FFD700);
}
.legend-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
/* Light theme: darker bg + darker text */
[data-theme="light"] .hero-cursor-legend {
  background: rgba(255,255,255,0.50);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .legend-label {
  color: rgba(0,0,0,0.45);
}
@media (max-width: 768px) {
  .hero-cursor-legend { display: none; }
}

/* ─── Section Header ─────────────────────────────────── */
.section-label {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700; color: var(--heading); line-height: 1.1;
}
.section-divider { width: 3rem; height: 2px; background: var(--accent); margin: 1.25rem 0; }

/* ─── About ───────────────────────────────────────────── */
#about .about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start; margin-top: 3rem;
}

/* ── 左侧：信息卡片 2×2 ── */
.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.about-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(13, 18, 20, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: background 0.35s, border-color 0.35s, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.about-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(242,244,246,0.80);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.about-card:hover {
  transform: translateY(-3px);
  background: rgba(13, 18, 20, 0.50);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 28px rgba(242,244,246,0.15);
}
.about-card:hover::before {
  transform: scaleX(1);
}
.about-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  width: 2.2rem;
  text-align: center;
}
.about-card-content {
  min-width: 0;
}
.about-card-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.15rem;
}
.about-card-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--heading);
  line-height: 1.3;
}
.about-card-sub {
  font-size: 0.75rem;
  color: rgba(242,244,246,0.80);
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

/* 宽卡片 — 2×1 横向跨列 */
.about-card--wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
}
.about-card--wide .about-card-icon {
  font-size: 1.4rem;
  width: 2rem;
}
.about-card--wide .about-card-value {
  font-size: 0.95rem;
}
.about-card--wide .about-card-sub {
  font-size: 0.75rem;
  margin-top: 0.05rem;
}

/* ── 右侧：证件照 + 示波器 ── */
.about-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.about-photo-wrap {
  text-align: center;
}
.about-photo-frame {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.35s;
}
/* 渐变边框 (背景色在 frame 之下扩展 1px 形成边框) */
.about-photo-frame::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  z-index: -1;
  background: linear-gradient(
    135deg,
    rgba(242,244,246,0.55)  0%,
    rgba(242,244,246,0.05) 30%,
    rgba(242,244,246,0.05) 60%,
    rgba(242,244,246,0.25) 80%,
    transparent            100%
  );
  pointer-events: none;
  transition: opacity 0.35s;
}
.about-photo-frame:hover::before {
  background: linear-gradient(
    135deg,
    rgba(242,244,246,0.75)  0%,
    rgba(242,244,246,0.06) 25%,
    rgba(242,244,246,0.06) 55%,
    rgba(242,244,246,0.40) 75%,
    rgba(242,244,246,0.06) 100%
  );
}
.about-photo-frame:hover {
  box-shadow: 0 0 28px rgba(242,244,246,0.18);
}
/* 四边渐变遮罩：白底 → 渐隐融入背景 */
.about-photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 75% 75% at center,
    transparent 35%,
    rgba(0, 0, 0, 0.72) 100%
  );
  transition: opacity 0.35s;
}
[data-theme="light"] .about-photo-frame::after {
  background: radial-gradient(
    ellipse 75% 75% at center,
    transparent 35%,
    rgba(0, 0, 0, 0.10) 100%
  );
}
.about-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.about-photo-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}
/* ── GitHub 统计卡片（替代示波器 / 频谱） ── */
.about-github-section {
  width: 100%;
}
.github-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(13, 18, 20, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: background 0.35s, border-color 0.35s, transform 0.25s ease, box-shadow 0.25s ease;
}
.github-card:hover {
  transform: translateY(-3px);
  background: rgba(13, 18, 20, 0.50);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 28px rgba(242,244,246,0.15);
}
.github-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(242,244,246,0.80);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.github-card:hover::before {
  transform: scaleX(1);
}

/* ── GitHub Logo 头部 ── */
.github-logo {
  text-align: center;
  margin-bottom: 0.5rem;
}
.github-logo-img {
  width: 28px;
  height: 28px;
  display: inline-block;
  opacity: 0.55;
  filter: brightness(0) invert(1);
  transition: opacity 0.35s;
}
.github-card:hover .github-logo-img {
  opacity: 0.85;
}
[data-theme="light"] .github-logo-img {
  filter: none;
  opacity: 0.50;
}
[data-theme="light"] .github-card:hover .github-logo-img {
  opacity: 0.80;
}
[data-theme="light"] .github-card {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(26, 46, 34, 0.06);
}
[data-theme="light"] .github-card:hover {
  background: rgba(255, 255, 255, 0.60);
  border-color: rgba(26, 46, 34, 0.15);
  box-shadow: 0 6px 28px rgba(0,230,118,0.08);
}
[data-theme="light"] .github-card::before {
  background: var(--accent);
}

/* ── 统计数字行 ── */
.github-stats {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.github-stat {
  text-align: center;
  flex: 1;
}
.github-stat-icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 0.2rem;
  opacity: 0.70;
  filter: brightness(0) invert(1);
}
[data-theme="light"] .github-stat-icon {
  filter: none;
  opacity: 0.65;
}
.github-stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.github-stat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* ── 贡献度图表（GitHub 完全一致布局）── */
.gh-section {
  margin-top: 0.6rem;
}

.gh-header {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-2);
}

.gh-count {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--heading);
}

.gh-count-label {
  font-size: 0.7rem;
  color: var(--text-2);
}

.gh-graph-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 2px;
}

/* Table-based graph — matches GitHub's own layout */
.gh-table {
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
  width: 1px;
  margin-left: -2px;
}

.gh-table td {
  padding: 0;
  border: none;
  vertical-align: middle;
  line-height: 0;
}

.gh-table thead tr td {
  padding-bottom: 8px;
}

.gh-month-label {
  color: #8b949e;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  padding-left: 1px;
}
.gh-table .gh-month-label {
  line-height: 1.3;
}

[data-theme="light"] .gh-month-label {
  color: #656d76;
}

.gh-day-label {
  color: #8b949e;
  text-align: right;
  padding-right: 8px;
  vertical-align: middle;
  font-weight: 400;
  white-space: nowrap;
}
.gh-table .gh-day-label {
  line-height: 1;
}

[data-theme="light"] .gh-day-label {
  color: #656d76;
}

/* Contribution cells — exact GitHub colors */
.gh-cell {
  border-radius: 1px;
  transition: transform 0.12s ease;
  cursor: default;
  line-height: 0;
  aspect-ratio: 1 / 1;
}

.gh-cell:hover {
  transform: scale(1.35);
  z-index: 2;
  position: relative;
  outline: 1px solid rgba(255,255,255,0.2);
}

/* GitHub dark mode exact colors */
.gh-cell.level-0 { background: #1b1f22; }
.gh-cell.level-1 { background: #0e4429; }
.gh-cell.level-2 { background: #006d32; }
.gh-cell.level-3 { background: #26a641; }
.gh-cell.level-4 { background: #39d353; }

/* GitHub light mode exact colors */
[data-theme="light"] .gh-cell.level-0 { background: #ebedf0; }
[data-theme="light"] .gh-cell.level-1 { background: #9be9a8; }
[data-theme="light"] .gh-cell.level-2 { background: #40c463; }
[data-theme="light"] .gh-cell.level-3 { background: #30a14e; }
[data-theme="light"] .gh-cell.level-4 { background: #216e39; }

/* Legend cells — same 5‑level colors */
.gh-legend-cell.level-0 { background: #1b1f22; }
.gh-legend-cell.level-1 { background: #0e4429; }
.gh-legend-cell.level-2 { background: #006d32; }
.gh-legend-cell.level-3 { background: #26a641; }
.gh-legend-cell.level-4 { background: #39d353; }
[data-theme="light"] .gh-legend-cell.level-0 { background: #ebedf0; }
[data-theme="light"] .gh-legend-cell.level-1 { background: #9be9a8; }
[data-theme="light"] .gh-legend-cell.level-2 { background: #40c463; }
[data-theme="light"] .gh-legend-cell.level-3 { background: #30a14e; }
[data-theme="light"] .gh-legend-cell.level-4 { background: #216e39; }

/* Legend — Less □□□□□ More */
.gh-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-right: 2px;
  font-size: 8px;
  color: #8b949e;
  line-height: 1;
}

[data-theme="light"] .gh-legend {
  color: #656d76;
}

.gh-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Activity overview — two‑column: repo list + cross chart */
.gh-activity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

[data-theme="light"] .gh-activity {
  border-top-color: rgba(0,0,0,0.06);
}

.gh-activity-header {
  font-size: 0.55rem;
  color: var(--text-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

/* Left column — repo list */
.gh-repo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gh-repo-item {
  font-size: 0.52rem;
  color: var(--text-2);
  line-height: 1.7;
  padding: 0.04rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-repo-item::before {
  content: '\25B8';
  margin-right: 0.3rem;
  color: var(--accent);
  opacity: 0.6;
}

/* Right column — cross chart */
.gh-activity-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gh-cross-chart-wrap {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
}

.gh-cross-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}



/* ─── Activity left column — Languages bar ───────────────────────────────────────── */
.gh-lang-section {
  margin-bottom: 0.65rem;
}
.gh-lang-bar {
  height: 6px;
  border-radius: 3px;
  margin-bottom: 0.45rem;
}
.gh-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.6rem;
}
.gh-lang-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-2);
  line-height: 1.6;
}
.gh-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gh-lang-pct {
  margin-left: auto;
  color: var(--text-3);
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.55rem;
}

/* ─── Productivity ──────────────────────────────────────────── */
.gh-productivity {
  margin-bottom: 0.65rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .gh-productivity {
  border-top-color: rgba(0,0,0,0.06);
}
.gh-lines {
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-1);
}
.gh-lines-add {
  color: #39d353;
}
.gh-lines-del {
  color: #f85149;
}
.gh-lines-label {
  color: var(--text-3);
  font-size: 0.6rem;
  font-family: inherit;
}
.gh-peak {
  font-size: 0.6rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-top: 0.1rem;
}
.gh-peak-tag {
  display: inline-block;
  padding: 0 0.35rem;
  background: rgba(57,211,83,0.12);
  border: 1px solid rgba(57,211,83,0.2);
  border-radius: 3px;
  font-size: 0.55rem;
  color: #39d353;
  letter-spacing: 0.02em;
}

/* ─── Achievements ─────────────────────────────────────────── */
.gh-achievements {
  display: flex;
  gap: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
[data-theme="light"] .gh-achievements {
  border-top-color: rgba(0,0,0,0.06);
}
.gh-achievement-badge {
  width: 28px;
  height: 28px;
  opacity: 0.4;
  transition: opacity 0.25s ease, box-shadow 0.35s ease;
  border-radius: 6px;
  cursor: default;
  flex-shrink: 0;
}
.gh-achievement-badge:hover {
  opacity: 1;
  box-shadow: 0 0 12px rgba(57,211,83,0.5), 0 0 24px rgba(57,211,83,0.2);
}
.gh-achievement-badge img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── Skills ──────────────────────────────────────────── */
#skills { background: var(--bg); transition: background 0.35s; }

.radar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.radar-chart-wrap {
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(67,97,238,0.07) 0%, transparent 65%),
    var(--surface);
  padding: 1.5rem 1.25rem 1rem;
  position: relative;
  overflow: hidden;
  transition: background 0.35s, border-color 0.35s, transform 0.25s ease, box-shadow 0.25s ease;
}
.radar-chart-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.radar-chart-wrap:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 28px rgba(67,97,238,0.12);
}
.radar-chart-wrap:hover::before { transform: scaleX(1); }

.radar-chart-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--heading);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 0.75rem;
}

.radar-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* ─── Experience (career / education) ─────────────────── */
#experience { background: var(--bg); transition: background 0.35s; }
.exp-timeline { margin-top: 3rem; position: relative; }

/* 时间线竖线 */
.exp-timeline::before {
  content: ''; position: absolute; left: 1.85rem; top: 0; bottom: 0;
  width: 1px; background: var(--border);
  transition: background 0.35s;
}

.exp-item {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateX(20px);
}
.exp-item:last-child { margin-bottom: 0; }

/* 左侧数轴（竖线 + 圆点/菱形） */
.exp-left {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2.2rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
/* 连接上个 item 的线 */
.exp-item:not(:first-child) .exp-left::before {
  content: '';
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 2.7rem;
  background: var(--border);
  transition: background 0.35s;
}

/* 圆点（工作） */
.exp-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: background 0.35s, border-color 0.35s;
}
/* 菱形（教育） */
.exp-edu .exp-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  transform: rotate(45deg);
  border-width: 2.5px;
}

/* 右侧主体 */
.exp-body { min-width: 0; flex: 1; }
.exp-period {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--accent); letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* 标题行：logo + (title + org) 并排 */
.exp-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
.exp-logo {
  width: 2.75rem; height: 2.75rem;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  box-sizing: border-box;
  padding: 3px;
  transition: background 0.35s, border-color 0.35s;
}
.exp-title-group { min-width: 0; flex: 1; }
.exp-title {
  font-family: var(--mono); font-size: 1rem; font-weight: 500;
  color: var(--heading); margin: 0 0 0.1rem 0;
}
.exp-org {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text-2); margin: 0;
}
.exp-desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.75; }

/* ─── Contact ─────────────────────────────────────────── */
#contact { text-align: center; }
.contact-inner { max-width: 640px; margin: 0 auto; }
#led-canvas { width: 100%; height: clamp(56px, 13vw, 90px); margin: 2rem auto 0; display: block; }
.contact-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.contact-link {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-2); text-decoration: none;
  padding-bottom: 0.25rem; border-bottom: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Footer ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem var(--gap);
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 1rem;
  transition: border-color 0.35s;
}
footer span { font-family: var(--mono); font-size: 0.7rem; color: var(--text-2); letter-spacing: 0.08em; }
footer .footer-left { display: flex; flex-direction: column; gap: 0.5rem; flex: 1 1 auto; min-width: min(100%, 12rem); }
footer .footer-beian-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
footer .footer-beian {
  font-family: var(--mono); font-size: 0.62rem;
  color: var(--text-2); letter-spacing: 0.05em;
  text-decoration: none; align-self: flex-start;
  transition: color 0.2s;
}
footer .footer-beian:hover { color: var(--accent); }

[data-theme="light"] #pill-nav {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(26, 46, 34, 0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (hover: none), (max-width: 768px) {
  body { cursor: auto; }
  #cursor-probe { display: none !important; }
  .btn { cursor: pointer; }
}
/* (pcb-canvas removed in hero redesign) */

/* ── Tablet & below (≤768px) ────────────────────────── */
@media (max-width: 768px) {
  #about .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-cards { grid-template-columns: 1fr; gap: 0.85rem; }
  .about-card--wide { padding: 0.9rem 1rem; }
  .about-photo-frame { max-width: 180px; }
  .about-right { gap: 1rem; }
  .about-github-section { margin-top: 0; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .hero-name-text { font-size: clamp(3.2rem, 14vw, 5rem); }

  section { padding: 3rem 0; }
  .radar-grid { grid-template-columns: 1fr; gap: 1rem; }
  .radar-chart-wrap { padding: 0.8rem 0.75rem 0.5rem; display: flex; flex-direction: column; align-items: center; }
  .radar-chart-title { font-size: 0.72rem; margin-bottom: 0.5rem; width: 100%; text-align: center; }
  .radar-canvas { max-width: 260px; }
  .hero-scroll-hint { display: none; }
  .nav-btn { padding: 0.6rem 1rem; }
  .exp-timeline::before { left: 1.85rem; }
  .gh-activity { grid-template-columns: 1fr; }
  .gh-cross-chart-wrap { max-width: 200px; }
}
/* ── Small tablet / large phone (≤640px) ─────────────── */
@media (max-width: 640px) {
  .about-stats { gap: 0.75rem; }
  .exp-item { gap: 0.75rem; margin-bottom: 2rem; }
  .exp-left { width: 1.8rem; }
  .exp-logo { width: 2.25rem; height: 2.25rem; }
  .exp-dot { width: 10px; height: 10px; border-width: 2px; }
  .exp-edu .exp-dot { width: 8px; height: 8px; border-width: 2px; }
  .exp-title-row { gap: 0.65rem; }
  .exp-timeline::before { left: 1.65rem; }
  .github-stat-value { font-size: 1rem; }
  .github-card { padding: 0.75rem; }
  .github-logo-img { width: 22px; height: 22px; }
  .github-stat-icon { width: 15px; height: 15px; }
  .gh-cross-chart-wrap { max-width: 180px; }
}
/* ── Phone (≤480px) ──────────────────────────────────── */
@media (max-width: 480px) {
  section { padding: 2.5rem 0; }
  .hero-name { /* font-size inherited from .hero-name-text */ }
  .hero-name-text { font-size: clamp(3.2rem, 14vw, 5rem); }
  .hero-title { font-size: clamp(0.85rem, 3vw, 1.1rem); }
  .hero-desc { font-size: 0.85rem; }
  .hero-cta { gap: 0.75rem; }
  .btn { padding: 0.6rem 1.25rem; font-size: 0.72rem; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-box { padding: 0.85rem; }
  .stat-num { font-size: 1.5rem; }
  .radar-chart-wrap { padding: 0.7rem 0.6rem 0.4rem; display: flex; flex-direction: column; align-items: center; }
  .radar-chart-title { font-size: 0.65rem; margin-bottom: 0.4rem; width: 100%; text-align: center; }
  .radar-canvas { max-width: 200px; }
  footer { flex-direction: column; align-items: flex-start; }
  .contact-links { gap: 0.75rem; }
  .contact-link { font-size: 0.7rem; }
  .exp-item { gap: 0.65rem; margin-bottom: 1.5rem; }
  .exp-left { width: 1.5rem; }
  .exp-logo { width: 1.85rem; height: 1.85rem; }
  .exp-dot { width: 8px; height: 8px; border-width: 1.5px; }
  .exp-edu .exp-dot { width: 7px; height: 7px; }
  .exp-title-row { gap: 0.5rem; }
  .exp-title { font-size: 0.9rem; }
  .exp-org { font-size: 0.7rem; }
  .exp-timeline::before { left: 1.5rem; }
  .exp-period { font-size: 0.62rem; }
  .github-stat-value { font-size: 0.9rem; }
  .github-stat-icon { width: 15px; height: 15px; }
  .github-logo-img { width: 20px; height: 20px; }
  .gh-cross-chart-wrap { max-width: 150px; }
}
/* ── Small phone (≤400px) ────────────────────────────── */
@media (max-width: 400px) {
  .about-stats { grid-template-columns: 1fr; }
  .hero-name { /* font-size inherited from .hero-name-text */ }
  .hero-name-text { font-size: clamp(2.4rem, 11vw, 3.6rem); }
  .section-title { font-size: clamp(1.2rem, 6vw, 1.6rem); }
}
/* ── Bottom nav on mobile (≤600px) ──────────────────── */
@media (max-width: 600px) {
  .nav-gradient--bottom { display: block; }
  #pill-nav {
    top: auto; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    left: 50%; transform: translateX(-50%);
    width: calc(100vw - 1.25rem);
    max-width: calc(100vw - 1.25rem);
    padding: 0.28rem 0.3rem;
    gap: 0;
    justify-content: space-between;
  }
  .pill-item {
    flex: 1;
    text-align: center;
    font-size: clamp(0.48rem, 2.1vw, 0.62rem);
    padding: 0.42rem clamp(0.15rem, 1.5vw, 0.5rem);
    letter-spacing: 0;
  }
  body { padding-bottom: calc(3.8rem + env(safe-area-inset-bottom, 0px)); }
}

/* --- Lang ripple canvas overlay --- */
#lang-wipe {
  position: fixed; inset: 0; z-index: 8000;
  pointer-events: none;
  width: 100%; height: 100%;
  display: block;
}

/* ─── Experience 流动边框 + 毛玻璃 ──────────────────── */
.exp-item {
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(20, 26, 28, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, background 0.35s;
}
.exp-item:hover {
  border-color: rgba(67, 97, 238, 0.3);
}

/* ─── 640px 断点：小屏平板（大约户） ─────────────── */
@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-stats { gap: 0.75rem; }
  .radar-grid { grid-template-columns: 1fr; }
  .exp-item { gap: 0.75rem; margin-bottom: 2rem; }
  .exp-left { width: 1.8rem; }
  .exp-logo { width: 2.25rem; height: 2.25rem; }
  .exp-dot { width: 10px; height: 10px; border-width: 2px; }
  .exp-edu .exp-dot { width: 8px; height: 8px; border-width: 2px; }
  .exp-title-row { gap: 0.65rem; }
  .exp-timeline::before { left: 1.65rem; }
  .github-logo-img { width: 22px; height: 22px; }
  .github-stat-icon { width: 15px; height: 15px; }
}

/* ─── 480px 断点：手机 ─────────────────────────────── */
@media (max-width: 480px) {
  section { padding: 2.5rem 0; }
  .hero-name { /* font-size inherited from .hero-name-text */ }
  .hero-name-text { font-size: clamp(3.2rem, 14vw, 5rem); }
  .hero-title { font-size: clamp(0.85rem, 3vw, 1.1rem); }
  .hero-desc { font-size: 0.85rem; }
  .hero-cta { gap: 0.75rem; }
  .btn { padding: 0.6rem 1.25rem; font-size: 0.72rem; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-box { padding: 0.85rem; }
  .stat-num { font-size: 1.5rem; }
  .radar-chart-wrap { padding: 0.7rem 0.6rem 0.4rem; display: flex; flex-direction: column; align-items: center; }
  .radar-chart-title { font-size: 0.65rem; margin-bottom: 0.4rem; width: 100%; text-align: center; }
  .radar-canvas { max-width: 200px; }
  footer { flex-direction: column; align-items: flex-start; }
  .contact-links { gap: 0.75rem; }
  .contact-link { font-size: 0.7rem; }
  .exp-item { gap: 0.65rem; margin-bottom: 1.5rem; }
  .exp-left { width: 1.5rem; }
  .exp-logo { width: 1.85rem; height: 1.85rem; }
  .exp-dot { width: 8px; height: 8px; border-width: 1.5px; }
  .exp-edu .exp-dot { width: 7px; height: 7px; }
  .exp-title-row { gap: 0.5rem; }
  .exp-title { font-size: 0.9rem; }
  .exp-org { font-size: 0.7rem; }
  .exp-timeline::before { left: 1.5rem; }
  .exp-period { font-size: 0.62rem; }
  .github-stat-value { font-size: 0.9rem; }
  .github-stat-icon { width: 15px; height: 15px; }
  .github-logo-img { width: 20px; height: 20px; }
}

/* ─── 400px 断点：小屏手机 ─────────────────────────── */
@media (max-width: 400px) {
  .about-stats { grid-template-columns: 1fr; }
  .hero-name { /* font-size inherited from .hero-name-text */ }
  .hero-name-text { font-size: clamp(2.4rem, 11vw, 3.6rem); }
  .section-title { font-size: clamp(1.2rem, 6vw, 1.6rem); }
  #pill-nav .pill-item { font-size: clamp(0.42rem, 2vw, 0.55rem); padding: 0.35rem 0.1rem; }
}

/* @property 驱动角度动画，避免 transform:rotate 的雷达效应 */
@property --flow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes border-flow {
  from { --flow-angle: 0deg; }
  to { --flow-angle: 360deg; }
}

/* 流动边框伪元素 */
.exp-item::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 2px;
  background: conic-gradient(
    from var(--flow-angle, 0deg),
    transparent 0deg,
    transparent 265deg,
    var(--accent) 275deg,
    var(--accent) 300deg,
    transparent 310deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-flow 3s linear infinite;
  pointer-events: none;
  opacity: 0.65;
  transition: opacity 0.3s;
}
.exp-item:hover::before {
  opacity: 1;
  animation-duration: 1.2s;
}

/* ── 背景氛围光晕（继承雷达图家族语言） ── */
.exp-item::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(67, 97, 238, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.exp-item:hover::after {
  transform: scale(1.08);
}

/* 不支持 @property 的浏览器回退：静态边框 */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .exp-item::before { display: none; }
}

@media (hover: none) {
  .exp-item::before { opacity: 0.35; }
  .exp-item { cursor: default; }
}

/* 缩小个人项目与 GitHub 项目之间的间距 */
#projects { padding-bottom: 1.5rem; }
#github   { padding-top: 0; }

/* ═══════════════════════════════════════════════════════════
   Terminal 3D Carousel — macOS Terminal style
   ═══════════════════════════════════════════════════════════ */

/* ── 3D 透视容器 ── */
.terminal-3d-wrap {
  margin-top: 3rem;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(.23,1,.32,1), opacity 0.8s ease;
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translateY(30px);
  opacity: 0;
}

.terminal-3d-wrap.revealed {
  opacity: 1;
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translateY(0);
}

/* ── 终端窗口 ── */
.terminal-window {
  background: rgba(10, 14, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 4px 32px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 80px rgba(67,97,238,0.12);
}

/* ── 标题栏 ── */
.terminal-titlebar {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(20, 26, 28, 0.9);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.terminal-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.terminal-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: filter 0.15s;
  cursor: pointer;
}

.terminal-dot:hover { filter: brightness(1.4); }
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-2);
  opacity: 0.7;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.terminal-title-spacer {
  flex: 1;
}

/* ── 终端主体 ── */
.terminal-body {
  padding: 1.25rem 1.5rem 1rem;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
  line-height: 1.7;
  color: #c8d6d9;
}

.terminal-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prompt */
.prompt-user  { color: var(--accent); font-weight: 600; }
.prompt-at    { color: var(--text-2); }
.prompt-host  { color: var(--danger); font-weight: 500; }
.prompt-path  { color: #6ab0f3; }
.prompt-sym   { color: var(--text-2); }
.cmd-text     { color: var(--text); }

/* 闪烁光标 */
.terminal-cursor {
  display: inline-block;
  color: var(--accent);
  animation: cursor-blink 1s step-end infinite;
  margin-left: 0.1em;
  font-size: 0.85em;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── 轮播容器 ── */
.carousel-wrap {
  position: relative;
  margin: 0.75rem 0;
  overflow: visible;
  min-height: 160px;
}

.carousel-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

/* ── 单张卡片 ── */
.carousel-card {
  position: absolute;
  transition: all 0.45s cubic-bezier(.4,0,.2,1);
  width: 85%;
  max-width: 480px;
  left: 50%;
  top: 0;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  /* JS 会设置 transform，包含 translateX(-50%) 居中 + 偏移旋转缩放 */
}

/* ── 卡片链接（全实心不透明） ── */
.card-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card-link:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 24px rgba(67, 97, 238, 0.08);
}

/* ── 卡片行 — 全部不透明 ── */
.card-line {
  font-family: var(--mono);
  line-height: 1.6;
}

.perms-line {
  font-size: 0.7rem;
  color: var(--text);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card-icon { color: #6ab0f3; }
.card-user { color: var(--text); }
.card-size { color: var(--text-2); margin-left: auto; }
.card-date { color: var(--text); }

.name-line {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-arrow {
  color: var(--accent);
  font-size: 0.6rem;
}

.card-name {
  color: var(--heading);
  font-weight: 600;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  transition: color 0.2s;
  word-break: break-all;
}

.card-link:hover .card-name {
  color: var(--accent);
}

.desc-line {
  margin-top: 0.25rem;
}

.card-comment {
  color: var(--text);
  font-size: 0.72rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 个人项目卡片描述完全展示 */
#projects-list .card-comment {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.meta-line {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
}

.card-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--lc, var(--text));
}

.card-lang::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lc, var(--text-2));
}

.card-stat {
  color: var(--text);
}

.card-updated {
  margin-left: auto;
  color: var(--text);
}

/* ── 底部 prompt ── */
.terminal-prompt-end {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── 控制条 ── */
.terminal-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 1rem;
}

.carousel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.carousel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(67, 97, 238, 0.06);
  transform: scale(1.08);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(67, 97, 238, 0.4);
  width: 20px;
  border-radius: 4px;
}

.carousel-dot:hover {
  background: var(--text-2);
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .terminal-body {
    padding: 1rem 1rem 0.75rem;
    font-size: 0.7rem;
  }
  .carousel-card {
    width: 92%;
  }
  .card-link {
    padding: 0.75rem 1rem;
  }
  .card-name {
    font-size: 0.8rem;
  }
  .perms-line {
    font-size: 0.62rem;
    gap: 0.4rem;
  }
  .meta-line {
    font-size: 0.62rem;
    gap: 0.5rem;
  }
  .terminal-title {
    font-size: 0.6rem;
  }
  .terminal-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .terminal-body {
    padding: 0.75rem 0.75rem 0.5rem;
    font-size: 0.62rem;
  }
  .carousel-card {
    width: 96%;
  }
  .card-link {
    padding: 0.6rem 0.75rem;
  }
  .terminal-titlebar {
    padding: 0.4rem 0.75rem;
  }
  .terminal-dot {
    width: 8px;
    height: 8px;
    gap: 0.3rem;
  }
  .carousel-btn {
    width: 30px;
    height: 30px;
  }
}

/* ── Back to Top ───────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(242,244,246,0.25);
  background: rgba(9,9,11,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top img {
  display: block;
  width: 18px;
  height: 18px;
  opacity: 0.65;
  transition: opacity 0.2s;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background: rgba(242,244,246,0.12);
  border-color: rgba(242,244,246,0.5);
}
#back-to-top:hover img {
  opacity: 1;
}
@media (max-width: 480px) {
  #back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
  }
  #back-to-top img {
    width: 15px;
    height: 15px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Light theme overrides
   ═══════════════════════════════════════════════════════════ */

/* ── 0. Cursor probe — darker corners on light bg ── */
[data-theme="light"] .probe-corner {
  border-color: rgba(26, 46, 34, 0.55);
}
[data-theme="light"] .probe-box.is-snapped .probe-corner {
  border-color: var(--accent);
}
[data-theme="light"] .probe-box.is-snapped {
  filter:
    drop-shadow(0 0 4px rgba(67, 97, 238, 0.90))
    drop-shadow(0 0 14px rgba(67, 97, 238, 0.60))
    drop-shadow(0 0 36px rgba(67, 97, 238, 0.25));
}
[data-theme="light"] .probe-dot {
  box-shadow:
    0 0 8px var(--accent),
    0 0 20px rgba(67, 97, 238, 0.12);
}

/* ── 1. Hero ── */
[data-theme="light"] .hero-badge {
  color: rgba(0,0,0,0.35);
}
[data-theme="light"] .hero-name-text > span {
  background-image: linear-gradient(
    to bottom,
    #1a2e22 0%,
    rgba(26,46,34,0.76) 22%,
    rgba(26,46,34,0.52) 38%,
    rgba(26,46,34,0.30) 52%,
    rgba(26,46,34,0.14) 66%,
    rgba(26,46,34,0.04) 80%,
    transparent 92%
  );
}
[data-theme="light"] .hero-title {
  color: rgba(0,0,0,0.45);
}
[data-theme="light"] .hero-title .typed-cursor {
  color: rgba(0,0,0,0.55);
}
[data-theme="light"] .hero-desc {
  color: rgba(0,0,0,0.30);
}
[data-theme="light"] .hero-cta .btn {
  color: rgba(0,0,0,0.60);
  background: rgba(0,0,0,0.06);
}
[data-theme="light"] .hero-cta .btn:hover {
  background: rgba(0,0,0,0.12);
  color: #000000;
}
[data-theme="light"] .hero-cta .btn-ghost {
  background: transparent;
  color: rgba(0,0,0,0.30);
}
[data-theme="light"] .hero-cta .btn-ghost:hover {
  color: rgba(0,0,0,0.60);
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .hero-scroll-hint span {
  color: rgba(0,0,0,0.18);
}
[data-theme="light"] .scroll-line {
  background: linear-gradient(to bottom, rgba(0,0,0,0.12), transparent);
}
[data-theme="light"] .hero-glow--a {
  background: radial-gradient(
    ellipse at 50% 45%,
    rgba(100,120,120,0.10) 0%,
    rgba(100,120,120,0.04) 22%,
    transparent 68%
  );
  filter: blur(110px);
}
[data-theme="light"] .hero-glow--b {
  background: radial-gradient(
    ellipse at center,
    rgba(100,120,120,0.07) 0%,
    transparent 60%
  );
  filter: blur(85px);
}

/* ── 2. Pill nav active ── */
[data-theme="light"] .pill-item.active {
  background: var(--bg-2);
  color: var(--heading);
}

/* ── 3. About card accents ── */
[data-theme="light"] .about-card::before {
  background: var(--accent);
}
[data-theme="light"] .about-card:hover {
  box-shadow: 0 6px 28px rgba(67,97,238,0.08);
}
[data-theme="light"] .about-card-sub {
  color: var(--accent);
}
[data-theme="light"] .about-photo-frame::before {
  background: linear-gradient(
    135deg,
    rgba(67,97,238,0.55) 0%,
    rgba(67,97,238,0.02) 30%,
    rgba(67,97,238,0.02) 60%,
    rgba(67,97,238,0.20) 80%,
    transparent 100%
  );
}
[data-theme="light"] .about-photo-frame:hover::before {
  background: linear-gradient(
    135deg,
    rgba(67,97,238,0.75) 0%,
    rgba(67,97,238,0.04) 25%,
    rgba(67,97,238,0.04) 55%,
    rgba(67,97,238,0.30) 75%,
    rgba(67,97,238,0.05) 100%
  );
}
[data-theme="light"] .about-photo-frame:hover {
  box-shadow: 0 0 28px rgba(67,97,238,0.10);
}

/* ── 4. Terminal (light variant) ── */
[data-theme="light"] .terminal-window {
  background: rgba(243,247,244,0.90);
  box-shadow:
    0 4px 32px rgba(0,0,0,0.08),
    0 0 0 1px rgba(0,0,0,0.04) inset,
    0 0 80px rgba(67,97,238,0.08);
}
[data-theme="light"] .terminal-titlebar {
  background: rgba(232,240,234,0.92);
}
[data-theme="light"] .terminal-body {
  color: #1a2e22;
}
[data-theme="light"] .cmd-text {
  color: #1a2e22;
}
[data-theme="light"] .terminal-title {
  color: #4a7058;
}
[data-theme="light"] .prompt-path {
  color: #4a90d9;
}
[data-theme="light"] #back-to-top {
  background: rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] #back-to-top img {
  filter: brightness(0);
  opacity: 0.5;
}
[data-theme="light"] #back-to-top:hover {
  background: rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.25);
}
[data-theme="light"] #back-to-top:hover img {
  opacity: 0.8;
}

/* ── 5. About card frosted glass ── */
[data-theme="light"] .about-card {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(26, 46, 34, 0.06);
}
[data-theme="light"] .about-card:hover {
  background: rgba(255, 255, 255, 0.60);
  border-color: rgba(26, 46, 34, 0.15);
}

/* ── 7. Experience frosted glass ── */
[data-theme="light"] .exp-item {
  background: rgba(232, 240, 234, 0.6);
}
