/* ============================================================
   Cicada Studio · 官网样式
   设计基调：Trae 深色画布 × 智能绿点缀 × WorkBuddy 简洁卡片
   详见 docs/DESIGN.md
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* 色彩 */
  --bg-0: #070A0E;          /* 页面底色 */
  --bg-1: #0B0F14;          /* 主背景 */
  --bg-2: #10161E;          /* 卡片 */
  --bg-3: #17202B;          /* 卡片 hover */
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text-1: #EDF3F0;        /* 主文字 */
  --text-2: #A3B0BA;        /* 次要文字 */
  --text-3: #67727E;        /* 弱文字 */
  --green: #37E494;         /* 智能绿（主强调） */
  --green-deep: #14B877;
  --blue: #57A6FF;          /* 亮蓝（次强调） */
  --grad: linear-gradient(115deg, #37E494 0%, #57A6FF 100%);
  --glow-green: rgba(55, 228, 148, .18);
  --glow-blue: rgba(87, 166, 255, .14);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;

  /* 间距（4px 基准） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* 圆角 */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;

  /* 动效 */
  --ease-out: cubic-bezier(.22, .75, .28, 1);
  --t-fast: .18s var(--ease-out);
  --t-mid: .32s var(--ease-out);

  /* 布局 */
  --container: 1120px;
  --header-h: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
svg { display: block; }

::selection { background: rgba(55, 228, 148, .28); }

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

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 110;
  transition: background var(--t-mid), border-color var(--t-mid), backdrop-filter var(--t-mid);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7, 10, 14, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-name-thin { font-weight: 400; color: var(--text-2); margin-left: 5px; }

.main-nav {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 14.5px;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--text-1); background: rgba(255, 255, 255, .06); }
.nav-link.active { color: var(--green); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 14px; height: 2px;
  border-radius: 2px;
  background: var(--green);
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--glow-green);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* 语言切换 */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.lang-btn:hover { color: var(--text-1); border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 128px;
  padding: 6px;
  background: rgba(16, 22, 30, .92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 30;
}
.lang-switch.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-menu li {
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-menu li:hover { background: rgba(255, 255, 255, .07); color: var(--text-1); }
.lang-menu li[aria-selected="true"] { color: var(--green); }

.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.nav-github:hover { color: var(--text-1); background: rgba(255,255,255,.07); transform: translateY(-1px); }

/* 汉堡按钮 */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 9px;
}
.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-1);
  transition: transform var(--t-mid), opacity var(--t-mid);
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端菜单 */
.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px 22px;
  background: rgba(7, 10, 14, .96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu[hidden] { display: none; }
.mobile-link {
  padding: 13px 10px;
  font-size: 16px;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.mobile-link:hover { color: var(--text-1); background: rgba(255,255,255,.05); }
.mobile-cta {
  margin-top: 10px;
  padding: 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #04120B;
  background: var(--green);
  border-radius: var(--r-pill);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 72% -8%, rgba(55, 228, 148, .10), transparent 62%),
    radial-gradient(900px 480px at 12% 112%, rgba(87, 166, 255, .10), transparent 60%),
    var(--bg-0);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .85;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}
.hero-orb-a {
  width: 420px; height: 420px;
  top: -120px; right: -80px;
  background: var(--glow-green);
  animation: float-a 14s ease-in-out infinite alternate;
}
.hero-orb-b {
  width: 380px; height: 380px;
  bottom: -140px; left: -110px;
  background: var(--glow-blue);
  animation: float-b 17s ease-in-out infinite alternate;
}
@keyframes float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-46px, 34px, 0) scale(1.12); }
}
@keyframes float-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(52px, -28px, 0) scale(.94); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: calc(var(--header-h) + var(--sp-8)) 0 var(--sp-9);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--text-2);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(.82); }
}

.hero-title {
  margin-top: var(--sp-5);
  font-size: clamp(2.55rem, 7.2vw, 4.7rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
}
.hero-title span { display: block; }
.hero-title-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 620px;
  margin-top: var(--sp-5);
  font-size: clamp(15.5px, 1.8vw, 17.5px);
  color: var(--text-2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}
.stat dt {
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--text-1);
}
.stat dd {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text-3);
  letter-spacing: .06em;
}

