/* 跟原本的應募監控同一套：米色紙感、墨色、橄欖綠，數字用襯線字 */
:root {
  --bg: #efeae2; --surface: #f7f4ee; --ink: #2b2925; --muted: #8a857c; --line: #ddd6ca;
  --green: #5f7f52; --green-soft: #e3eadb; --red: #b5533c; --red-soft: #f2dfd6;
  --amber: #a7761f; --amber-soft: #f1e6cc; --tw: #2f5d8a; --ko: #8a4f7d;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", -apple-system, "PingFang TC", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17; --surface: #25231f; --ink: #ece7dd; --muted: #a09a8f; --line: #3a3731;
    --green: #9cbd8b; --green-soft: #26321f; --red: #e38a73; --red-soft: #3c2520;
    --amber: #e0b35e; --amber-soft: #3a2f18; --tw: #8db6e0; --ko: #d79bc9;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
.num, .big, b { font-variant-numeric: tabular-nums; }

.wrap { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 40px); display: flex; flex-direction: column; gap: 16px; }

.top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.err { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.icon-btn { background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; }

.event h1 { font-family: var(--serif); font-size: 21px; line-height: 1.35; margin: 0 0 8px; text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: 13px; }
.chip { background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.end { background: var(--red-soft); color: var(--red); }
.chip.hot { background: var(--amber-soft); color: var(--amber); }
.banner { margin-top: 10px; background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.hero { background: var(--surface); border: 1.5px solid var(--ink); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.hero-main { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; }
.hero-main .label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.big { font-family: var(--serif); font-size: 76px; font-weight: 900; line-height: .95; }
.big small { font-family: var(--sans); font-size: 18px; font-weight: 500; margin-left: 4px; color: var(--muted); }
.hero.safe .big { color: var(--green); }
.hero-cost { font-family: var(--serif); font-size: 22px; font-weight: 700; text-align: right; }
.hero-sub { font-size: 14px; color: var(--muted); }
.lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.line-item { display: flex; flex-direction: column; min-width: 0; }
.line-item span { font-size: 12px; color: var(--muted); }
.line-item b { font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.line-item em { font-style: normal; font-size: 12px; color: var(--muted); }

.meter { position: relative; height: 34px; margin-top: 4px; }
.meter .track { position: absolute; left: 0; right: 0; top: 10px; height: 8px; border-radius: 99px; background: var(--line); }
.meter .fill { position: absolute; left: 0; top: 10px; height: 8px; border-radius: 99px; background: var(--ink); }
.meter .mk { position: absolute; top: 4px; width: 2px; height: 20px; background: var(--ink); }
.meter .mk span { position: absolute; top: 20px; transform: translateX(-50%); font-size: 10px; white-space: nowrap; color: var(--muted); }
.meter .mk.est { background: var(--green); }
.meter .mk.g { background: var(--amber); }
.meter .mk.bud { background: var(--red); }

.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.bad { background: var(--red-soft); color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); }

.actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.btn { height: 50px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-weight: 700; font-size: 16px; width: 100%; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { height: 44px; font-size: 14px; color: var(--muted); }
.btn.danger { color: var(--red); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card h2 { font-family: var(--serif); font-size: 18px; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.rank li.me { background: var(--green-soft); border-radius: 10px; padding-inline: 8px; border-bottom-color: transparent; }
.rank li.cut { border-bottom: 2px dashed var(--red); }
.rank .pos { font-family: var(--serif); font-weight: 700; color: var(--muted); text-align: center; }
.rank .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nm small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.rank .tot { font-family: var(--serif); font-size: 22px; font-weight: 700; text-align: right; min-width: 3ch; }
.cutlabel { font-size: 11px; color: var(--red); text-align: right; padding-top: 2px; }
.site { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; border: 1px solid currentColor; }
.site.tw { color: var(--tw); }
.site.ko { color: var(--ko); }
.unseen { font-size: 13px; color: var(--muted); margin: 0; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.feed li.tap { cursor: pointer; }
.feed li.tap:active { background: var(--bg); }
.feed .tm { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .who { font-weight: 700; min-width: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.feed .qty { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--green); text-align: right; }
.feed .qty.neg { color: var(--red); }
.feed .why { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.tag.guess { border: 1px dashed var(--amber); color: var(--amber); }
.tag.set { background: var(--ink); color: var(--bg); }
.tag.mine { background: var(--green); color: var(--surface); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.how p { margin: 0; font-size: 14px; color: var(--muted); }
.how b { color: var(--ink); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(20, 18, 14, .45); }
.sheet-body { position: relative; background: var(--surface); border-radius: 18px 18px 0 0; padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); display: flex; flex-direction: column; gap: 12px; max-height: 88vh; overflow-y: auto; width: 100%; max-width: 520px; margin: 0 auto; }
.sheet-body.tall { max-height: 94vh; }
.sheet h3 { font-family: var(--serif); font-size: 19px; margin: 0; }
.sheet h4 { font-family: var(--serif); font-size: 16px; margin: 8px 0 0; }
.stepper { display: grid; grid-template-columns: 60px 1fr 60px; gap: 8px; }
.stepper button { height: 60px; border-radius: 12px; border: 0; background: var(--green-soft); color: var(--green); font-size: 28px; font-weight: 700; }
.stepper input { min-width: 0; width: 100%; height: 60px; text-align: center; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); font-family: var(--serif); font-size: 32px; font-weight: 700; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chips-row button { flex: 1; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; white-space: nowrap; }
.mine-cost { font-size: 14px; color: var(--muted); }
.mine-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mine-row button { border: 0; background: none; color: var(--red); font-weight: 700; padding: 6px 8px; }
.pick { display: flex; flex-direction: column; gap: 6px; }
.pick button { height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); text-align: left; padding: 0 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.pick button.cur { border: 2px solid var(--ink); }
.pick button small { font-weight: 400; color: var(--muted); }

.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.f input, .f select { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; font-weight: 400; font-size: 16px; min-width: 0; width: 100%; }
.f small { font-weight: 400; color: var(--muted); }
.row-check { flex-direction: row; align-items: center; gap: 8px; }
.row-check input { width: 22px; height: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roster-row { display: grid; grid-template-columns: 1fr 96px 40px; gap: 6px; margin-bottom: 6px; }
.roster-row input, .roster-row select { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 8px; font-size: 16px; min-width: 0; width: 100%; }
.roster-row button { border: 0; background: none; color: var(--red); font-size: 20px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700; z-index: 80; max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
