:root {
  --ink: #18231f;
  --muted: #6b7771;
  --paper: #f4f2ec;
  --surface: #fffefb;
  --green: #174f3d;
  --green-2: #267158;
  --lime: #cef06d;
  --line: #dce0da;
  --soft: #eaf0eb;
  --danger: #b8463e;
  --warning: #a46c17;
  --blue: #2b618d;
  --shadow: 0 18px 60px rgba(22, 40, 32, .10);
  --radius: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(38,113,88,.22); outline-offset: 2px; }
[hidden] { display: none !important; }

.eyebrow { margin: 0; color: var(--green-2); font: 800 11px/1.2 Arial, sans-serif; letter-spacing: 2.1px; }
.muted { color: var(--muted); line-height: 1.7; }
.button { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { background: var(--green); color: white; }
.button.accent { background: var(--lime); color: var(--ink); }
.button.ghost { background: var(--surface); border: 1px solid var(--line); }
.button.danger { background: #fff0ee; color: var(--danger); border: 1px solid #f0cbc6; }
.button.small { padding: 7px 11px; font-size: 12px; }
.button.large { min-height: 50px; padding: 13px 20px; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.text-button { padding: 4px; border: 0; background: none; color: var(--green-2); font-weight: 800; cursor: pointer; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--soft); font-size: 24px; line-height: 1; cursor: pointer; }

label { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
input, select, textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; }
input:disabled, select:disabled, textarea:disabled { background: #f0f1ee; color: #879089; }
textarea { resize: vertical; line-height: 1.65; }
label small { display: block; margin-top: 6px; color: #869089; font-weight: 500; line-height: 1.5; }
.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.check-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.check-line, .consent-line { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); font-weight: 700; }
.check-line input, .consent-line input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); flex: 0 0 auto; }
.form-message { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.brand-logo { display: block; width: 185px; max-width: 48%; height: auto; object-fit: contain; }
.brand-logo.compact { width: 105px; max-width: none; padding: 4px; border-radius: 8px; background: white; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 80% 10%, rgba(206,240,109,.32), transparent 28%), linear-gradient(135deg,#eef0e9,#f8f5ee 55%,#e6ede8); }
.login-card { width: min(520px,100%); padding: 44px; border: 1px solid rgba(23,79,61,.14); border-radius: 24px; background: rgba(255,254,251,.95); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 40px; color: var(--green); font: 800 11px Arial; letter-spacing: 1.8px; }
.login-card h1 { margin: 11px 0 12px; font: 800 clamp(27px,5vw,38px)/1.2 Georgia,"Microsoft YaHei",serif; }
.login-copy { margin: 0 0 27px; color: var(--muted); line-height: 1.8; }
.setup-notice { margin: 0 0 20px; padding: 13px 14px; border-radius: 10px; background: #fff2d8; color: #76500d; font-size: 13px; line-height: 1.65; }
.login-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 0 20px; padding: 5px; border-radius: 12px; background: #e7e9e4; }
.login-mode-tabs button { min-height: 39px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.login-mode-tabs button.active { background: white; color: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.login-mode-tabs button:disabled { cursor: not-allowed; opacity: .45; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px; background: #122a21; color: white; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand b, .sidebar-brand small { display: block; }
.sidebar-brand b { font-size: 17px; }
.sidebar-brand small { margin-top: 4px; color: #9bb2a8; font: 700 9px Arial; letter-spacing: 1.7px; }
.side-nav { display: grid; gap: 7px; margin-top: 25px; }
.side-nav button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; border: 0; border-radius: 10px; background: transparent; color: #bbcbc4; text-align: left; font-weight: 800; cursor: pointer; }
.side-nav button span { color: #6e8f81; font: 800 10px Arial; }
.side-nav button.active { background: var(--lime); color: var(--ink); }
.side-nav button.active span { color: var(--green); }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.12); color: #9fb3aa; font-size: 11px; }
.online-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(206,240,109,.12); }

.workspace { min-width: 0; }
.workspace-head { min-height: 86px; display: flex; align-items: center; gap: 18px; padding: 17px clamp(22px,4vw,56px); border-bottom: 1px solid var(--line); background: rgba(244,242,236,.92); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.workspace-head h1 { margin: 6px 0 0; font: 800 23px/1.2 Georgia,"Microsoft YaHei",serif; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.menu-toggle { display: none; border: 0; background: none; font-size: 24px; }
.workspace-main { padding: 35px clamp(22px,4vw,56px) 70px; }
.view { display: none; }
.view.active { display: block; animation: view-in .2s ease; }
@keyframes view-in { from { opacity: .2; transform: translateY(5px); } }

.hero-panel { min-height: 270px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: clamp(28px,4vw,48px); border-radius: 22px; background: linear-gradient(125deg,#173d30,#10271f); color: white; overflow: hidden; position: relative; }
.hero-panel::after { content: ""; position: absolute; right: -70px; top: -80px; width: 310px; height: 310px; border: 70px solid rgba(206,240,109,.10); border-radius: 50%; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel .eyebrow { color: var(--lime); }
.hero-panel h2 { max-width: 780px; margin: 12px 0 14px; font: 800 clamp(29px,4vw,50px)/1.15 Georgia,"Microsoft YaHei",serif; letter-spacing: -.5px; }
.hero-panel h2 em { color: var(--lime); font-style: normal; }
.hero-panel p:last-child { margin: 0; color: #bdd0c7; line-height: 1.7; }

.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.metric-card { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric-card span, .metric-card strong { display: block; }
.metric-card span { min-height: 33px; color: var(--muted); font-size: 12px; }
.metric-card strong { margin-top: 4px; font: 800 29px Georgia,serif; }
.metric-card.warn strong { color: var(--warning); }
.metric-card.live strong { color: var(--green-2); }

.content-grid { display: grid; gap: 18px; }
.content-grid.two-one { grid-template-columns: minmax(0,2fr) minmax(270px,1fr); }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.surface-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.surface-head h3 { margin: 7px 0 0; font: 800 20px Georgia,"Microsoft YaHei",serif; }
.compact-list { display: grid; }
.compact-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid #eceeea; }
.compact-item:first-child { border-top: 0; }
.compact-item b, .compact-item small { display: block; }
.compact-item small { margin-top: 4px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; align-self: center; padding: 5px 9px; border-radius: 999px; background: var(--soft); color: var(--green); font-size: 11px; font-weight: 800; }
.status-pill.open { background: #e2f4dc; color: #24672e; }
.status-pill.closed { background: #eee; color: #666; }
.status-pill.draft { background: #fff1d4; color: #7f5816; }
.status-pill.expired { background: #fff0e9; color: #a04a25; }
.storage-row { margin-bottom: 17px; }
.storage-row div { display: flex; justify-content: space-between; font-size: 12px; }
.storage-track { height: 8px; margin-top: 8px; border-radius: 99px; background: #e9ece7; overflow: hidden; }
.storage-track i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }

.section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-toolbar h2 { margin: 8px 0 7px; font: 800 clamp(27px,3vw,37px) Georgia,"Microsoft YaHei",serif; }
.section-toolbar p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.topic-rail { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 13px; }
.topic-card { min-width: 215px; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: left; cursor: pointer; }
.topic-card b, .topic-card small { display: block; }
.topic-card small { margin-top: 6px; color: var(--muted); }
.topic-card.active { background: var(--green); border-color: var(--green); color: white; }
.topic-card.active small { color: #c4d5ce; }
.topic-card .topic-edit { border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.question-toolbar { display: grid; grid-template-columns: auto minmax(210px,1fr) auto; gap: 15px; align-items: end; margin: 15px 0; }
.filter-group, .event-filter-row { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #e7e9e4; width: fit-content; }
.filter-group button, .event-filter-row button { padding: 8px 13px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.filter-group button.active, .event-filter-row button.active { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(0,0,0,.07); }
.search-field { position: relative; }
.search-field span { position: absolute; left: 12px; top: 19px; color: #9aa29e; font-size: 11px; font-weight: 700; }
.search-field input { padding-left: 55px; }
.question-list { display: grid; gap: 10px; }
.question-card { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 15px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.question-number { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 11px; background: var(--soft); color: var(--green); font: 800 13px Arial; }
.question-card h3 { margin: 1px 0 10px; font-size: 15px; line-height: 1.65; }
.question-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 8px; border-radius: 999px; background: #f0f1ed; color: var(--muted); font-size: 10px; font-weight: 800; }
.tag.ready { background: #e2f3e8; color: #277044; }
.tag.draft { background: #fff0d2; color: #885d11; }
.question-options { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card-actions { display: flex; gap: 5px; }
.card-actions button { padding: 6px 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.card-actions button.delete { color: var(--danger); }

.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.organization-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.organization-card header { display: flex; justify-content: space-between; gap: 10px; }
.organization-card h3 { margin: 3px 0 7px; font-size: 18px; }
.organization-card p { min-height: 44px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.organization-card footer { display: flex; justify-content: space-between; align-items: center; padding-top: 13px; border-top: 1px solid #eceeea; color: var(--muted); font-size: 11px; }
.owner-note { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.event-filter-row { margin: -8px 0 18px; }
.event-list { display: grid; gap: 13px; }
.event-card { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,1fr) auto; gap: 20px; align-items: center; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.event-card h3 { margin: 7px 0 7px; font-size: 18px; }
.event-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.event-stats { display: grid; grid-template-columns: repeat(3,1fr); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.event-stats div { padding: 5px 15px; text-align: center; }
.event-stats strong, .event-stats span { display: block; }
.event-stats strong { font: 800 22px Georgia,serif; }
.event-stats span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.event-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 220px; }

.table-surface { padding: 0; overflow: hidden; }
.data-table { width: 100%; overflow-x: auto; }
.data-row { display: grid; min-width: 720px; gap: 12px; align-items: center; padding: 13px 18px; border-top: 1px solid #eceeea; font-size: 12px; }
.data-head { border-top: 0; background: #edf0eb; color: var(--muted); font-weight: 800; }
.audit-table .data-row { grid-template-columns: 155px 130px 1fr 1.4fr; }
.results-table .data-row { grid-template-columns: 1.3fr .8fr .65fr .7fr 1.1fr; }

.empty-state { padding: 52px 20px; border: 1px dashed #c8cdc6; border-radius: 14px; text-align: center; color: var(--muted); }
.empty-state b { display: block; margin-bottom: 7px; color: var(--ink); font-size: 16px; }

dialog { width: min(620px,calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 100px rgba(0,0,0,.3); }
dialog.wide-dialog { width: min(850px,calc(100% - 28px)); }
dialog::backdrop { background: rgba(10,27,20,.66); backdrop-filter: blur(3px); }
.dialog-form { padding: clamp(21px,4vw,31px); display: grid; gap: 17px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.dialog-head h3 { margin: 7px 0 0; font: 800 24px Georgia,"Microsoft YaHei",serif; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.option-editor { margin-top: -3px; }
.question-option-input { min-height: 94px; resize: vertical; line-height: 1.65; }
.image-preview { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f2f3ef; }
.image-preview img { width: 130px; max-height: 100px; object-fit: contain; border-radius: 8px; background: white; }
.rule-note { padding: 12px 14px; border-radius: 10px; background: #edf4ef; color: #456256; font-size: 12px; line-height: 1.6; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.qr-dialog-content { text-align: center; }
.qr-dialog-content label { text-align: left; }
.qr-canvas { width: 290px; height: 290px; max-width: 100%; display: grid; place-items: center; margin: 0 auto; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.qr-canvas canvas, .qr-canvas img { width: 100% !important; height: 100% !important; object-fit: contain; image-rendering: pixelated; }
.qr-hint { margin: -3px 0 0; color: var(--muted); font-size: 13px; }
.mini-metrics { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.mini-metric { padding: 11px; border-radius: 10px; background: var(--soft); text-align: center; }
.mini-metric b, .mini-metric span { display: block; }
.mini-metric b { font: 800 22px Georgia,serif; }
.mini-metric span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.import-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.import-summary div { padding: 12px; border-radius: 10px; background: var(--soft); }
.import-summary b, .import-summary span { display: block; }
.import-summary b { font-size: 22px; }
.import-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }

.toast-region { position: fixed; right: 18px; top: 18px; z-index: 1000; display: grid; gap: 8px; width: min(370px,calc(100% - 36px)); pointer-events: none; }
.toast { padding: 13px 15px; border-radius: 11px; background: #183d30; color: white; box-shadow: var(--shadow); font-size: 13px; line-height: 1.55; animation: toast-in .22s ease; }
.toast.error { background: #8e352f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* Candidate exam */
.exam-body { background: radial-gradient(circle at 80% 0,rgba(206,240,109,.3),transparent 24%),var(--paper); }
.exam-brandbar { min-height: 70px; display: flex; align-items: center; gap: 11px; padding: 12px max(16px,calc((100% - 880px)/2)); border-bottom: 1px solid var(--line); background: rgba(255,254,251,.94); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(12px); }
.exam-brandbar b, .exam-brandbar small { display: block; }
.exam-brandbar b { font-size: 15px; }
.exam-brandbar small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.exam-shell { width: min(880px,calc(100% - 28px)); margin: 30px auto 80px; }
.exam-state-card { padding: clamp(25px,5vw,44px); border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); }
.exam-state-card > h1 { margin: 10px 0 12px; font: 800 clamp(27px,6vw,41px)/1.22 Georgia,"Microsoft YaHei",serif; }
.exam-state-card > p { color: var(--muted); line-height: 1.7; }
.loading-card, .error-card, .result-card { text-align: center; }
.loading-mark { width: 34px; height: 34px; margin: 0 auto; border: 4px solid #dfe5df; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.event-facts { display: grid; grid-template-columns: repeat(2,1fr); margin: 26px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.event-facts div { padding: 15px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.event-facts div:nth-child(-n+2) { border-top: 0; }
.event-facts div:nth-child(2n) { border-right: 0; }
.event-facts span, .event-facts b { display: block; }
.event-facts span { color: var(--muted); font-size: 11px; }
.event-facts b { margin-top: 6px; font-size: 14px; }
.availability { margin-bottom: 22px; padding: 12px 14px; border-radius: 10px; background: #e5f4e8; color: #28673b; font-size: 13px; }
.availability.closed { background: #fff0e2; color: #905329; }
.consent-line { font-size: 12px; line-height: 1.6; }

.exam-sticky-head { position: sticky; top: 70px; z-index: 25; display: flex; justify-content: space-between; align-items: center; padding: 12px 17px; border: 1px solid #234c3b; border-radius: 0 0 14px 14px; background: #173d30; color: white; box-shadow: 0 10px 30px rgba(16,39,31,.14); }
.candidate-block span, .candidate-block b, .timer-block span, .timer-block b { display: block; }
.candidate-block span, .timer-block span { color: #b9cec4; font-size: 10px; }
.candidate-block b { margin-top: 3px; }
.timer-block { text-align: right; }
.timer-block b { margin-top: 1px; color: var(--lime); font: 800 25px/1 Arial; letter-spacing: 1px; }
.timer-block.warning b { color: #ffd56c; }
.timer-block.danger b { color: #ff998f; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.exam-overview { display: flex; justify-content: space-between; gap: 28px; align-items: end; padding: 32px 5px 20px; }
.exam-overview h1 { margin: 8px 0 6px; font: 800 clamp(27px,5vw,39px) Georgia,"Microsoft YaHei",serif; }
.exam-overview p:last-child { margin: 0; color: var(--muted); }
.progress-block { width: min(260px,40%); color: var(--muted); font-size: 12px; }
.progress-track { height: 8px; margin-top: 8px; border-radius: 99px; background: #dfe3dd; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green-2); transition: width .2s ease; }
.network-state { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0 5px 15px; padding: 6px 10px; border-radius: 999px; background: #e8f3e9; color: #366747; font-size: 10px; }
.network-state span { width: 7px; height: 7px; border-radius: 50%; background: #51a068; }
.network-state.saving { background: #fff2d9; color: #835e1b; }
.network-state.saving span { background: #d59b32; animation: pulse 1s infinite; }
.network-state.offline { background: #fee9e7; color: #933c35; }
.network-state.offline span { background: #c9544b; }
.question-jump { display: flex; gap: 7px; overflow-x: auto; padding: 3px 5px 15px; }
.question-jump button { flex: 0 0 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.question-jump button.answered { background: var(--green); border-color: var(--green); color: white; }
.mobile-question-list { display: grid; gap: 13px; }
.mobile-question { scroll-margin-top: 135px; padding: clamp(18px,4vw,26px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.mobile-question header { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.mobile-question header span:first-child { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--soft); color: var(--green); font: 800 12px Arial; }
.mobile-question h2 { margin: 0 0 17px; font-size: 16px; line-height: 1.75; }
.question-image { display: block; max-width: 100%; max-height: 420px; margin: 0 auto 18px; border-radius: 10px; object-fit: contain; }
.mobile-options { display: grid; gap: 9px; }
.mobile-option { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; min-height: 52px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-weight: 600; cursor: pointer; }
.mobile-option input { position: absolute; opacity: 0; pointer-events: none; }
.mobile-option i { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: #eff1ed; color: var(--muted); font: 800 12px Arial; font-style: normal; }
.mobile-option:has(input:checked) { border-color: var(--green); background: #edf5ef; box-shadow: inset 0 0 0 1px var(--green); }
.mobile-option:has(input:checked) i { background: var(--green); color: white; }
.save-note { min-height: 16px; margin-top: 9px; color: var(--muted); font-size: 10px; text-align: right; }
.submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 20px; border-radius: 15px; background: #173d30; color: white; }
.submit-panel b, .submit-panel p { display: block; margin: 0; }
.submit-panel p { margin-top: 4px; color: #b9cec4; font-size: 11px; }
.compact-dialog { max-width: 500px; }
.result-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: #e4f4e5; color: #317346; font-size: 31px; font-weight: 900; }
.result-mark.error { background: #fee8e5; color: var(--danger); }
.score-display { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 26px auto; }
.score-display strong { font: 900 76px/1 Georgia,serif; color: var(--green); }
.score-display span { font-size: 18px; }
.score-display b { align-self: center; margin-left: 11px; padding: 6px 10px; border-radius: 999px; background: #e4f4e5; color: #317346; font-size: 12px; }
.score-display b.failed { background: #fee8e5; color: var(--danger); }
.result-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-facts span { padding: 7px 11px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; }
.wrong-section { margin-top: 36px; text-align: left; }
.wrong-head { margin-bottom: 14px; }
.wrong-head h2 { margin: 7px 0; font: 800 24px Georgia,"Microsoft YaHei",serif; }
.wrong-card { margin-top: 10px; padding: 18px; border: 1px solid #eed5d1; border-radius: 13px; background: #fff9f7; }
.wrong-card h3 { margin: 0 0 12px; font-size: 14px; line-height: 1.7; }
.answer-compare { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.answer-compare b { color: var(--ink); }
.answer-compare .correct { color: #277044; }
.explanation { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: #edf3ee; color: #4b655a; font-size: 12px; line-height: 1.7; }
.result-foot { margin-top: 30px !important; font-size: 11px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3,1fr); }
  .card-grid { grid-template-columns: repeat(2,1fr); }
  .event-card { grid-template-columns: 1fr auto; }
  .event-stats { grid-row: 2; grid-column: 1/-1; border: 0; border-top: 1px solid var(--line); padding-top: 13px; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 238px; transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .workspace-head { min-height: 75px; padding: 13px 18px; }
  .workspace-main { padding: 25px 16px 60px; }
  .hero-panel { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid.two-one { grid-template-columns: 1fr; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .question-toolbar { grid-template-columns: 1fr auto; }
  .question-toolbar .filter-group { grid-column: 1/-1; }
  .card-grid { grid-template-columns: 1fr; }
  .form-grid.three, .check-grid { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .event-stats { grid-row: auto; grid-column: auto; }
  .event-actions { justify-content: flex-start; max-width: none; }
  .mini-metrics { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 560px) {
  .login-shell { padding: 15px; }
  .login-card { padding: 28px 21px; }
  .user-menu span { display: none; }
  .hero-panel { padding: 28px 22px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 25px; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .question-toolbar { grid-template-columns: 1fr; }
  .question-toolbar .filter-group { grid-column: auto; }
  .question-card { grid-template-columns: 42px 1fr; }
  .question-number { width: 38px; height: 38px; }
  .question-card .card-actions { grid-column: 2; }
  .topic-card { min-width: 190px; }
  .mini-metrics { grid-template-columns: repeat(2,1fr); }
  .import-summary { grid-template-columns: repeat(2,1fr); }
  .event-facts { grid-template-columns: 1fr; }
  .event-facts div, .event-facts div:nth-child(-n+2) { border-top: 1px solid var(--line); border-right: 0; }
  .event-facts div:first-child { border-top: 0; }
  .exam-shell { width: min(100% - 20px,880px); margin-top: 18px; }
  .exam-overview { align-items: flex-start; flex-direction: column; }
  .progress-block { width: 100%; }
  .submit-panel { align-items: stretch; flex-direction: column; }
  .submit-panel .button { width: 100%; }
  .score-display strong { font-size: 62px; }
  .dialog-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
