/* ============================================================
   DSH Desktop Shell — 官网样式
   深色为主（与客户端启动页一致），浅色可切换。
   背景主层由 engine.js 提供；此处只做兜底舞台与前景排版。
   ============================================================ */

:root {
  --bg: #05070d;
  --fg: #e8edf7;
  --fg-dim: #9aa7bd;
  --fg-faint: #6b7a92;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --card: rgba(255,255,255,.035);
  --card-hover: rgba(255,255,255,.06);
  --accent: #4d8dff;
  --accent-2: #7aa9ff;
  --accent-soft: rgba(77,141,255,.14);
  --ok: #38d39f;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1120px;
  --font: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #f6f8fc;
  --fg: #10182b;
  --fg-dim: #4a5a75;
  --fg-faint: #7b88a1;
  --line: rgba(16,24,43,.10);
  --line-strong: rgba(16,24,43,.18);
  --card: rgba(255,255,255,.72);
  --card-hover: rgba(255,255,255,.92);
  --accent: #2d6ae8;
  --accent-2: #1f56c9;
  --accent-soft: rgba(45,106,232,.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--accent-soft);
  color: var(--fg);
  padding: .12em .45em;
  border-radius: 6px;
  word-break: break-all;
}

/* ============================================================
   兜底背景舞台（engine.js 缺席或浅色自隐藏时启用）
   ============================================================ */

.stage {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  overflow: hidden;
}
.halo {
  position: absolute; inset: -20% -10%;
  background:
    radial-gradient(60% 45% at 50% 8%, rgba(77,141,255,.20), transparent 70%),
    radial-gradient(45% 35% at 78% 30%, rgba(122,169,255,.12), transparent 70%),
    radial-gradient(45% 35% at 22% 26%, rgba(58,110,220,.11), transparent 70%);
}
.flow { position: absolute; inset: 0; }
.flow i {
  position: absolute; left: -10%; width: 120%; height: 42%;
  border-radius: 50%;
  filter: blur(52px);
  opacity: .30;
}
.f1 { top: 6%;  background: linear-gradient(90deg, transparent, rgba(70,130,255,.55), transparent); animation: drift 24s ease-in-out infinite; }
.f2 { top: 30%; background: linear-gradient(90deg, transparent, rgba(120,90,255,.35), transparent); animation: drift 31s ease-in-out infinite reverse; }
.f3 { top: 54%; background: linear-gradient(90deg, transparent, rgba(45,190,255,.30), transparent); animation: drift 27s ease-in-out infinite; }
.f4 { top: 72%; background: linear-gradient(90deg, transparent, rgba(90,140,255,.22), transparent); animation: drift 36s ease-in-out infinite reverse; }
.f5 { top: 88%; background: linear-gradient(90deg, transparent, rgba(60,110,230,.18), transparent); animation: drift 42s ease-in-out infinite; }
@keyframes drift {
  0%, 100% { transform: translate3d(-4%, 0, 0) scaleY(1); }
  50%      { transform: translate3d(4%, -3%, 0) scaleY(1.15); }
}

html[data-theme="light"] .halo {
  background:
    radial-gradient(60% 45% at 50% 6%, rgba(45,106,232,.12), transparent 70%),
    radial-gradient(45% 35% at 80% 28%, rgba(45,106,232,.07), transparent 70%);
}
html[data-theme="light"] .flow i { opacity: .16; }

/* ============================================================
   顶栏
   ============================================================ */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px 24px;
  backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
/* 分隔线只在滚动离开顶部后出现，避免首屏出现一条"飘着的白线" */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line);
  opacity: 0; transition: opacity .25s;
}
body.scrolled .topbar::after { opacity: 1; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 650; font-size: 15px;
  letter-spacing: .2px; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }

.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14.5px; }
.nav a { color: var(--fg-dim); }
.nav a:hover { color: var(--fg); text-decoration: none; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--fg-dim); cursor: pointer;
  display: grid; place-items: center; padding: 0;
  transition: .18s;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-strong); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s, background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 82%, #000));
  color: #fff;
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--accent) 78%, transparent); }

.btn-outline { border-color: var(--line-strong); color: var(--fg); background: var(--card); }
.btn-outline:hover { background: var(--card-hover); }

