:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --border: #dde2e8;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --badge-bg: #efe7fb;
  --badge-text: #5b2a9c;
  --tag-bg: #eef2f7;
  --notice-bg: #fff8e6;
  --notice-border: #f0d9a0;
  --error: #b42318;
  --ok: #1a7f37;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e6eaf0;
    --muted: #9aa6b4;
    --border: #2d3540;
    --accent: #6ea8fe;
    --accent-text: #0b1220;
    --badge-bg: #3a2a55;
    --badge-text: #dcc8ff;
    --tag-bg: #26303b;
    --notice-bg: #2b2616;
    --notice-border: #5a4b20;
    --error: #ff8a80;
    --ok: #7ee2a0;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.7;
  font-size: 16px;
}
a { color: var(--accent); }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 0.9em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 28px 0 20px; }
.site-header h1 { margin: 0 0 6px; font-size: 1.6rem; }
.lead { margin: 0; color: var(--muted); }

.notice {
  margin: 20px 0;
  padding: 12px 16px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 10px;
  font-size: 0.92rem;
}
.notice ul { margin: 6px 0 0; padding-left: 1.2em; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar p { margin: 0; }
.search { flex: 1 1 260px; }
.search input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.policy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.policy.ended { opacity: 0.75; }
.policy-head { display: flex; flex-direction: column; gap: 4px; }
.status {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
}
.title { margin: 0; font-size: 1.15rem; line-height: 1.45; }
.summary { margin: 8px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 0.8rem; background: var(--tag-bg); padding: 1px 10px; border-radius: 999px; }
.policy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.source { font-size: 0.9rem; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
button.primary, .toggle { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button:disabled { opacity: 0.6; cursor: wait; }
button.link { border: none; background: none; padding: 0; color: var(--muted); font-size: 0.85rem; text-decoration: underline; }

.board { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 14px; }
.form-label { display: block; font-weight: 700; margin-bottom: 4px; }
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}
.honeypot { position: absolute; left: -9999px; }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.form-msg { margin: 6px 0 0; min-height: 1.4em; font-size: 0.9rem; }
.form-msg.error { color: var(--error); }
.form-msg.ok { color: var(--ok); }

.comments { list-style: none; margin: 10px 0 0; padding: 0; }
.comments li { padding: 10px 0; border-top: 1px solid var(--border); }
.comment-meta { display: flex; gap: 12px; align-items: baseline; font-size: 0.85rem; color: var(--muted); }
.comment-meta .name { color: var(--ok); font-weight: 700; }
.comment-meta button { margin-left: auto; }
.comment-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--border); margin-top: 32px; padding: 16px 0 32px; font-size: 0.9rem; }
.site-footer p { margin: 4px 0; }

/* 管理画面 */
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; text-align: left; font-size: 0.9rem; }
.admin-table tr.is-deleted td { opacity: 0.5; text-decoration: line-through; }
.admin-table .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-scroll { overflow-x: auto; }
