:root {
  --bg: #f5f7f8; --card: #fff; --text: #1f2933; --muted: #6b7a86;
  --line: #e2e8ee; --accent: #2563eb; --accent2: #0f766e;
  --ok: #15803d; --warn: #b45309; --err: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1318; --card: #161d23; --text: #dbe4ea; --muted: #82929c;
    --line: #24303a; --accent: #4f8ff7; --accent2: #2dd4bf;
    --ok: #4ade80; --warn: #fbbf24; --err: #f87171; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, "PingFang SC", "Segoe UI", sans-serif; }
header { background: linear-gradient(160deg, #2563eb, #0f766e); color: #fff; padding: 28px 18px 22px; text-align: center; }
header h1 { margin: 0; font-size: 22px; letter-spacing: 2px; }
header p { margin: 6px 0 0; opacity: .9; font-size: 13px; }
main { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.bar { display: flex; align-items: center; justify-content: space-between; }
.bar h2 { margin: 0; }
.actions { display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
button { font: inherit; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer; }
button.ghost { background: transparent; }
button.primary { background: var(--accent); color: #fff; border: none; font-weight: 600; padding: 11px 22px; }
.run-bar { text-align: center; margin: 16px 0; }

/* 票据行 */
.receipt { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.receipt .rhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.receipt .rhead .idx { font-weight: 600; color: var(--accent2); }
.receipt .rhead button { font-size: 13px; padding: 4px 10px; color: var(--err); }
.rgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rgrid label { font-size: 12px; }
.extra { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.extra.hidden { display: none; }

/* 报告 */
#report h2 { margin-top: 0; }
.line { padding: 9px 0; border-bottom: 1px solid var(--line); }
.line .verdict { font-weight: 700; }
.line.ok .verdict { color: var(--ok); } .line.warn .verdict { color: var(--warn); } .line.error .verdict { color: var(--err); }
.line .meta { color: var(--muted); font-size: 14px; }
.line ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.summary { margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 8px; }
.flags { color: var(--err); font-weight: 600; margin-top: 8px; }
.hidden { display: none; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 40px; }

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .rgrid { grid-template-columns: repeat(2, 1fr); }
  .extra { grid-template-columns: repeat(2, 1fr); }
}
