:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #dfe3e8;
  --text: #1c2126;
  --muted: #6b7280;
  --accent: #2563eb;
  --warning-bg: #fff7e6;
  --warning-border: #f0c36d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.nav .brand { font-weight: 700; text-decoration: none; color: var(--text); }
.nav nav a { margin-left: 16px; color: var(--accent); text-decoration: none; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.preview { white-space: pre-wrap; word-break: break-word; }

.post-list, .topic-list { list-style: none; padding: 0; margin: 0; }
.post-list li, .topic-list li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.post-list li:last-child, .topic-list li:last-child { border-bottom: none; }

.tag {
  font-size: 0.85em; background: #eef2ff; color: var(--accent);
  border-radius: 6px; padding: 2px 8px;
}
.muted { color: var(--muted); font-size: 0.9em; }
.error { color: #b42318; }

form.inline { display: inline; margin: 0; }

textarea {
  width: 100%; font-family: inherit; font-size: 1em;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
}
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

button {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; font-size: 0.95em; cursor: pointer; margin: 6px 6px 0 0;
}
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button:hover { filter: brightness(0.97); }

label { display: block; font-size: 0.85em; color: var(--muted); margin-bottom: 4px; }

.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.login-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 380px; text-align: center;
}
.login-form { text-align: left; margin: 16px 0; }
.login-form input {
  width: 100%; font: inherit; padding: 10px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.login-form button { width: 100%; margin: 4px 0 0; padding: 10px; }
.or { margin: 12px 0; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --card: #1c2126; --border: #2a3038; --text: #e6e8eb;
    --muted: #9aa2ab; --warning-bg: #2a2412; --warning-border: #7a5a12;
  }
  .tag { background: #1e2b52; }
}
