/*
 * 流感周报 App —— 样式表（自 index.html 抽出 + 扩展轮新增区块样式）
 * ---------------------------------------------------------------------------
 * 配色唯一权威 = 设计档 §2.5.6；断点 = §2.5.2（<600px 两列 / 600–899px 三列 / ≥900px 六列）。
 * 零构建：普通 <link rel="stylesheet"> 相对路径加载（file:// 下同样可用），无预处理器。
 */

/* ===== 基础与配色 ===== */
* { box-sizing: border-box; }
:root {
  --bg: #f5f7fa; --card: #ffffff; --text: #212529; --muted: #6c757d;
  --main: #1864ab; --line: #dee2e6; --warn-bg: #fff3bf; --warn-line: #f0c36d;
  --err-bg: #ffe3e3; --err-line: #e03131; --weak-bg: #f8f9fa; --weak-line: #ced4da;
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
.top { background: var(--main); color: #fff; padding: 14px 16px; }
.top h1 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.top .sub { margin: 4px 0 0; font-size: 12.5px; opacity: .88; }
main { max-width: 1100px; margin: 0 auto; padding: 12px; }
.panel { background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }
.panel h2 { font-size: 15px; margin: 0 0 10px; color: var(--main); }
.panel h2 .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.panel h3 { font-size: 13.5px; margin: 12px 0 6px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ===== 控制条 ===== */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.field span { color: var(--muted); }
select {
  min-height: 44px; min-width: 150px; padding: 0 10px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit;
}
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  min-height: 44px; min-width: 86px; padding: 0 12px; font-size: 15px; cursor: pointer;
  border: 0; background: #fff; color: var(--muted); font-family: inherit;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--main); color: #fff; }
.seg button[disabled] { background: #f1f3f5; color: #adb5bd; cursor: not-allowed; }
#window-note { margin: 0; flex-basis: 100%; }

/* ===== 流行态势条（§2.5.10） ===== */
.posture .p-main { margin: 0; font-size: 14.5px; }
.posture .p-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.posture .p-weak {
  margin: 8px 0 0; padding: 6px 8px; background: var(--weak-bg);
  border: 1px dashed var(--weak-line); border-radius: 6px;
  font-size: 12px; color: var(--muted);                 /* ★ 弱提示：浅底 + 虚线 + 小字号，权重低于徽标 */
}
.posture .p-toggle {
  margin-top: 8px; min-height: 44px; padding: 0 14px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--main); cursor: pointer;
}
.posture .p-basis { margin-top: 8px; font-size: 12.5px; color: var(--text); border-top: 1px dashed var(--line); padding-top: 8px; }
.posture .p-basis ul { margin: 4px 0; padding-left: 18px; }
.posture .p-basis li { margin: 2px 0; }
.posture .p-basis .bt { margin: 6px 0 0; color: var(--muted); }

/* 阶段徽标：浅色底 + 同色描边 + 同色文字（实线边框 ⇒ 与弱提示的虚线边框可区分） */
.badge {
  display: inline-block; margin-left: 4px; padding: 1px 6px; font-size: 11.5px; line-height: 1.5;
  border: 1px solid currentColor; border-radius: 999px; background: #fff; white-space: nowrap;
}
.badge-slot { margin-left: 4px; }

/* ===== 数据说明行 / 提示条 ===== */
.meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 10px; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; font-size: 13.5px; border-radius: 8px; }
.notice[data-kind="cache"] { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.notice[data-kind="error"] { background: var(--err-bg); border: 1px solid var(--err-line); }
.notice[hidden] { display: none; }
.notice button {
  min-height: 44px; padding: 0 16px; font-size: 13.5px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--main); border-radius: 6px; background: #fff; color: var(--main);
}
.error-inline { margin: 10px 0 0; background: var(--err-bg); border: 1px solid var(--err-line); }
.error-inline[hidden] { display: none; }

/* ===== 指标卡（断点：<600px 两列 / 600–899px 三列 / ≥900px 六列） ===== */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card { background: var(--bg); border-radius: 8px; padding: 10px; min-height: 66px; }
.card .k { display: block; font-size: 12.5px; color: var(--muted); }
.card .v { display: block; margin-top: 2px; font-size: 21px; font-weight: 600; line-height: 1.25; }
.card .v.wk { font-size: 15px; }
.card .v small, .card .k2 { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.card .chg { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.src { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* ===== 图表 ===== */
.charts { display: grid; grid-template-columns: 1fr; gap: 12px; }
.chart { width: 100%; height: 220px; }
.chart.tall { height: 220px; }
.cap { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ===== 复选框组（多国对比 / 病原体多选） ===== */
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-size: 13.5px; }
.checks input { width: 18px; height: 18px; }
.tip { margin: 0 0 8px; font-size: 12.5px; color: #e8590c; }
.tip[hidden] { display: none; }

/* ===== 中疾控区块：11 行 × 5 列当周表格（375px 不横向滚动，字号 12px，首列 ≤32%） ===== */
.cdc-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.cdc-table th, .cdc-table td { border: 1px solid var(--line); padding: 4px 3px; text-align: right; word-break: break-word; }
.cdc-table thead th { background: var(--bg); color: var(--muted); font-weight: 600; text-align: center; }
.cdc-table tbody th { text-align: left; width: 30%; font-weight: 500; }
.cdc-notes { margin: 10px 0 0; padding-left: 18px; font-size: 11.5px; color: var(--muted); }
.cdc-notes li { margin: 3px 0; }

/* ===== 页脚 ===== */
.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 28px; font-size: 12px; color: var(--muted); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--main); word-break: break-all; }

/* ===== 断点：600px / 900px ===== */
@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls { flex-wrap: nowrap; }
  .chart { height: 250px; }
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr 1fr; align-items: start; }
  .charts .wide { grid-column: 1 / -1; }
  .chart { height: 300px; }
  .top { padding: 18px 24px; }
  #sec-cdc .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
