:root {
  --ink: #12232e;
  --muted: #5b6b76;
  --line: #dce5ea;
  --paper: #ffffff;
  --canvas: #f3f7f9;
  --primary: #0f5c7a;
  --primary-dark: #0b4157;
  --accent: #e8a33d;
  --good: #1e7a4c;
  --bad: #b33a3a;
  --warn: #a86a00;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(16, 42, 56, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }
.site-header {
  background: linear-gradient(120deg, #0c3348, #0f5c7a 70%, #177a89);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand-mark { background: #fff; color: #0f5c7a; border-radius: 7px; padding: 1px 6px; font-size: 13px; letter-spacing: .08em; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; }
.main-nav a, .link-button { color: rgba(255,255,255,.88); text-decoration: none; padding: 5px 4px; }
.main-nav a:hover, .link-button:hover { color: #fff; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; }
.messages { max-width: 1120px; margin: 14px auto 0; padding: 0 18px; }
.message { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; background: #e8f1f5; border-left: 4px solid var(--primary); }
.message.error { background: #fbeaea; border-color: var(--bad); }
.message.success { background: #e8f5ed; border-color: var(--good); }
.message.warning { background: #fdf3df; border-color: var(--warn); }
.page { max-width: 1120px; margin: 0 auto; padding: 26px 18px 54px; }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 18px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 5vw, 38px); }
h2 { font-size: clamp(21px, 3.5vw, 27px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.lede { color: var(--muted); max-width: 65ch; }
.hero {
  background: radial-gradient(circle at 90% 10%, rgba(232,163,61,.22), transparent 32%), linear-gradient(135deg, #fff, #eef6f8);
  border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 4vw, 42px); box-shadow: var(--shadow);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 2px 10px rgba(16,42,56,.04);
}
.card h3 { margin-bottom: 6px; }
.card p:last-child { margin-bottom: 0; }
.stat { padding: 16px; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.03em; color: var(--primary-dark); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: #fff; text-decoration: none; font: inherit; font-weight: 650;
  cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.secondary { background: #fff; color: var(--primary); border-color: var(--line); }
.btn.secondary:hover { background: #eef6f8; color: var(--primary-dark); }
.btn.ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn.danger { background: var(--bad); }
.btn.small { min-height: 34px; padding: 5px 11px; font-size: 14px; }
.forms { display: grid; gap: 12px; }
label { font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #c7d5dd; border-radius: 9px;
  background: #fff; color: var(--ink); font: inherit; margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15,92,122,.18); border-color: var(--primary); }
.helptext, .muted { color: var(--muted); font-size: 13px; }
.errorlist { color: var(--bad); margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.auth-card { max-width: 460px; margin: 28px auto; }
.auth-card .card { padding: 26px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f6f8; color: #304956; font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e8f1f5; color: var(--primary-dark); font-size: 12px; font-weight: 650; }
.tag.good { background: #e5f4eb; color: var(--good); }
.tag.bad { background: #fbe8e8; color: var(--bad); }
.tag.warn { background: #fcf0d9; color: var(--warn); }
.question-card { max-width: 820px; margin: 0 auto; }
.question-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.stem { font-size: clamp(18px, 2.6vw, 21px); line-height: 1.75; margin: 16px 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 15px; border: 1px solid var(--line);
  border-radius: 11px; background: #fff; cursor: pointer; transition: border-color .12s, background .12s;
}
.option:hover { border-color: #9fc3d1; background: #f8fcfd; }
.option input { margin-top: 4px; accent-color: var(--primary); }
.option.selected { border-color: var(--primary); background: #eef7fa; }
.option.correct { border-color: var(--good); background: #eaf6ef; }
.option.wrong { border-color: var(--bad); background: #fbecec; }
.option-letter { font-weight: 800; color: var(--primary); min-width: 1.2em; }
.option-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback { margin-top: 18px; padding: 16px; border-radius: 12px; display: none; }
.feedback.show { display: block; }
.feedback.ok { background: #eaf6ef; border: 1px solid #bfe0cc; }
.feedback.no { background: #fbecec; border: 1px solid #ecc4c4; }
.feedback h3 { margin-bottom: 6px; }
.explanation { white-space: pre-wrap; overflow-wrap: anywhere; color: #2d4653; }
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: #dce8ed; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #2b9aa4); }
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.pager a, .pager span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; font-size: 13px; }
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: 13px; }
.filters a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.draft { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; margin-bottom: 10px; }
.draft-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.draft-stem { white-space: pre-wrap; margin: 8px 0; }
.draft-options { margin: 6px 0; padding-left: 18px; color: #2d4653; }
.draft-issues { color: var(--warn); font-size: 13px; }
.empty { text-align: center; padding: 42px 18px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.checkbox-row { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.checkbox-row input { width: auto; margin-top: 5px; }
/* 管理后台 */
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.console-shell {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px;
  max-width: 1240px; margin: 0 auto; padding: 22px 18px 54px;
}
.console-side {
  position: sticky; top: 16px; align-self: start;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: 0 2px 10px rgba(16,42,56,.04);
}
.console-brand { padding: 2px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.console-brand strong { display: block; font-size: 16px; line-height: 1.35; }
.console-nav { display: grid; gap: 4px; }
.console-nav a {
  display: block; padding: 9px 11px; border-radius: 9px; color: #2d4653;
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.console-nav a:hover { background: #eef6f8; color: var(--primary-dark); }
.console-nav a.active { background: var(--primary); color: #fff; }
.console-side-foot {
  display: grid; gap: 8px; margin-top: 18px; padding: 12px 8px 2px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.console-side-foot a { text-decoration: none; }
.console-main { min-width: 0; }
.console-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
}
.console-head h1 { margin-bottom: 4px; }
.console-head .lede { margin-bottom: 0; }
.list-stack { display: grid; gap: 8px; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); text-decoration: none;
}
.list-row:hover { background: #f7fbfc; color: var(--ink); }
.list-row small { display: block; color: var(--muted); font-size: 12px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.quick-actions a {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; background: #f8fbfc; font-weight: 650;
}
.quick-actions a:hover { background: #eef6f8; }
.plain-list { margin: 0 0 12px; padding-left: 20px; color: #2d4653; }
.plain-list li { margin-bottom: 6px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invite-code { font-size: 22px; font-weight: 750; letter-spacing: .08em; }
.console-inline-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 12px; background: #f7fbfc; border: 1px solid var(--line); border-radius: 12px;
}
.console-inline-form .field-grow { flex: 1 1 180px; }
.console-inline-form input { margin-top: 2px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-actions form { margin: 0; }
.table-actions .btn { white-space: nowrap; }
details.card > summary { cursor: pointer; font-weight: 650; }
details.card > summary::marker { color: var(--primary); }
.console-section { scroll-margin-top: 18px; margin-bottom: 40px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; padding-top: 18px; border-top: 1px solid var(--line);
}
.section-head h2 { margin: 0 0 4px; font-size: 26px; }
.section-head p { margin: 0; }
.bank-card h3 { margin-bottom: 4px; }
.bank-mini-stats {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
  color: var(--muted); font-size: 13px;
}
.bank-mini-stats strong { color: var(--primary-dark); font-size: 17px; }
.flow-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.flow-line span { padding: 5px 10px; border-radius: 999px; background: #eef6f8; color: var(--primary-dark); font-size: 13px; font-weight: 650; }
.flow-line span + span::before { content: "→"; margin-right: 8px; color: var(--muted); font-weight: 400; }
.compact-details { padding: 14px 18px; }
.compact-details > summary { cursor: pointer; }
.compact-details > summary::marker { color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-field label { display: block; }
.form-field input[type=checkbox] { width: auto; margin-top: 8px; accent-color: var(--primary); }
.form-field .helptext { margin: 3px 0 0; }
.form-field .errorlist { margin-top: 3px; }
.preset-block {
  margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #f8fbfc;
}
.preset-block > summary { cursor: pointer; font-weight: 650; color: var(--primary-dark); }
.preset-block > summary::marker { color: var(--primary); }
.preset-block[open] > summary { margin-bottom: 4px; }
.filters select { width: auto; min-width: 150px; margin-top: 0; padding: 7px 10px; }
.filters .btn { min-height: 36px; padding: 5px 11px; font-size: 14px; }
.copy-row .mono { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .console-shell { grid-template-columns: 1fr; gap: 14px; }
  .console-side { position: static; }
  .console-nav { display: flex; flex-wrap: wrap; }
  .console-nav a { padding: 7px 11px; }
  .console-side-foot { display: flex; flex-wrap: wrap; justify-content: space-between; }
}
@media (max-width: 640px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: 6px; }
  .main-nav { gap: 2px 10px; }
  .page { padding-top: 18px; }
  .site-footer { flex-direction: column; }
  th, td { padding: 9px 8px; }
  .console-inline-form { align-items: stretch; }
  .console-inline-form .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
