:root {
  --bg: #121110;
  --panel: #1B1917;
  --panel-2: #24211E;
  --line: rgba(245, 240, 232, 0.11);
  --line-gold: rgba(214, 178, 110, 0.36);
  --ink: #F5F1E9;
  --ink-2: #BEB6AA;
  --ink-3: #8B8378;
  --gold: #D6B26E;
  --red: #E5484D;
  --red-bright: #FF5B5F;
  --red-bg: rgba(229, 72, 77, 0.14);
  --green: #2EB87B;
  --green-bg: rgba(46, 184, 123, 0.14);
  --amber: #E5A032;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --radius-lg: 18px;
  --radius-md: 12px;
}

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

html {
  color-scheme: dark;
  background: var(--bg);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button, input {
  font-family: inherit;
  color-scheme: dark;
}

[hidden] { display: none !important; }

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 132px;
}

/* 顶部隐私遥测与录屏控制条 */
.telemetry-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
}

.telemetry-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #DDF7EA;
  background: rgba(46, 184, 123, 0.14);
  border: 1px solid rgba(46, 184, 123, 0.34);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.telemetry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.demo-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-gold);
  background: rgba(214, 178, 110, 0.14);
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-btn.playing {
  border-color: rgba(229, 72, 77, 0.65);
  background: var(--red-bg);
  color: #FF8C90;
}

.demo-btn.ghost {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
}

/* 主网格：桌面左右仪表+闸门，手机竖屏单列 */
.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  align-items: start;
}

/* 左侧核心熔断仪表盘 */
.gauge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.gauge-card.state-danger {
  border-color: rgba(229, 72, 77, 0.55);
  background: linear-gradient(180deg, rgba(229, 72, 77, 0.11) 0%, var(--panel) 46%);
}

.gauge-card.state-safe {
  border-color: rgba(46, 184, 123, 0.45);
  background: linear-gradient(180deg, rgba(46, 184, 123, 0.08) 0%, var(--panel) 44%);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.app-label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 700;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.state-badge.danger {
  background: var(--red-bg);
  color: #FF8C90;
  border-color: rgba(229, 72, 77, 0.48);
}

.state-badge.safe {
  background: var(--green-bg);
  color: #6BE3AC;
  border-color: rgba(46, 184, 123, 0.45);
}

.state-badge.warn {
  background: rgba(229, 160, 50, 0.16);
  color: #F4C46B;
  border-color: rgba(229, 160, 50, 0.42);
}

.scope-switch, .sheet-mode-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.scope-tab {
  min-height: 34px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.scope-tab.active {
  background: rgba(214, 178, 110, 0.18);
  color: var(--gold);
}

/* SVG 表盘与下方读数屏严格物理分离（杜绝负 margin 穿线重叠） */
.dial-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 4px;
}

.dial-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}

.dial-center-readout {
  margin-top: 6px;
  width: 100%;
  text-align: center;
}

.quote-compare-line {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.quote-compare-line s {
  color: var(--ink-3);
  margin-right: 6px;
}

.landing-price {
  font-size: clamp(36px, 7.5vw, 46px);
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  color: var(--ink);
  transition: color 0.2s ease;
}

.landing-price.danger { color: var(--red-bright); }
.landing-price.safe { color: #5CE0A4; }

.spike-banner {
  margin-top: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.spike-banner.danger {
  background: var(--red-bg);
  border-color: rgba(229, 72, 77, 0.48);
  color: #FFD1D2;
}

.spike-banner.safe {
  background: var(--green-bg);
  border-color: rgba(46, 184, 123, 0.38);
  color: #DDF7EA;
}

.spike-banner strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--red-bright);
  white-space: nowrap;
  flex-shrink: 0;
}

.spike-banner.safe strong { color: #5CE0A4; }

/* 总预算与 10% 机动金硬锁 */
.budget-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.budget-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.budget-head label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.num-input-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line-gold);
  border-radius: 9px;
  padding: 0 10px;
  min-height: 40px;
  flex-shrink: 0;
}

.num-input-wrap span {
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  margin-right: 4px;
}

.num-input {
  width: 98px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  outline: none;
  text-align: right;
  color-scheme: dark;
}

.reserve-bar-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  margin-bottom: 10px;
}

.bar-seg-base { background: var(--gold); transition: width 0.25s ease; }
.bar-seg-trap { background: var(--red-bright); transition: width 0.25s ease; }
.bar-seg-reserve { background: rgba(46, 184, 123, 0.35); margin-left: auto; }

