/* ─────────────────────────────────────────────────────────────────
   strategy.css · 全站唯一样式表
   统一排版 · 左深侧栏 · 右浅内容 · 响应式 · 打印优化
   ───────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════
   📐 1. 设计变量（统一复用源）
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Layout & structural colors */
  --bg-sidebar: #0f172a;    --text-sidebar: #94a3b8;
  --bg-content: #f8fafc;   --text-main: #0f172a;    --text-sec: #475569;
  --c-danger:  #dc2626;    --c-info: #2563eb;       --c-border: #e2e8f0;

  /* Semantic palette (used by components & inline refs) */
  --gold:         #c9a84c;
  --gold-dim:     rgba(201, 168, 76, 0.08);
  --gold-light:   #fdf6e3;
  --blue:         #2563eb;
  --green:        #16a34a;
  --orange:       #ea580c;
  --red:          #dc2626;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Typography */
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Dimensions */
  --nav-w: 260px;
  --content-max: 840px;
  --radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   🌍 2. 基础重置与排版
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--text-main);
  background: var(--bg-content);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  margin: 2.5rem 0 1rem;
  line-height: 1.35;
  font-weight: 600;
  scroll-margin-top: 1.5rem;
  color: var(--text-main);
}
h1 { font-size: 1.9rem; border-bottom: 2px solid var(--c-border); padding-bottom: 0.5rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; color: var(--text-sec); }
p  { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.5rem; padding-left: 0.5rem; }
code, pre, .formula {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
pre { padding: 1rem; overflow-x: auto; }

/* ═══════════════════════════════════════════════════════════════
   📐 3. 布局架构（左深侧栏 + 右浅内容）
   ═══════════════════════════════════════════════════════════════ */
.layout-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  overflow-y: auto;
  padding: 1.5rem;
  z-index: 100;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Legacy brand block (other pages) */
.sidebar-brand {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #1e293b;
}
.sidebar-brand a {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e2e8f0 !important;
  text-decoration: none;
}

/* Logo block (meta.html style) */
.sidebar-logo {
  padding-bottom: 1.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #1e293b;
}
.logo-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.25);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 0.6rem;
}
.logo-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #e2e8f0;
  margin-bottom: 0.3rem;
}
.logo-ver {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Section labels & nav items */
.sidebar-section,
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  margin: 1.25rem 0 0.4rem;
  padding: 0 0.25rem;
}
.sidebar a,
.nav-item {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--text-sidebar);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .2s, border-left-color .2s, background .2s;
  font-size: 0.88rem;
  line-height: 1.5;
}
.nav-item.sub {
  padding-left: 1.5rem;
  font-size: 0.8rem;
  color: #64748b;
}
.sidebar a:hover,
.sidebar a.active,
.nav-item:hover,
.nav-item.active {
  color: #fff;
  border-left-color: var(--gold);
  background: var(--gold-dim);
}

.main-content {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  max-width: calc(var(--content-max) + var(--nav-w));
  padding: 2.5rem 3rem;
}

/* Homepage: no sidebar, full width */
body.no-sidebar .main-content {
  margin-left: 0;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   🔗 4. 基础语义组件
   ═══════════════════════════════════════════════════════════════ */
a:not(.sidebar a):not(.nav-item) {
  color: var(--c-info);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: all .2s;
}
a:not(.sidebar a):not(.nav-item):hover { border-bottom-color: currentColor; }

.alert, blockquote {
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--c-info);
  background: #eff6ff;
  border-radius: 0 6px 6px 0;
  color: #1e3a8a;
}
.alert.danger, blockquote.danger {
  border-left-color: var(--c-danger);
  background: #fef2f2;
  color: #7f1d1d;
}

/* ═══════════════════════════════════════════════════════════════
   📊 5. 表格响应式
   ═══════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}
th { background: #f8fafc; font-weight: 600; white-space: nowrap; }
tr:nth-child(even) { background: #fafafa; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════
   💡 6. 术语提示（Hover tooltip）
   ═══════════════════════════════════════════════════════════════ */
