:root {
  --bg: #f5f6f8; --card: #ffffff; --ink: #1b2430; --muted: #5a6473; --faint: #8a93a0;
  --line: #e2e5ea; --line2: #eef0f3; --accent: #1f4fb8; --accent-bg: #e8eef8;
  --up: #c62828; --down: #1b7f3b; --warn-bg: #fff4e0; --warn: #8a5300;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
header.top .in { max-width: 1280px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
header.top .brand { font-size: 20px; font-weight: 700; }
header.top nav { display: flex; gap: 6px; }
header.top nav a { padding: 10px 14px; border-radius: 8px; color: #4a5565; font-weight: 500; text-decoration: none; }
header.top nav a.on { background: var(--accent-bg); color: var(--accent); }
header.top .meta { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h2 { margin: 0; font-size: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.note { font-size: 13px; color: var(--muted); }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
button, .btn { min-height: 40px; padding: 0 14px; border: 1px solid #d5dae1; border-radius: 8px; background: #fff;
  color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
button.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 13px; padding: 10px 8px; border-bottom: 1px solid #d5dae1; text-align: right; white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line2); text-align: right; white-space: nowrap; }
th.l, td.l { text-align: left; }
tr.total td { font-weight: 700; font-size: 16px; border-bottom: 0; }
tr.pos { cursor: pointer; }
tr.pos:hover td { background: #fafbfc; }
tr.lot td { background: #f8f9fb; color: var(--muted); font-size: 13px; }
.up { color: var(--up); } .down { color: var(--down); } .dim { color: var(--faint); }
.dist { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; margin-top: 16px; }
.dist .pie { flex: 0 1 320px; min-width: 240px; position: relative; }
.dist .list { flex: 999 1 420px; min-width: 0; }
.bar-row { display: grid; grid-template-columns: 12px minmax(0, 170px) minmax(40px, 1fr) 58px 128px; gap: 10px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.bar-row .sw { width: 12px; height: 12px; border-radius: 3px; }
.bar-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-row .tr { height: 8px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.bar-row .tr i { display: block; height: 8px; border-radius: 4px; }
.bar-row .pc { text-align: right; font-weight: 700; }
.bar-row .am { text-align: right; color: var(--muted); }
.bar-row.other { cursor: pointer; }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 12px minmax(0, 1fr) 54px 110px; }
  .bar-row .tr { display: none; }
}
input.cell, select.cell { min-height: 38px; padding: 0 8px; border: 1px solid #d5dae1; border-radius: 6px; font: inherit; font-size: 14px; background: #fff; }
input.num { text-align: right; width: 120px; }
tr.dirty td { background: #fffbea; }
tr.calc input.auto { background: #f2f4f7; }
.login { max-width: 360px; margin: 12vh auto; }
.login input { width: 100%; min-height: 44px; margin: 12px 0; padding: 0 12px; border: 1px solid #d5dae1; border-radius: 8px; font: inherit; }
.login button { width: 100%; justify-content: center; min-height: 44px; }
