*{box-sizing:border-box} :root{font-family:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg);line-height:1.6;--bg:#f5f6f8;--surface:#fff;--ink:#252830;--muted:#626975;--line:#dce0e6;--red:#c82040;--soft:#fceef1;--success:#16764e;--error:#a51b38;color-scheme:light}body{margin:0;background:var(--bg);overflow-wrap:anywhere}button,input,select,.button{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid transparent;border-radius:6px;background:linear-gradient(110deg,#b91e3a,#d92e4e);color:#fff;font-weight:600;cursor:pointer;text-decoration:none;line-height:1.4;transition:background-color .18s,box-shadow .18s,transform .18s}button:hover:not(:disabled),.button:hover{filter:brightness(.95)}button:active:not(:disabled){transform:translateY(1px)}button:disabled{cursor:default;opacity:.5}.quiet{background:var(--surface);border-color:var(--line);color:var(--ink)}:focus-visible{outline:3px solid #cb4461;outline-offset:3px}[hidden]{display:none!important}header{height:64px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 24px;background:var(--surface);border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;font-size:18px}.mark{display:grid;place-items:center;width:32px;height:32px;background:var(--red);border-radius:6px;color:#fff;font-weight:800}#account{font-size:13px;padding:8px 12px;min-height:40px;background:transparent;color:var(--muted);border-color:var(--line)}main{max-width:860px;margin:auto;padding:24px 20px calc(108px + env(safe-area-inset-bottom))}h1,h2,h3,p{margin:0 0 12px}h1{font-size:30px;line-height:1.3;letter-spacing:-.03em}h2{font-size:21px;line-height:1.4}h3{font-size:17px;line-height:1.6}.muted,small{color:var(--muted)}small{font-size:12px}.hero{background:linear-gradient(115deg,#af1936,#ce2c48);color:#fff;padding:24px;border-radius:8px;margin-bottom:16px}.hero p{color:#fff}.eyebrow{display:block;font-size:12px;letter-spacing:.08em;margin-bottom:8px;color:#fff}.hero button{background:#fff;color:#a81734;border-color:#fff}.card{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:20px;margin-bottom:16px}.login{max-width:440px;margin:24px auto}.wide{width:100%}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.learning-stats{margin:0 0 20px}.stat{text-align:left;display:block;padding:16px;min-width:0}.stat strong{display:block;font-size:30px;font-variant-numeric:tabular-nums;line-height:1.2;margin-top:8px}.stat strong span{font-size:13px;font-weight:400;color:var(--muted)}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.row h3{margin:0}.exam-card .muted{font-size:13px;margin-top:12px}.exam-card .row:last-child{justify-content:flex-start}.status{display:inline-block;padding:3px 8px;border-radius:4px;background:var(--soft);color:var(--red);font-size:12px;white-space:nowrap}label{display:block;font-size:14px;font-weight:600;margin-bottom:16px}input,select{display:block;width:100%;min-width:0;max-width:100%;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:6px;padding:10px 12px;margin-top:6px;min-height:44px}input[type=file]{padding:8px;font-size:13px}input[type=checkbox]{display:inline-block;width:18px;min-height:18px;vertical-align:middle}label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px}.question{font-size:19px;font-weight:600;line-height:1.8;white-space:normal;margin-bottom:16px;word-break:normal;overflow-wrap:anywhere}.study-hint{font-size:12px;margin-top:-8px}.option{display:block;text-align:left;width:100%;min-height:52px;margin:10px 0;padding:12px 14px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-weight:400;line-height:1.6}.option:hover:not(:disabled){background:var(--soft)}.option.selected{background:var(--soft);border-color:var(--red)}.option.correct{background:#e8f6ef;border-color:#27845d;color:#15583d}.option.incorrect{background:var(--soft);border-color:var(--red);color:var(--error)}.option:disabled{opacity:1}.feedback{padding:16px;margin-top:16px;background:var(--soft);border-left:3px solid var(--red);border-radius:4px;font-size:14px}.feedback strong{display:block;margin-bottom:8px}.progress{width:100%;height:6px;accent-color:var(--red);margin:0 0 20px}.actions{margin-top:20px}.jump-form{display:flex;align-items:flex-end;gap:12px;padding:12px 16px}.jump-form label{margin:0;flex:1;display:flex;align-items:center;gap:12px;font-weight:400}.jump-form input{width:90px;margin:0}.jump-form button{min-width:72px}.jump{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.jump button{min-width:44px;padding:8px}.countdown{font-size:24px;font-weight:700;color:var(--red);font-variant-numeric:tabular-nums}summary{cursor:pointer;min-height:32px}.review-options{list-style:none;padding:0;font-size:14px;color:var(--muted)}.review-options li{padding:6px 0;border-bottom:1px solid var(--line)}.review-card p{font-size:14px}.review-card small{display:block;margin-bottom:8px}table{width:100%;border-collapse:collapse;text-align:left}th,td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle}th{font-size:12px;color:var(--muted);background:var(--bg);font-weight:600}#notice{position:fixed;top:76px;left:50%;transform:translateX(-50%);z-index:20;padding:12px 16px;background:var(--ink);color:var(--surface);max-width:calc(100% - 32px);width:max-content;border-radius:6px;box-shadow:0 6px 24px #0001;line-height:1.5;font-size:14px;pointer-events:none}#nav{position:fixed;bottom:0;left:0;right:0;z-index:10;display:flex;align-items:center;justify-content:center;background:var(--surface);border-top:1px solid var(--line);padding:8px 8px calc(8px + env(safe-area-inset-bottom));height:calc(68px + env(safe-area-inset-bottom))}#nav button{flex:1;max-width:180px;min-width:0;color:var(--muted);background:transparent;font-size:14px;font-weight:500;border-radius:6px}#nav button.current{background:var(--soft);color:var(--red);font-weight:700}img{max-width:100%;height:auto}.error{color:var(--error);background:var(--soft);padding:10px 12px;border-radius:4px;font-size:13px}[aria-invalid=true]{border-color:var(--red);box-shadow:0 0 0 1px var(--red)}
/* Full-height management workspace: only content regions may scroll. */
body.is-manager{height:100dvh;overflow:hidden;display:flex;flex-direction:column}body.is-manager>header{flex:0 0 64px}body.is-manager>main{flex:1;min-height:0;max-width:none;width:100%;padding:0;overflow:auto}body.is-manager #nav{display:none}.admin-dashboard{height:100%;display:grid;grid-template-columns:200px minmax(0,1fr);min-height:0}.dashboard-nav{background:#1e222b;color:#f7f8fb;padding:24px 12px;overflow:auto}.dashboard-brand{padding:0 16px 24px;font-size:18px;font-weight:700}.dashboard-brand small{display:block;font-weight:400;color:#aeb6c5;font-size:12px;margin-top:4px}.dashboard-nav a{display:block;padding:12px 16px;margin:4px 0;text-decoration:none;color:#d2d8e2;border-radius:6px;font-size:14px}.dashboard-nav a:hover{background:#303642}.dashboard-nav a.current{background:#39404e;color:#fff;box-shadow:inset 3px 0 #ea5470}.dashboard-nav button{margin:24px 16px 0;background:transparent;color:#d2d8e2;border-color:#505868;font-size:13px}.dashboard-content{display:flex;flex-direction:column;gap:20px;padding:24px 28px;min-height:0;min-width:0}.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0}.dashboard-heading h1{font-size:26px;margin:4px 0}.dashboard-heading p{font-size:13px;color:var(--muted);margin:0}.dashboard-heading small{display:block;margin-top:4px}.dashboard-kicker{font-size:12px;color:var(--red);font-weight:600}.admin-stage{flex:1;min-height:0;min-width:0;display:flex;flex-direction:column}.admin-pane{height:100%;min-height:0;overflow:auto;min-width:0}.dashboard-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.dashboard-stats>div{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:16px 20px;border-top:3px solid var(--red)}.dashboard-stats small,.dashboard-stats span{display:block;color:var(--muted);font-size:12px}.dashboard-stats strong{display:block;font-size:32px;font-variant-numeric:tabular-nums;margin:6px 0}.dashboard-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:20px;padding:20px 0;border-block:1px solid var(--line)}.dashboard-summary h2{font-size:18px;margin-bottom:4px}.dashboard-summary p{margin:0;font-size:14px}.dashboard-section{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:24px}.dashboard-section h2{font-size:19px}.dashboard-section .muted{font-size:13px}.dashboard-section>.row{align-items:flex-end;justify-content:flex-start;gap:20px}.dashboard-section>.row>div{margin-right:auto}.dashboard-section>.row label{margin:0}.dashboard-section select{min-width:140px}.quick-start{margin-top:20px}.quick-links{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0 28px}.quick-start>p:last-child{margin-bottom:0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.dashboard-section form{min-width:0}.dashboard-section .file-label{margin-top:24px}.dashboard-section>label{max-width:100%}.dashboard-section#import{max-width:840px;width:100%}.dashboard-section#exam{max-width:1100px;width:100%}.dashboard-section#exam>p{margin-bottom:20px}.table-wrap{overflow:auto;min-height:0;flex:1;margin-top:20px;border:1px solid var(--line);border-radius:4px}.table-wrap>p.muted{display:none}.exam-table{font-size:14px;min-width:700px}.exam-table th{position:sticky;top:0;z-index:1}.exam-table button{padding:8px 12px;font-size:13px}.empty{padding:24px;color:var(--muted)}#exam-list:not([hidden]){display:flex;flex-direction:column}.dashboard-heading>.button{font-size:14px}.workspace-title{font-size:26px}body.is-manager main>.workspace-title,body.is-manager main>p,body.is-manager main>#retry{margin:24px}body.is-manager main:has(>#return){padding:24px}.is-manager .card:has(table){overflow:auto;max-height:calc(100dvh - 240px)}
@media(max-width:680px){header{height:60px;padding:10px 16px}.brand{font-size:16px;gap:8px}main{padding:20px 16px calc(100px + env(safe-area-inset-bottom))}h1{font-size:26px}h2{font-size:20px}.hero{padding:20px}.hero h1{font-size:28px}.hero p{font-size:14px}.card{padding:16px}.learning-stats{gap:10px}.stat{padding:14px}.stat small{font-size:11px}.stat strong{font-size:28px}.question{font-size:18px;line-height:1.8}.row>h2{max-width:100%}.study-actions{position:fixed;left:0;right:0;bottom:calc(68px + env(safe-area-inset-bottom));z-index:9;flex-wrap:nowrap;gap:8px;justify-content:space-between;background:var(--surface);padding:12px 16px;border-top:1px solid var(--line);margin:0}.study-actions button{flex:1;font-size:14px;min-width:0;padding:10px 8px}body[data-view=practice] main,body[data-view=wrong] main{padding-bottom:calc(176px + env(safe-area-inset-bottom))}body[data-view=locked] .study-actions{bottom:0;padding-bottom:calc(12px + env(safe-area-inset-bottom))}body[data-view=locked]:has(.study-actions) main{padding-bottom:calc(112px + env(safe-area-inset-bottom))}.jump-form{padding:12px}.jump-form label{font-size:13px}.jump-form input{width:80px}.exam-card .row:last-child button{width:100%}.admin-dashboard{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}.dashboard-nav{display:flex;gap:4px;align-items:center;flex-wrap:wrap;padding:8px}.dashboard-brand{display:none}.dashboard-nav a{padding:8px;font-size:12px;margin:0}.dashboard-nav button{margin:0 0 0 auto;padding:6px;min-height:36px;font-size:12px}.dashboard-content{padding:16px;gap:12px}.dashboard-heading h1{font-size:21px}.dashboard-heading p{display:none}.dashboard-heading>.button{font-size:12px;padding:10px}.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.dashboard-stats>div{padding:12px}.dashboard-stats strong{font-size:26px}.dashboard-summary{padding:12px 0;margin-top:12px}.dashboard-summary .button{font-size:12px;padding:8px}.dashboard-summary h2{font-size:16px}.dashboard-section{padding:16px}.quick-start{margin-top:12px}.quick-links{gap:8px;margin:12px 0 16px}.quick-links button{font-size:12px}.form-grid{grid-template-columns:1fr;gap:0}.dashboard-section>.row{gap:12px}.dashboard-section>.row>div{flex-basis:100%}.dashboard-section>.row label{flex:1;min-width:100px}.dashboard-section select{min-width:0}.table-wrap{margin-top:12px}}
@media(max-height:720px) and (min-width:681px){.dashboard-content{padding:16px 24px;gap:12px}.dashboard-heading p{display:none}.dashboard-heading h1{font-size:23px}.dashboard-stats>div{padding:12px 16px}.dashboard-stats strong{font-size:28px}.dashboard-summary{margin-top:12px;padding:12px 0}.quick-start{margin-top:12px;padding:16px 20px}.quick-links{margin:12px 0 16px}.dashboard-section{padding:20px}.dashboard-section label{margin-bottom:12px}.dashboard-section input{padding:8px 10px}.dashboard-section#exam>p{margin-bottom:12px}}
@media(prefers-color-scheme:dark){:root{--bg:#171a20;--surface:#232730;--ink:#eceff5;--muted:#b0b8c6;--line:#414857;--red:#ff8ca4;--soft:#3e2933;--error:#ffadbd;color-scheme:dark}.hero{background:linear-gradient(115deg,#8e1730,#ac213e)}.option.correct{background:#203e31;color:#a4e5c1;border-color:#529c75}.dashboard-nav{background:#11151b}.error{color:var(--error)}button,.button{background:linear-gradient(110deg,#a81d38,#c62a47)}.quiet{background:var(--surface);color:var(--ink)}#nav button{background:transparent}#nav button.current{background:var(--soft)}.dashboard-nav button{background:transparent}.option{background:var(--surface);color:var(--ink)}.option.selected,.option.incorrect{background:var(--soft)}.option.correct{background:#203e31}.hero button{background:#fff;color:#a81734}}
.feedback.is-correct{background:#e8f6ef;border-color:#27845d;color:#15583d}@media(prefers-color-scheme:dark){.feedback.is-correct{background:#203e31;border-color:#529c75;color:#a4e5c1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

.jump button.marked{border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent);}

/* Mobile practice surface: Swiss study sheet */
@media(max-width:680px){
  body[data-view=practice],body[data-view=wrong],body[data-view=locked]{background:#f7f7f8}
  body[data-view=practice] main,body[data-view=wrong] main,body[data-view=locked] main{padding-left:12px;padding-right:12px}
  body[data-view=practice] .row:first-child,body[data-view=wrong] .row:first-child{padding:0 4px;align-items:baseline}
  body[data-view=practice] .row:first-child small,body[data-view=wrong] .row:first-child small{font-variant-numeric:tabular-nums;color:var(--red);font-weight:700}
  body[data-view=practice] .progress,body[data-view=wrong] .progress{height:5px;margin:2px 4px 14px;width:calc(100% - 8px)}
  body[data-view=practice] article.card,body[data-view=wrong] article.card,body[data-view=locked] article.card{border:0;border-top:1px solid #cfd3da;border-bottom:1px solid #cfd3da;border-radius:0;padding:18px 4px;background:transparent}
  body[data-view=practice] .question,body[data-view=wrong] .question,body[data-view=locked] .question{font-size:20px;line-height:1.65;letter-spacing:-.01em}
  body[data-view=practice] .option,body[data-view=wrong] .option,body[data-view=locked] .option{position:relative;display:flex;align-items:flex-start;justify-content:flex-start;gap:10px;min-height:56px;margin:8px 0;padding:14px 12px 14px 48px;border-radius:4px;border:1px solid #cfd3da;background:#fff;text-align:left}
  body[data-view=practice] .option::before,body[data-view=wrong] .option::before,body[data-view=locked] .option::before{content:'';position:absolute;left:14px;top:16px;width:20px;height:20px;border:1px solid #aeb5c0;border-radius:50%;background:#fff}
  body[data-view=practice] .option.selected::before,body[data-view=wrong] .option.selected::before,body[data-view=locked] .option.selected::before{border:6px solid var(--red)}
  body[data-view=practice] .option.correct::before{border:6px solid var(--success)}
  body[data-view=practice] .option:hover:not(:disabled),body[data-view=wrong] .option:hover:not(:disabled),body[data-view=locked] .option:hover:not(:disabled){background:#fff}
  body[data-view=practice] .feedback,body[data-view=wrong] .feedback{margin:16px 0 0;padding:14px;border-left-width:4px;background:#fff}
  body[data-view=practice] .study-actions,body[data-view=wrong] .study-actions,body[data-view=locked] .study-actions{box-shadow:0 -4px 16px #1b243014}
  body[data-view=practice] .jump-form,body[data-view=wrong] .jump-form{border:0;border-top:1px solid #cfd3da;border-radius:0;background:transparent;margin-top:10px}
  body[data-view=locked] .countdown{font-size:20px;background:#fff0f2;border:1px solid #f2bdc8;border-radius:4px;padding:4px 8px}
  body[data-view=locked] details.card{border:0;border-top:1px solid #cfd3da;border-radius:0;background:transparent;padding:14px 4px}
  body[data-view=locked] .jump button{border-radius:4px;background:#fff}
  body[data-view=locked] .jump button.marked{border-color:var(--red);color:var(--red);box-shadow:inset 0 -3px var(--red)}
  .feedback-mode{margin:0 4px 12px;font-size:12px;color:var(--muted);font-weight:500}
  .feedback-mode select{display:inline-block;width:136px;min-height:38px;margin:0 0 0 8px;padding:7px 32px 7px 12px;font-size:13px;font-weight:600;border:1px solid #c82040;border-radius:8px;appearance:none;background-color:#fff;background-image:linear-gradient(45deg,transparent 50%,#c82040 50%),linear-gradient(135deg,#c82040 50%,transparent 50%);background-position:calc(100% - 15px) 16px,calc(100% - 10px) 16px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;box-shadow:0 0 0 3px #c8204018}
  .feedback-mode select:focus{outline:3px solid #c8204030;outline-offset:1px}
}
@media(max-width:680px){
  body[data-view=home]{overflow:hidden;height:100dvh}
  body[data-view=home] main{height:calc(100dvh - 60px);padding:16px 16px 24px;overflow:hidden}
  .home-screen{height:100%;display:flex;flex-direction:column;justify-content:center;gap:18px}
  .home-screen .hero{margin:0;padding:24px 20px;border-radius:10px}
  .home-actions{display:grid;gap:12px}
  .home-action{display:flex;align-items:center;justify-content:space-between;min-height:72px;padding:16px 18px;text-align:left;background:#fff;color:var(--ink);border:1px solid #d4d8df;border-left:5px solid var(--red);border-radius:6px;box-shadow:0 3px 10px #1b24300b}
  .home-action strong{font-size:17px}.home-action small{color:var(--muted);font-size:12px}
}
.brand-home{margin:0;padding:0;border:0;background:transparent;color:var(--ink);min-height:32px;border-radius:4px}
.brand-home:hover{background:transparent;filter:none}.brand-home:active{transform:none}
#refresh{display:inline-flex;width:max-content;min-height:42px;padding:9px 16px;align-self:start;justify-self:start;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:6px;box-shadow:none}
.admin-cards>#refresh{grid-column:1 / -1}
.admin-published{margin-top:20px;padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.admin-published>.row:first-child{margin-bottom:14px}
.admin-published>.row:first-child h2{margin:0;font-size:20px}
.exam-filters{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:10px;margin-bottom:12px}
.exam-filters input,.exam-filters select{margin:0;min-height:42px}
.admin-published .published-card{min-height:70px;margin:8px 0;padding:14px 16px;background:#fff;border:1px solid var(--line);border-left:4px solid #8b9d83;border-radius:8px!important;box-shadow:none}
.admin-published .published-card h3{margin:0 0 4px;font-size:16px}
.admin-published .published-card small{font-size:12px;color:var(--muted)}
.admin-published .published-card button{min-height:38px;padding:8px 14px;border-radius:6px;background:#606c38;color:#fff}
.admin-page>.admin-sidebar{text-align:center}
.admin-page>.admin-sidebar .dashboard-stats{display:block;grid-template-columns:none;gap:0;text-align:center}
.admin-page>.admin-sidebar .dashboard-stats small{white-space:nowrap}
.admin-page>.admin-sidebar strong,.admin-page>.admin-sidebar small,.admin-page>.admin-sidebar b{display:block;text-align:center}
.admin-page>.admin-sidebar b{font-size:30px!important;line-height:1.15;margin-top:5px}
@media(max-width:680px){.admin-published{padding:14px}.exam-filters{grid-template-columns:1fr}.admin-published .published-card{align-items:center;padding:12px}.admin-published .published-card button{width:auto}}