.btn-ghost { color: var(--fg-dim); background: transparent; border-color: var(--line); }
.btn-ghost:hover { color: var(--fg); background: var(--card); }

.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 72px 24px 40px;
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr);
  gap: 48px; align-items: center;
}
.hero-inner { min-width: 0; }

.pill {
  display: inline-block;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 12.5px; color: var(--fg-dim);
  letter-spacing: .2px;
}

.hero h1 {
  margin: 20px 0 16px;
  font-size: clamp(30px, 4.4vw, 47px);
  line-height: 1.16; font-weight: 720;
  letter-spacing: -.5px;
}

.lede { margin: 0 0 30px; color: var(--fg-dim); font-size: 16.5px; max-width: 34em; }
.lede strong { color: var(--fg); font-weight: 640; }

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

.meta { margin: 18px 0 0; font-size: 13.5px; color: var(--fg-faint); }

.hash-box {
  margin-top: 26px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
  max-width: 560px;
}
.hash-label { font-size: 11.5px; color: var(--fg-faint); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 7px; }
.hash-row { display: flex; align-items: center; gap: 10px; }
.hash-row code {
  flex: 1; min-width: 0; background: none; padding: 0;
  font-size: 11.5px; color: var(--fg-dim);
  overflow-wrap: anywhere;
}
.copy {
  flex: none; padding: 5px 11px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--fg-dim); font-size: 12.5px; font-family: inherit;
  cursor: pointer; transition: .16s;
}
.copy:hover { color: var(--fg); background: var(--card-hover); }
.copy.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

/* 应用预览窗口 */
.hero-shot { min-width: 0; }
.window {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #070a11;
  box-shadow: 0 30px 70px -28px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.03);
}
.titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: #0c1119;
  border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.win-title { margin-left: 10px; font-size: 12px; color: #7d8aa3; }
.window img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center; }

/* ============================================================
   区块通用
   ============================================================ */

.section { max-width: var(--maxw); margin: 0 auto; padding: 62px 24px; }
.section h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 700; letter-spacing: -.3px;
}
.section-sub { margin: 0 0 30px; color: var(--fg-dim); }

.cards.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }

.card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: border-color .2s, background .2s;
}
.card:hover { border-color: var(--line-strong); background: var(--card-hover); }
.card-featured { border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.card h3 { margin: 0 0 10px; font-size: 18.5px; font-weight: 660; }
.card > p { margin: 0 0 18px; color: var(--fg-dim); font-size: 14.8px; }
.card-tag {
  position: absolute; top: -11px; left: 22px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 650; letter-spacing: .3px;
}

.facts { list-style: none; margin: 18px 0 0; padding: 0; font-size: 13.5px; }
.facts li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.facts li > span { flex: none; width: 66px; color: var(--fg-faint); }
.facts li > code, .facts li > a { min-width: 0; }

.codeblock {
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: rgba(0,0,0,.28); margin: 0 0 14px;
}
html[data-theme="light"] .codeblock { background: rgba(16,24,43,.045); }
.cb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--fg-faint); letter-spacing: .4px;
}
.codeblock pre { margin: 0; padding: 13px 14px; overflow-x: auto; }
.codeblock code {
  background: none; padding: 0; font-size: 12.8px; color: var(--fg);
  word-break: normal; white-space: pre; display: block;
}
/* 长命令允许换行，避免横向溢出卡片 */
.codeblock pre.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }

.note { font-size: 13.2px; color: var(--fg-faint); margin: 0 0 6px; }

.callout {
  margin-top: 22px; padding: 15px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; background: var(--card);
  font-size: 14px; color: var(--fg-dim);
}
.callout strong { color: var(--fg); }

/* ============================================================
   功能网格
   ============================================================ */

.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.feat {
  padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
  transition: border-color .2s, background .2s, transform .2s;
}
.feat:hover { border-color: var(--line-strong); background: var(--card-hover); transform: translateY(-2px); }
.fi { font-size: 22px; line-height: 1; margin-bottom: 12px; }
.feat h3 { margin: 0 0 7px; font-size: 15.2px; font-weight: 640; }
.feat p { margin: 0; font-size: 13.6px; color: var(--fg-dim); line-height: 1.65; }

/* ============================================================
   安装步骤
   ============================================================ */

