:root {
  --bg-page: #f2f7f4;
  --bg-elevated: rgba(255, 255, 255, 0.84);
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-strong: #ffffff;
  --bg-code: #14221d;
  --ink-main: #132620;
  --ink-sub: #476258;
  --ink-muted: #6e887e;
  --accent: #1b7f64;
  --accent-bright: #10b981;
  --accent-cyan: #0ea5e9;
  --accent-warm: #d97706;
  --border-soft: rgba(27, 127, 100, 0.14);
  --border-strong: rgba(27, 127, 100, 0.28);
  --shadow-card: 0 18px 42px -14px rgba(17, 45, 36, 0.08), 0 4px 14px rgba(17, 45, 36, 0.04);
  --shadow-hero: 0 28px 68px -18px rgba(16, 56, 44, 0.14), 0 0 0 1px rgba(27, 127, 100, 0.14);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font-sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --font-serif: "Source Han Serif SC", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

[data-theme="dark"] {
  --bg-page: #0c1613;
  --bg-elevated: rgba(18, 33, 28, 0.84);
  --bg-card: rgba(20, 36, 31, 0.78);
  --bg-card-strong: #152620;
  --bg-code: #09120f;
  --ink-main: #e7f3ee;
  --ink-sub: #9cb7ad;
  --ink-muted: #69857b;
  --accent: #2dd4a8;
  --accent-bright: #10b981;
  --accent-cyan: #38bdf8;
  --border-soft: rgba(45, 212, 168, 0.15);
  --border-strong: rgba(45, 212, 168, 0.32);
  --shadow-card: 0 20px 46px -16px rgba(0, 0, 0, 0.55);
  --shadow-hero: 0 32px 76px -18px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(45, 212, 168, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-main);
  background: var(--bg-page);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* 清新科技感背景网格与柔光极光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(circle at 14% 12%, rgba(16, 185, 129, 0.12), transparent 38%),
    radial-gradient(circle at 86% 18%, rgba(14, 165, 233, 0.10), transparent 40%),
    radial-gradient(circle at 52% 84%, rgba(27, 127, 100, 0.09), transparent 45%),
    linear-gradient(to right, rgba(27, 127, 100, 0.038) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 127, 100, 0.038) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px, 36px 36px;
}

#ink-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

.wrap {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

/* 顶部独立导航栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: color-mix(in srgb, var(--bg-page) 80%, transparent);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink-main);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .brand-logo,
[data-theme="dark"] .modal-brand-logo {
  filter: invert(0.92);
}

.brand:hover .brand-logo {
  transform: rotate(-6deg) scale(1.06);
}

.brand-tag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--border-soft);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--ink-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

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

.theme-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--ink-sub);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.theme-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink-main);
}

/* 按钮体系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn-sm {
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, #1b7f64 0%, #149675 55%, #0d9488 100%);
  color: #ffffff;
  box-shadow: 0 10px 26px -6px rgba(20, 150, 117, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -6px rgba(20, 150, 117, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--ink-main);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

/* 首屏展台 */
.hero {
  padding: 54px 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.18fr;
  gap: 36px;
  align-items: center;
}

.kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-card-strong));
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.hero-title .grad {
  background: linear-gradient(125deg, var(--accent) 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--ink-sub);
  line-height: 1.75;
}

/* 4项清新科技指标卡 */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric-item {
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

.metric-val {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.metric-lbl {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.meta-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.verify-drawer {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  padding: 10px 14px;
  font-size: 12.5px;
}

.verify-drawer summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-sub);
  user-select: none;
}

.verify-drawer pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-code);
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  overflow-x: auto;
}

/* 右侧清新科技感双栏实时创作台仿真舱 */
.studio-stage {
  perspective: 1200px;
}

.studio-window {
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
  transition: transform 0.2s ease, background-color 0.25s ease;
  backdrop-filter: blur(22px);
}

.studio-window[data-skin="morandi"] {
  --studio-bg: #e7ecee;
  --studio-paper: #f9fbfc;
  --studio-accent: #426978;
}

.studio-window[data-skin="celadon"] {
  --studio-bg: #e5efe9;
  --studio-paper: #fbfdfb;
  --studio-accent: #1b7f64;
}

.studio-window[data-skin="xuan"] {
  --studio-bg: #eeeae0;
  --studio-paper: #faf6ec;
  --studio-accent: #7a5c38;
}

.studio-window[data-skin="night"] {
  --studio-bg: #17211e;
  --studio-paper: #1e2b27;
  --studio-accent: #34d399;
  color: #e4f0ec;
}

