/* ============================================================================
   DSH 企业版管理平台 · 官网
   ----------------------------------------------------------------------------
   设计令牌直接取自产品控制台（packages/console/src/styles/base.css 与 theme.css），
   官网与产品界面共用一套颜色，读者从官网点进控制台不会有割裂感。

   主题：深色为默认（与产品一致），浅色照搬产品已实算过对比度的那一套。

   版式主张：**截图是页面的主干**。文字只做注解，能删的都删了；
   每一节先给视觉，再给一句话。
   ========================================================================== */

/* ── 1. 令牌：深色即默认 ─────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg:            #0d1117;
  --panel:         #161b22;
  --panel-2:       #1c2128;
  --inset:         #010409;

  --line:          #30363d;
  --line-soft:     #21262d;
  --line-strong:   #444c56;

  --fg:            #e6edf3;
  --fg-muted:      #9ba6b2;
  --fg-subtle:     #7d8590;

  --accent:        #2f81f7;
  --accent-hi:     #4c94f8;
  --accent-soft:   rgba(47, 129, 247, .13);
  --success:       #3fb950;
  --success-soft:  rgba(63, 185, 80, .13);
  --warn:          #d29922;
  --warn-soft:     rgba(210, 153, 34, .13);
  --danger:        #f85149;
  --danger-soft:   rgba(248, 81, 73, .13);
  --purple:        #a371f7;

  --radius:        6px;
  --radius-lg:     10px;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* 浅色：与产品 theme.css 同一套取值（Primer 一脉，对比度已实算过）。
   两份写法是必要的 —— 一份管「系统偏好浅色」，一份管「手动选浅色」。 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:          #f6f8fa;
    --panel:       #ffffff;
    --panel-2:     #f6f8fa;
    --inset:       #ffffff;
    --line:        #d0d7de;
    --line-soft:   #e6eaef;
    --line-strong: #afb8c1;
    --fg:          #1f2328;
    --fg-muted:    #59636e;
    --fg-subtle:   #6a737d;
    --accent:      #0550ae;
    --accent-hi:   #033d8b;
    --accent-soft: #ddf4ff;
    --success:     #116329;
    --success-soft:#dafbe1;
    --warn:        #7d4e00;
    --warn-soft:   #fff8c5;
    --danger:      #a40e26;
    --danger-soft: #ffebe9;
    --purple:      #6639ba;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:          #f6f8fa;
  --panel:       #ffffff;
  --panel-2:     #f6f8fa;
  --inset:       #ffffff;
  --line:        #d0d7de;
  --line-soft:   #e6eaef;
  --line-strong: #afb8c1;
  --fg:          #1f2328;
  --fg-muted:    #59636e;
  --fg-subtle:   #6a737d;
  --accent:      #0550ae;
  --accent-hi:   #033d8b;
  --accent-soft: #ddf4ff;
  --success:     #116329;
  --success-soft:#dafbe1;
  --warn:        #7d4e00;
  --warn-soft:   #fff8c5;
  --danger:      #a40e26;
  --danger-soft: #ffebe9;
  --purple:      #6639ba;
}

/* ── 2. 基础 ─────────────────────────────────────────────────────────────── */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; letter-spacing: -.012em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.22; letter-spacing: -.024em; text-wrap: balance; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); text-wrap: balance; }
h3 { font-size: 1rem; line-height: 1.5; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; }
code, .mono { font-family: var(--mono); font-size: .875em; }

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

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: var(--radius); color: var(--fg);
  transition: top .15s;
}
.skip:focus { top: 16px; }

/* ── 3. 版式原语 ─────────────────────────────────────────────────────────── */

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

.section { padding-block: 82px; }
.section + .section { border-top: 1px solid var(--line-soft); }

.sec-head { max-width: 700px; margin-bottom: 38px; }
.sec-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--accent); margin-bottom: 12px;
}
.sec-kicker::before { content: ""; width: 14px; height: 1px; background: var(--accent); }
.sec-head p { color: var(--fg-muted); margin-top: 12px; }
.prose { max-width: 640px; color: var(--fg-muted); }

/* ── 4. 顶栏 ─────────────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-in { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--radius);
  background: linear-gradient(150deg, var(--accent), var(--purple));
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 600; flex: none;
}
.brand-name { font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--fg-subtle); font-weight: 400; margin-left: 2px; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--fg-muted); font-size: 13.5px; padding: 6px 11px; border-radius: var(--radius); }
.nav-links a:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

/* ── 5. 按钮 ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 500;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--fg);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--panel); border-color: var(--line-strong); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

.theme-btn {
  width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: transparent; color: var(--fg-muted); cursor: pointer;
}
.theme-btn:hover { background: var(--panel-2); color: var(--fg); }
.theme-btn svg { width: 15px; height: 15px; }
/* 图标显示规则：默认（跟随系统）按 prefers-color-scheme 切；
   手动选了主题之后由 [data-theme] 说了算。 */
