/* ============================================================================
   念念 · cannian.cc — Obsidian Silk Atelier (v8)
   原生 WebGL 实时液态光影 + 物理金属边缘追光 + 电影胶片颗粒 + 3D 交互空间
   彻底脱离骑手工具暗紫风格，摒弃廉价 AI 赛博装饰
   ============================================================================ */

:root {
  --bg: #05070a;
  --surface: rgba(12, 15, 21, 0.56);
  --surface-strong: rgba(15, 19, 27, 0.74);
  --border: rgba(255, 255, 255, 0.085);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #f2f5f9;
  --text-2: #9ba5b4;
  --text-3: #6c7686;
  --jade: #7de5d6;
  --jade-rgb: 125, 229, 214;
  --silver-rgb: 214, 228, 245;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

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

::selection {
  background: rgba(var(--jade-rgb), 0.24);
  color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ==================== 1. 全屏 WebGL 光影背景 + 电影胶片颗粒 ==================== */
.shader-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

body.motion-off .shader-bg {
  filter: saturate(0.82) brightness(0.88);
}

.film-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 75% at 50% 35%, transparent 35%, rgba(4, 6, 9, 0.68) 100%),
    linear-gradient(180deg, rgba(4, 6, 9, 0.28) 0%, transparent 22%, rgba(4, 6, 9, 0.52) 100%);
}

.film-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(var(--jade-rgb), 0.075) 0%, rgba(var(--silver-rgb), 0.025) 38%, transparent 70%);
  transform: translate3d(-999px, -999px, 0);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ambient-glow.visible {
  opacity: 1;
}

body.motion-off .ambient-glow {
  opacity: 0 !important;
}

/* ==================== 2. 悬浮液态玻璃胶囊顶栏 ==================== */
.dock-wrap {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 18px;
  pointer-events: none;
}

.dock {
  pointer-events: auto;
  width: 100%;
  max-width: 1060px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px 9px 18px;
  border-radius: 999px;
  background: rgba(11, 14, 20, 0.62);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 46px rgba(0, 0, 0, 0.42);
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand-gem {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, var(--jade) 100%);
  box-shadow: 0 0 10px rgba(var(--jade-rgb), 0.55);
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-nav a {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.dock-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.dock-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.dock-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.dock-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.dock-btn.active {
  color: var(--text);
  background: rgba(var(--jade-rgb), 0.12);
  border-color: rgba(var(--jade-rgb), 0.32);
}

.dock-btn.icon-only {
  width: 32px;
  padding: 0;
}

.motion-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.dock-btn.active .motion-dot {
  background: var(--jade);
  box-shadow: 0 0 8px rgba(var(--jade-rgb), 0.85);
}

.snd-on {
  display: none;
}

#btn-sound[aria-pressed="true"] {
  color: var(--jade);
  border-color: rgba(var(--jade-rgb), 0.34);
  background: rgba(var(--jade-rgb), 0.1);
}

#btn-sound[aria-pressed="true"] .snd-on {
  display: block;
}

#btn-sound[aria-pressed="true"] .snd-off {
  display: none;
}

/* ==================== 3. 物理级金属边框追光玻璃表面 ==================== */
.glass-surface {
  position: relative;
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 随鼠标局部浮现的细腻冷银追光（零廉价全框发光） */
.glass-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(var(--silver-rgb), 0.11),
    rgba(var(--jade-rgb), 0.04) 36%,
    transparent 70%
  );
  transition: opacity 0.32s ease;
  z-index: 0;
}

.glass-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.34),
    rgba(var(--jade-rgb), 0.24) 40%,
    transparent 72%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity 0.32s ease;
  z-index: 2;
}

.glass-surface:hover::before,
.glass-surface:hover::after {
  opacity: 1;
}

body.motion-off .glass-surface::before,
body.motion-off .glass-surface::after {
  opacity: 0 !important;
}

