/* ============================================================
   句读 · 英语精读工作台 —— 暖纸批注风（editorial grammar notebook）
   ============================================================ */

:root {
  --paper: #faf6ee;          /* 暖白纸面 */
  --paper-deep: #f3ecdd;     /* 深一度的纸 */
  --card: #fffdf7;           /* 卡片纸 */
  --ink: #2b2620;            /* 墨色 */
  --ink-soft: #6b6355;       /* 淡墨 */
  --line: #e5dcc8;           /* 纸纹线 */
  --accent: #c8452c;         /* 朱砂红（老师红笔） */
  --accent-soft: #f7e3dc;

  /* 八种语法成分的批注色 */
  --c-subj: #1f5fa8;   /* 主语 蓝 */
  --c-pred: #c0392b;   /* 谓语 红 */
  --c-obj:  #1e7d4e;   /* 宾语 绿 */
  --c-predic: #7d3c98; /* 表语 紫 */
  --c-attr: #b9770e;   /* 定语 琥珀 */
  --c-adv:  #0e7a8a;   /* 状语 青 */
  --c-comp: #c2186b;   /* 宾补 玫红 */
  --c-appo: #8d6e3a;   /* 同位语 古铜 */
  --c-bound: #8a8577;  /* 边界/其它 灰 */

  --serif-cn: "Noto Serif SC", serif;
  --sans-cn: "Noto Sans SC", sans-serif;
  --serif-en: "Source Serif 4", Georgia, serif;

  --shadow: 0 1px 2px rgba(43,38,32,.05), 0 6px 24px -12px rgba(43,38,32,.18);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans-cn);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(200,69,44,.045), transparent 60%),
    radial-gradient(900px 420px at -10% 20%, rgba(31,95,168,.04), transparent 60%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.7;
}

/* 纸面颗粒 */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ 顶部 ============ */
.masthead { position: relative; z-index: 1; }
.masthead-inner {
  max-width: 920px; margin: 0 auto; padding: 56px 24px 28px;
}
.brand { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.brand-mark {
  font-family: var(--serif-cn); font-weight: 900; font-size: 44px;
  letter-spacing: .06em; color: var(--ink);
}
.brand-dot { color: var(--accent); }
.brand-sub {
  font-size: 12px; letter-spacing: .34em; color: var(--ink-soft);
  text-transform: uppercase; border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.tagline {
  font-family: var(--serif-cn); font-size: 17px; color: var(--ink-soft);
  margin: 10px 0 20px; max-width: 620px;
}
.tagline::first-letter { color: var(--accent); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; list-style: none; }
.legend li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft);
  padding: 3px 10px 3px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card);
  cursor: default; transition: transform .15s ease, box-shadow .15s ease;
}
.legend li:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.legend li[data-c="主语"] i { background: var(--c-subj); }
.legend li[data-c="谓语"] i { background: var(--c-pred); }
.legend li[data-c="宾语"] i { background: var(--c-obj); }
.legend li[data-c="表语"] i { background: var(--c-predic); }
.legend li[data-c="定语"] i { background: var(--c-attr); }
.legend li[data-c="状语"] i { background: var(--c-adv); }
.legend li[data-c="宾补"] i { background: var(--c-comp); }
.legend li[data-c="同位语"] i { background: var(--c-appo); }

/* ============ 版心 ============ */
.page { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 8px 24px 80px; }
.no {
  font-family: var(--serif-cn); font-weight: 900; color: #fff;
  background: var(--accent); font-size: 13px;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; margin-right: 10px; vertical-align: 2px;
}