.budget-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.kpi-mini {
  background: rgba(18, 17, 16, 0.58);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  min-width: 0;
}

.kpi-mini .k { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-mini .v { font-size: 13.5px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.kpi-mini .v.red { color: var(--red-bright); }
.kpi-mini .v.gold { color: var(--gold); }
.kpi-mini .v.green { color: #5CE0A4; }

/* 全 4 品类总盘汇总条 */
.all-cat-bar {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--green-bg);
  border: 1px solid rgba(46, 184, 123, 0.42);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #DDF7EA;
  font-variant-numeric: tabular-nums;
}

.all-cat-total {
  font-size: 15px;
  font-weight: 900;
  color: #FFFFFF;
}

/* 状态机 4 节点指示条 */
.state-machine {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.sm-step {
  padding: 7px 4px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-step.active-warn {
  border-color: rgba(229, 72, 77, 0.58);
  background: var(--red-bg);
  color: #FF8C90;
}

.sm-step.active-ok {
  border-color: rgba(46, 184, 123, 0.58);
  background: var(--green-bg);
  color: #6BE3AC;
}

.sm-step.active-neutral {
  border-color: var(--line-gold);
  background: rgba(214, 178, 110, 0.14);
  color: var(--gold);
}

/* 右侧操作区 */
.work-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.panel-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sub {
  font-size: 12px;
  color: var(--ink-3);
}

/* 4 品类闸门开关 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.cat-btn {
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cat-btn.active {
  border-color: var(--gold);
  background: rgba(214, 178, 110, 0.12);
  color: var(--ink);
}

.cat-btn .cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  gap: 4px;
}

.cat-btn .cat-meta {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-free {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--green-bg);
  color: #6BE3AC;
  font-weight: 700;
  white-space: nowrap;
}

.tag-lock {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* 纸面报价输入条 */
.quote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.quote-copy { min-width: 0; flex: 1 1 200px; }
.quote-row label { font-size: 13px; font-weight: 700; color: var(--ink); display: block; }
.quote-row small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* 暗坑空气开关列表 */
.trap-list { display: grid; gap: 10px; }

.trap-switch {
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

.trap-switch[aria-pressed="true"] {
  border-color: rgba(229, 72, 77, 0.55);
  background: rgba(229, 72, 77, 0.10);
}

.trap-switch.demo-flash {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(214, 178, 110, 0.35);
}

.trap-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.breaker-pill {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.breaker-pill::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.trap-switch[aria-pressed="true"] .breaker-pill {
  background: rgba(229, 72, 77, 0.32);
  border-color: var(--red-bright);
}

.trap-switch[aria-pressed="true"] .breaker-pill::after {
  transform: translateX(18px);
  background: var(--red-bright);
}

.trap-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.trap-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.trap-cost {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--ink-3);
}

.trap-switch[aria-pressed="true"] .trap-cost { color: var(--red-bright); }

/* 必补合同条款与尾款锁 */
.clause-list { display: grid; gap: 8px; }

.clause-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}

.clause-item.checked {
  border-color: rgba(46, 184, 123, 0.44);
  background: rgba(46, 184, 123, 0.08);
}

.clause-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: transparent;
}

.clause-item.checked .clause-box {
  background: var(--green);
  border-color: var(--green);
  color: #0E1914;
}

.clause-text { font-size: 13px; color: var(--ink); }
.clause-item.checked .clause-text { color: var(--ink-2); }

.retain-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(214, 178, 110, 0.09);
  border: 1px solid var(--line-gold);
  display: grid;
  gap: 10px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.retain-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.retain-box strong { color: var(--gold); }

.inspector-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(214, 178, 110, 0.25);
}

.inspector-row label { font-size: 12px; color: var(--ink-2); font-weight: 700; }

.text-input {
  min-height: 36px;
  width: 190px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  color-scheme: dark;
}

.gate-footer-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-accept {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(46, 184, 123, 0.45);
  background: var(--green-bg);
  color: #6BE3AC;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-accept.accepted {
  background: var(--green);
  color: #0E1914;
  border-color: var(--green);
}

.btn-accept:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--ink-3);
}

.backup-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

.link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* 底部悬浮操控胶囊（z-index: 40，高于 Toast 30，低于弹窗 100） */
.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  background: rgba(27, 25, 23, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 241, 233, 0.16);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  z-index: 40;
}

