.asa-overlay{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(2,8,14,.78);backdrop-filter:blur(4px);box-sizing:border-box}.asa-card{width:min(680px,94vw);max-height:min(760px,92vh);display:flex;flex-direction:column;overflow:hidden;background:#0b2233;color:#e7f2fa;border:1px solid var(--line2,#45697b);border-radius:10px;box-shadow:0 30px 80px rgba(0,0,0,.6);outline:none}.asa-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:16px 20px;border-bottom:1px solid var(--line,#284758);font-family:"Songti SC",serif;color:var(--gold2,#f0c674)}.asa-card h2{margin:0;font-size:18px;letter-spacing:.08em}.asa-meta{display:flex;gap:8px;align-items:center;margin-top:8px;font:12px system-ui;color:#abc2d0}.asa-badge{padding:3px 8px;border-radius:12px;background:rgba(230,180,92,.16);color:#f3d28d}.asa-close{border:1px solid #45697b;border-radius:7px;background:transparent;color:#abc2d0;font-size:13px;min-width:72px;min-height:44px;white-space:nowrap;cursor:pointer;flex:none}.asa-close:disabled{opacity:.45;cursor:wait}.asa-body{padding:20px;overflow:auto;font-size:14px;line-height:1.7}.asa-question-head{display:flex;justify-content:space-between;gap:10px;color:#a9c5d5;font-size:12px}.asa-clock{color:#f0c674;font-variant-numeric:tabular-nums;font-size:18px;font-weight:700}.asa-category{margin:16px 0 4px;color:#8fb9cb;font-size:12px}.asa-body h3{margin:0 0 16px;font-size:18px;line-height:1.55;overflow-wrap:anywhere}.asa-choices{border:0;padding:0;margin:0;min-width:0}.asa-choice{display:flex;gap:10px;align-items:flex-start;padding:12px;margin:8px 0;border:1px solid rgba(126,174,201,.25);border-radius:8px;cursor:pointer;overflow-wrap:anywhere}.asa-choice:hover,.asa-choice.selected{border-color:#4cb5da;background:rgba(76,181,218,.12)}.asa-choice input{margin-top:5px;accent-color:#4cb5da;flex:none}.asa-choices:disabled .asa-choice{cursor:wait;opacity:.7}.asa-feedback{margin-top:16px;padding:12px;border-radius:8px;line-height:1.65}.asa-feedback.correct{border:1px solid rgba(75,184,143,.45);background:rgba(75,184,143,.12)}.asa-feedback.incorrect{border:1px solid rgba(239,106,91,.5);background:rgba(239,106,91,.1)}.asa-feedback p{margin:5px 0}.asa-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:18px}.asa-notice{padding:0 20px 16px;display:flex;align-items:center;justify-content:flex-end;gap:10px}.asa-error{margin:0 auto 0 0;color:#ffb4ac;font-size:13px}.asa-summary{text-align:center}.asa-summary h3{font-size:20px;color:#f0c674}.asa-summary>strong{display:block;font-size:34px;color:#e7f2fa;font-variant-numeric:tabular-nums}.asa-up{color:#7ee0ab;font-weight:700}.asa-card button:focus-visible,.asa-choice:focus-within{outline:2px solid #8bd6f0;outline-offset:3px}@media(max-width:420px){.asa-overlay{padding:8px}.asa-card{width:100%;max-height:96vh}.asa-card header,.asa-body{padding-left:14px;padding-right:14px}.asa-body h3{font-size:16px}.asa-choice{padding:10px}.asa-notice{padding-left:14px;padding-right:14px}}

.asa-level-badge{display:inline-block;margin-left:8px;padding:1px 8px;border:1px solid rgba(230,180,92,.6);border-radius:999px;background:rgba(230,180,92,.16);color:#f6d79b;font-size:12px;font-weight:700;vertical-align:middle;letter-spacing:.02em}

/* Captain level privileges gated by the matching ASA certificate. */
.asa-meta .asa-gate{flex:0 1 auto;min-width:0;padding:2px 8px;border-radius:10px;border:1px solid rgba(126,174,201,.4);background:rgba(12,40,56,.7);color:#bcd6e5;font-size:11.5px;white-space:normal;overflow-wrap:anywhere}
.asa-meta .asa-gate.is-locked{border-color:rgba(239,106,91,.55);background:rgba(239,106,91,.12);color:#ffcfc7}
.asa-meta .asa-gate-reward{flex:0 1 auto;min-width:0;color:#9fd8bf;font-size:11px;white-space:normal;overflow-wrap:anywhere}
.asa-meta .asa-next-level{flex:0 1 auto;min-width:0;padding:2px 8px;border-radius:10px;border:1px solid rgba(240,198,116,.45);background:rgba(240,198,116,.1);color:#f3d28d;font-size:11.5px;white-space:normal;overflow-wrap:anywhere}
.asa-meta .asa-next-level.is-max{border-color:rgba(126,224,171,.45);background:rgba(126,224,171,.1);color:#9fe8c0}
.asa-meta .asa-sep{flex:none;color:#4a6b7d;font-size:11px}
@media(max-width:700px){.asa-meta{flex-wrap:wrap;gap:6px}.asa-meta .asa-gate,.asa-meta .asa-gate-reward,.asa-meta .asa-next-level{font-size:10.5px}}

.asa-appeal{display:block;border:0;background:transparent;color:#aab8c2;font-size:12px;padding:3px 0;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.asa-appeal:hover,.asa-appeal:focus-visible{color:#e6f4fa}.asa-appeal:disabled{opacity:.55;cursor:default}
.asa-appeal-status{display:block;color:#aab8c2;font-size:12px}
/* Per-question scene illustration rendered by the server from the prompt. */
.asa-scene{position:relative;margin:0 0 12px;padding:0;border:1px solid rgba(126,174,201,.28);border-radius:10px;overflow:hidden;background:#071c2a;line-height:0}
.asa-scene svg{display:block;width:100%;height:auto;aspect-ratio:480 / 190;min-height:120px}
.asa-scene figcaption{padding:7px 10px;border-top:1px solid rgba(126,174,201,.2);color:#a9c5d5;font-size:12px;line-height:1.45}
.asa-scene-zoom{position:absolute;right:8px;top:8px;min-width:44px;min-height:44px;border:1px solid rgba(126,174,201,.55);border-radius:7px;background:#071c2acc;color:#e7f2fa;cursor:pointer;line-height:1}
.asa-scene-zoom:hover,.asa-scene-zoom:focus-visible{border-color:#4cb5da;background:#0e3850;outline:2px solid #4cb5da;outline-offset:2px}
.asa-scene-dialog{position:fixed;inset:0;z-index:71;display:flex;align-items:center;justify-content:center;padding:18px;background:#02080ed9}
.asa-scene-dialog[hidden]{display:none}
.asa-scene-dialog-inner{position:relative;width:min(960px,96vw);max-height:92vh;overflow:auto;padding:12px;background:#071c2a;border:1px solid #45697b;border-radius:10px}
.asa-scene-dialog svg{display:block;width:100%;height:auto}
.asa-scene-dialog-close{position:absolute;right:16px;top:16px;min-width:44px;min-height:44px;border:1px solid #45697b;border-radius:7px;background:#071c2acc;color:#fff;cursor:pointer}
@media(max-width:700px){.asa-scene{margin:0 0 8px}.asa-scene svg{min-height:0}.asa-scene figcaption{font-size:11px}}
@media(max-width:360px){.asa-body{padding:12px}}

/* ============================================================
 Viewport fit (2026-11-19): keep the whole question, every choice
 and the primary action inside the screen without any scrolling.
 ============================================================ */
.asa-overlay{padding:12px}
.asa-card{width:min(680px,calc(100vw - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px)}
.asa-card header{padding:12px 18px}
.asa-card h2{font-size:17px}
.asa-meta{margin-top:5px}
.asa-body{padding:6px 18px 12px;overflow-x:hidden}
.asa-question-head{margin-top:6px}
.asa-category{margin:6px 0 2px}
.asa-body h3{margin:0 0 10px;font-size:17px;line-height:1.4}
.asa-scene{margin:0 0 10px}
.asa-scene svg{width:100%;height:clamp(100px,16vh,200px);aspect-ratio:auto;min-height:0}
.asa-scene figcaption{padding:5px 10px;font-size:11px;line-height:1.4}
.asa-choice{padding:9px 11px;margin:5px 0;line-height:1.45}
.asa-feedback{margin-top:10px;padding:9px 11px;line-height:1.5}
.asa-feedback p{margin:3px 0}
.asa-actions{position:sticky;bottom:0;z-index:3;margin-top:10px;padding:6px 0 2px;background:linear-gradient(180deg,rgba(11,34,51,0),#0b2233 16px)}
.asa-card:has(.asa-feedback) .asa-scene svg{height:clamp(70px,10vh,130px)}
.asa-card:has(.asa-feedback) .asa-calculator{display:none}
.asa-card:has(.asa-feedback) .asa-numeric-layout{grid-template-columns:minmax(0,1fr)}
@media(max-height:820px){.asa-body h3{font-size:16px;line-height:1.36;margin-bottom:8px}.asa-category{margin:4px 0 2px}.asa-choice{padding:7px 10px;margin:4px 0}.asa-scene svg{height:clamp(88px,13vh,160px)}.asa-feedback{padding:8px 10px;font-size:13px}.asa-calculator button{min-height:26px}}
@media(max-height:660px){.asa-card header{padding:8px 14px}.asa-card h2{font-size:15px}.asa-close{min-height:34px;font-size:12px}.asa-body{padding:2px 14px 8px}.asa-scene{display:none}.asa-actions{margin-top:6px}.asa-choice{padding:6px 9px;margin:3px 0;font-size:13px}}
@media(max-width:420px){.asa-card{width:100%}.asa-scene svg{height:clamp(84px,14vh,150px)}}

/* 2026-11-19 round 3: narrow phones. The decorative scene is dropped below
   720px so the prompt, every choice and the action button always fit. */
@media(max-width:700px) and (max-height:720px){
.asa-scene{display:none}
.asa-card header{padding:8px 12px}
.asa-card h2{font-size:15px}
.asa-close{min-height:34px;min-width:56px;font-size:12px}
.asa-body{padding:4px 12px 8px;line-height:1.35}
.asa-question-head{font-size:11px;line-height:1.25}
.asa-clock{font-size:14px}
.asa-category{font-size:11px;margin:3px 0 1px}
.asa-body h3{font-size:14px;line-height:1.3;margin-bottom:5px}
.asa-choice{padding:5px 8px;margin:3px 0;font-size:12px;line-height:1.3}
.asa-feedback{margin-top:6px;padding:6px 8px;font-size:11.5px;line-height:1.35}
.asa-feedback p{margin:2px 0}
.asa-feedback .asa-appeal{font-size:11px;padding:1px 0}
.asa-actions{margin-top:6px}
.asa-actions .btn{min-height:36px;padding:4px 12px;font-size:13px}
.asa-notice{padding:0 12px 8px}
}
/* 2026-11-19 round 5: small portrait phones keep every control visible. */
@media(max-width:380px) and (max-height:620px){
.asa-question-head{font-size:10px;line-height:1.2}
.asa-clock{font-size:12px}
.asa-category{font-size:10px;margin:2px 0 1px}
.asa-body h3{font-size:12px;line-height:1.2;margin-bottom:3px}
.asa-choice{padding:2px 6px;margin:2px 0;font-size:11px;line-height:1.2}
.asa-feedback{margin-top:4px;padding:4px 6px;font-size:10.5px;line-height:1.3}
.asa-actions{margin-top:4px}
.asa-actions .btn{min-height:32px;padding:2px 10px;font-size:12px}
}
/* 2026-11-19 round 3: very short narrow phones get the compact stack. */
@media(max-width:700px) and (max-height:560px){
.asa-card header{padding:4px 8px}
.asa-card h2{font-size:13px}
.asa-meta{display:none}
.asa-close{min-height:28px;min-width:48px;font-size:11px}
.asa-body{padding:2px 8px 4px;line-height:1.25}
.asa-question-head{font-size:10px;line-height:1.2;margin-top:2px}
.asa-clock{font-size:12px}
.asa-category{font-size:10px;margin:2px 0 1px}
.asa-body h3{font-size:12px;line-height:1.2;margin-bottom:3px}
.asa-choice{padding:3px 6px;margin:2px 0;font-size:11px;line-height:1.2;gap:6px}
.asa-choice input{margin-top:2px}
.asa-feedback{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:6px;row-gap:0;margin-top:4px;padding:4px 6px;font-size:10.5px;line-height:1.25}
.asa-feedback strong{font-size:10.5px}
.asa-feedback p{margin:0;flex:0 1 auto}
.asa-feedback p:last-child{flex:1 0 100%}
.asa-feedback .asa-appeal{display:inline-block;padding:0;font-size:10.5px;line-height:1.25}
.asa-appeal-status{display:inline;font-size:10.5px}
.asa-actions{margin-top:4px;padding:2px 0 0}
.asa-actions .btn{min-height:32px;padding:2px 10px;font-size:12px}
.asa-notice{padding:0 8px 4px}
}
/* Numeric questions: a 6-column keypad keeps the calculator short enough to fit. */
.asa-calc-keys{grid-template-columns:repeat(6,minmax(0,1fr))}
.asa-calculator button[data-asa-key="="]{grid-column:auto}
.asa-calculator{gap:5px;padding:8px}
@media(max-height:900px){.asa-card:has(.asa-numeric-layout) .asa-scene svg{height:clamp(60px,8vh,100px)}.asa-calculator button{min-height:27px}.asa-calculator input{height:30px}.asa-calculator output{min-height:18px}}
@media(max-height:620px){.asa-card:has(.asa-numeric-layout) .asa-scene{display:none}}
@media(max-height:460px){.asa-body{padding:0 10px 6px}.asa-body h3{font-size:13px;line-height:1.25;margin-bottom:5px}.asa-category{display:none}.asa-choice{padding:5px 8px;margin:2px 0;font-size:12px;line-height:1.3}.asa-feedback{padding:6px 8px;font-size:11.5px;line-height:1.35;margin-top:6px}.asa-actions{margin-top:4px}}

/* Ultra-compact layout for very short viewports (phone landscape). */
@media(max-width:480px){.asa-body h3{margin-bottom:5px}.asa-category{margin:2px 0}}
@media(max-height:460px){.asa-overlay{padding:4px}.asa-card{max-height:calc(100vh - 8px);max-height:calc(100dvh - 8px)}.asa-card header{padding:4px 10px}.asa-card h2{font-size:13px}.asa-meta{display:none}.asa-close{min-height:28px;min-width:52px;font-size:11px}.asa-body{padding:0 8px 4px}.asa-question-head{font-size:11px}.asa-body h3{font-size:12px;line-height:1.2;margin-bottom:3px}.asa-choice{padding:4px 7px;margin:2px 0;font-size:11.5px;line-height:1.25}.asa-feedback{padding:5px 7px;font-size:11px;line-height:1.3;margin-top:4px}.asa-feedback p{margin:2px 0}.asa-actions{margin-top:3px;padding:3px 0 0}.asa-actions .btn{min-height:30px;padding:3px 10px;font-size:12px}}
/* 2026-11-19 round 2: phones in landscape (height <= 460px) must show every
   choice, the feedback and the submit/next button without any scrolling. */
@media(max-height:460px){
.asa-body{padding:0 6px 2px;line-height:1.2}
.asa-question-head{font-size:10px;line-height:1.2;margin-top:2px}
.asa-clock{font-size:12px;line-height:1.2}
.asa-body h3{font-size:12px;line-height:1.2;margin-bottom:3px}
.asa-choice{padding:2px 6px;margin:2px 0;font-size:11px;line-height:1.2;gap:6px}
.asa-choice input{margin-top:2px}
.asa-feedback{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:6px;row-gap:0;margin-top:3px;padding:3px 6px;font-size:10.5px;line-height:1.25}
.asa-feedback strong{font-size:10.5px}
.asa-feedback p{margin:0;flex:0 1 auto}
.asa-feedback p:last-child{flex:1 0 100%}
.asa-feedback .asa-appeal{display:inline-block;padding:0;font-size:10.5px;line-height:1.25}
.asa-appeal-status{display:inline;font-size:10.5px}
.asa-actions{margin-top:3px;padding:2px 0 0}
.asa-actions .btn{min-height:28px;padding:2px 10px;font-size:11.5px}
.asa-notice{padding:2px 8px 4px}
}
/* 2026-11-19: after submitting, the correct option's radio renders as a
   filled green circle so the right answer is obvious at a glance. */
.asa-choice.is-correct{border-color:#22c55e;background:rgba(34,197,94,.14)}
.asa-choices:disabled .asa-choice.is-correct{opacity:1}
.asa-choice.is-correct input[type="radio"]{
  appearance:none;-webkit-appearance:none;
  width:15px;height:15px;margin-top:4px;
  border:2px solid #22c55e;border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 2px rgba(34,197,94,.22);
}

/* 2026-11-19: question snapshot button ("拍照") beside submit/next. It copies
   the current question and its options to the clipboard as a PNG and falls
   back to a file download when the clipboard API is unavailable. */
.asa-actions .asa-photo{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:4px 12px;border:1px solid rgba(126,174,201,.5);border-radius:8px;background:rgba(12,40,56,.85);color:#d9ecf6;font-size:13px;line-height:1.2;cursor:pointer}
.asa-actions .asa-photo:hover{border-color:#4cb5da;background:rgba(76,181,218,.16);color:#fff}
.asa-actions .asa-photo:disabled{opacity:.55;cursor:wait}
.asa-actions .asa-photo svg{width:17px;height:17px;flex:none}
.asa-photo-toast{position:fixed;left:50%;bottom:28px;z-index:79;transform:translateX(-50%);max-width:min(560px,90vw);padding:11px 18px;border:1px solid rgba(75,184,143,.5);border-radius:24px;background:rgba(10,30,46,.96);color:#d8f5e6;font-size:13px;line-height:1.5;text-align:center;box-shadow:0 12px 32px rgba(0,0,0,.45);pointer-events:none}
.asa-photo-toast.is-error{border-color:rgba(239,106,91,.6);color:#ffcfc7}
.asa-photo-toast[hidden]{display:none}
@media(max-width:430px),(max-height:460px){.asa-actions .asa-photo span{display:none}.asa-actions .asa-photo{min-width:36px;padding:4px 10px}}
@media(max-height:460px){.asa-actions .asa-photo{min-height:28px;padding:2px 9px}}