.i-sun { display: none; }
.i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: block; }
  :root:not([data-theme="dark"]) .i-moon { display: none; }
}
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ── 6. Hero ─────────────────────────────────────────────────────────────── */

.hero { position: relative; padding-block: 72px 0; overflow: hidden; }
/* 底纹：方舟生成的深色工程网格，压得很淡只当质感用 —— 它不该被看见，
   只该让第一屏不那么平。浅色下整块关掉：深色网格压到低透明度不是"变淡"，
   是变成浅底上的灰色斜纹，像印刷污渍；那是极性不对，调透明度解决不了。 */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../img/bg-hero-field.png") center top / cover no-repeat;
  opacity: .6;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.4) 60%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.4) 60%, transparent 92%);
}
:root[data-theme="light"] .hero::before { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero::before { display: none; }
}
.hero > .wrap { position: relative; z-index: 1; }

.hero h1 { max-width: 18em; }
.hero .lede { margin-top: 20px; max-width: 620px; font-size: 16.5px; color: var(--fg-muted); line-height: 1.85; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* 产品本体放第一屏：比任何形容词都有说服力。加一层辉光把它从背景里托起来。 */
.hero-shot { margin-top: 52px; }
.hero-shot .frame { box-shadow: 0 30px 80px rgba(1, 4, 9, .55); }
/* 截图本身在下沿就结束了（那是一屏的高度），硬边看着像被裁断。
   给图加一层向下渐隐，读起来是"下面还有"而不是"没截全"。 */
.hero-shot .frame img {
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}
:root[data-theme="light"] .hero-shot .frame { box-shadow: 0 24px 60px rgba(31, 35, 40, .16); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-shot .frame { box-shadow: 0 24px 60px rgba(31, 35, 40, .16); }
}

/* ── 7. 数字条 ───────────────────────────────────────────────────────────── */

.strip-band { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 28px; margin: 0; padding-block: 26px; }
.strip > div { padding-block: 6px; }
.strip dt { font-size: 1.05rem; font-weight: 600; color: var(--fg); letter-spacing: -.01em; }
.strip dd { margin: 4px 0 0; font-size: 13px; color: var(--fg-subtle); line-height: 1.6; }

/* ── 8. 核心能力：图标 + 一句话 ──────────────────────────────────────────── */

.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 0 36px; border-top: 1px solid var(--line-soft); }
.cap { padding: 26px 0 28px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.cap-ico {
  width: 34px; height: 34px; margin-bottom: 14px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.cap-ico svg { width: 18px; height: 18px; }
.cap h3 { margin-bottom: 8px; }
.cap p { color: var(--fg-muted); font-size: 13.8px; }

/* ── 9. 安全边界 ─────────────────────────────────────────────────────────── */

.bounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 36px; }
.bound { padding: 22px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
/* 编号要跨两行：.bound 是两列网格，而它是 h3 和 p 两个兄弟节点 ——
   不给它 grid-row: span 2，正文 p 会掉到第二行的第一列（30px 宽），
   整段中文就会逐字竖排。 */
.bound-n {
  grid-row: span 2;
  width: 26px; height: 26px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
}
.bound h3 { margin-bottom: 6px; }
.bound p { color: var(--fg-muted); font-size: 13.8px; }

.iso-band { margin-top: 34px; }
.iso-band img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.iso-band figcaption { margin-top: 14px; font-size: 13.5px; color: var(--fg-muted); max-width: 720px; }
.iso-band figcaption b { color: var(--fg); font-weight: 500; }

.threats { margin-top: 40px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.threats table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.threats th, .threats td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.threats thead th { font-size: 12px; font-weight: 500; color: var(--fg-subtle); background: var(--panel-2); }
.threats tbody tr:last-child td { border-bottom: 0; }
.threats td:first-child { color: var(--fg); width: 36%; }
.threats td:nth-child(2) { color: var(--fg-muted); }
.threats td:last-child { white-space: nowrap; width: 1%; }
.scroll-x { overflow-x: auto; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.tag-strong { background: var(--success-soft); color: var(--success); }
.tag-mid    { background: var(--warn-soft);    color: var(--warn); }

/* ── 10. 截图 ────────────────────────────────────────────────────────────── */

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tab {
  font: inherit; font-size: 13px; padding: 6px 14px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--fg-muted);
  border-radius: 20px; transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--fg); border-color: var(--line-strong); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.frame { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; }
.frame-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); background: var(--panel-2);
}
.cmd-dots { display: flex; gap: 5px; }
.cmd-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.frame-url {
  margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--fg-subtle);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.frame img { display: block; width: 100%; height: auto; background: var(--bg); }
.frame-note { padding: 11px 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--fg-subtle); }

