/* results.css — 结果区/方法论/澄清缺数据/trace弹层/模板/存档/空态/媒体查询/动画 */
  /* ---- 结果区（嵌入 assistant 气泡内）---- */
  .result-head { display: flex; align-items: baseline; gap: var(--gap-sm); margin: 0 0 var(--gap-xs); }
  .result-head h2 { font-family: var(--serif); font-size: clamp(18px, 2.4vw, 24px);
                 font-weight: 600; margin: 0; letter-spacing: -0.01em; }
  .badge { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
           text-transform: uppercase; color: var(--st-info); border: var(--bw-hair) solid var(--st-info);
           padding: 2px 8px; border-radius: var(--r-sm); white-space: nowrap; }

  .block { margin-top: var(--gap-md); }
  .block-title { display: flex; align-items: baseline; gap: var(--gap-sm);
                 font-family: var(--serif); font-size: 18px; font-weight: 600;
                 margin: 0 0 var(--gap-sm); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .block-title .no { font-family: var(--mono); font-size: 12px; color: var(--accent);
                 font-weight: 400; letter-spacing: 0.05em; }

  .tbl-scroll { overflow: auto; max-height: 420px; border-bottom: 1px solid var(--line); }
  .tbl-scroll table thead th { position: sticky; top: 0; background: var(--bg, #fff); z-index: 1; }
  .tbl-meta { font-size: 11px; color: var(--ink-faint); margin: 4px 2px 0; font-family: var(--mono); }
  table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
  th { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
       text-transform: uppercase; color: var(--ink-faint); text-align: right;
       padding: 6px 14px 8px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
  th:first-child { text-align: left; }
  td { padding: 7px 14px; border-bottom: 1px solid var(--line); text-align: right;
       font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
  td:first-child { text-align: left; font-family: var(--sans); color: var(--ink); }
  tbody tr { transition: background .18s var(--ease-out); }
  tbody tr:hover { background: var(--navy-wash); }
  td.neg { color: var(--down); } td.pos { color: var(--up); }
  tbody tr.is-anchor { background: var(--accent-wash); }
  tbody tr.is-anchor td:first-child { font-weight: 600; color: var(--accent); }
  tbody tr.is-total { border-top: 1.5px solid var(--ink); font-weight: 600; }
  tbody tr.is-total td:first-child { font-family: var(--mono); font-size: 11px;
       letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

  .note-label { font-family: var(--mono); font-size: var(--label-size); letter-spacing: var(--label-tracking);
       text-transform: uppercase; color: var(--ink-faint); margin: var(--gap-md) 0 var(--gap-xs); }
  .code { background: var(--ink); color: #e8e6df; padding: 14px 16px; border-radius: var(--r-sm);
          font: 12.5px/1.7 var(--mono); overflow-x: auto; white-space: pre; }
  /* 方法论：复用 .card.card--accent 容器，此处仅补充行高 */
  .method { font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); }
  .chart-card { background: var(--surface); border: var(--bw-hair) solid var(--line); border-radius: var(--r-md);
          height: 340px; padding: 10px 12px 6px; margin-bottom: var(--gap-md); }
  /* 澄清/缺数据：信号卡并入 AGENT 橙条结构 —— 去自带青/琥珀左条与卡片内距（need-data 同款一起） */
  .clarify-card { border-left: none; padding: 0; }
  .clarify-list { margin: 8px 0 6px; padding-left: 20px; }
  .clarify-list li { font-size: 14px; line-height: 1.9; color: var(--ink); }
  .clarify-understand { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft);
          background: var(--surface); border-radius: var(--r-sm);
          padding: 10px 14px; margin: 8px 0; white-space: pre-wrap; }
  .hint { font-size: 12px; color: var(--ink-faint); }

  /* 口径回显：容器用 .card.card--info，label/正文用 .card__label / .card__body */

  /* 审判：容器用 .card.card--{success|warn|danger|neutral}，此处仅 note/anomalies 子元素 */
  .judgment-card .note { font-size: 13.5px; line-height: 1.7; color: var(--ink); margin-bottom: 6px; }
  .judgment-card .anomalies { margin: 8px 0 0; padding-left: 18px; }
  .judgment-card .anomalies li { font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
  /* 可溯源单元格 */
  td.traceable { cursor: pointer; }
  td.traceable:hover { background: var(--accent-wash); box-shadow: inset 0 -2px 0 var(--accent); }
  #tracePop { position: fixed; z-index: 50; display: none; max-width: 460px;
       background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r-md);
       box-shadow: 0 10px 40px rgba(0,0,0,.22); padding: 0; font-family: var(--sans); }
  #tracePop .tp-head { display: flex; justify-content: space-between; align-items: baseline;
       gap: 12px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); }
  #tracePop .tp-title { font-weight: 600; font-size: 13px; color: var(--ink); }
  #tracePop .tp-val { font-family: var(--mono); font-size: 13px; color: var(--accent); }
  #tracePop .tp-close { cursor: pointer; color: var(--ink-faint); font-size: 16px;
       line-height: 1; border: none; background: none; padding: 0 2px; }
  #tracePop .tp-body { padding: 11px 14px 13px; }
  #tracePop .tp-row { margin-bottom: 9px; }
  #tracePop .tp-row:last-child { margin-bottom: 0; }
  #tracePop .tp-k { font-family: var(--mono); font-size: 10px; letter-spacing: .07em;
       text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 2px; }
  #tracePop .tp-formula { font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
       background: var(--bg); padding: 7px 9px; border-radius: var(--r-sm); white-space: pre-wrap; word-break: break-all; }
  #tracePop .tp-rows { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted);
       max-height: 120px; overflow-y: auto; line-height: 1.6; }
  #tracePop .tp-src { font-size: 12px; color: var(--ink); line-height: 1.7; }
  #tracePop .tp-src .f { font-family: var(--mono); color: var(--navy); }
  #tracePop .tp-loading { color: var(--text-muted); font-size: 12.5px; }
  #tracePop .tp-err { color: var(--down); font-size: 12.5px; }
  .tp-badge { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
       text-transform: uppercase; color: var(--accent); border: var(--bw-hair) solid var(--accent); border-radius: var(--r-sm);
       padding: 1px 6px; margin-left: 8px; vertical-align: middle; }

  /* 模板下拉（套用模板 ▾）*/
  .tpl-wrap { position: relative; display: inline-flex; align-items: center; }
  .tpl-sel { font-family: var(--sans); font-size: 13px; padding: 6px 8px;
             border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
             background: var(--surface); color: var(--text); cursor: pointer; }
  .tpl-sel:focus { outline: none; border-color: var(--navy); }
  .tpl-sel option { color: var(--text); }

  /* 模板管理 Modal */
  .tpl-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.38);
             z-index: 100; display: flex; align-items: center; justify-content: center; }
  .tpl-modal-backdrop.hidden { display: none; }
  .tpl-modal { background: var(--surface); border-radius: var(--r-md); border: 1.5px solid var(--line-strong);
             box-shadow: 0 16px 60px rgba(0,0,0,.28); width: min(740px, 96vw);
             max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
  .tpl-modal-head { display: flex; align-items: center; justify-content: space-between;
             padding: 14px 20px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
  .tpl-modal-title { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
  .tpl-modal-close { font-size: 20px; color: var(--ink-faint); cursor: pointer; border: none;
             background: none; line-height: 1; padding: 0 4px; }
  .tpl-modal-close:hover { color: var(--ink); }
  .tpl-modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
  .tpl-list-empty { font-size: 13.5px; color: var(--ink-faint); padding: 12px 0; }
  .tpl-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px;
             margin-bottom: 10px; background: var(--paper); }
  .tpl-row-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
  .tpl-row-name { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; }
  .tpl-row-kind { font-family: var(--mono); font-size: 10px; letter-spacing: .07em;
             text-transform: uppercase; color: var(--st-info); border: 1px solid var(--st-info);
             padding: 1px 6px; border-radius: var(--r-sm); }
  .tpl-row-del { font-family: var(--mono); font-size: 11.5px; color: var(--st-danger);
             border: 1px solid var(--st-danger); border-radius: var(--r-sm);
             padding: 2px 8px; cursor: pointer; background: none; flex-shrink: 0; }
  .tpl-row-del:hover { background: var(--st-danger-wash); }
  .tpl-schema { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
  .tpl-schema-box { background: var(--surface); border: 1px solid var(--line-strong);
             border-radius: var(--r-sm); padding: 8px 10px; }
  .tpl-schema-lbl { font-family: var(--mono); font-size: 9.5px; letter-spacing: .07em;
             text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
  .tpl-schema-cols { font-size: 12px; color: var(--ink-soft); line-height: 1.8; }
  .tpl-schema-caliber { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; font-style: italic; }
  .tpl-kw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .tpl-kw-chip { font-family: var(--mono); font-size: 10.5px; background: var(--navy-wash);
             border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 2px 8px;
             color: var(--navy); }

  /* 列对齐确认卡（template_map）*/
  .tmap-card .tmap-stat { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
  .tmap-card .tmap-stat b { font-family: var(--mono); }
  .tmap-card .tmap-items { margin-bottom: 12px; }
  .tmap-item { display: flex; align-items: center; gap: 8px; padding: 7px 0;
             border-bottom: 1px solid var(--line); }
  .tmap-item:last-child { border-bottom: none; }
  .tmap-item .tmap-check { accent-color: var(--navy); width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; }
  .tmap-item .tmap-tcol { font-family: var(--mono); font-size: 12.5px; color: var(--navy); min-width: 110px; }
  .tmap-item .tmap-arr { color: var(--ink-faint); flex-shrink: 0; }
  .tmap-item .tmap-ccol { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); flex: 1; }
  .tmap-item .tmap-conf { font-family: var(--mono); font-size: 11px; color: var(--up); flex-shrink: 0; }
  .tmap-item .tmap-conf.low { color: var(--st-warn); }
  .tmap-card .tmap-actions { display: flex; gap: var(--gap-sm); }

  /* 存模板 */
  .save-zone { margin-top: var(--gap-md); border-top: 1px solid var(--line); padding-top: var(--gap-md); }
  .save-zone .lead { font-family: var(--serif); font-style: italic; color: var(--text-muted);
          font-size: 14px; margin-bottom: var(--gap-sm); }
  .save-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--gap-sm); align-items: end; }
  .save-grid label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
          text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--gap-xs); }
  .save-grid input { padding: 9px 11px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
          background: var(--surface); font-family: var(--sans); font-size: 13.5px; width: 100%; }
  .save-grid input:focus { outline: none; border-color: var(--accent); }
  .save-status { font-size: 12.5px; font-family: var(--mono); margin-top: var(--gap-xs); }
  .save-status .ok { color: var(--up); } .save-status .err { color: var(--down); }
  .dl-row { margin-top: var(--gap-md); }
  a.dl { text-decoration: none; }

  /* ---- 数据体检折叠区 ---- */
  .health-card { margin-top: var(--gap-md); padding: 0; }
  .health-summary {
    display: flex; align-items: center; cursor: pointer;
    padding: 10px 14px; list-style: none; user-select: none;
    font-size: 13.5px; font-family: var(--sans); color: var(--ink);
    border-radius: var(--r-sm);
  }
  .health-summary::-webkit-details-marker { display: none; }
  .health-summary::before {
    content: '▶'; font-size: 10px; margin-right: 8px; color: var(--ink-faint);
    transition: transform .2s var(--ease-out);
  }
  details.health-card[open] .health-summary::before { transform: rotate(90deg); }
  .health-status--severe { color: var(--st-warn, #b7791f); }  /* 由红改琥珀黄：警示而非告警，配 ⚠️ */
  .health-status--warn   { color: var(--st-warn, #b7791f); }
  .health-status--ok     { color: var(--up, #276749); }

  .health-body { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
  .health-skipped { font-size: 13px; color: var(--ink-faint); }
  .health-ok { font-size: 13.5px; color: var(--up, #276749); }

  .health-section-label {
    font-family: var(--mono); font-size: 10px; letter-spacing: .07em;
    text-transform: uppercase; color: var(--ink-faint); margin: 10px 0 6px;
  }
  .health-findings { display: flex; flex-direction: column; gap: 10px; }
  .health-col-group { background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r-sm); padding: 8px 12px; }
  .health-col-name {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase; color: var(--navy);
    margin-bottom: 6px;
  }
  .health-finding {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px;
  }
  .health-finding:last-of-type { border-bottom: none; }
  .hf-val  { font-family: var(--mono); font-size: 13px; color: var(--down, #c0392b); font-weight: 600; }
  .hf-basis{ font-size: 12px; color: var(--ink-faint); }
  .hf-loc  { font-size: 12px; color: var(--ink-soft); font-style: italic; }
  .hf-more { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; font-family: var(--mono); }

  .health-empty-col {
    margin-top: 10px; font-size: 13px; color: var(--st-warn, #b7791f);
    background: var(--surface); border-left: 3px solid var(--st-warn, #b7791f);
    border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 6px 10px;
  }
  .health-missing {
    margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono);
  }
  .health-footer {
    margin-top: 10px; font-size: 11.5px; color: var(--ink-faint);
    font-family: var(--mono); border-top: 1px solid var(--line); padding-top: 8px;
  }

  /* 空态 */
  .empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
           height: 100%; text-align: center; color: var(--ink-faint); padding: var(--gap-lg); }
  .empty .e-title { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--text-muted);
           margin-bottom: var(--gap-sm); }
  .empty .e-sub { font-size: 14px; max-width: 46ch; line-height: 1.8; }

  @media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .side { display: none; }
    .save-grid { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, ::before { animation: none !important; transition: none !important; }
  }
  @keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
