/* bizeng-app */
:root {
  --ink: #1c1915;
  --muted: #5e564c;
  --line: #e3d9cc;
  --paper: #f4efe6;
  --card: #fffdf9;
  --accent: #0f4c5c;
  --accent-hover: #0b3945;
  --accent-soft: #e6f1f3;
  --terra: #8d4b32;
  --ok: #1d6b45;
  --ok-bg: #eef7f1;
  --bad: #9d2c2c;
  --bad-bg: #fbf0f0;
  --warn-bg: #fff6e8;
  --warn: #8a5a12;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --max: 1040px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 249, 0.96);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f6f1e8;
  font-family: var(--serif);
  font-size: 18px;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; letter-spacing: 0.01em; }
.brand-co {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav { display: flex; align-items: stretch; gap: 2px; height: 64px; }
.nav a, .mobile-nav a { color: var(--muted); text-decoration: none; }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
}
.nav a.active, .mobile-nav a.active { color: var(--accent); font-weight: 700; }
.nav a.active { border-bottom-color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.letterhead, .card, .feedback, .notice, .passage, .model {
  background: var(--card);
  border: 1px solid var(--line);
}
.letterhead {
  position: relative;
  margin-top: 22px;
  padding: 28px 28px 22px;
}
.letterhead::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 78%, var(--terra) 78% 100%);
}
.kicker {
  margin: 0 0 8px;
  color: var(--terra);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.35; }
h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 40px); }
h2 { margin: 0; font-size: 26px; }
h3 { margin: 0 0 8px; font-size: 18px; }
.lead { margin: 0; max-width: 40em; color: var(--ink); }
.fine { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.hero-actions, .form-actions, .pager { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions { margin-top: 18px; }
.status-row, .grid-3, .grid-2 { display: grid; gap: 12px; margin-top: 14px; }
.grid-3, .status-row { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { display: block; padding: 16px 16px 14px; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
.card-kicker { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 700; }
.card p, .muted { color: var(--muted); }
.card p { margin: 8px 0 0; }
.status { padding: 14px 14px 12px; background: var(--card); border: 1px solid var(--line); }
.status b { display: block; font-size: 15px; }
.status span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.section { margin: 26px 0; }
.section-title { margin: 0 0 8px; }
ol.steps, ul.clean, .checks, .phrases, .req-list { margin: 8px 0 0; padding-left: 1.2em; }
.item-link {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.item-link:hover strong { color: var(--accent); }
.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.passage, .model, .feedback { padding: 14px 16px; margin-top: 12px; }
.passage { white-space: pre-wrap; }
.script { list-style: none; margin: 12px 0 0; padding: 0; }
.script li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.who { font-size: 13px; font-weight: 700; color: var(--terra); }
.en { margin: 4px 0; }
.zh { margin: 0; color: var(--muted); font-size: 14px; }
.option, .choice label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.correct, .choice label.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.wrong, .choice label.wrong { border-color: var(--bad); background: var(--bad-bg); }
input[type="radio"], input[type="checkbox"] { width: auto; margin-top: 4px; accent-color: var(--accent); }
label.field, .field-label { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.wordcount { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.feedback { border-left: 4px solid var(--accent); }
.source-label { margin: 0 0 8px; color: var(--terra); font-size: 13px; font-weight: 700; }
.good { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.checks { list-style: none; padding: 0; }
.checks li { display: flex; flex-wrap: wrap; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mark { min-width: 4.5em; font-size: 13px; font-weight: 700; }
.hit .mark { color: var(--ok); }
.miss .mark { color: var(--terra); }
.hint { color: var(--muted); font-size: 13px; }
.model-label { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--accent); }
.model pre { margin: 0; white-space: pre-wrap; font-family: var(--sans); }
.phrases li { margin: 6px 0; }
.phrases .en { display: block; }
.phrases .zh { display: block; }
.notice { padding: 12px 14px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.inline-error { min-height: 1.2em; margin: 8px 0 0; color: var(--bad); }
.pager { margin-top: 16px; }
.empty { padding: 8px 0 20px; }
.record { margin-top: 12px; }
.account-grid { align-items: start; }
.footer {
  margin-top: 28px;
  padding: 22px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  background: #fffdf9;
}
.footer p { margin: 4px 0; }
.footer-name { color: var(--ink); font-weight: 700; }
.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: #fffdf9;
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-nav a { font-size: 12px; text-align: center; padding: 8px 4px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
}
.toast.show { opacity: 1; }
@media (max-width: 860px) {
  .nav { display: none; }
  .mobile-nav { display: flex; }
  .grid-3, .grid-2, .status-row { grid-template-columns: 1fr; }
  body { padding-bottom: 64px; }
  .letterhead { padding: 22px 16px 16px; }
  .footer { margin-bottom: 8px; }
}
@media (max-width: 720px) {
  .brand-co { display: none; }
  .wrap { width: min(var(--max), calc(100% - 24px)); }
}
