/* ==========================================================================
   支付宝提额材料 · 计费与账单页 样式
   资料来源：dataviz skill 参考调色板（light surface #fcfcfb）
   ========================================================================== */

:root {
  color-scheme: light;

  /* 版面 */
  --plane: #f9f9f7;      /* 页面底色 */
  --surface: #fcfcfb;    /* 内容面 */
  --border: rgba(11, 11, 11, 0.10);
  --border-soft: rgba(11, 11, 11, 0.06);

  /* 文字 */
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;

  /* 图表 */
  --series-1: #2a78d6;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  /* 状态（保留色，不与系列色混用） */
  --good: #0ca30c;
  --warning: #fab219;

  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Hiragino Sans GB", sans-serif;

  --sheet-w: 1440px;
  --pad-x: 56px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sheet {
  width: var(--sheet-w);
  margin: 0 auto;
  background: var(--surface);
  padding: 40px var(--pad-x) 56px;
}

/* ---------- 草稿条 ---------- */

.draft-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #7a4f00;
  background: rgba(250, 178, 25, 0.14);
  border: 1px solid rgba(250, 178, 25, 0.55);
  border-radius: 6px;
}
.draft-banner::before {
  content: "⚠";
  font-size: 14px;
}
.draft-banner[hidden] { display: none; }

/* ---------- 页头 ---------- */

.doc-head { margin-bottom: 34px; }

.brand {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.doc-head h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.meta .sep { color: var(--axis); margin: 0 8px; }

/* ---------- 区块 ---------- */

.section { margin-top: 36px; }
.section:first-of-type { margin-top: 0; }

.section > h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.section > h2 .idx {
  color: var(--muted);
  font-weight: 500;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.section > .lede {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-2);
  max-width: 96ch;
}

.rule {
  height: 1px;
  background: var(--border-soft);
  margin: 30px 0 0;
}

/* ---------- 表格 ---------- */

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

table.tbl caption {
  caption-side: top;
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 8px;
}

table.tbl thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--axis);
  white-space: nowrap;
}

table.tbl tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

table.tbl tbody tr:last-child td { border-bottom: 1px solid var(--axis); }
table.tbl tbody tr:hover td { background: rgba(11, 11, 11, 0.018); }

.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl .mono {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.tbl .tier { font-weight: 600; white-space: nowrap; }
.tbl .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---------- 状态标记（图标 + 文字，从不只靠颜色） ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-2);
  background: rgba(11, 11, 11, 0.03);
  white-space: nowrap;
}
.chip > .ico { font-weight: 700; line-height: 1; }
.chip.ok {
  color: #0a7d0a;
  border-color: rgba(12, 163, 12, 0.38);
  background: rgba(12, 163, 12, 0.08);
}
.chip.refund {
  color: #52514e;
  border-color: var(--border);
  background: rgba(11, 11, 11, 0.04);
}

/* ---------- KPI 行 ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.kpi {
  background: var(--surface);
  padding: 18px 20px 16px;
}

.kpi .k-label {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.kpi .k-value {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.kpi .k-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-left: 3px;
  letter-spacing: 0;
}
.kpi .k-note {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 图表（单系列：无图例，标题即命名） ---------- */

.chart { margin-top: 4px; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.chart-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chart-head h3 .idx {
  color: var(--muted);
  font-weight: 500;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.chart-head .unit { font-size: 11.5px; color: var(--muted); }

.plot { display: flex; }

.plot-y {
  width: 58px;
  height: 180px;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.plot-y span { line-height: 1; transform: translateY(-50%); }
.plot-y span:first-child { transform: translateY(0); }
.plot-y span:last-child { transform: translateY(-100%); }

.plot-main {
  position: relative;
  flex: 1;
  height: 180px;
}

.plot-main .grid {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grid);
}
.plot-main .grid.bottom { background: var(--axis); }

.bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.bar {
  width: 100%;
  background: var(--series-1);
  border-radius: 4px 4px 0 0;
  transition: filter 120ms ease;
}
.col:hover .bar { filter: brightness(1.06); }

.val {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 4px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.col:hover .tip { opacity: 1; }

.plot-x {
  display: flex;
  gap: 2px;
  margin-left: 58px;
  padding-top: 8px;
}
.plot-x span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 脚注 ---------- */

.foot {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}
.foot p { margin: 0 0 4px; }
.foot strong { color: var(--ink-2); font-weight: 600; }

.crosslink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--series-1);
  text-decoration: none;
}
