/* ---------- Tokens ---------- */
:root {
  --bg: #fbfaf7;
  --paper: #fffefb;
  --ink: #1d1c1a;
  --ink-soft: #3b3a36;
  --muted: #726f67;
  --faint: #a5a096;
  --line: #e6e2d9;
  --line-strong: #d5cfc3;
  --accent: #2f5d50;
  --accent-soft: rgba(47, 93, 80, 0.08);
  --ochre: #9a7a48;
  --violet: #746a86;
  --rust: #a24a33;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --reading-size: 17px;
  --bar-h: 58px;
  --radius: 10px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(47, 93, 80, 0.16); }

a { color: inherit; }

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

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 250, 247, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease;
}

.icon-btn:hover { background: #f0ece4; color: var(--ink); }

.doc-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.doc-title {
  border: 0;
  background: transparent;
  width: 100%;
  max-width: 620px;
  padding: 1px 4px;
  margin-left: -4px;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-overflow: ellipsis;
  transition: background 0.16s ease;
}

.doc-title:hover { background: #f1ede5; }
.doc-title:focus { outline: 0; background: #fff; box-shadow: 0 0 0 1px var(--line-strong); }

.doc-meta {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
  padding-left: 1px;
}

.bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.api-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.api-pill:hover { color: var(--ink-soft); border-color: var(--line-strong); }

.api-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c5c0b5;
  flex-shrink: 0;
}

.api-pill.is-ready { color: var(--ink-soft); }
.api-pill.is-ready .dot { background: var(--accent); }

body.is-reading .api-pill { display: none; }

.bar-sub {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.mode-tabs {
  display: flex;
  gap: 26px;
  height: 46px;
  flex-shrink: 0;
}

.tab {
  position: relative;
  height: 46px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.16s ease;
}

.tab:hover { color: var(--ink); }

.tab.is-active { color: var(--ink); }

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
}

.mode-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.tool { position: relative; }

.bare-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 15px 4px 2px;
  cursor: pointer;
}

.bare-select:hover { color: var(--ink); }

.tool::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-right: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.seg {
  display: inline-flex;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.seg-btn {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: #efebe2; color: var(--ink); }

.font-control {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.font-control button {
  border: 0;
  background: none;
  padding: 3px 5px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 4px;
}

.font-control button:hover { color: var(--ink); background: #f0ece4; }
.font-control button:disabled { color: #d2cdc3; cursor: default; background: none; }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  opacity: 0.5;
  transition: width 0.08s linear;
}

/* ---------- Environment notice ---------- */
.env-notice {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 32px;
  font-size: 12px;
  color: var(--rust);
  border-bottom: 1px solid #ead9d2;
  background: #fdf7f4;
}

.env-notice code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(162, 74, 51, 0.07);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ---------- Landing ---------- */
.landing {
  max-width: 760px;
  margin: 0 auto;
  padding: 76px 32px 72px;
  animation: fadeIn 0.3s ease both;
}

.landing-head h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.landing-head p {
  margin: 18px 0 0;
  max-width: 540px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
}

.input-panel {
  margin-top: 40px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-panel:focus-within {
  border-color: #c6bfb0;
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.06);
}

.input-panel.is-dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#articleInput {
  display: block;
  width: 100%;
  min-height: 286px;
  padding: 26px 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.9;
  resize: vertical;
  border-radius: 12px 12px 0 0;
}

#articleInput::placeholder { color: var(--faint); }
#articleInput:focus { outline: none; }

.input-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border-top: 1px solid var(--line);
}

.foot-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.foot-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hint {
  font-size: 11.5px;
  color: var(--faint);
}

.count {
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: #fbfaf7;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.primary-btn:hover { background: #34322e; }

.primary-btn:disabled {
  background: #d6d1c7;
  color: #fbfaf7;
  cursor: not-allowed;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.ghost-btn:hover { border-color: var(--line-strong); background: #f7f4ee; }

.link-btn {
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.link-btn:hover { border-bottom-color: currentColor; }
.link-btn.is-danger { color: var(--rust); }
.link-btn:disabled { color: var(--faint); cursor: default; border-bottom-color: transparent; }

.landing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.feature-line {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.feature-line span { margin: 0 8px; }

.landing-foot .link-btn { font-size: 12.5px; }

.privacy-line {
  margin: 64px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--faint);
}

/* ---------- Reading ---------- */
.reading {
  padding: 0 32px 140px;
  animation: fadeIn 0.3s ease both;
}

.reading-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 40px;
}

.paper {
  color: var(--ink-soft);
  font-size: var(--reading-size);
  line-height: 1.95;
}

.paper[data-mode="summary"] { max-width: 920px; margin: 0 auto; }
.paper[data-mode="exam"] { max-width: 1060px; margin: 0 auto; }

.run-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  font-size: 12.5px;
  color: var(--muted);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.run-meter {
  width: 72px;
  height: 2px;
  background: var(--line);
  overflow: hidden;
  border-radius: 2px;
}

.run-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

.run-status .link-btn { margin-left: 2px; color: var(--rust); font-size: 12px; }

/* ---------- Notices & empty states ---------- */
.notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 28px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.notice.is-error {
  border-color: #e7d6ce;
  background: #fdf8f5;
  color: #85543f;
}

.notice .link-btn { font-size: 12.5px; }

.empty-state {
  max-width: 520px;
  padding: 64px 0 72px;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.empty-state p {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--muted);
}

.loading-note {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- Compare ---------- */
.compare .col-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  padding-bottom: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.col-lang {
  margin-left: 8px;
  color: var(--faint);
  letter-spacing: 0.1em;
}

.pairs {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.cell { min-width: 0; }

.cell p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.cell.src p { color: #24231f; }

.cell.tgt p { color: #5b5851; }

.cell-empty {
  font-size: 12.5px;
  color: var(--faint);
}

.cell-empty .link-btn { font-size: 12.5px; }

.compare.stacked .col-head { display: none; }

.compare.stacked .pairs { gap: 34px; }

.compare.stacked .pair {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.compare.stacked .cell.tgt {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

/* skeleton */
.sk {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 5px;
}

.sk span {
  display: block;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, #eeeae2 25%, #f8f5ef 37%, #eeeae2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
}

.sk span:nth-child(2) { width: 86%; }
.sk span:nth-child(3) { width: 61%; }

/* ---------- Summary ---------- */
.summary-head,
.exam-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.summary-head strong,
.exam-head strong {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.summary-item:last-child { border-bottom: 0; }

.sum-idx {
  padding-top: 5px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.summary-body { min-width: 0; }

.sum-text {
  margin: 0;
  font-size: 1.02em;
  line-height: 1.85;
  color: var(--ink);
}

.points {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.points li {
  position: relative;
  padding-left: 17px;
  margin-top: 5px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--muted);
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.76em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c0b9ac;
}

.orig-details {
  margin-top: 13px;
}

.orig-details summary {
  display: inline-block;
  font-size: 11.5px;
  color: var(--faint);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.orig-details summary::-webkit-details-marker { display: none; }
.orig-details summary:hover { color: var(--muted); }
.orig-details summary::before { content: "＋ "; font-size: 10px; }

.orig-details[open] summary::before { content: "− "; }

.orig-text {
  margin: 10px 0 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.9;
  color: #77736b;
}

.summary-item .sk { padding-top: 3px; }

/* ---------- Exam ---------- */
.exam-list { display: flex; flex-direction: column; }

.exam-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.exam-item:last-child { border-bottom: 0; }

.exam-text {
  min-width: 0;
  font-size: 1.02em;
  line-height: 2;
  color: #24231f;
}

.exam-text p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

mark.word-mark {
  background: transparent;
  color: inherit;
  border-bottom: 1px dotted rgba(47, 93, 80, 0.6);
  padding-bottom: 1px;
}

.exam-notes {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  padding-top: 2px;
}

.note-group { margin-bottom: 18px; }
.note-group:last-child { margin-bottom: 0; }

.note-group h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.note-group h4::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}

.note-group.grammar h4::before { background: var(--accent); }
.note-group.words h4::before { background: var(--ochre); }
.note-group.sentences h4::before { background: var(--violet); }

.grammar-item { margin-bottom: 8px; }
.grammar-item:last-child { margin-bottom: 0; }

.g-point {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.g-explain {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.word-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
}

.word-item:last-child { margin-bottom: 0; }

.w-word { color: var(--ink-soft); font-weight: 500; }

.w-pos {
  font-size: 10.5px;
  color: var(--faint);
  font-style: italic;
}

.w-mean { color: var(--muted); }

.sent-item { margin-bottom: 10px; }
.sent-item:last-child { margin-bottom: 0; }

.s-text {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid #e7e1d5;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.s-why {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--faint);
}

.note-empty { font-size: 12px; color: var(--faint); }

.exam-item .sk { padding-top: 7px; }

/* ---------- Setting sheet ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(35, 31, 25, 0.14);
}

.sheet[open] { animation: sheetIn 0.2s ease both; }

.sheet::backdrop {
  background: rgba(34, 31, 26, 0.26);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.sheet form { padding: 28px 30px 24px; }

.sheet-head h2 {
  margin: 0 0 7px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sheet-head p {
  margin: 0 0 24px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

.field { margin-bottom: 17px; }

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder { color: var(--faint); }

.field input:focus {
  outline: none;
  border-color: #bdb6a8;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.provider-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.chip:hover { color: var(--ink); border-color: var(--line-strong); }

.chip.is-active {
  color: var(--accent);
  border-color: rgba(47, 93, 80, 0.45);
  background: var(--accent-soft);
}

.sheet-note {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--faint);
}

.sheet-note code {
  font-family: var(--mono);
  font-size: 11px;
  background: #f2eee7;
  padding: 1px 4px;
  border-radius: 3px;
}

.field-error {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--rust);
}

.test-result {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
}

.test-result.is-ok { color: var(--accent); }
.test-result.is-error { color: var(--rust); }

.sheet-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
}

.spacer { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 6px;
  background: #26241f;
  color: #faf8f3;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #7d3b28; }

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .exam-item { grid-template-columns: minmax(0, 1fr); gap: 18px; }

  .exam-notes {
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .exam-notes .note-group { margin-bottom: 14px; }
}

@media (max-width: 860px) {
  .compare.columns .pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .compare.columns .col-head { display: none; }
  .compare.columns .cell.tgt {
    padding-left: 15px;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .bar-main { padding: 0 18px; gap: 12px; }
  .bar-sub { padding: 0 18px; gap: 16px; height: auto; min-height: 46px; flex-wrap: wrap; }
  .mode-tabs { height: 44px; gap: 22px; }
  .tab { height: 44px; padding-bottom: 0; }
  .mode-tools { margin-left: 0; padding: 0 0 9px; gap: 14px; flex-wrap: wrap; }
  .font-control { display: none; }

  .landing { padding: 50px 20px 60px; }
  .landing-head h1 { font-size: 35px; }
  .landing-head p { font-size: 13.5px; margin-top: 15px; }
  .input-panel { margin-top: 30px; }
  #articleInput { min-height: 220px; padding: 20px 20px; font-size: 15px; }
  .input-foot { flex-direction: column; align-items: stretch; padding: 12px 14px; gap: 10px; }
  .foot-left { justify-content: space-between; }
  .foot-right { margin-left: 0; justify-content: space-between; }
  .hint { display: none; }
  .landing-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .privacy-line { margin-top: 46px; }

  .reading { padding: 0 20px 100px; }
  .reading-inner { padding-top: 28px; }
  .run-status { margin-bottom: 22px; }

  .pairs { gap: 26px; }
  .compare.stacked .pairs { gap: 30px; }

  .summary-item { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 22px 0; }
  .summary-head, .exam-head { font-size: 10.5px; }

  .exam-item { padding: 24px 0; }
  .exam-text { line-height: 1.95; }

  .sheet form { padding: 24px 20px 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .sheet-head h2 { font-size: 18px; }
}

@media (max-width: 420px) {
  .brand-sub { display: none; }
  .brand-mark { font-size: 18px; }
  .api-pill { padding: 0 10px; font-size: 11px; }
  .landing-head h1 { font-size: 31px; }
  .env-notice { padding: 9px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================
   v2 追加：服务状态与设置面板
   服务端托管密钥后，前端不再有「密钥输入」区块，
   换成只读状态面板 —— 视觉上保持原有极简语言，不加装饰。
   ========================================================== */
.api-pill.is-warn { color: #85543f; border-color: #e7d6ce; }
.api-pill.is-warn .dot { background: #c2703f; }

.status-panel {
  margin: 0 0 22px;
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.status-row:last-child { border-bottom: none; }

.status-row strong {
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.mode-tools .ghost-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

#noticeBar { margin-top: 0; }

@media (max-width: 720px) {
  .mode-tools .ghost-btn { display: none; }
}