.dock-summary { min-width: 0; font-variant-numeric: tabular-nums; }
.dock-summary .d-k { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-summary .d-v { font-size: 16px; font-weight: 900; color: var(--red-bright); white-space: nowrap; }
.dock-summary .d-v.safe { color: #5CE0A4; }

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

.btn-primary, .btn-secondary {
  min-height: 44px;
  border-radius: 11px;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary {
  padding: 0 16px;
  border: none;
  background: var(--gold);
  color: #161412;
  font-weight: 800;
}

.btn-secondary {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 700;
}

/* 弹窗通用层（z-index: 100，严格高于 Toast 30 与 Bottom Dock 40） */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.76);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-gold);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  min-width: 0;
  line-height: 1.35;
}

.close-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 验收一页单预览卡 */
.sheet-preview {
  background: #FFFDF9;
  color: #1A1917;
  border-radius: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}

.sheet-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 20px;
  font-weight: 800;
  color: rgba(200, 40, 41, 0.12);
  transform: rotate(-20deg);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 12px;
}

.sheet-preview.unlocked .sheet-watermark { display: none; }

.sheet-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #E5DFD5;
  padding-bottom: 8px;
}

.sheet-brand-title { font-size: 15px; font-weight: 900; }
.sheet-brand-sub { font-size: 11px; color: #6B655E; margin-top: 2px; }

.sheet-state-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  background: #FEE2E2;
  color: #B91C1C;
  white-space: nowrap;
  flex-shrink: 0;
}

.sheet-state-tag.safe {
  background: #DCFCE7;
  color: #15803D;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.sheet-cell { background: #F4F1EA; padding: 9px 10px; border-radius: 8px; }
.sheet-cell .k { font-size: 11px; color: #6B655E; }
.sheet-cell .v { font-size: 15px; font-weight: 800; margin-top: 2px; }
.sheet-cell .v.red { color: #C82829; }
.sheet-cell .v.gold { color: #8A6320; }

.sheet-clause-title { font-size: 12px; font-weight: 800; margin-top: 6px; }

.sheet-clauses {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #2B2825;
  display: grid;
  gap: 5px;
}

.sheet-sign-row {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #D6CFC4;
  font-size: 11px;
  color: #6B655E;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 解锁弹窗：小红书个人售卖买断卡 */
.pay-card {
  background: var(--panel-2);
  border: 1px solid var(--line-gold);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.price-badge-box {
  background: var(--bg);
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.price-meta-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.price-channel {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}

.price-big {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-once {
  font-size: 10.5px;
  color: #6BE3AC;
  background: var(--green-bg);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}

.pay-guide-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}

.pay-benefits ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: grid;
  gap: 4px;
}

.shop-steps {
  margin: 0 0 14px;
  padding: 10px 12px 10px 28px;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  display: grid;
  gap: 4px;
}

.unlock-label {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 700;
  display: block;
}

.unlock-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.code-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-gold);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color-scheme: dark;
}

.unlock-feedback {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.unlock-feedback.error { color: #FF8C90; }
.unlock-feedback.ok { color: #6BE3AC; }

/* 轻量 Toast：z-index 严格设为 30（低于底部条 40 与弹窗 100） */
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  max-width: calc(100% - 28px);
  background: #24211E;
  border: 1px solid var(--line-gold);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast button {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { padding: 12px 12px 168px; }
  .telemetry-bar { padding: 10px 12px; }
  .telemetry-actions { width: 100%; display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-machine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-card { grid-template-columns: 1fr; }
  .price-badge-box { flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 14px; text-align: left; }
  .price-meta-col { align-items: flex-start; }
  .unlock-row { flex-direction: column; }
  .unlock-row .btn-primary { width: 100%; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary { width: 100%; min-height: 46px; }
  .gate-footer-bar { flex-direction: column; align-items: stretch; }
  .btn-accept { width: 100%; }
  .backup-inline { justify-content: center; }

  /* 移动端底部操控条单列全宽充裕留白，零挤压 */
  .bottom-dock {
    width: calc(100% - 20px);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .dock-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .dock-btns {
    display: grid;
    grid-template-columns: 1fr 1.55fr;
    gap: 8px;
    width: 100%;
  }
  .dock-btns .btn-primary,
  .dock-btns .btn-secondary {
    width: 100%;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