/* ── 11. 额度 ────────────────────────────────────────────────────────────── */

.credit-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.credit {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--inset); padding: 20px 22px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.9; color: var(--fg);
}
.credit .op { color: var(--accent); }
.credit .num { color: var(--success); }
.credit .cm { color: var(--fg-subtle); }

.buckets { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 22px; }
.bucket { padding-block: 14px; border-top: 1px solid var(--line-soft); }
.bucket dt { font-size: 12.5px; color: var(--fg-subtle); }
.bucket dd { margin: 5px 0 0; font-family: var(--mono); font-size: 14px; color: var(--fg); }

/* ── 12. FAQ ─────────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--line-soft); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer; padding: 17px 34px 17px 0; position: relative;
  font-size: 15px; font-weight: 500; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%;
  width: 8px; height: 8px; margin-top: -5px;
  border-right: 1.5px solid var(--fg-subtle); border-bottom: 1.5px solid var(--fg-subtle);
  transform: rotate(45deg); transition: transform .18s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > p { padding: 0 0 19px; color: var(--fg-muted); font-size: 14px; max-width: 760px; }

/* ── 13. 结尾 CTA + 页脚 ─────────────────────────────────────────────────── */

.cta-band { padding-block: 78px; border-top: 1px solid var(--line); background: var(--panel); }
.cta-band h2 { max-width: 20em; }
.cta-band p { color: var(--fg-muted); margin-top: 14px; max-width: 600px; }
.cta-band .hero-cta { margin-top: 28px; }

.foot { padding-block: 32px 46px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; font-size: 13px; color: var(--fg-subtle); }
.foot-in .sp { margin-left: auto; }

/* ── 14. 预约弹窗 ────────────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(1, 4, 9, .74); backdrop-filter: blur(3px); }
:root[data-theme="light"] .modal-back { background: rgba(31, 35, 40, .48); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .modal-back { background: rgba(31, 35, 40, .48); }
}

.modal-card {
  position: relative; width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 26px 22px; box-shadow: 0 24px 64px rgba(1, 4, 9, .55);
}
.modal-card h2 { font-size: 1.25rem; }
.modal-card > p { margin-top: 10px; color: var(--fg-muted); font-size: 14px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--fg-subtle); cursor: pointer;
}
.modal-close:hover { background: var(--panel-2); color: var(--fg); border-color: var(--line); }
.modal-close svg { width: 15px; height: 15px; }

.qr-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.qr-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel-2); padding: 16px; text-align: center; }
.qr-card h3 { font-size: 14px; margin-bottom: 12px; }
.qr-slot { position: relative; aspect-ratio: 1 / 1; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--inset); }
.qr-slot img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; }
/* 二维码还没放进来时显示的占位。图一加载出来就盖住它；加载失败（404）时把 img
   藏掉，露出这段说明，而不是一个碎图标。 */
.qr-slot img[data-failed] { display: none; }
.qr-ph {
  position: absolute; inset: 0; z-index: 0; display: grid; place-content: center; gap: 6px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--fg-subtle); font-size: 12.5px; line-height: 1.6; padding: 12px;
}
.qr-ph .mono { font-size: 11px; word-break: break-all; }
.qr-card .hint { margin-top: 12px; font-size: 12.5px; color: var(--fg-subtle); }
.modal-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--fg-subtle); }

body.modal-open { overflow: hidden; }

/* ── 15. 窄屏 ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .credit-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .wrap { padding-inline: 18px; }
  .section { padding-block: 56px; }
  .hero { padding-block: 46px 0; }
  .nav-links { display: none; }
  .brand-sub { display: none; }
  .hero-shot { margin-top: 34px; }
  .qr-row { grid-template-columns: minmax(0, 1fr); }
  .modal-card { padding: 22px 18px 18px; }
  .bound { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 480px) {
  .nav-actions .btn { padding: 6px 12px; font-size: 13px; }
  .hero-cta .btn { width: 100%; }
}

/* ── 16. 尊重减少动效 / 打印 ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .nav, .hero-cta, .tabs { display: none; }
  body { background: #fff; color: #000; }
}
