:root {
  --bg: #120d14;
  --panel: #1b1420;
  --panel-2: #231a29;
  --line: #2f2436;
  --text: #ece6ef;
  --muted: #9a8fa3;
  --gold: #d4a24c;
  --accent: #e0699a;
  --accent-ink: #2a0d1a;
  --discord: #5865f2;
  --danger: #ff6b6b;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.55 var(--sans); -webkit-text-size-adjust: 100%; min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px; max-width: 860px; margin: 0 auto; padding: 10px 16px 4px; }
.brand { font-weight: 600; font-size: 17px; color: var(--gold); text-decoration: none; flex: 1; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 13px; min-width: 0; }
.me span.n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sections { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 860px; margin: 0 auto; padding: 0 12px; }
.sections::-webkit-scrollbar { display: none; }
.sections a {
  padding: 8px 10px; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; font-size: 14px;
}
.sections a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.discord {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px;
  background: #1c1d3a; color: #c9ceff; text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line);
}
.discord:hover { background: #23255a; }
.discord::after { content: '→'; }
.notice { max-width: 860px; margin: 12px auto 0; padding: 10px 14px; background: #3a2a10; color: #f5d9a0; border-radius: 8px; font-size: 14px; }
.notice a { color: #ffd889; }

.main { max-width: 860px; margin: 0 auto; padding: 16px 16px 64px; }
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.bar .hint { color: var(--muted); font-size: 13px; flex: 1 1 100%; margin: 0 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
.spacer { flex: 1; }
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer;
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn[aria-pressed="true"] { color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }

.list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.row { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; align-items: flex-start; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--panel-2); }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.row .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .stats { color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.pending { background: #3a2a10; color: #f5d9a0; border-color: #5a4218; }
.tag.pin { color: var(--gold); }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 0 5px; border-radius: 4px; background: #3b2a12; color: var(--gold); }
.badge.TG, .badge.STAFF { background: #4a1630; color: #ff9cc5; }
.empty { color: var(--muted); padding: 32px 16px; text-align: center; }

.av { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #1b1420; overflow: hidden; font-size: 15px; }
.av.sm { width: 26px; height: 26px; font-size: 12px; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.thread-h { margin: 4px 0 14px; }
.thread-h h1 { font-size: 21px; margin: 6px 0 4px; overflow-wrap: anywhere; }
.post { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 10px; }
.post.first { border-color: #4a3550; }
.post .body { flex: 1; min-width: 0; }
.post .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.post .who .n { font-weight: 600; }
.post .who time { color: var(--muted); }
.post .text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 4px; }
.post .acts { display: flex; gap: 4px; margin-left: -8px; }

.composer, .form { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px; }
.form label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.form label:first-child { margin-top: 0; }
input[type=text], textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none;
}
input[type=text]:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 110px; }
.composer textarea { min-height: 80px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.actions .count { color: var(--muted); font-size: 12px; margin-right: auto; }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 1em; }
.muted { color: var(--muted); font-size: 13px; }

.card { max-width: 480px; margin: 48px auto; text-align: center; padding: 28px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.card h2 { color: var(--gold); margin: 0 0 8px; }
.card p { color: var(--muted); }
.card ul { text-align: left; color: var(--text); padding-left: 20px; }
.card li { margin: 6px 0; }
.card .actions { justify-content: center; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(92vw, 520px);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; z-index: 10;
}
@media (max-width: 560px) {
  .row .stats { display: none; }
  .me span.n { display: none; }
}