.hero-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--bg-0));
  z-index: 1;
  pointer-events: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r-pill);
  transition: transform var(--t-fast), box-shadow var(--t-mid),
              background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-primary {
  color: #04120B;
  background: var(--green);
  box-shadow: 0 8px 28px rgba(55, 228, 148, .22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: #4BF0A3;
  box-shadow: 0 12px 36px rgba(55, 228, 148, .34);
}
.btn-primary svg { transition: transform var(--t-fast); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 10px 30px var(--glow-green);
}

/* ---------- 通用 Section ---------- */
.section {
  position: relative;
  padding: var(--sp-9) 0;
  content-visibility: auto;
  contain-intrinsic-size: 640px;
}

.section-head {
  max-width: 680px;
  margin-bottom: var(--sp-7);
}
.section-kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  color: var(--green);
}
.section-title {
  margin-top: var(--sp-3);
  font-size: clamp(1.85rem, 3.8vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.22;
}
.section-desc {
  margin-top: var(--sp-4);
  font-size: 16.5px;
  color: var(--text-2);
}

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  gap: var(--sp-5);
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  padding: var(--sp-6);
  background: linear-gradient(165deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--t-mid), border-color var(--t-mid), box-shadow var(--t-mid), background var(--t-mid);
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(420px 190px at 20% -10%, var(--glow-green), transparent 68%);
  opacity: 0;
  transition: opacity var(--t-mid);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(55, 228, 148, .38);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .38), 0 0 0 1px rgba(55, 228, 148, .12);
}
.card:hover::before { opacity: 1; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin-bottom: var(--sp-4);
  color: var(--green);
  background: rgba(55, 228, 148, .10);
  border: 1px solid rgba(55, 228, 148, .22);
  border-radius: 14px;
}
.card-icon svg { width: 23px; height: 23px; }

.card-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card-text {
  margin-top: var(--sp-3);
  font-size: 14.8px;
  color: var(--text-2);
}

/* 产品卡 */
.product-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  margin-bottom: var(--sp-4);
  font-size: 21px;
  font-weight: 800;
  color: #04120B;
  border-radius: 15px;
}
.mark-ztab  { background: linear-gradient(135deg, #37E494, #1CC6B4); }
.mark-zmt   { background: linear-gradient(135deg, #57A6FF, #7C6CFF); }
.mark-media { background: linear-gradient(135deg, #37E494, #57A6FF); }
.mark-jicelue { background: linear-gradient(135deg, #FFB454, #FF7E5F); }

.product-tagline {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--green);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-5);
  font-family: var(--font-mono);
  font-size: 12.8px;
  color: var(--text-2);
  transition: color var(--t-fast), gap var(--t-fast);
}
.card-link:hover { color: var(--green); gap: 9px; }

/* ---------- 产品叠排（纵深叠放） ----------
   状态：stacked 收拢 / spread 依次拉开 / is-front 选中置前
   --i 卡片序号（渲染时写入）；--sx/--sy/--rot 由 JS 按视口计算 */
.stack { position: relative; }
.stack-stage {
  position: relative;
  height: var(--stack-h, 470px);
  transition: height .55s var(--ease-out);
}
[data-state="spread"] .stack-stage { height: var(--spread-h, 560px); }

.stack-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: 340px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,.015)), var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
  cursor: pointer;
  transform: translate(-50%, calc(var(--i) * 24px)) rotate(var(--rot, 0deg)) scale(calc(1 - var(--i) * .028));
  z-index: calc(10 - var(--i));
  transition: transform .55s var(--ease-out), border-color .35s, box-shadow .35s;
  transition-delay: calc(var(--i) * 75ms);   /* 依次拉开 / 依次归位 */
}
[data-state="spread"] .stack-card {
  transform: translate(calc(-50% + var(--sx, 0px)), var(--sy, 0px)) scale(calc(1 - var(--i) * .012));
}
.stack-card.is-front {
  transform: translate(calc(-50% + var(--sx, 0px)), calc(var(--sy, 0px) - 12px)) scale(1.02);
  z-index: 50;
  border-color: rgba(55, 228, 148, .5);
  box-shadow: 0 30px 64px rgba(0, 0, 0, .46), 0 0 0 1px rgba(55, 228, 148, .22);
  transition-delay: 0s;                       /* 选中即时响应 */
}
.stack-card:hover { border-color: rgba(55, 228, 148, .38); }
.stack-card:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.stack-card .card-link { margin-top: auto; padding-top: var(--sp-4); }
.stack-card .card-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* LOGO 浅色托底（深色圆标也能看清） */
.stack-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px; height: 62px;
  margin-bottom: var(--sp-4);
  padding: 7px;
  background: #F7F8FA;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}
.stack-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.stack-logo .product-mark { width: 100%; height: 100%; margin: 0; border-radius: 11px; }

.stack-close {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, color var(--t-fast), border-color var(--t-fast);
}
.stack-card.is-front .stack-close { opacity: 1; pointer-events: auto; }
.stack-close:hover { color: var(--green); border-color: var(--green); }

.stack-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.stack-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.stack-toggle:hover {
  color: var(--green);
  border-color: rgba(55, 228, 148, .5);
  background: rgba(55, 228, 148, .08);
}
.stack-toggle-icon { flex-shrink: 0; }
.stack-hint {
  font-size: 12.5px;
  color: var(--text-3);
}
[data-state="stacked"] .hint-spread,
[data-state="stacked"] .lbl-collapse,
[data-state="spread"] .hint-stacked,
[data-state="spread"] .lbl-expand { display: none; }

/* 开源卡 */
.repo-top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.repo-icon {
  width: 22px; height: 22px;
  color: var(--green);
  flex-shrink: 0;
}
.lang-tag {
  margin-left: auto;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}
.lang-js  { color: #E8D44C; border-color: rgba(232, 212, 76, .3); }
.lang-ts  { color: #57A6FF; border-color: rgba(87, 166, 255, .3); }
.lang-php { color: #A78BFA; border-color: rgba(167, 139, 250, .3); }

.private-repo {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  color: var(--text-2);
  background: rgba(255, 255, 255, .028);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.private-repo strong { color: var(--text-1); font-weight: 600; }
.private-repo:hover {
  color: var(--text-1);
  border-color: rgba(55, 228, 148, .45);
  background: rgba(55, 228, 148, .06);
}
.private-arrow { margin-left: auto; flex-shrink: 0; }

/* 团队卡 */
.team-badge {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-4);
}
.badge-overseas {
  color: var(--blue);
  background: rgba(87, 166, 255, .10);
  border: 1px solid rgba(87, 166, 255, .28);
}
.badge-domestic {
  color: var(--green);
  background: rgba(55, 228, 148, .09);
  border: 1px solid rgba(55, 228, 148, .28);
}
.team-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.team-tags li {
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* 兴趣小项目卡 */
.side-card .repo-top { margin-top: 2px; }
.badge-hobby {
  color: #C9B8FF;
  background: rgba(167, 139, 250, .10);
  border: 1px solid rgba(167, 139, 250, .30);
}

/* ---------- 联系 ---------- */
.section-contact { padding-bottom: var(--sp-9); }

.contact-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--sp-7);
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(720px 320px at 88% -20%, var(--glow-green), transparent 62%),
    radial-gradient(560px 300px at -8% 120%, var(--glow-blue), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--r-lg) + 6px);
}
.contact-panel .section-head { margin-bottom: 0; }

.contact-ways {
  display: grid;
  gap: var(--sp-4);
}
.contact-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(55, 228, 148, .42);
  background: rgba(55, 228, 148, .07);
}
.contact-card:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.contact-icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  color: var(--green);
  background: rgba(55, 228, 148, .12);
  border-radius: 13px;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-label {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-3);
}
.contact-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-1);
  word-break: break-all;
}
.contact-action {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  color: var(--text-3);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.contact-card:hover .contact-action {
  color: var(--green);
  border-color: rgba(55, 228, 148, .5);
  transform: translateX(3px);
}
.contact-note {
  margin-top: var(--sp-3);
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-0);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--sp-6);
  padding: var(--sp-7) 0 var(--sp-5);
}
.footer-slogan {
  margin-top: var(--sp-3);
  font-size: 13.5px;
  color: var(--text-3);
}
.footer-nav, .footer-ext {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  font-size: 14px;
}
.footer-nav a, .footer-ext a {
  color: var(--text-2);
  width: fit-content;
  transition: color var(--t-fast);
}
.footer-nav a:hover, .footer-ext a:hover { color: var(--green); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--sp-6);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}
.footer-bottom a { color: var(--text-3); transition: color var(--t-fast); }
.footer-bottom a:hover { color: var(--text-2); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  color: var(--text-1);
  background: rgba(16, 22, 30, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-mid), transform var(--t-mid), border-color var(--t-fast);
}
.back-top[hidden] { display: none; }
.back-top.show { opacity: 1; transform: translateY(0); }
.back-top:hover { border-color: var(--green); color: var(--green); }

