:root {
  --bg: #ffffff;
  --surface: #f6f9fb;
  --surface-strong: #eef4f6;
  --text: #10213d;
  --muted: #5e6d82;
  --border: #d9e2e8;
  --accent: #0b8f83;
  --accent-dark: #087268;
  --success: #12875d;
  --danger: #cf2e3f;
  --danger-soft: #fff0f2;
  --warning: #a56505;
  --warning-soft: #fff5da;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(16, 33, 61, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { color: inherit; font: 600 1rem/1.35 var(--font); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.15; }
h2 { font-size: 1.08rem; line-height: 1.3; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 9px; background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(11, 143, 131, .24); outline-offset: 2px; }
textarea { min-height: 100px; resize: vertical; font-weight: 400; }
label { display: block; margin: 16px 0 7px; font-weight: 700; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 19px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; cursor: pointer; font-weight: 750; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--border); background: #fff; }
.button-guide { border-color: #bdd9d5; color: var(--accent-dark); background: #f2fbfa; }
.button-full { width: 100%; }
.button-link { min-height: 44px; padding: 8px; border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }

.alert { display: flex; gap: 8px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 9px; }
.alert-error { color: #9c1f2c; border-color: #f3a9b2; background: var(--danger-soft); }
.alert-success { color: #075f43; border-color: #99d8c1; background: #effaf5; }

.login-page { background: linear-gradient(180deg, #fff 0%, #f6fafb 100%); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 30px 20px; }
.login-panel { width: 100%; max-width: 390px; min-width: 0; }
.brand-mark { display: grid; width: 54px; height: 54px; margin-bottom: 26px; place-items: center; border-radius: 14px; color: #fff; background: var(--accent); font-size: 1.4rem; font-weight: 800; }
.login-panel h1 { margin-bottom: 10px; }
.login-lead { margin-bottom: 30px; color: var(--muted); font-size: 1.05rem; }
.login-form { margin-top: 22px; }
.login-form .button { margin-top: 16px; }
.login-notice { margin-top: 38px; padding: 20px; border-radius: var(--radius); background: var(--surface); }
.login-notice ul { margin: 12px 0 0; padding: 0; color: var(--muted); line-height: 1.8; list-style: none; }
.login-notice li::before { margin-right: 10px; color: var(--success); content: "✓"; font-weight: 900; }

.reviewer-page { --pull-distance: 0px; overflow-x: hidden; overscroll-behavior-y: contain; }
.reviewer-page.is-pulling { user-select: none; }
.reviewer-page > .mobile-header,
.reviewer-page > .review-header,
.reviewer-page > .mobile-main,
.reviewer-page > .review-main { transform: translateY(var(--pull-distance)); }
.pull-refresh-resetting > .mobile-header,
.pull-refresh-resetting > .review-header,
.pull-refresh-resetting > .mobile-main,
.pull-refresh-resetting > .review-main { transition: transform .2s ease-out; }
.pull-refresh { position: fixed; z-index: 20; top: max(8px, env(safe-area-inset-top)); left: 50%; display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--accent-dark); background: rgba(255,255,255,.98); box-shadow: 0 7px 24px rgba(16,33,61,.14); font-size: .84rem; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, -52px); transition: opacity .12s ease-out; }
.pull-refresh.is-visible { opacity: 1; transform: translate(-50%, calc(var(--pull-distance) - 52px)); }
.pull-refresh-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease-out; }
.pull-refresh.is-ready .pull-refresh-icon { transform: rotate(180deg); }
.pull-refresh.is-refreshing .pull-refresh-icon { animation: pull-refresh-spin .7s linear infinite; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }
.mobile-header, .review-header { position: sticky; z-index: 10; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: max(12px, env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); }
.mobile-header h1 { margin: 0; font-size: 1.55rem; }
.overline { margin: 0 0 3px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.mobile-main, .review-main { width: min(100%, 680px); margin: 0 auto; padding: 22px 18px max(30px, env(safe-area-inset-bottom)); }
.batch-list { display: grid; gap: 14px; }
.batch-card { display: block; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; background: #fff; box-shadow: 0 4px 15px rgba(16,33,61,.04); }
.batch-card:hover { border-color: #9ecbc5; }
.batch-card-heading { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.batch-card-heading strong { display: block; font-size: 1.08rem; }
.batch-card-heading div > span { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.batch-progress-copy { display: flex; justify-content: space-between; margin: 18px 0 8px; color: var(--muted); font-size: .9rem; }
.batch-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.batch-card-actions .button { flex: 1 1 135px; }
.progress { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; background: #dfe7eb; accent-color: var(--accent); }
.progress::-webkit-progress-bar { border-radius: 99px; background: #dfe7eb; }
.progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
.progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }
.status { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status-open { color: #075f77; background: #e7f7fb; }
.status-done { color: #08704f; background: #e4f7ef; }
.status-flagged { color: #a51e2e; background: #ffe3e7; }
.status-void { color: #667085; background: #edf0f2; }
.task-help { margin-top: 24px; padding: 18px; border-left: 4px solid var(--accent); background: var(--surface); }
.task-help p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.empty-state, .complete-state { padding: 80px 20px; text-align: center; }
.empty-icon, .complete-check { display: grid; width: 64px; height: 64px; margin: 0 auto 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-size: 2rem; font-weight: 800; }
.empty-state p, .complete-state p { color: var(--muted); }
.complete-state .button { margin-top: 16px; }

.review-header { min-height: 58px; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; border: 0; color: var(--text); background: transparent; font-size: 1rem; text-decoration: none; cursor: pointer; }
.back-link:first-letter { font-size: 1.8rem; }
.batch-id { max-width: 45%; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.progress-section { margin-bottom: 18px; }
.progress-title { display: flex; justify-content: space-between; margin-bottom: 10px; }
.task-meta { display: flex; justify-content: space-between; margin: 0 -18px; padding: 14px 18px; border-block: 1px solid var(--border); }
.task-meta span { color: var(--muted); }
.content-panel { max-height: min(38vh, 380px); margin-top: 18px; overflow-y: auto; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.content-panel h2 { margin-bottom: 10px; color: var(--muted); font-size: .9rem; }
.content-panel p { margin-bottom: 0; font-size: 1.05rem; font-weight: 450; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.text-block + .text-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.chinese-translation { color: #173f3a; }
.chinese-translation h2 { color: var(--accent-dark); }
.model-answer { display: flex; margin: 14px 0 22px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-strong); }
.model-answer span { color: var(--muted); }
.model-answer strong { font-size: 1.45rem; }
.verdict-section h2 { margin-bottom: 12px; }
.verdict-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.verdict { display: flex; min-width: 0; min-height: 104px; flex-direction: column; align-items: center; justify-content: center; padding: 9px 5px; border: 2px solid transparent; border-radius: 11px; background: #fff; cursor: pointer; }
.verdict > span { display: grid; width: 28px; height: 28px; margin-bottom: 4px; place-items: center; border-radius: 50%; color: #fff; font-size: 1.2rem; }
.verdict strong { font-size: 1.08rem; }
.verdict small { margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.verdict-correct { border-color: #9bd7be; background: #f1fbf6; }.verdict-correct > span { background: var(--success); }
.verdict-wrong { border-color: #f0a3ac; background: #fff3f4; }.verdict-wrong > span { background: var(--danger); }
.verdict-uncertain { border-color: #ebcc88; background: var(--warning-soft); }.verdict-uncertain > span { background: var(--warning); }
.verdict[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(16,33,61,.15); transform: translateY(-1px); }
.verdict[disabled] { opacity: .62; cursor: wait; }
.correction-panel { margin-top: 18px; padding: 16px; border: 1px solid #efb4bb; border-radius: var(--radius); background: #fff9fa; }
.correction-panel fieldset { margin: 0; padding: 0; border: 0; }
.correction-panel legend { margin-bottom: 10px; font-weight: 800; }
.correction-panel .button-full { margin-top: 16px; }
.label-options { display: flex; flex-wrap: wrap; gap: 8px; }
.label-options label { margin: 0; }
.label-options input { position: absolute; opacity: 0; pointer-events: none; }
.label-options span { display: grid; min-width: 50px; min-height: 48px; padding: 8px 12px; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.label-options input:checked + span { color: #fff; border-color: var(--accent); background: var(--accent); }
.optional-note { margin-top: 18px; }
.review-footer { display: flex; flex-wrap: wrap; margin-top: 20px; justify-content: space-between; gap: 10px; }
.complete-state .button + .button { margin-left: 8px; }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.history-heading h1 { margin-bottom: 0; }
.history-heading > span { flex: 0 0 auto; padding: 7px 10px; border-radius: 7px; color: var(--accent-dark); background: #eaf7f5; font-size: .88rem; font-weight: 800; }
.history-help { margin: 14px 0 22px; color: var(--muted); line-height: 1.6; }
.history-list { display: grid; gap: 14px; }
.history-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 15px rgba(16,33,61,.04); }
.history-card-top { display: flex; align-items: center; justify-content: space-between; }
.history-verdict { padding: 5px 9px; border-radius: 6px; font-size: .86rem; font-weight: 800; }
.history-verdict-correct { color: #075f43; background: #e4f7ef; }
.history-verdict-wrong { color: #9c1f2c; background: var(--danger-soft); }
.history-verdict-uncertain { color: #815005; background: var(--warning-soft); }
.history-text { display: -webkit-box; margin: 14px 0 10px; overflow: hidden; line-height: 1.6; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.history-translation { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface); line-height: 1.6; }
.history-translation span { margin-right: 8px; color: var(--accent-dark); font-weight: 800; }
.history-meta { display: flex; gap: 22px; margin: 12px 0; }
.history-meta div { display: flex; gap: 7px; }
.history-meta dt { color: var(--muted); }
.history-meta dd { margin: 0; font-weight: 800; }
.history-note { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.history-card .button { margin-top: 6px; }
.compact-empty { padding-block: 48px; }
.guide-main h1 { font-size: 1.45rem; }
.guide-list { display: grid; gap: 12px; }
.guide-item { display: grid; grid-template-columns: 60px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.guide-label { display: grid; min-height: 50px; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-weight: 800; }
.guide-item p { margin: 0; line-height: 1.65; }.guide-item ul { margin-bottom: 0; padding-left: 20px; color: var(--muted); }

.admin-page { min-width: 1040px; background: #f7f9fb; }
.admin-topbar { display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--border); background: #fff; }
.admin-brand { display: flex; align-items: center; gap: 12px; }.admin-brand span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; color: #fff; background: var(--accent); }
.admin-shell { display: grid; min-height: calc(100vh - 64px); grid-template-columns: 210px minmax(0, 1fr); }
.admin-sidebar { padding: 28px 14px; border-right: 1px solid var(--border); background: #fff; }
.admin-sidebar a { display: block; margin-bottom: 5px; padding: 12px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.admin-sidebar a.active { color: var(--accent-dark); background: #eaf7f5; font-weight: 800; }
.admin-content { padding: 32px; }
.admin-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-heading h1 { margin-bottom: 7px; }.admin-heading p { color: var(--muted); }.admin-actions { display: flex; gap: 10px; }
.table-panel, .reviewer-admin-section { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 3px 12px rgba(16,33,61,.03); }
.table-scroll { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: .88rem; } th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; } th { color: var(--muted); background: #f9fbfc; font-size: .78rem; } td small { display: block; margin-top: 3px; color: var(--muted); }
.table-progress { min-width: 100px; }.table-progress > span { display: block; margin-bottom: 6px; }.table-progress .progress { height: 6px; }
.flagged-row { background: var(--danger-soft); }.flagged-row td:first-child strong { color: var(--danger); }
.empty-cell { padding: 40px; color: var(--muted); text-align: center; }
.reviewer-admin-section { padding: 20px; }.section-heading h2 { margin: 0; }.reviewer-grid { margin-top: 16px; }.reviewer-row { display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 18px; align-items: center; padding: 13px 0; border-top: 1px solid var(--border); }.reviewer-row code { display: block; margin-top: 3px; color: var(--muted); }
.check-row { display: flex; min-height: 48px; align-items: center; gap: 10px; }.check-row input { width: 20px; min-height: 20px; }.check-row span { font-weight: 600; }
dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgba(16,33,61,.25); } dialog::backdrop { background: rgba(16,33,61,.42); }.dialog-card { padding: 24px; }.dialog-heading { display: flex; justify-content: space-between; }.dialog-heading button { width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 1.5rem; }.dialog-actions { display: flex; margin-top: 24px; justify-content: flex-end; gap: 10px; }
.error-page { display: grid; min-height: 100vh; place-content: center; gap: 18px; padding: 24px; }

@media (max-width: 480px) {
  .mobile-main, .review-main { padding-inline: 16px; }
  .task-meta { margin-inline: -16px; padding-inline: 16px; }
  .verdict-buttons { gap: 7px; }
  .verdict { min-height: 100px; }
  .verdict small { font-size: .64rem; }
  .review-footer .button { min-width: 112px; }
  .review-footer .button { flex: 1 1 100px; }
  .complete-state .button { display: flex; width: 100%; margin: 12px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .pull-refresh.is-refreshing .pull-refresh-icon { animation: none; }
}
