:root {
  color-scheme: light;
  --ink: #1a242b;
  --muted: #5e6a72;
  --line: #ddd8ce;
  --paper: #f3f1eb;
  --card: #fffcf8;
  --brand: #0e3a4d;
  --brand-soft: #e7f0f3;
  --danger: #8d2f2f;
  --warn-bg: #f3ead8;
  --warn-ink: #5c4a32;
  --ok: #1d6b45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea { font: inherit; color: inherit; }

.banner {
  margin: 0;
  padding: 8px 16px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  text-align: center;
  font-size: 13px;
}

.hero {
  background: var(--brand);
  color: #f5f8f8;
  padding: 28px 16px 24px;
}

.wrap { width: min(760px, calc(100% - 32px)); margin: 0 auto; }
.page-admin .wrap { width: min(1120px, calc(100% - 32px)); }

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hero h1 { margin: 0; font-size: 28px; font-weight: 650; line-height: 1.25; }
.lede { margin: 8px 0 0; color: #d5e3e8; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 8px 10px;
  background: rgb(255 255 255 / 8%);
  border-radius: 8px;
  font-size: 14px;
}

.facts li > span:first-child {
  display: block;
  color: #b7c9d0;
  font-size: 12px;
}

main { padding: 20px 0 40px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.card + .card, .stack > * + * { margin-top: 12px; }

.notice { margin: 0; padding-left: 18px; color: var(--muted); }
.notice li + li { margin-top: 4px; }

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.section { margin-top: 22px; }
.section h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
}

.field { margin: 0 0 12px; }
.field span, legend span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.req::after { content: " *"; color: var(--danger); }

input[type="text"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfc8bc;
  border-radius: 8px;
  background: #fff;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

[aria-invalid="true"] { border-color: var(--danger); }

.help, .count { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.count { text-align: right; }
.error { min-height: 0; margin: 4px 0 0; color: var(--danger); font-size: 13px; }
.error:empty { display: none; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.4;
}
.choice input { margin-top: 3px; }
.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8e8e8;
  color: var(--danger);
}
.alert[hidden] { display: none; }

.actions { margin-top: 8px; }
.submit, .button, .ghost {
  border-radius: 8px;
  cursor: pointer;
}
.submit, .button {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
}
.submit { width: 100%; font-weight: 600; }
.submit:disabled, .button:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost, .text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
}
.text-button { border: 0; background: transparent; color: var(--brand); padding: 0; cursor: pointer; }
.danger { color: var(--danger); }

.lookup { margin-top: 14px; color: var(--muted); }
.lookup summary { cursor: pointer; }
.lookup .row { display: flex; gap: 8px; margin-top: 10px; }
.lookup input { flex: 1; }

.success h2 { margin: 0; font-size: 18px; }
.code {
  margin: 8px 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 28px;
  letter-spacing: 0.04em;
}
.meal-lines { margin: 0 0 16px; white-space: pre-line; }

.footer {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.admin-bar h1 { margin: 0; font-size: 22px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat b { display: block; font-size: 26px; font-weight: 650; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }

.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 12px; margin-top: 12px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; }

.bar { display: grid; grid-template-columns: 72px 1fr 28px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.track { height: 8px; background: #ece7de; border-radius: 99px; overflow: hidden; }
.fill { display: block; height: 100%; background: var(--brand); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar input[type="search"] { width: min(280px, 100%); padding: 8px 10px; border: 1px solid #cfc8bc; border-radius: 8px; }
.toolbar a { color: var(--brand); font-size: 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f7f5f0; }
.muted { color: var(--muted); }
.detail { background: #f7f5f0; white-space: pre-wrap; }
.links { display: flex; gap: 10px; }

.login {
  width: min(420px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.login h1 { margin: 0 0 8px; font-size: 22px; }

[hidden] { display: none !important; }

.page-form {
  color-scheme: dark;
  background: linear-gradient(180deg, #0c3c9e 0%, #1248c0 32%, #1660e4 100%);
  background-attachment: fixed;
  color: #f7f4ee;
  accent-color: #e4c27a;
}

.page-form .banner {
  background: #0c3488;
  color: #f6e2a8;
}

.page-form .hero {
  background: transparent;
  padding: 36px 16px 8px;
  text-align: center;
}

.page-form .kicker {
  margin: 0 0 16px;
  color: #f6e2a8;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.page-form .kicker::before,
.page-form .kicker::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 10px;
  background: #e4c27a;
  vertical-align: middle;
}

.page-form .eyebrow {
  color: #f3e6c4;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.page-form .hero h1 {
  color: #f8e6b0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-shadow: 0 0 22px rgb(232 196 110 / 35%);
}

.page-form .slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #f6e7c1;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.page-form .slogan::before,
.page-form .slogan::after {
  content: "";
  width: 36px;
  height: 1px;
  background: #e4c27a;
}

.page-form .lede {
  margin-top: 12px;
  color: #f7f4ee;
  font-weight: 600;
}

.page-form .facts { gap: 10px; margin-top: 20px; text-align: left; }

.page-form .facts li {
  background: #0e409e;
  color: #f7f4ee;
  border: 1px solid rgb(232 196 120 / 55%);
  border-radius: 12px;
  box-shadow: none;
  padding: 12px 14px;
  font-weight: 650;
}

.page-form .facts li > span:first-child {
  color: #f0d48a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-form main { padding-top: 16px; }

.page-form .card {
  background: #0e409e;
  border: 1px solid rgb(232 196 120 / 45%);
  border-radius: 16px;
  box-shadow: none;
  padding: 20px;
  color: #f7f4ee;
}

.page-form #intro h2,
.page-form .section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #f6e2a8;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.page-form #intro h2::before,
.page-form .section h2::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #e4c27a;
}

.page-form .notice { color: #f7f4ee; }
.page-form .notice li::marker { color: #e4c27a; }

.page-form .field span,
.page-form legend span { color: #f7f4ee; }

.page-form .req::after { color: #ffc8bc; }

.page-form .help,
.page-form .count,
.page-form .lookup { color: #c5d4ef; }

.page-form .error { color: #ffc8bc; }

.page-form .alert {
  background: #4a2030;
  color: #ffd0c8;
}

.page-form input[type="text"],
.page-form input[type="tel"],
.page-form textarea {
  border-color: #3d6ec4;
  border-radius: 8px;
  background: #0c3288;
  color: #f7f4ee;
}

.page-form input::placeholder,
.page-form textarea::placeholder { color: #8eadd4; }

.page-form input:focus,
.page-form textarea:focus,
.page-form button:focus-visible {
  outline-color: #e4c27a;
}

.page-form .choice {
  border-color: #3d6ec4;
  border-radius: 8px;
  background: #0c3288;
  color: #f7f4ee;
}

.page-form .choice:has(input:checked) {
  border-color: #e4c27a;
  background: #1648a8;
}

.page-form .submit,
.page-form .button {
  background: linear-gradient(180deg, #f6e2a8, #c9963a);
  color: #1c1408;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.page-form .ghost {
  border-color: #e4c27a;
  background: transparent;
  color: #f6e2a8;
}

.page-form .text-button { color: #f6e2a8; }

.page-form .code { color: #f6e2a8; }

.page-form .orgs {
  margin-top: 16px;
  padding: 18px 16px 16px;
  border: 1px solid rgb(232 196 120 / 45%);
  border-radius: 16px;
  background: #0e409e;
  box-shadow: none;
  color: #f7f4ee;
  text-align: center;
}

.page-form .orgs-title {
  margin: 0 0 12px;
  color: #f6e2a8;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.page-form .orgs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.page-form .orgs-grid p {
  margin: 0;
  padding: 10px 8px;
  background: #0c3288;
  border: 1px solid #3d6ec4;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}

.page-form .orgs-grid span {
  display: block;
  margin-bottom: 4px;
  color: #f0d48a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-form .orgs-slogan {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e4c27a;
  color: #f6e2a8;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 720px) {
  .facts, .choices, .stats, .split, .page-form .orgs-grid { grid-template-columns: 1fr; }
  .hero h1, .page-form .hero h1 { font-size: 32px; }
  .lookup .row { flex-direction: column; }
}