/* ==================== 4. 主舞台布局 ==================== */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1096px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== 5. 首屏：沉浸式空间剧场 ==================== */
.hero {
  min-height: 100vh;
  padding: 124px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: center;
  gap: 56px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(12, 16, 22, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 28px;
}

.chip-sep {
  opacity: 0.38;
}

.live-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.live-indicator.online {
  background: var(--ok);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
}

.live-indicator.checking {
  background: var(--warn);
}

.live-indicator.offline {
  background: var(--err);
}

.hero-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(54px, 7.6vw, 84px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.03em;
  color: #f7f9fc;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero-bio {
  margin-top: 28px;
  max-width: 520px;
  font-size: 16.5px;
  line-height: 1.95;
  color: rgba(235, 240, 247, 0.84);
}

.hero-bio p {
  margin: 0 0 12px;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* 冷银高定实体金属主按钮（彻底告别 AI 荧光渐变按钮） */
.cta-primary,
.cta-secondary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.24s var(--ease-out), box-shadow 0.28s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.cta-primary {
  background: linear-gradient(180deg, #fafcfe 0%, #dce4ee 100%);
  color: #070a0f;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 12px 32px rgba(0, 0, 0, 0.36),
    0 2px 10px rgba(var(--silver-rgb), 0.16);
}

.cta-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, 0.72) 50%, transparent 78%);
  transform: translateX(-125%);
  transition: transform 0.65s var(--ease-out);
}

.cta-primary:hover::after {
  transform: translateX(125%);
}

.cta-primary:hover {
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 16px 38px rgba(0, 0, 0, 0.45),
    0 4px 18px rgba(var(--jade-rgb), 0.2);
}

.cta-secondary {
  background: rgba(14, 18, 25, 0.56);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.26);
}

.cta-primary svg,
.cta-secondary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s var(--ease-out);
}

.cta-primary:hover svg {
  transform: translate(1.5px, -1.5px);
}

.cta-secondary:hover svg {
  transform: translateY(2px);
}

/* 右侧：3D 镜面折射黑曜石肖像藏品卡 */
.hero-right {
  display: flex;
  justify-content: flex-end;
  perspective: 1100px;
}

.portrait-card {
  width: 344px;
  padding: 14px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.26s var(--ease-out), border-color 0.3s ease;
}

body.motion-off .portrait-card {
  transform: none !important;
}

.portrait-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(
    125deg,
    transparent 24%,
    rgba(255, 255, 255, 0.13) 47%,
    rgba(var(--jade-rgb), 0.1) 52%,
    transparent 74%
  );
  transform: translateX(calc(var(--sx, 0) * 1px));
  transition: opacity 0.3s ease;
}

.portrait-card:hover .portrait-sheen {
  opacity: 1;
}

body.motion-off .portrait-sheen {
  opacity: 0 !important;
}

.portrait-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0d12;
}

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

.portrait-card:hover .portrait-frame img {
  transform: scale(1.03);
}

body.motion-off .portrait-card:hover .portrait-frame img {
  transform: none;
}

.portrait-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(6, 9, 13, 0.58) 100%);
}

.portrait-meta {
  position: relative;
  z-index: 1;
  padding: 16px 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.portrait-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}

.portrait-greeting {
  font-size: 12.5px;
  color: var(--text-2);
}

.portrait-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.portrait-tags span {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

/* ==================== 6. 通用章节头部 ==================== */
.section {
  padding: 76px 0;
  scroll-margin-top: 86px;
}

.section-head {
  margin-bottom: 28px;
}

.head-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--text);
}

.section-sub {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--text-2);
}

/* ==================== 7. 作品展台：朴扑骑手工具 ==================== */
.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.work-main {
  position: relative;
  z-index: 1;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--border);
}

.work-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.work-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
  flex-shrink: 0;
}

.work-title {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
}

.work-sub {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.work-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(226, 232, 240, 0.84);
}

.work-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.work-points li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--text-2);
}

.work-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--jade-rgb), 0.75);
}

.work-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 15px;
  border-radius: 13px;
  background: rgba(6, 9, 14, 0.45);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}

.work-status-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.work-latency {
  color: var(--jade);
  font-size: 12.5px;
}

.tele-btn {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.tele-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.08);
}

.work-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.work-url {
  font-size: 12.5px;
  color: var(--text-3);
}

/* 右侧：钛金属 3D 悬浮交互手机展台 */
.work-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 36px 26px;
  background:
    radial-gradient(circle at 52% 46%, rgba(var(--jade-rgb), 0.11), transparent 62%),
    radial-gradient(circle at 78% 82%, rgba(var(--silver-rgb), 0.07), transparent 55%),
    rgba(6, 9, 14, 0.34);
  perspective: 1100px;
}

.device-3d {
  display: block;
  width: 266px;
  transform: rotateY(-11deg) rotateX(5deg);
  transition: transform 0.28s var(--ease-out);
  transform-style: preserve-3d;
}

body.motion-off .device-3d {
  transform: none !important;
}

.device-frame {
  position: relative;
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.06) 44%,
    rgba(var(--jade-rgb), 0.22) 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.26),
    -22px 28px 56px rgba(0, 0, 0, 0.7),
    0 0 36px rgba(var(--jade-rgb), 0.09);
  overflow: hidden;
}

