/* ============================================================
   concept_board.css —— 图解统计独有样式
   公共部分见 marketing.css
   ============================================================ */
/* cta-main / cta-sub / to-assistant 过渡增强已移至 marketing.css 公共层，供各营销页共用 */

/* ============ 目录分组折叠 ============ */
.toc .sub { padding-left: 22px; font-size: 13px; color: var(--muted); }
.toc .sub a { padding: 3px 10px; }
/* 分组：当前方法展开显示子项，其余收起 */
.toc-group { margin-bottom: 1px; }
.toc-parent { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.toc-parent .caret { font-size: 10px; color: var(--muted); transition: transform .2s; display: inline-block; }
.toc-group.open .toc-parent .caret { transform: rotate(90deg); }
.toc-children { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.toc-group.open .toc-children { max-height: 200px; }

/* ============ 正文独有：首页导语 ============ */
.intro { padding: 8px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.intro h2 { font-size: 28px; margin-bottom: 14px; }
.intro p { color: var(--ink-soft); }

/* ============ KaTeX 公式微调 ============ */
/* KaTeX 在 .formula / .cs-math 容器内的样式微调：
   - .formula 原本 white-space:pre，KaTeX 渲染出的 span 结构不需要 pre，取消之；
   - 行内公式与正文基线对齐；
   - 块级公式（display）居左而非居中，与原「等宽多行公式」阅读习惯一致；
   - 移动端横向溢出交给外层 overflow-x:auto。 */
.formula:has(.katex) { white-space: normal; }
.formula .katex-display { margin: .35em 0; text-align: left; }
.formula .katex-display > .katex { text-align: left; }
.formula .katex, .cs-math .katex { font-size: 1.05em; }
.cs-math:has(.katex-display) { white-space: normal; }
.cs-math .katex-display { margin: .25em 0; text-align: left; }
.cs-math .katex-display > .katex { text-align: left; }
/* 折叠面板打开时 max-height 是硬上限，公式撑起来后可能被裁——放宽 */
.math-panel.open .math-body { max-height: 12000px; }
/* 公式多行块：左侧术语标签（可点弹层），右侧 LaTeX 公式；
   替代原来靠 white-space:pre 手对齐的等宽文本块 */
.formula-rows { display: block; white-space: normal; font-family: inherit; }
.formula-rows .fr {
  display: grid; grid-template-columns: 92px 1fr;
  align-items: baseline; gap: 12px; padding: 4px 0;
}
.formula-rows .fr + .fr { border-top: 1px dashed rgba(79,70,229,.15); }
.formula-rows .fr-label {
  color: var(--accent); font-weight: 700; font-size: 13.5px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.formula-rows .fr-expr { color: var(--ink); overflow-x: auto; }
.formula-rows .fr-note { color: var(--muted); font-size: 13px; margin-left: 6px; }
@media (max-width: 640px) {
  .formula-rows .fr { grid-template-columns: 72px 1fr; gap: 8px; }
}

/* ============ 交互演示卡独有：操作按钮 / 画布 / 读数 / 徽章 ============ */
.fill-btn {
  flex-shrink: 0; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--d-line); background: var(--d-canvas);
  color: var(--d-muted); font-size: 13px; cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.fill-btn:hover { color: var(--d-text); border-color: var(--d-primary); }
.board { display: flex; flex-direction: column; }
.board-body { display: flex; flex-direction: column; gap: 14px; }
.graph { height: 420px; }
.side {
  width: 100%;
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px;
}
.side > .readout, .side > .controls { flex: 1 1 280px; }
.readout {
  background: var(--d-canvas); border: 1px solid var(--d-line);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.readout .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--d-muted); }
.readout .row b { color: var(--d-text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.readout .big { font-size: 28px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.readout .big .unit { font-size: 14px; color: var(--d-muted); font-weight: 400; margin-left: 6px; }
.readout .hint { font-size: 13px; color: var(--d-muted); line-height: 1.55; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  align-self: flex-start;
}
.badge.ok   { background: rgba(34,197,94,.14);  color: var(--d-success); border: 1px solid rgba(34,197,94,.45); }
.badge.no   { background: rgba(148,163,184,.1); color: var(--d-muted);   border: 1px solid rgba(148,163,184,.3); }
.badge.pur  { background: rgba(168,85,247,.14); color: var(--d-accent);  border: 1px solid rgba(168,85,247,.45); }
.badge.warn { background: rgba(245,158,11,.14); color: var(--d-warn);    border: 1px solid rgba(245,158,11,.45); }
.badge.red  { background: rgba(239,68,68,.14); color: #f87171;        border: 1px solid rgba(239,68,68,.45); }
.badge.blue { background: rgba(59,130,246,.14); color: #60a5fa;        border: 1px solid rgba(59,130,246,.45); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.controls {
  background: var(--d-canvas); border: 1px solid var(--d-line);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.slider-row { display: grid; grid-template-columns: 60px 1fr 52px; align-items: center; gap: 10px; }
.slider-row label { font-size: 15px; font-weight: 600; color: var(--d-text); }
.slider-row .slider-val { font-size: 13px; color: var(--d-muted); text-align: right; font-variant-numeric: tabular-nums; }
.ctrl-note { font-size: 12.5px; color: var(--d-muted); line-height: 1.6; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--d-line); }
.ctrl-note b { color: var(--d-text); font-weight: 700; }
.ctrl-note u { color: var(--d-warn); text-decoration: none; }
.model-strip {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--d-canvas); border: 1px solid var(--d-line);
  border-left: 3px solid var(--d-accent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}
.model-strip .ms-eq {
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 15px; color: var(--d-text); white-space: nowrap; overflow-x: auto;
}
.model-strip .ms-hl { color: var(--d-accent); }
.model-strip .ms-note { font-size: 12.5px; color: var(--d-muted); line-height: 1.6; }
.model-strip .ms-note b { color: var(--d-text); font-weight: 700; }
.demo-cap { font-size: 12.5px; color: var(--d-muted); line-height: 1.6; margin: 0 2px 10px; }
.demo-cap b { color: var(--d-text); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; background: transparent; cursor: pointer; --fill: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--d-primary) var(--fill), var(--d-line) var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--d-primary); margin-top: -5px; transition: transform .2s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--d-line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--d-primary); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--d-primary); transition: transform .2s; }
input[type="range"]:active::-moz-range-thumb { transform: scale(1.2); }

/* ============ 模态（填入真实结果） ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(2,6,23,.7);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-mask.show { display: flex; }
.modal {
  width: 340px; background: #1e293b; border: 1px solid #334155;
  border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  color: #e2e8f0;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.modal-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.modal-fields .mf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-fields label { font-size: 14px; color: #94a3b8; }
.modal-fields input {
  width: 130px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid #334155; background: #0f172a; color: #e2e8f0;
  font-size: 14px; font-family: inherit; text-align: right;
}
.modal-fields input:focus { outline: none; border-color: #6366f1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button {
  padding: 8px 18px; border-radius: 8px; border: 1px solid #334155;
  background: #0f172a; color: #94a3b8; font-size: 14px; cursor: pointer; transition: all .2s;
}
.modal-actions button:hover { color: #e2e8f0; }
.modal-actions button.primary { background: #6366f1; border-color: #6366f1; color: #fff; }
.modal-actions button.primary:hover { filter: brightness(1.1); }

/* ============ 动画独有 ============ */
@keyframes glowPurple { 0%,100% { filter: drop-shadow(0 0 0 rgba(168,85,247,0)); } 50% { filter: drop-shadow(0 0 10px rgba(168,85,247,.9)); } }
.glow-purple { animation: glowPurple 1.1s ease-in-out infinite; }

/* ============ 窄屏独有 ============ */
@media (max-width: 860px) {
  .graph { height: 300px; }
  .side > .readout, .side > .controls { flex: 1 1 100%; }
}

/* ── 报告出图示例：真实数据截图栅格 ── */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 14px 0 8px;
  align-items: start;   /* 卡片按内容高度，扁图列不再被最高图拉出空白 */
}
.shot-grid figure {
  margin: 0;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(31, 78, 121, 0.08);
}
.shot-grid img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}
.shot-grid figcaption {
  padding: 7px 10px;
  font-size: 12px;
  color: #4a5a6a;
  border-top: 1px solid #eef2f6;
  background: #f7fafc;
}
.shot-note {
  font-size: 12px;
  color: #8a97a5;
  margin: 2px 0 6px;
}
/* ── AI 助手出图署名：每张截图角标 + shot-note 跳主页 CTA ── */
.shot-grid figcaption::before {
  content: "AI 助手出图";
  display: inline-block;
  padding: 1px 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: var(--d-accent, #a855f7);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: 1px;
}
.shot-note .shot-cta {
  color: var(--d-accent, #a855f7);
  font-weight: 600;
  white-space: nowrap;
}
.shot-note .shot-cta:hover { text-decoration: underline; }

/* ── 示例图放大查看（lightbox）── */
.shot-grid img { cursor: zoom-in; }
.shot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 25, 35, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  cursor: zoom-out;
}
.shot-lightbox[hidden] { display: none; }
.shot-lightbox figure {
  margin: 0;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: default;
}
.shot-lightbox img {
  max-width: 94vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.shot-lightbox figcaption {
  padding: 9px 14px;
  font-size: 13px;
  color: #33414e;
  background: #f7fafc;
  border-top: 1px solid #eef2f6;
}
.shot-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1f4e79;
  font-size: 18px;
  cursor: pointer;
}
.shot-lightbox-close:hover { background: #fff; }

/* ── 真实分析产物载入：来源注 + 剖面 z 表 ── */
.real-btn { background: #27ae60; border-color: #27ae60; }
.real-btn:hover { background: #2ecc71; }
.real-note {
  margin: 10px 0 4px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #1e5631;
  background: #eefaf1;
  border: 1px solid #bfe6cc;
  border-radius: 8px;
}
.real-ztable {
  border-collapse: collapse;
  margin-top: 6px;
  width: 100%;
  font-size: 12px;
}
.real-ztable th, .real-ztable td {
  border: 1px solid #cfe3d6;
  padding: 4px 8px;
  text-align: center;
}
.real-ztable th { background: #f2faf5; color: #1e5631; }