.term {
  border-bottom: 1px dotted var(--c-info);
  cursor: help;
  position: relative;
}
.term:hover::after,
.term:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%; left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   🦸 7. Hero 区块
   ═══════════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  padding: 3rem 3rem 2.5rem;
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
}
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  border: none;
  padding: 0;
  margin: 0 0 1rem;
  line-height: 1.25;
}
.hero-sub {
  font-size: 0.98rem;
  line-height: 1.8;
  color: #94a3b8;
  max-width: 600px;
  margin-bottom: 1.75rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hero-meta-item .label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.hero-meta-item .value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════
   📑 8. Section 块
   ═══════════════════════════════════════════════════════════════ */
.section {
  margin-bottom: 3.5rem;
  padding-top: 0.5rem;
}
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--c-border);
}
.section-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--text-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════════════════════
   📢 9. Callout 提示框
   ═══════════════════════════════════════════════════════════════ */
.callout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--c-info);
  background: #eff6ff;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.94rem;
  line-height: 1.7;
}
.callout-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: inherit;
  opacity: 0.8;
}
.callout.gold {
  border-left-color: var(--gold);
  background: var(--gold-dim);
  color: #78560a;
}
.callout.info {
  border-left-color: var(--blue);
  background: #eff6ff;
  color: #1e3a8a;
}
.callout.danger {
  border-left-color: var(--red);
  background: #fef2f2;
  color: #7f1d1d;
}
.callout.warning {
  border-left-color: var(--orange);
  background: #fff7ed;
  color: #7c2d12;
}

/* ═══════════════════════════════════════════════════════════════
   🃏 10. Card & Card Grid
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.card h4 { margin-top: 0; margin-bottom: 0.6rem; font-size: 1rem; color: var(--text-primary); }
.card p:last-child { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   📊 11. Stat Card
   ═══════════════════════════════════════════════════════════════ */
.stat-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}
.stat-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   📦 12. Tier Cards（资金分层）
   ═══════════════════════════════════════════════════════════════ */
.tier-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-border);
  border-radius: var(--radius);
  margin: 1.25rem 0;
  overflow: hidden;
}
.tier-card.tier-1 { border-left-color: var(--green); }
.tier-card.tier-2 { border-left-color: var(--blue); }
.tier-card.tier-3 { border-left-color: var(--gold); }

