:root {
  color-scheme: light;
  font: 100%/1.5 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--page);
  --text: #15213b;
  --page: #eef2fa;
  --surface: #fff;
  --blue: #2449b5;
  --accent: #2449b5;
  --soft: #edf2fc;
  --soft-text: #23438a;
  --tag: #e0e9ff;
  --active: #e8eeff;
  --input-line: #aab9d2;
  --error-text: #931d3e;
  --error-bg: #fff0f3;
  --muted: #536581;
  --line: #dce4f2;
}
[data-theme="dark"] {
  color-scheme: dark;
  --text: #e6edf9;
  --page: #101623;
  --surface: #1b2435;
  --blue: #3659c1;
  --accent: #a8bdff;
  --muted: #acb9d0;
  --line: #34405a;
  --soft: #24334e;
  --soft-text: #c4d2ff;
  --tag: #2b3d65;
  --active: #293b61;
  --input-line: #687997;
  --error-text: #ffc0cf;
  --error-bg: #432332;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; min-width: 0; }
main { width: min(100%, 43rem); margin: auto; padding: max(1rem, env(safe-area-inset-top)) 1rem calc(7rem + env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: .55rem; margin-bottom: .65rem; font-weight: 800; letter-spacing: -.02em; }
.brand-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .7rem; background: var(--blue); color: white; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
#status { margin: 0 0 .6rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; }
.topic-tag { display: inline-block; padding: .26rem .55rem; border-radius: 1rem; background: var(--tag); color: var(--soft-text); font-size: .75rem; font-weight: 750; }
.surface, article, .empty, #topic-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }
.empty { text-align: center; padding-block: 2rem; }
.empty span { color: var(--accent); font-size: 2rem; }
.empty h2 { margin: .25rem 0; }
.empty p, details p { color: var(--muted); font-size: .9rem; }
.filters { display: flex; gap: .45rem; overflow-x: auto; padding: .15rem .15rem .55rem; margin-bottom: .4rem; }
.filters button { flex: 0 0 auto; max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button, input, textarea, select { font: inherit; border-radius: .7rem; padding: .6rem .8rem; }
button, select { min-height: 44px; }
button { border: 1px solid transparent; background: var(--blue); color: white; cursor: pointer; font-weight: 650; }
button:disabled { opacity: .55; cursor: wait; }
button.secondary, .filters button[aria-pressed="false"] { background: var(--soft); color: var(--soft-text); border-color: var(--line); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea, select { color: inherit; border: 1px solid var(--input-line); background: var(--surface); min-width: 0; }
.row input { flex: 1; width: 0; }
label { display: block; margin-bottom: .4rem; font-weight: 700; }
.copy-row { margin-bottom: .7rem; }
.copy-row button { flex-shrink: 0; }
.preference label { margin: 0; }
.preference + .preference { margin-top: .65rem; }
.preference h2 { margin: 0; }
#account-usage, #account-push { font-size: .85rem; color: var(--muted); }
#notification-state { margin: .4rem 0 .7rem; color: var(--muted); font-size: .85rem; }
.notification-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
summary { cursor: pointer; font-weight: 750; }
#topic-list { padding: 0; list-style: none; margin: .65rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
#topic-list:empty { display: none; }
#topic-list li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; border: 0; border-radius: 0; background: transparent; padding: .55rem .75rem; }
#topic-list li + li { border-top: 1px solid var(--line); }
#topic-list strong { flex: 1 1 7rem; overflow-wrap: anywhere; }
#topic-list button { padding-inline: .55rem; font-size: .82rem; }
#publish { margin-top: .65rem; }
#messages { display: grid; gap: .65rem; }
.meta { display: flex; gap: .45rem .6rem; align-items: center; flex-wrap: wrap; color: var(--muted); overflow-wrap: anywhere; }
.unread .meta::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: #b9233c; }
article pre, article p { margin: .65rem 0; }
article form { display: grid; gap: .5rem; }
article form button { text-align: start; }
pre, p { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; font: inherit; }
#error { color: var(--error-text); background: var(--error-bg); padding: .65rem; border-radius: .7rem; }
.dock { position: fixed; inset: auto 0 0; z-index: 1; display: flex; justify-content: center; gap: .3rem; border-top: 1px solid var(--line); background: var(--surface); padding: .45rem .75rem max(.45rem, env(safe-area-inset-bottom)); }
.dock button { flex: 0 1 7rem; display: grid; justify-items: center; align-content: center; gap: .15rem; color: var(--muted); background: transparent; font-size: .78rem; min-height: 53px; padding: .25rem; }
.dock button[aria-current="page"] { color: var(--accent); background: var(--active); }
.dock svg { width: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-icon { position: relative; display: flex; }
.unread-badge { position: absolute; top: -.32rem; left: calc(100% - .38rem); min-width: 1rem; height: 1rem; padding: 0 .2rem; border-radius: 1rem; background: #b9233c; color: #fff; font-size: .65rem; line-height: 1rem; font-weight: 750; text-align: center; }
@media (min-width: 44rem) { main { padding-top: 2rem; } }