/* ---------- 滚动进场 ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-panel { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .stack-card { width: 320px; min-height: 370px; }
}

@media (max-width: 720px) {
  :root { --sp-9: 72px; }

  .main-nav { display: none; }
  .nav-burger { display: flex; }
  .nav-actions { margin-left: auto; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }

  .hero-inner { padding-top: calc(var(--header-h) + var(--sp-7)); }
  .hero-stats { gap: var(--sp-5) var(--sp-6); }
  .stat { min-width: 96px; }

  .hero-orb-a { width: 300px; height: 300px; }
  .hero-orb-b { width: 260px; height: 260px; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .footer-bottom { flex-direction: column; }

  .private-repo { flex-wrap: wrap; }
  .private-arrow { display: none; }

  /* 叠排：移动端竖向阶梯，卡片加宽、步距收窄 */
  .stack-card {
    width: min(340px, calc(100vw - 56px));
    min-height: 320px;
    padding: var(--sp-5);
  }
  .stack-card .card-text { -webkit-line-clamp: 3; }
  .stack-card { transition-duration: .45s; }     /* 移动端动效稍快，减少等待 */
  .stack-bar { margin-top: var(--sp-4); }
  .stack-toggle { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .container { width: calc(100% - 32px); }
  .brand-name { font-size: 15.5px; }
  .btn { padding: 12px 20px; font-size: 14px; }
  .hero-cta { gap: var(--sp-3); }
  .lang-btn span { display: none; }
  .lang-btn { padding: 8px 10px; }
}

/* ---------- 无障碍：减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