.device-notch {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 14px;
  border-radius: 99px;
  background: #040609;
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 3;
}

.device-screen {
  border-radius: 27px;
  padding: 34px 15px 16px;
  background: linear-gradient(170deg, #0c121b 0%, #06080d 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mock-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mock-top img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mock-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}

.mock-sub {
  font-size: 10.5px;
  color: var(--text-3);
}

.mock-hero-card {
  padding: 13px;
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(var(--jade-rgb), 0.13), rgba(var(--silver-rgb), 0.05));
  border: 1px solid rgba(var(--jade-rgb), 0.24);
}

.mock-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mock-lbl {
  font-size: 10.5px;
  color: var(--jade);
}

.mock-ping {
  font-size: 10px;
  color: var(--text-2);
}

.mock-big {
  font-size: 18px;
  font-weight: 700;
  margin: 3px 0 10px;
  letter-spacing: 0.06em;
  color: #f4f8fc;
}

.mock-bars {
  height: 38px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.mock-bars i {
  flex: 1;
  height: var(--h);
  border-radius: 3px;
  background: linear-gradient(to top, rgba(var(--jade-rgb), 0.24), rgba(var(--jade-rgb), 0.9));
  transition: height 0.45s var(--ease-out), background 0.35s ease;
}

.mock-bars.offline i {
  background: linear-gradient(to top, rgba(248, 113, 113, 0.2), rgba(248, 113, 113, 0.78));
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mock-tile {
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.065);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mock-tile span {
  font-size: 10px;
  color: var(--text-3);
}

.mock-tile strong {
  font-size: 11.5px;
  color: var(--text);
}

.mock-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mock-enter svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-3d:hover .mock-enter {
  background: rgba(var(--jade-rgb), 0.18);
  border-color: rgba(var(--jade-rgb), 0.36);
  color: var(--jade);
}

.device-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    280px circle at var(--dx, 50%) var(--dy, 20%),
    rgba(255, 255, 255, 0.22),
    rgba(var(--jade-rgb), 0.06) 42%,
    transparent 68%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.device-3d:hover .device-sheen {
  opacity: 1;
}

body.motion-off .device-sheen {
  opacity: 0 !important;
}

/* ==================== 8. 3D 数学与 AI 互动实验室 ==================== */
.lab-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(12, 15, 21, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.lab-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lab-pill:hover {
  color: var(--text);
}

.lab-pill.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.lab-stage {
  height: 416px;
  background: rgba(8, 11, 16, 0.66);
}

.lab-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.lab-canvas:active {
  cursor: grabbing;
}

.lab-overlay-top,
.lab-overlay-bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.lab-overlay-top {
  top: 20px;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.lab-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.lab-eq {
  font-size: 12px;
  color: rgba(var(--jade-rgb), 0.85);
}

.lab-overlay-bottom {
  bottom: 18px;
}

.lab-tip {
  font-size: 12.5px;
  color: var(--text-3);
}

.lab-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.mini-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  background: rgba(8, 11, 16, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.mini-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.08);
}

/* ==================== 9. 联系方式双联触感卡 ==================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.contact-card {
  padding: 28px 30px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.24s var(--ease-out), border-color 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
}

body.motion-off .contact-card:hover {
  transform: none;
}

.contact-head,
.contact-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-kind {
  font-size: 13px;
  color: var(--text-2);
}

.contact-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-ext svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-ext:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.contact-badge {
  font-size: 12px;
  color: var(--text-3);
}

.contact-val {
  position: relative;
  z-index: 1;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact-hint {
  font-size: 12.5px;
  color: var(--text-3);
}

.copy-state {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover .copy-state {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
}

.copy-state.copied {
  background: rgba(74, 222, 128, 0.16) !important;
  border-color: rgba(74, 222, 128, 0.45) !important;
  color: var(--ok) !important;
}

/* ==================== 10. 页脚与轻提示 ==================== */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  margin-top: 44px;
}

.footer-inner {
  max-width: 1096px;
  margin: 0 auto;
  padding: 26px 24px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
}

.toast-msg {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 19, 27, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  animation: toastIn 0.22s var(--ease-out);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 手机端专属底部快捷导航（PC 端完全隐藏） */
.mobile-dock {
  display: none;
}

/* ==================== 11. 响应式精细适配（仅作用于平板/手机，PC 端完全不变） ==================== */
@media (hover: none) {
  .glass-surface:hover::before,
  .glass-surface:hover::after,
  .portrait-card:hover .portrait-sheen,
  .device-3d:hover .device-sheen {
    opacity: 0;
  }

  .portrait-card:hover .portrait-frame img,
  .contact-card:hover {
    transform: none;
  }

  .cta-primary:hover::after {
    transform: translateX(-125%);
  }

  /* 触摸设备没有鼠标追光，赋予卡片微妙克制的静态黑曜石刃光，避免死黑扁平 */
  .glass-surface {
    background: linear-gradient(168deg, rgba(18, 24, 34, 0.72) 0%, rgba(10, 14, 21, 0.66) 100%);
    border-color: rgba(255, 255, 255, 0.11);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 18px 46px rgba(0, 0, 0, 0.48);
  }

  .dock-btn:active,
  .cta-primary:active,
  .cta-secondary:active,
  .portrait-card:active,
  .contact-card:active,
  .mini-btn:active,
  .tele-btn:active,
  .m-nav-item:active {
    transform: scale(0.975);
  }
}

@media (max-width: 920px) {
  .dock-nav {
    display: none;
  }

  .ambient-glow {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: calc(96px + env(safe-area-inset-top)) 0 40px;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-right {
    justify-content: center;
  }

  .portrait-card {
    width: 100%;
    max-width: 360px;
  }

  .work-card {
    grid-template-columns: 1fr;
  }

  .work-main {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .device-3d {
    transform: perspective(900px) rotateX(3deg);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* 启用手机/平板底部悬浮液态玻璃导航胶囊 */
  .mobile-dock {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: min(352px, calc(100vw - 24px));
    padding: 5px;
    border-radius: 999px;
    background: rgba(11, 15, 22, 0.8);
    backdrop-filter: blur(22px) saturate(155%);
    -webkit-backdrop-filter: blur(22px) saturate(155%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 14px 36px rgba(0, 0, 0, 0.58);
  }

  .m-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: color 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, transform 0.16s ease;
    border: 1px solid transparent;
  }

  .m-nav-item svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .m-nav-item.active {
    color: #ffffff;
    background: rgba(var(--jade-rgb), 0.15);
    border-color: rgba(var(--jade-rgb), 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .m-nav-item.active svg {
    color: var(--jade);
  }

  .footer-inner {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .toast-host {
    bottom: calc(68px + env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
    display: flex;
    justify-content: center;
  }

  .toast-msg {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.45;
  }
}

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

  .dock-wrap {
    top: max(10px, env(safe-area-inset-top));
    padding: 0 12px;
  }

  .dock {
    padding: 6px 8px 6px 13px;
    gap: 8px;
    background: rgba(11, 15, 22, 0.76);
  }

  .dock-brand {
    font-size: 12.5px;
    gap: 7px;
  }

  .dock-controls {
    gap: 5px;
  }

  .dock-btn {
    height: 31px;
    padding: 0 10px;
    font-size: 12px;
    gap: 5px;
  }

  .dock-btn.icon-only {
    width: 31px;
  }

  .stage {
    padding: 0 16px;
  }

  /* 首屏手机端一屏成画：紧凑精致、头像卡片化身为高定横版黑曜石名片 */
  .hero {
    padding: calc(76px + env(safe-area-inset-top)) 0 24px;
    gap: 20px;
  }

  .status-chip {
    padding: 5px 12px;
    font-size: 12px;
    gap: 7px;
    margin-bottom: 18px;
    max-width: 100%;
  }

  .hero-name {
    font-size: clamp(42px, 12.5vw, 54px);
    line-height: 1.06;
  }

  .hero-bio {
    margin-top: 14px;
    font-size: 14.8px;
    line-height: 1.82;
  }

  .hero-bio p {
    margin-bottom: 8px;
  }

  .hero-actions {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cta-primary,
  .cta-secondary {
    width: 100%;
    height: 46px;
    justify-content: center;
    padding: 0 18px;
    font-size: 14px;
  }

  /* 肖像卡在手机端变形为横版高定黑曜石藏品卡，彻底告别笨重大方图占满整屏 */
  .hero-right {
    justify-content: stretch;
  }

  .portrait-card {
    max-width: none;
    padding: 14px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
  }

  .portrait-frame {
    width: 84px;
    height: 84px;
    border-radius: 14px;
  }

  .portrait-meta {
    padding: 0;
    gap: 9px;
  }

  .portrait-title {
    font-size: 17.5px;
  }

  .portrait-greeting {
    font-size: 11.5px;
    color: var(--jade);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(var(--jade-rgb), 0.1);
    border: 1px solid rgba(var(--jade-rgb), 0.22);
    white-space: nowrap;
  }

  .portrait-tags {
    gap: 6px;
  }

  .portrait-tags span {
    padding: 2px 8px;
    font-size: 11.5px;
  }

  /* 章节与留白节奏更利落 */
  .section {
    padding: 36px 0;
    scroll-margin-top: 68px;
  }

  .section-head {
    margin-bottom: 18px;
  }

  .head-split {
    gap: 14px;
  }

  .section-head h2 {
    font-size: 24px;
  }

  .section-sub {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.6;
  }

  /* 作品展台精修 */
  .glass-surface {
    border-radius: 20px;
  }

  .work-main {
    padding: 22px 18px 20px;
    gap: 16px;
  }

  .work-top {
    gap: 13px;
  }

  .work-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .work-title {
    font-size: 19px;
  }

  .work-sub {
    font-size: 12.5px;
  }

  .work-desc {
    font-size: 14px;
    line-height: 1.75;
  }

  .work-points {
    gap: 7px;
  }

  .work-points li {
    font-size: 13.5px;
    padding-left: 14px;
  }

  .work-status-bar {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 12.5px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .work-status-left {
    gap: 7px;
    min-width: 0;
    overflow: hidden;
  }

  #work-health {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tele-btn {
    padding: 4px 10px;
    flex-shrink: 0;
  }

  .work-actions {
    margin-top: 2px;
    gap: 0;
  }

  .work-url {
    display: none;
  }

  /* 3D 钛金属手机展台在手机端精细缩放，保持精致立体氛围但不撑爆高度 */
  .work-stage {
    padding: 24px 16px 28px;
  }

  .device-3d {
    width: min(244px, 78vw);
  }

  .device-frame {
    border-radius: 32px;
    padding: 8px;
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.28),
      0 20px 44px rgba(0, 0, 0, 0.68),
      0 0 28px rgba(var(--jade-rgb), 0.12);
  }

  .device-notch {
    top: 14px;
    width: 60px;
    height: 12px;
  }

  .device-screen {
    border-radius: 24px;
    padding: 30px 13px 14px;
    gap: 11px;
  }

  .mock-top img {
    width: 34px;
    height: 34px;
  }

  .mock-hero-card {
    padding: 11px;
  }

  .mock-big {
    font-size: 16px;
    margin: 2px 0 8px;
  }

  .mock-bars {
    height: 32px;
  }

  .mock-tile {
    padding: 8px 9px;
  }

  .mock-enter {
    padding: 8px;
    font-size: 11.5px;
  }

  /* 互动实验室：全宽 4 等分单行高定分段胶囊，彻底告别尴尬 3+1 折行 */
  .lab-switch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    border-radius: 14px;
    padding: 4px;
    gap: 3px;
  }

  .lab-pill {
    padding: 8px 2px;
    border-radius: 10px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .lab-stage {
    height: 332px;
  }

  .lab-overlay-top {
    top: 14px;
    left: 14px;
    right: 14px;
    gap: 2px;
  }

  .lab-name {
    font-size: 13.5px;
  }

  .lab-eq {
    display: block;
    font-size: 10.5px;
    opacity: 0.76;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lab-overlay-bottom {
    bottom: 12px;
    left: 14px;
    right: 14px;
    gap: 8px;
  }

  .lab-tip {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lab-btns {
    gap: 6px;
    flex-shrink: 0;
  }

  .mini-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  /* 联系卡：紧致有力、单行利落 */
  .contact-grid {
    gap: 12px;
  }

  .contact-card {
    padding: 18px;
    gap: 12px;
    border-radius: 18px;
  }

  .contact-val {
    font-size: 18px;
  }

  .contact-hint {
    font-size: 12px;
  }

  .copy-state {
    padding: 4px 12px;
    font-size: 12px;
  }

  .footer {
    margin-top: 24px;
  }

  .footer-inner {
    padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .dock {
    padding: 6px 7px 6px 11px;
    gap: 6px;
  }

  .dock-brand {
    font-size: 12px;
    gap: 6px;
  }

  .dock-btn {
    padding: 0 8px;
    font-size: 11.5px;
  }

  .portrait-card {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .portrait-frame {
    width: 74px;
    height: 74px;
  }

  .lab-pill {
    font-size: 11px;
  }

  .m-nav-item {
    font-size: 11px;
    gap: 4px;
    padding: 0 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
