/* ============================================================
   三角洲行动工具站 · 军事暗黑风
   tokens 基于方向库 tech-utility（暗色适配），单一强调色
   ============================================================ */
:root {
  --bg:      oklch(17% 0.012 240);
  --surface: oklch(21% 0.014 240);
  --surface-2: oklch(24.5% 0.016 240);
  --fg:      oklch(93% 0.008 240);
  --muted:   oklch(66% 0.014 240);
  --border:  oklch(31% 0.014 240);
  --accent:  oklch(78% 0.16 145);

  --accent-soft: color-mix(in oklch, var(--accent) 16%, transparent);
  --fg-soft:     color-mix(in oklch, var(--fg) 7%, transparent);
  --danger:      oklch(70% 0.18 30);
  --danger-soft: color-mix(in oklch, var(--danger) 16%, transparent);

  --font-display: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;

  --fs-h1: clamp(34px, 4.4vw, 52px);
  --fs-h2: clamp(26px, 3.2vw, 38px);
  --fs-h3: 19px;
  --fs-lead: 17px;
  --fs-body: 15px;
  --fs-meta: 12.5px;

  --gap-xs: 8px; --gap-sm: 12px; --gap-md: 20px; --gap-lg: 32px; --gap-xl: 56px; --gap-2xl: 88px;
  --container: 1120px; --gutter: 28px;
  --radius: 8px; --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

/* ── layout ── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(44px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* ── type ── */
.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.015em; margin: 0; font-weight: 700; }
.h2, h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.01em; margin: 0; font-weight: 700; }
.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); max-width: 62ch; margin: 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--gap-md);
}
.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── chrome ── */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 13px; gap: var(--gap-md); }
.topnav .logo { font-family: var(--font-mono); font-size: 16px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.topnav .logo em { font-style: normal; color: var(--accent); }
.topnav nav { display: flex; gap: var(--gap-lg); flex-wrap: wrap; }
.topnav nav a { font-size: 14px; color: var(--muted); padding: 6px 2px; border-bottom: 1.5px solid transparent; }
.topnav nav a:hover { color: var(--fg); }
.topnav nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.pagefoot { padding-block: var(--gap-xl); color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; min-height: 40px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14.5px; font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: oklch(20% 0.03 145); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 86%, white); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--muted); background: var(--fg-soft); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover { color: var(--fg); background: var(--fg-soft); }
.btn-copy { padding: 6px 12px; min-height: 32px; font-size: 12.5px; font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── card ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card-flat { background: transparent; border: 0; padding: 0; }
.card-interactive { transition: border-color 0.15s ease, background 0.15s ease; }
.card-interactive:hover { border-color: var(--muted); background: var(--surface-2); }

/* ── feature ── */
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.feature-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--accent); margin-bottom: var(--gap-md);
}
.feature-mark svg { width: 18px; height: 18px; }

/* ── pill / tag ── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.05em; white-space: nowrap;
}
.tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; white-space: nowrap;
}
.pill-danger { background: var(--danger-soft); color: var(--danger); }

/* ── form ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; min-height: 42px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--fg);
  font: inherit; font-size: 14.5px;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ── segmented tabs ── */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg button {
  padding: 9px 18px; min-height: 40px; background: transparent; border: 0;
  color: var(--muted); font-size: 14px; border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--fg); background: var(--fg-soft); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 600; }

/* ── table ── */
.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th, .ds-table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ds-table th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.ds-table tbody tr:hover { background: var(--fg-soft); }
.ds-table .num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── calculator bits ── */
.threshold-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px; }
.threshold-num { font-family: var(--font-mono); font-size: clamp(40px, 5vw, 60px); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.gauge { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.gauge-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.gauge-bar.over { background: var(--danger); }
.slot-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.item-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; text-align: left; width: 100%;
}
.item-chip:hover { border-color: var(--accent); }
.item-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.item-chip .chip-name { font-size: 13.5px; font-weight: 500; }
.item-chip .chip-vals { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
#calc-price-table .input { max-width: 140px; text-align: right; }

/* ── code block (改枪码) ── */
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in oklch, var(--bg) 60%, var(--surface));
}
.code-box code { font-family: var(--font-mono); font-size: 14.5px; letter-spacing: 0.06em; word-break: break-all; color: var(--fg); }
.build-card { display: flex; flex-direction: column; gap: 12px; }
.build-card .build-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.build-card .build-desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.build-card .build-src { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ── tier list ── */
.tier-band { display: grid; grid-template-columns: 88px 1fr; gap: var(--gap-md); padding-block: var(--gap-md); border-top: 1px solid var(--border); }
.tier-badge {
  font-family: var(--font-mono); font-weight: 700; font-size: 26px;
  display: grid; place-items: center; height: 56px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.tier-badge.t0 { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in oklch, var(--accent) 45%, transparent); }
.gun-row { padding: 12px 0; border-top: 1px dashed var(--border); }
.gun-row:first-child { border-top: 0; }
.gun-row .gun-note { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.gun-row .gun-src { font-family: var(--font-mono); font-size: 11px; color: var(--muted); opacity: 0.8; }
@media (max-width: 640px) { .tier-band { grid-template-columns: 1fr; } }

/* ── notice ── */
.notice {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px; color: var(--muted); font-size: 13.5px;
}
.notice strong { color: var(--fg); }
.notice .meta { display: block; margin-top: 6px; }

/* ── log row（首页数据说明） ── */
.log-row { display: grid; grid-template-columns: 90px 1fr 110px; gap: var(--gap-lg); padding: 22px 0; border-top: 1px solid var(--border); align-items: baseline; }
.log-row .meta { color: var(--muted); }
.log-row h3 { font-size: 18px; }
.log-row .pull { text-align: right; }
@media (max-width: 720px) {
  .log-row { grid-template-columns: 1fr; gap: 6px; }
  .log-row .pull { text-align: left; }
}

/* ── API 状态条 / 实时方案 / 属性条 ── */
.api-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-md); }
@media (max-width: 920px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { display: flex; flex-direction: column; gap: 14px; }
.plan-items { list-style: none; margin: 0; padding: 0; }
.plan-items li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px dashed var(--border); font-size: 13px;
}
.plan-items li:first-child { border-top: 0; }
.plan-item-name { font-weight: 500; }
.plan-items .tag { font-size: 10.5px; padding: 2px 7px; }
.prop-row { display: flex; flex-wrap: wrap; gap: 6px; }
.prop-chip {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--muted); white-space: nowrap;
}
.prop-chip.prop-up { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.prop-chip.prop-down { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 40%, transparent); }

/* ── hero ── */
.hero { padding-block: clamp(64px, 9vw, 120px); }
.hero-center { text-align: center; max-width: 46ch; margin-inline: auto; }
.hero .lead { margin: var(--gap-md) auto var(--gap-lg); }
.hero-cta { display: inline-flex; gap: var(--gap-sm); flex-wrap: wrap; justify-content: center; }
.gridline {
  background-image: linear-gradient(var(--fg-soft) 1px, transparent 1px), linear-gradient(90deg, var(--fg-soft) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ── 行情页 ── */
.pwd-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pwd-code { font-size: clamp(36px, 4vw, 48px); font-weight: 700; letter-spacing: 0.14em; line-height: 1.1; }
.thumb-cell { display: inline-flex; align-items: center; gap: 10px; }
.item-thumb {
  width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
}
.scroll-y { max-height: 520px; overflow-y: auto; }
.grade-pick { min-width: 110px; }