/* ============ 输入卡 ============ */
.input-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px 20px;
  animation: rise .5s ease both;
}
.input-head, .input-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.input-head h2, .results-bar h2, .exercise-head h2 {
  font-family: var(--serif-cn); font-size: 21px; font-weight: 700;
}
.input-tools { display: flex; align-items: center; gap: 14px; }
.char-count { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.paper {
  margin-top: 14px; position: relative;
  background:
    repeating-linear-gradient(to bottom, transparent 0 35px, rgba(31,95,168,.10) 35px 36px),
    linear-gradient(to right, transparent 0 14px, rgba(200,69,44,.35) 14px 15px, transparent 15px),
    #fffef9;
  border: 1px solid var(--line); border-radius: 8px;
}
.paper textarea {
  width: 100%; border: none; outline: none; resize: vertical;
  background: transparent; padding: 10px 16px 10px 30px;
  font-family: var(--serif-en); font-size: 17px; line-height: 36px;
  color: var(--ink); min-height: 180px;
}
.paper textarea::placeholder { color: #b3a98f; font-family: var(--sans-cn); font-size: 13.5px; line-height: 2.4; }

.input-foot { margin-top: 16px; }
.hint { font-size: 12.5px; color: var(--ink-soft); max-width: 520px; }

.primary-btn {
  font-family: var(--serif-cn); font-weight: 700; font-size: 16px;
  color: #fff; background: var(--accent);
  border: none; border-radius: 8px; padding: 12px 34px;
  letter-spacing: .18em; cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(200,69,44,.55);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary-btn:hover { transform: translateY(-1px); background: #b53a23; box-shadow: 0 10px 22px -10px rgba(200,69,44,.6); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }

.ghost-btn {
  font-family: var(--sans-cn); font-size: 13.5px; font-weight: 500;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px;
  cursor: pointer; transition: all .15s ease;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ghost-btn:disabled { opacity: .5; cursor: wait; }

.error-msg {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: #fbe9e5; border: 1px solid #eec5ba; color: #9c3418; font-size: 13.5px;
}

/* ============ 使用方式面板（兑换码 / 自带 Key） ============ */
.model-panel {
  margin-top: 14px; padding: 14px 16px;
  background: var(--paper-deep); border: 1px solid var(--line);
  border-radius: 10px; animation: rise .3s ease both;
}
.model-panel-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.model-panel-head h3 {
  font-family: var(--serif-cn); font-size: 15px; letter-spacing: .1em;
}
.code-title {
  font-family: var(--serif-cn); font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.code-title small { font-family: var(--sans-cn); font-weight: 400; font-size: 11.5px; color: var(--ink-soft); margin-left: 8px; }
.code-input-row { display: flex; gap: 8px; }
.code-input-row input {
  flex: 1; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--card); color: var(--ink);
  outline: none; letter-spacing: .06em; font-family: var(--serif-en);
  transition: border-color .15s ease;
}
.code-input-row input:focus { border-color: var(--accent); }
.code-input-row input::placeholder { color: #b3a98f; letter-spacing: 0; }
.code-status {
  margin-top: 8px; font-size: 12.5px; color: var(--ink-soft);
  padding: 7px 10px; background: var(--card); border-radius: 7px; border: 1px dashed var(--line);
}
.code-status.ok { color: var(--c-obj); border-color: #c8e0d3; }
.code-status.warn { color: #9c3418; border-color: #eec5ba; background: #fbe9e5; }
.mode-divider {
  display: flex; align-items: center; margin: 14px 0; color: var(--ink-soft);
  font-size: 12px; letter-spacing: .3em;
}
.mode-divider::before, .mode-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.mode-divider span { padding: 0 4px; }
.byok-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.byok-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--ink-soft); font-weight: 500;
}
.byok-grid input, .byok-grid select {
  font-size: 13px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--card); color: var(--ink);
  outline: none; transition: border-color .15s ease; font-family: var(--sans-cn);
}
.byok-grid input:focus, .byok-grid select:focus { border-color: var(--c-subj); }
.byok-grid input::placeholder { color: #b3a98f; }
.byok-note {
  margin-top: 10px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.6;
  padding: 8px 10px; background: var(--card); border-radius: 7px;
  border: 1px dashed var(--line);
}
@media (max-width: 640px) {
  .byok-grid { grid-template-columns: 1fr; }
}

/* ============ 加载卡 ============ */
.loading-card {
  margin-top: 20px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px;
}
.loading-row { display: flex; gap: 16px; align-items: center; }
.seal {
  font-family: var(--serif-cn); font-weight: 900; font-size: 20px; color: #fff;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); border-radius: 8px; transform: rotate(-4deg);
  box-shadow: 0 4px 10px -4px rgba(200,69,44,.5); flex: none;
  animation: sealPulse 1.6s ease-in-out infinite;
}
.loading-text strong { font-family: var(--serif-cn); font-size: 16px; display: block; }
.loading-sub { font-size: 12.5px; color: var(--ink-soft); }
.loading-bar {
  margin-top: 16px; height: 5px; border-radius: 3px; overflow: hidden;
  background: var(--paper-deep);
}
.loading-bar i {
  display: block; height: 100%; width: 32%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #e0784f);
  animation: slide 1.4s ease-in-out infinite;
}

/* ============ 结果区 ============ */
.results { margin-top: 26px; animation: rise .5s ease both; }
.results-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 14px 0;
  border-bottom: 2px solid var(--ink); margin-bottom: 18px;
}
.results-bar-left, .results-bar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tts-ctl { display: inline-flex; align-items: center; gap: 8px; }
.rate-label { font-size: 12.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.rate-label select {
  font-size: 12.5px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
#btnTts.speaking { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.translation-block {
  background: var(--paper-deep); border-left: 4px solid var(--ink);
  border-radius: 0 8px 8px 0; padding: 14px 18px; margin-bottom: 16px;
}
.translation-block h3 {
  font-family: var(--serif-cn); font-size: 14px; color: var(--ink-soft);
  letter-spacing: .2em; margin-bottom: 4px;
}
.translation-block p { font-size: 15.5px; }

.highlights { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.highlights .hl-tag {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--card); border: 1px dashed var(--c-attr); color: var(--c-attr);
}
.highlights .hl-tag::before { content: "◆ "; font-size: 10px; }

/* ============ 句卡 ============ */
.sentence-list { list-style: none; counter-reset: sent; display: flex; flex-direction: column; gap: 14px; }

.sent-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: border-color .2s ease;
}
.sent-card.speaking { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }

.sent-head {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px 12px;
  cursor: pointer; user-select: none;
}
.sent-num {
  font-family: var(--serif-cn); font-weight: 700; color: var(--accent);
  font-size: 15px; flex: none; margin-top: 3px;
 counter-increment: sent;
}
.sent-num::before { content: counter(sent, cjk-ideographic) "、"; }

.sent-main { flex: 1; min-width: 0; }
.sent-en {
  font-family: var(--serif-en); font-size: 17.5px; line-height: 1.9; color: var(--ink);
  word-break: break-word;
}
.sent-zh { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }

.sent-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.badge {
  font-size: 11.5px; padding: 2.5px 9px; border-radius: 999px; font-weight: 500;
  border: 1px solid transparent;
}
.badge.pattern { background: #eaf1f9; color: var(--c-subj); border-color: #c9d9ee; }
.badge.tense   { background: #e9f3f0; color: var(--c-obj);  border-color: #c8e0d3; }
.badge.special { background: #f6eef8; color: var(--c-predic); border-color: #e0cde8; }

.sent-tools { display: flex; gap: 6px; flex: none; align-items: center; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-size: 14px; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.icon-btn:hover { border-color: var(--c-adv); color: var(--c-adv); background: #e8f4f6; }
.icon-btn.expand { transition: transform .2s ease; }
.sent-card.open .icon-btn.expand { transform: rotate(180deg); }

/* 展开区 */
.sent-detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.sent-card.open .sent-detail { grid-template-rows: 1fr; }
.sent-detail-inner { overflow: hidden; }
.sent-detail-body {
  border-top: 1px dashed var(--line); margin: 0 18px; padding: 14px 2px 18px;
  display: flex; flex-direction: column; gap: 14px;
}

/* 批注句（token 着色下划线 + 词下小标签） */
.annotated { font-family: var(--serif-en); font-size: 18px; line-height: 2.5; word-break: break-word; }
.tok { display: inline-flex; flex-direction: column; align-items: center; vertical-align: bottom; margin: 0 1.5px; }
.tok .lab {
  order: -1; font-family: var(--sans-cn); font-size: 10px; line-height: 1;
  padding: 2px 0 3px; letter-spacing: .05em; transform: translateY(4px);
  opacity: .85;
}
.tok .w { padding: 0 2px 3px; border-bottom: 3px solid var(--c-bound); }
.tok.stem .w { border-bottom-style: solid; }
.tok.mod .w { border-bottom-style: dashed; }
.tok.bound .w { border-bottom-style: dotted; }
.tok.t-引导词 .lab { color: var(--c-bound); }
.tok.t-引导词 .w { border-color: var(--c-bound); border-bottom-width: 1.5px; }

.tok.t-主语 .lab, .tok.t-主语 .w { border-color: var(--c-subj); } .tok.t-主语 .lab { color: var(--c-subj); }
.tok.t-谓语 .lab { color: var(--c-pred); } .tok.t-谓语 .w { border-color: var(--c-pred); }
.tok.t-宾语 .lab { color: var(--c-obj); } .tok.t-宾语 .w { border-color: var(--c-obj); }
.tok.t-表语 .lab { color: var(--c-predic); } .tok.t-表语 .w { border-color: var(--c-predic); }
.tok.t-定语 .lab { color: var(--c-attr); } .tok.t-定语 .w { border-color: var(--c-attr); }
.tok.t-状语 .lab { color: var(--c-adv); } .tok.t-状语 .w { border-color: var(--c-adv); }
.tok.t-宾补 .lab { color: var(--c-comp); } .tok.t-宾补 .w { border-color: var(--c-comp); }
.tok.t-同位语 .lab { color: var(--c-appo); } .tok.t-同位语 .w { border-color: var(--c-appo); }
.tok.t-边界 .lab { color: var(--c-bound); } .tok.t-边界 .w { border-color: var(--c-bound); font-style: italic; }
.tok.t-连词 .lab, .tok.t-感叹词 .lab { color: var(--c-bound); }
.tok.t-连词 .w, .tok.t-感叹词 .w { border-color: var(--c-bound); border-bottom-width: 1.5px; }

/* 判定依据 / 讲解块 */
.basis-block, .notes-block {
  background: var(--paper-deep); border-radius: 8px; padding: 10px 14px;
}
.basis-block h4, .notes-block h4, .special-block h4 {
  font-family: var(--serif-cn); font-size: 13px; letter-spacing: .15em;
  color: var(--ink-soft); margin-bottom: 6px;
}
.basis-block p { font-size: 13.5px; }
.notes-block ul { padding-left: 18px; }
.notes-block li { font-size: 13.5px; margin-bottom: 3px; }

.special-block {
  border: 1px dashed var(--c-predic); border-radius: 8px; padding: 10px 14px;
  background: #fbf8fc;
}
.special-block .restore { font-family: var(--serif-en); font-size: 14.5px; color: var(--c-predic); }

.boundary-block {
  background: #fdf6e3; border: 1px solid #ecdfb3; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: #8a6d1a;
}
.boundary-block::before { content: "⚠ 体系边界 · "; font-weight: 700; }

/* 成分表 */
.token-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.token-table th {
  text-align: left; font-family: var(--serif-cn); font-weight: 700; font-size: 12px;
  color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 4px 8px;
}
.token-table td { border-bottom: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
.token-table td.w { font-family: var(--serif-en); font-size: 14.5px; }
.token-table .pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  color: #fff; font-weight: 500;
}
.layer-主干 { background: var(--ink); }
.layer-修饰 { background: var(--c-bound); }
.layer-边界 { background: #b0a880; }

/* ============ 练习 ============ */
.exercise-wrap { margin-top: 34px; animation: rise .4s ease both; }
.exercise-head { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.exercise-head small { font-size: 13px; color: var(--ink-soft); font-weight: 400; margin-left: 8px; }
.exercise-loading {
  background: var(--paper-deep); border-radius: 8px; padding: 14px 18px;
  font-size: 14px; color: var(--ink-soft);
}
.question-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.q-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.q-card .q-type {
  font-size: 11px; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 1px 7px; letter-spacing: .1em; margin-bottom: 8px;
  display: inline-block;
}
.q-card .q-text { font-size: 15px; margin-bottom: 4px; }
.q-card .q-sent { font-family: var(--serif-en); font-size: 15.5px; color: var(--ink-soft); margin-bottom: 10px; }
.q-card .q-sent u { text-decoration-style: wavy; text-decoration-color: var(--accent); }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-opt {
  display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  font-size: 13.5px; background: #fffef9; transition: all .15s ease;
}
.q-opt:hover { border-color: var(--c-subj); }
.q-opt input { margin-top: 3px; accent-color: var(--accent); }
.q-opt .alpha { font-weight: 700; color: var(--ink-soft); flex: none; }
.q-card.locked .q-opt { cursor: default; }
.q-opt.correct { border-color: var(--c-obj); background: #e9f5ee; }
.q-opt.wrong { border-color: var(--accent); background: var(--accent-soft); }
.q-explain {
  margin-top: 10px; font-size: 13px; color: var(--ink-soft);
  background: var(--paper-deep); border-radius: 8px; padding: 9px 12px;
  border-left: 3px solid var(--c-obj);
}
.exercise-actions { display: flex; gap: 10px; margin-top: 18px; }
.score-board {
  margin-top: 18px; text-align: center; font-family: var(--serif-cn);
  font-size: 20px; font-weight: 700; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.score-board b { color: var(--accent); font-size: 30px; }

/* ============ 页脚 ============ */
.foot { margin-top: 56px; text-align: center; }
.foot p { font-size: 12px; color: var(--ink-soft); letter-spacing: .05em; }

/* ============ 动画 ============ */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slide { 0% { margin-left: -34%; } 100% { margin-left: 102%; } }
@keyframes sealPulse { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(-4deg) scale(1.06); } }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .masthead-inner { padding-top: 36px; }
  .brand-mark { font-size: 34px; }
  .q-opts { grid-template-columns: 1fr; }
  .results-bar { flex-direction: column; align-items: flex-start; }
  .sent-head { padding: 14px; }
  .sent-detail-body { margin: 0 14px; }
}

/* ============================================================
   管理后台（/admin）
   ============================================================ */

.admin-login-row { display: flex; gap: 10px; margin-top: 14px; }
.admin-login-row input {
  flex: 1; padding: 11px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fffef9; color: var(--ink); outline: none;
}
.admin-login-row input:focus { border-color: var(--accent); }

#adminPanel { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; animation: rise .4s ease both; }

#adminPanel .input-head small { font-size: 13px; color: var(--ink-soft); font-weight: 400; margin-left: 8px; }

.issue-grid {
  margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
}
.issue-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft); font-weight: 500;
}
.issue-grid input {
  padding: 9px 12px; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  background: #fffef9; outline: none; font-family: var(--sans-cn);
}
.issue-grid input:focus { border-color: var(--accent); }

.issue-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }

.batch-result { margin-top: 16px; }
.batch-head { font-size: 14px; margin-bottom: 8px; }
.batch-head b { color: var(--accent); }
.batch-codes { display: flex; flex-wrap: wrap; gap: 8px; }
.batch-codes code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13.5px; padding: 5px 12px; letter-spacing: .04em;
  background: var(--paper-deep); border: 1px dashed var(--c-appo);
  border-radius: 6px; color: var(--ink); cursor: pointer;
}

.codes-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.f-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.codes-table-wrap { overflow-x: auto; }
.codes-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.codes-table th {
  text-align: left; font-family: var(--serif-cn); font-weight: 700; font-size: 12px;
  color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 6px 10px; white-space: nowrap;
}
.codes-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: middle; white-space: nowrap; }
.codes-table code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px; letter-spacing: .04em;
}
.codes-table tr.st-已停用 td { opacity: .55; }
.codes-table tr.st-已用尽 td, .codes-table tr.st-已过期 td { opacity: .7; }

.st-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.st-pill.st-有效 { background: #e9f5ee; color: var(--c-obj); border: 1px solid #c8e0d3; }
.st-pill.st-已用尽 { background: var(--paper-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.st-pill.st-已过期 { background: #fdf6e3; color: #8a6d1a; border: 1px solid #ecdfb3; }
.st-pill.st-已停用 { background: var(--accent-soft); color: #9c3418; border: 1px solid #eec5ba; }

.codes-table .ops { display: flex; gap: 6px; }
.codes-table .op { padding: 4px 10px; font-size: 12px; }

.admin-foot { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.admin-foot .ghost-btn { text-decoration: none; display: inline-flex; align-items: center; }

@media (max-width: 640px) {
  .admin-login-row { flex-direction: column; }
  .codes-table td, .codes-table th { padding: 6px 6px; }
}

/* ============ 打印讲义 ============ */
#handout { display: none; }

@media print {
  body > *:not(#handout) { display: none !important; }
  body::before { display: none; }
  body { background: #fff; }
  #handout { display: block; font-family: var(--sans-cn); color: #111; }

  .hd-title { font-family: var(--serif-cn); font-weight: 900; font-size: 24px; text-align: center; margin-bottom: 4px; }
  .hd-meta { text-align: center; font-size: 12px; color: #555; margin-bottom: 24px; }
  .hd-title span { color: var(--accent); }
  .hd-sec { font-family: var(--serif-cn); font-weight: 700; font-size: 16px; border-bottom: 2px solid #111; padding-bottom: 4px; margin: 22px 0 12px; }
  .hd-passage { font-family: var(--serif-en); font-size: 14.5px; line-height: 1.9; background: #faf8f2; border: 1px solid #e5e0d0; border-radius: 6px; padding: 12px 16px; }
  .hd-trans { font-size: 13.5px; color: #333; margin-top: 10px; }
  .hd-sent { break-inside: avoid; margin-bottom: 14px; }
  .hd-sent .s-en { font-family: var(--serif-en); font-size: 15px; font-weight: 600; }
  .hd-sent .s-zh { font-size: 12.5px; color: #444; margin: 2px 0 6px; }
  .hd-sent table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
  .hd-sent th { text-align: left; border-bottom: 1.5px solid #111; padding: 3px 6px; }
  .hd-sent td { border-bottom: 1px solid #ddd; padding: 3px 6px; }
  .hd-sent .s-meta { font-size: 11.5px; color: #333; margin-top: 5px; }
  .hd-sent .s-note { font-size: 11.5px; color: #555; margin-top: 3px; }
  .hd-sent .s-bound { font-size: 11px; color: #8a6d1a; }
  .hd-q { break-inside: avoid; font-size: 12.5px; margin-bottom: 10px; }
  .hd-q .q { font-weight: 600; }
  .hd-q ol { margin: 4px 0 0 22px; }
  .hd-ans { font-size: 12px; color: #1e7d4e; }
  @page { margin: 16mm 14mm; }
}
