:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6ea;
  --accent: #1f6feb; --accent-text: #ffffff; --danger: #c62828; --ok: #2e7d32; --warn: #b26a00;
  --unread: #e8f0fe;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --card: #1b2027; --text: #e6e9ef; --muted: #98a2b3; --line: #2c333d;
    --accent: #4c8dff; --accent-text: #0b1220; --danger: #ef5350; --ok: #66bb6a; --warn: #ffb74d;
    --unread: #1d2a3f;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
header {
  position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
}
header h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
button, .btn {
  font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
input, select {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text);
}
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 4px; }
.dot.on { background: var(--ok); }
.hidden { display: none !important; }
.error { color: var(--danger); margin-top: 8px; }
.banner { background: var(--unread); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.chip { white-space: nowrap; border-radius: 16px; padding: 4px 12px; }
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* 通知清單 */
.notif { display: flex; gap: 12px; cursor: pointer; }
.notif.unread { background: var(--unread); }
.notif .thumb { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line); }
.notif .main { flex: 1; min-width: 0; }
.notif .title { font-weight: 600; }
.notif .meta { color: var(--muted); font-size: 13px; }
.notif .photo { width: 100%; border-radius: 8px; margin-top: 8px; }
.notif.flash { outline: 2px solid var(--accent); }
.site-head { display: flex; align-items: center; gap: 4px; font-size: 16px; }

/* 管理介面 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.stat .num { font-size: 24px; font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 140px; }
.row > button { flex: none; }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: var(--unread); padding: 8px; border-radius: 8px; }
.ok { color: var(--ok); } .bad { color: var(--danger); } .warn { color: var(--warn); }
.login { max-width: 360px; margin: 60px auto; }
