/* 本站自己的颜色和字号。浅色是默认；深色跟随系统设置。
   状态色（好、注意、坏）只用于状态，旁边总带文字或符号，不单靠颜色表达。 */
:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --panel: #ffffff;
  --fg: #0b0b0b;
  --muted: #52514e;
  --line: #e2e1dc;
  --grid: #e2e1dc;
  --axis: #a3a29b;
  --series: #2a78d6;
  --ok: #0ca30c;
  --warn: #fab219;
  --bad: #d03b3b;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Noto Sans SC", sans-serif;
  --serif: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  --fs-body: 15px;
  --fs-cap: 13px;
  --fs-h2: 18px;
  --fs-title: 26px;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1a1a19;
    --panel: #232322;
    --fg: #f0efec;
    --muted: #c3c2b7;
    --line: #3a3a37;
    --grid: #3a3a37;
    --axis: #7d7c75;
    --series: #3987e5;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: var(--fs-body); line-height: 1.5; }
a { color: inherit; }
[hidden] { display: none !important; }

/* 顶部：站名和标签页 */
.top { position: sticky; top: 0; padding-top: env(safe-area-inset-top); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top-in::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 13px 10px 11px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); font-weight: 500; }
.page { max-width: 1040px; margin: 0 auto; padding: 20px 16px calc(56px + env(safe-area-inset-bottom)); }

h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-title); margin: 0 0 6px; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 500; margin: 0 0 4px; }
h3 { font-size: var(--fs-body); font-weight: 500; margin: 0 0 6px; }
.sub { margin: 0 0 12px; color: var(--muted); font-size: var(--fs-cap); max-width: 62ch; }
.note { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-cap); }
.err { color: var(--muted); font-size: var(--fs-cap); padding: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 28px; }

/* 状态：圆点加文字 */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-cap); font-weight: 500; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--axis); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.fail, .dot.stale { background: var(--bad); }
.banner { border: 1px solid var(--line); border-left: 4px solid var(--axis); border-radius: 6px; padding: 8px 12px; font-size: var(--fs-cap); background: var(--panel); margin: 0 0 16px; }
.banner.bad { border-left-color: var(--bad); }

/* 首页：一行一个项目 */
.rows { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.row { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.row.stale { border-color: var(--bad); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row-name { font-size: var(--fs-h2); font-weight: 500; }
.row-line { margin: 6px 0 4px; }
.row-meta { color: var(--muted); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
.row-meta .late { color: var(--fg); font-weight: 500; }

/* 项目页的公共抬头 */
.head .take { margin: 0; line-height: 1.6; max-width: 62ch; }
.head .take b { font-weight: 500; font-variant-numeric: tabular-nums; }
.head-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 8px; color: var(--muted); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }

/* 数字卡片 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.tile .k { color: var(--muted); font-size: var(--fs-cap); }
.tile .v { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }

/* 刹车灯 */
.lights { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.light { display: grid; grid-template-columns: 64px 4.5em 1fr; gap: 10px; align-items: baseline; }
.light .r { color: var(--muted); font-size: var(--fs-cap); min-width: 0; }

/* 图表 */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.chart { position: relative; min-width: 0; }
.plot { position: relative; min-height: 170px; }
.plot.tall { min-height: 300px; }
.plot svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.plot text { font-family: var(--sans); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.plot text.strong { fill: var(--fg); font-weight: 500; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 6px; padding: 6px 8px; font-size: var(--fs-cap); line-height: 1.45; max-width: 240px; z-index: 2; }
.tip .t { color: var(--muted); }

/* 每天的记录：一列一个交易日 */
.gridwrap { overflow-x: auto; }
.grid { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; }
.grid th { font-weight: 400; font-size: 11px; color: var(--muted); text-align: center; padding: 0 0 2px; white-space: nowrap; }
.grid th.rowh { text-align: left; padding-right: 10px; position: sticky; left: 0; z-index: 1; background: var(--bg); font-size: var(--fs-cap); color: var(--fg); }
.cell { position: relative; width: 30px; min-width: 30px; height: 28px; text-align: center; font-size: 12px; border-radius: 4px; padding: 0; cursor: pointer; overflow: hidden; }
.cell i { position: absolute; inset: 0; }
.cell span { position: relative; }
.cell.none { color: var(--muted); }
.cell.sel { outline: 2px solid var(--fg); outline-offset: -2px; }
.day { margin: 10px 0 0; font-size: var(--fs-cap); line-height: 1.6; min-height: 3.2em; }
.day b { font-weight: 500; }

/* 表格 */
.tablewrap { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.table th { text-align: right; font-weight: 400; color: var(--muted); font-size: var(--fs-cap); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child, .table th:nth-child(2), .table td:nth-child(2) { text-align: left; }
.table tr.picked td:first-child { font-weight: 500; }