.tier-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--c-border);
}
.tier-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.tier-header-info { flex: 1; }
.tier-range {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.tier-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.tier-body { padding: 1.25rem 1.5rem; }

/* ═══════════════════════════════════════════════════════════════
   🔵 13. State Grid（市场状态矩阵）
   ═══════════════════════════════════════════════════════════════ */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.state-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  font-size: 0.88rem;
}
.state-card ul { margin: 0.5rem 0 0 1rem; padding: 0; font-size: 0.83rem; line-height: 1.7; }
.state-card.state-a { border-top-color: var(--green);  background: #f0fdf4; }
.state-card.state-b { border-top-color: var(--blue);   background: #eff6ff; }
.state-card.state-c { border-top-color: var(--orange); background: #fff7ed; }
.state-card.state-d { border-top-color: var(--red);    background: #fef2f2; }

.state-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  background: currentColor;
  color: #fff;
}
.state-card.state-a .state-badge { background: var(--green); }
.state-card.state-b .state-badge { background: var(--blue); }
.state-card.state-c .state-badge { background: var(--orange); }
.state-card.state-d .state-badge { background: var(--red); }

.state-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   📊 14. Allocation Bar（资金分配进度条）
   ═══════════════════════════════════════════════════════════════ */
.alloc-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem 0 1rem;
}
.alloc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.alloc-label {
  flex: 0 0 160px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alloc-bar-bg {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.alloc-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.alloc-pct {
  flex: 0 0 44px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   🔢 15. Flow Steps（开仓执行流程）
   ═══════════════════════════════════════════════════════════════ */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.25rem 0;
  position: relative;
}
.flow-steps::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--c-border);
  z-index: 0;
}
.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
  z-index: 1;
}
.flow-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  background: var(--text-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  padding: 0 6px;
}
.flow-step-body {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.7;
}
.flow-step-body strong { display: block; margin-bottom: 0.25rem; color: var(--text-primary); }
.flow-step-body span { color: var(--text-secondary); font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════
   📋 16. SOP Steps（月度操作 SOP）
   ═══════════════════════════════════════════════════════════════ */
.sop-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.sop-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.sop-step-icon {
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1;
  padding-top: 2px;
}
.sop-step-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.75;
}
.sop-step-content strong { display: block; margin-bottom: 0.3rem; color: var(--text-primary); }
.sop-step-content p { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }

.time-badge {
  display: inline-block;
  background: var(--text-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 0.4rem;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════
   🔴 17. Circuit Breaker Levels（三级熔断）
   ═══════════════════════════════════════════════════════════════ */
.circuit-level {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-border);
  border-radius: var(--radius);
  margin: 1.25rem 0;
  overflow: hidden;
}
.circuit-level.l1 { border-left-color: #eab308; }
.circuit-level.l2 { border-left-color: var(--orange); }
.circuit-level.l3 { border-left-color: var(--red); }

.circuit-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--c-border);
}
.circuit-header h4 { margin: 0; font-size: 1rem; color: var(--text-primary); }

.circuit-dot {
  flex-shrink: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: currentColor;
}
.circuit-level.l1 .circuit-dot { background: #eab308; }
.circuit-level.l2 .circuit-dot { background: var(--orange); }
.circuit-level.l3 .circuit-dot { background: var(--red); }

.circuit-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.trigger-list,
.action-list {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.75;
}
.trigger-list { border-right: 1px solid var(--c-border); }

.trigger-list .label,
.action-list .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.trigger-list li,
.action-list li {
  list-style: none;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.2rem;
  color: var(--text-secondary);
}
.trigger-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.action-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
}

/* ═══════════════════════════════════════════════════════════════
   🚫 18. Redlines（纪律红线）
   ═══════════════════════════════════════════════════════════════ */
.redlines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.redline-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}
.redline-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 2px;
}
.redline-text { flex: 1; color: var(--text-secondary); }
.redline-text strong { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   🏷 19. Badges（彩色标签）
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-gray   { background: #f1f5f9; color: #475569; border: 1px solid var(--c-border); }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

/* ═══════════════════════════════════════════════════════════════
   📝 20. Utility — Lists, Checklist, Formula, Comment, Misc
   ═══════════════════════════════════════════════════════════════ */

/* Styled bullet list */
.bullets {
  margin: 0.5rem 0 1rem 0;
  padding-left: 0;
  list-style: none;
}
.bullets li {
  padding: 0.25rem 0 0.25rem 1.25rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.bullets li::before {
  content: '·';
  position: absolute;
  left: 0.25rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Checklist */
.checklist {
  margin: 0.5rem 0 1rem 0;
  padding-left: 0;
  list-style: none;
}
.checklist li {
  padding: 0.3rem 0 0.3rem 1.75rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.checklist li::before {
  content: '☐';
  position: absolute;
  left: 0.25rem;
  color: var(--text-muted);
}
.checklist li.required::before {
  content: '★';
  color: var(--red);
}
.checklist li.required {
  color: var(--text-primary);
  font-weight: 500;
}

/* Formula / code box */
.formula-box {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.9;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  overflow-x: auto;
}
.formula-box .comment {
  color: #64748b;
  font-style: normal;
}

/* Inline comment (within formula-box) */
.comment {
  color: #64748b;
}

/* Divider */
hr.divider,
.divider {
  border: none;
  border-top: 2px solid var(--c-border);
  margin: 2.5rem 0;
}

/* Disclaimer block */
.disclaimer {
  background: #f8fafc;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-top: 2.5rem;
}
.disclaimer strong { color: var(--text-secondary); }

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

/* Log field tag */
.log-field {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--c-border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: 4px;
}

/* Utility text colors */
.text-red { color: var(--red); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   📱 21. 移动端断点
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0 !important; padding: 1.5rem 1rem; max-width: 100%; }

  .hero { padding: 1.75rem 1.25rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-meta { gap: 0.75rem 1.25rem; }

  .card-grid-3 { grid-template-columns: 1fr; }
  .card-grid   { grid-template-columns: 1fr; }
  .two-col     { grid-template-columns: 1fr; }
  .state-grid  { grid-template-columns: 1fr 1fr; }
  .circuit-body { grid-template-columns: 1fr; }
  .trigger-list { border-right: none; border-bottom: 1px solid var(--c-border); }

  .alloc-label { flex: 0 0 120px; }

  .term:hover::after,
  .term:focus::after {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw; max-width: 90vw;
  }
}

@media (max-width: 480px) {
  .state-grid { grid-template-columns: 1fr; }
  .flow-steps::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   🖨️ 22. 打印适配
   ═══════════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; max-width: 100% !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  a { text-decoration: none; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  table, tr, td, th, .alert, .callout { page-break-inside: avoid; }
  h1, h2, h3, .section-header { page-break-after: avoid; }
  .hero { background: #f8fafc !important; color: #000 !important; }
  .formula-box { background: #f1f5f9 !important; color: #000 !important; }
}
