:root {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1f2330;
  --border: #2a2f3f;
  --text: #e6e8ef;
  --text-muted: #9aa0b4;
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --danger: #ff6b6b;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 48px;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-header nav { display: flex; gap: 16px; align-items: center; }
.site-header nav a, .site-header nav button {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.site-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

a { color: var(--accent); }
.muted { color: var(--text-muted); }
.error-text { color: var(--danger); }
.mono { font-family: monospace; }

.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  padding: 0; font-size: inherit; text-decoration: underline; font-family: inherit;
}

.btn-primary {
  background: var(--accent); color: #fff; border: none; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-block; font-size: 0.95rem;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--accent); }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

.category-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.category-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.category-name { font-size: 1.05rem; font-weight: 600; text-decoration: none; }

.badge {
  display: inline-block; background: var(--surface-2); color: var(--text-muted);
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; margin-top: 6px;
}

.thread-list { list-style: none; padding: 0; }
.thread-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.thread-title { font-weight: 600; text-decoration: none; color: var(--text); }
.thread-title:hover { color: var(--accent); }

.thread-meta {
  color: var(--text-muted); font-size: 0.8rem; display: flex; gap: 6px;
  flex-wrap: wrap; margin-top: 4px;
}

.thread-post, .reply-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; margin-bottom: 14px;
}

.post-body { white-space: pre-wrap; line-height: 1.5; margin: 12px 0; }
.reply-list { list-style: none; padding: 0; }

.post-form {
  display: flex; flex-direction: column; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-top: 16px;
}

.field-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

input[type="text"], input[type="password"], textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; color: var(--text); font-family: inherit; font-size: 0.95rem; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.captcha { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-image { background: #fff; border-radius: 6px; overflow: hidden; line-height: 0; display: inline-block; }
.captcha-image img { display: block; }
.captcha-hint { font-size: 0.75rem; color: var(--text-muted); }

.report-details { margin-top: 8px; }
.report-details summary {
  cursor: pointer; color: var(--accent); font-size: 0.85rem; list-style: none;
}
.report-details summary::-webkit-details-marker { display: none; }
.report-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.admin-login { max-width: 360px; margin: 40px auto; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 0.85rem; text-decoration: none;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.admin-report-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.admin-report-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-actions form { display: inline; }

.flash-ok { background: #16331f; border: 1px solid #2f6b41; color: #b6f0c4; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash-error { background: #351619; border: 1px solid #7a2a2f; color: #ffc2c6; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