.steps { display: grid; gap: 20px; }
.step {
  display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 18px;
  padding: 26px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--card);
}
.step-no {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
  font-weight: 720; font-size: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.step-body { min-width: 0; }
.step-body h3 { margin: 0 0 14px; font-size: 17.5px; font-weight: 660; }
.step-body ol { margin: 0 0 14px; padding-left: 22px; color: var(--fg-dim); font-size: 14.6px; }
.step-body ol li { margin-bottom: 7px; }
.tree {
  margin: 10px 0 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0,0,0,.28);
  font-family: var(--mono); font-size: 12.6px; color: var(--fg-dim);
  overflow-x: auto; line-height: 1.75;
}
html[data-theme="light"] .tree { background: rgba(16,24,43,.045); }

/* ============================================================
   表格 / FAQ
   ============================================================ */

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table th, table td { padding: 14px 20px; text-align: left; vertical-align: top; }
table th { width: 190px; color: var(--fg-dim); font-weight: 560; }
table tr + tr th, table tr + tr td { border-top: 1px solid var(--line); }

.faq { display: grid; gap: 10px; }
details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
details[open] { border-color: var(--line-strong); }
summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; position: relative; padding-right: 46px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 22px; top: 50%;
  width: 8px; height: 8px; margin-top: -5px;
  border-right: 1.8px solid var(--fg-faint); border-bottom: 1.8px solid var(--fg-faint);
  transform: rotate(45deg); transition: transform .2s;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { margin: 0; padding: 0 20px 18px; color: var(--fg-dim); font-size: 14.4px; }

/* ============================================================
   页脚
   ============================================================ */

.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 34px 24px 46px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 620; margin-bottom: 12px; }
.foot-brand img { border-radius: 6px; }
.foot-note { margin: 0 0 6px; color: var(--fg-faint); font-size: 13.4px; max-width: 52em; }
.foot-meta { margin: 0; color: var(--fg-faint); font-size: 12.6px; }

/* ============================================================
   Hero 里的设置小窗（叠在启动页右下）
   ============================================================ */

.hero-shot { position: relative; }
.mini-window {
  position: absolute; right: -18px; bottom: -30px; width: 47%;
  border: 1px solid var(--line-strong); border-radius: 14px;
  overflow: hidden; background: #070a11;
  box-shadow: 0 26px 56px -20px rgba(0,0,0,.82), 0 0 0 1px rgba(255,255,255,.04);
}
.mini-window .titlebar { padding: 7px 10px; }
.mini-window .dot { width: 8px; height: 8px; }
.mini-window .win-title { font-size: 10.5px; margin-left: 7px; }
.mini-window img { aspect-ratio: auto; }

/* ============================================================
   界面截图展示
   ============================================================ */

.figure { margin: 0 0 34px; }
.figure:last-child { margin-bottom: 0; }
.figure img { width: 100%; }
.figure figcaption {
  margin-top: 15px; color: var(--fg-dim); font-size: 14.2px;
  max-width: 62em; line-height: 1.75;
}
.figure figcaption strong { color: var(--fg); font-weight: 640; }
.figure figcaption strong:first-child {
  display: block; margin-bottom: 5px; font-size: 15.4px;
}

.figure-split {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 30px; align-items: start;
}
.window-narrow { max-width: 380px; }
.window-narrow img { aspect-ratio: auto; }
.figure-split figcaption { margin-top: 0; padding-top: 4px; }

/* 窄屏：叠放 */
@media (max-width: 760px) {
  .mini-window { position: static; width: 100%; margin-top: 16px; }
  .figure-split { grid-template-columns: 1fr; gap: 16px; }
  .figure-split figcaption { margin-top: 0; }
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 52px; }
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cards.two { grid-template-columns: 1fr; }
  .nav { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar::after { left: 16px; right: 16px; }
  .section, .hero { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; padding: 20px; }
  .step-no { width: 38px; height: 38px; font-size: 16px; }
  table th { width: auto; }
  table th, table td { padding: 12px 15px; }
  .cta .btn { flex: 1 1 100%; }
  .footer-inner { padding: 28px 16px 40px; }
}

/* ============================================================
   减动态
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow i { animation: none; }
  .btn, .feat, .card { transition: none; }
  .btn:hover, .feat:hover { transform: none; }
}