.studio-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  background: var(--studio-bg, #e5efe9);
  border-bottom: 1px solid rgba(27, 127, 100, 0.14);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.studio-brand img {
  width: 22px;
  height: 22px;
}

.studio-window[data-skin="night"] .studio-brand img {
  filter: invert(0.92);
}

.studio-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(27, 127, 100, 0.18);
}

.studio-window[data-skin="night"] .studio-seg {
  background: rgba(0, 0, 0, 0.32);
}

.studio-seg button {
  border: 0;
  background: transparent;
  padding: 3px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.studio-seg button.active {
  background: var(--studio-accent, #1b7f64);
  color: #ffffff;
}

.studio-update-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(27, 127, 100, 0.35);
  background: rgba(27, 127, 100, 0.12);
  color: var(--studio-accent, #1b7f64);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.studio-update-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.studio-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--studio-bg, #e5efe9) 65%, white);
  border-bottom: 1px solid rgba(27, 127, 100, 0.1);
  flex-wrap: wrap;
}

.studio-window[data-skin="night"] .studio-subbar {
  background: #1b2723;
}

.skin-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.skin-chip {
  border: 1px solid rgba(27, 127, 100, 0.24);
  border-radius: 999px;
  padding: 2px 9px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.65);
  color: #1c312b;
}

.skin-chip.active {
  background: var(--studio-accent, #1b7f64);
  color: #fff;
  border-color: transparent;
}

.studio-body {
  display: grid;
  grid-template-columns: 148px 1fr 1.15fr;
  min-height: 330px;
  background: var(--studio-paper, #fbfdfb);
}

.studio-body[data-mode="source"] {
  grid-template-columns: 148px 1fr;
}

.studio-body[data-mode="source"] .studio-reader {
  display: none;
}

.studio-body[data-mode="reader"] {
  grid-template-columns: 148px 1fr;
}

.studio-body[data-mode="reader"] .studio-source {
  display: none;
}

.studio-toc {
  padding: 12px;
  background: color-mix(in srgb, var(--studio-bg, #e5efe9) 45%, transparent);
  border-right: 1px solid rgba(27, 127, 100, 0.12);
  font-size: 12px;
}

.studio-toc-filter {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(27, 127, 100, 0.16);
  font-size: 11px;
  color: #6c857c;
  margin-bottom: 8px;
}

.studio-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-toc-list li {
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
  transition: background-color 0.15s ease;
}

.studio-toc-list li.active {
  background: rgba(27, 127, 100, 0.15);
  color: var(--studio-accent, #1b7f64);
  font-weight: 700;
}

.studio-source {
  padding: 14px;
  border-right: 1px solid rgba(27, 127, 100, 0.12);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-y: auto;
}

.studio-reader {
  padding: 16px 18px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-y: auto;
}

.studio-reader h3 {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--studio-accent, #1b7f64);
}

.studio-reader table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
  margin-top: 8px;
}

.studio-reader th,
.studio-reader td {
  border: 1px solid rgba(27, 127, 100, 0.2);
  padding: 6px 8px;
  text-align: left;
}

.studio-reader th {
  background: rgba(27, 127, 100, 0.08);
}

.studio-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 11px;
  background: var(--studio-bg, #e5efe9);
  border-top: 1px solid rgba(27, 127, 100, 0.12);
  opacity: 0.9;
}

/* 章节通用样式 */
.sec {
  padding: 52px 0;
}

.sec-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.sec-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.sec-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sec-desc {
  margin: 0;
  color: var(--ink-sub);
  font-size: 15px;
}

/* 六大核心能力 Bento 卡片 */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.bento-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.bento-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
}

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.bento-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-sub);
  line-height: 1.7;
}

/* 实机界面巡礼标签页 */
.gallery-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.gallery-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--ink-sub);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.gallery-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.gallery-frame {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-card-strong);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}

.gallery-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-caption {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-sub);
  border-top: 1px solid var(--border-soft);
}

/* 在线热更新实时探针工作台 */
.ota-console {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  padding: 30px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  align-items: center;
}

.code-box {
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  max-height: 270px;
}

/* 页面内嵌的一键更新体验弹窗 */
.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 29, 24, 0.42);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.demo-modal-backdrop[hidden] {
  display: none !important;
}

.demo-update-card {
  width: min(468px, 100%);
  border-radius: 18px;
  background: var(--bg-card-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hero);
  overflow: hidden;
}

.demo-update-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.demo-update-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.demo-progress-track {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  overflow: hidden;
}

.demo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.2s ease;
}

.footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .hero-grid,
  .ota-console {
    grid-template-columns: 1fr;
  }
  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .studio-body {
    grid-template-columns: 1fr;
  }
  .studio-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .metric-strip,
  .bento-grid {
    grid-template-columns: 1fr 1fr;
  }
}
