/* Scoped question UI. Existing models, account pages and Life Ark are unchanged. */
[data-portal-current="exams"] .resource-view { padding-top: 38px; }
[data-portal-current="exams"] .resource-header { min-height: 170px; margin-bottom: 22px; padding-bottom: 20px; }
[data-portal-current="exams"] .resource-hero-copy { transform: none; gap: 12px; }
.qp, .qp-paper { --qp-ink:#17384a; --qp-muted:#5f7481; --qp-green:#31816e; --qp-dark:#245f52; --qp-line:#dbe7e3; color:var(--qp-ink); font-size:15px; line-height:1.65; }
.qp *, .qp-paper *, .qp-dialog * { box-sizing:border-box; }
.qp[hidden], .qp [hidden], .qp-paper [hidden] { display:none!important; }
.qp h2, .qp h3, .qp p, .qp-paper h1, .qp-paper h2, .qp-paper h3, .qp-paper p { margin:0; }
.qp button, .qp input, .qp-paper button, .qp-paper input, .qp-paper textarea, .qp-dialog button { font:inherit; }
.qp button, .qp-paper button, .qp-dialog button { cursor:pointer; }
.qp button:disabled, .qp-paper button:disabled { cursor:not-allowed; opacity:.5; }
.qp button:focus-visible, .qp input:focus-visible, .qp a:focus-visible, .qp-paper button:focus-visible, .qp-paper a:focus-visible, .qp-paper input:focus-visible, .qp-paper textarea:focus-visible, .qp-dialog button:focus-visible { outline:3px solid #73b5a3; outline-offset:3px; }
.qp input[type="checkbox"], .qp-paper input[type="checkbox"], .qp-paper input[type="radio"] { accent-color:var(--qp-green); width:18px; height:18px; flex:0 0 18px; }
.qp-topline { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
.qp-path { display:flex; align-items:center; gap:16px; color:#6d8189; font-size:13px; }
.qp-path .is-current { color:var(--qp-dark); font-weight:800; }
.qp-path i { width:28px; height:1px; background:#c2d8cf; }
.qp-demo, .qp-mini-tag { display:inline-flex; align-items:center; border:1px solid #d1e3da; background:#f0f8f3; color:#3d715f; border-radius:7px; padding:3px 9px; font-size:11px; font-weight:600; white-space:nowrap; }
.qp-demo { background:#fff9ed; color:#896c30; border-color:#ebdfc2; }
.qp-setup-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; align-items:start; gap:22px; }
.qp-config { display:grid; gap:20px; min-width:0; }
.qp-panel { border:1px solid var(--qp-line); border-radius:22px; padding:28px; background:#fff; box-shadow:0 8px 30px #17384a05; min-width:0; }
.qp-section-title { display:flex; align-items:flex-start; gap:13px; margin-bottom:22px; }
.qp-step { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; color:var(--qp-green); background:#edf7f2; font-size:12px; font-weight:800; flex-shrink:0; margin-top:2px; }
.qp-section-title h2 { font-size:19px; line-height:1.5; font-weight:700; }
.qp-section-title p { font-size:12px; color:var(--qp-muted); margin-top:3px; }
.qp-segments { display:flex; gap:5px; padding:5px; border-radius:12px; background:#f1f6f4; margin-bottom:20px; }
.qp-segments button { flex:1; min-height:43px; border:1px solid transparent; border-radius:9px; color:#617870; background:none; font-size:13px; }
.qp-segments button[aria-pressed="true"] { border-color:#d0e3d8; color:var(--qp-dark); background:#fff; font-weight:700; box-shadow:0 2px 6px #245f5207; }
.qp-all { display:flex; align-items:center; gap:16px; min-height:78px; background:linear-gradient(110deg,#f1f9f5,#fafcfb); border:1px dashed #c8dfd3; border-radius:14px; padding:20px; }
.qp-all-symbol { font-size:36px; line-height:1; color:#75ad98; }
.qp-all strong { font-size:14px; }
.qp-all p { color:var(--qp-muted); font-size:12px; margin-top:5px; }
.qp-all .qp-mini-tag { margin-left:auto; }
.qp-directory-heading { display:flex; justify-content:space-between; gap:10px; font-size:13px; margin:20px 0 12px; }
.qp-directory-heading span { font-size:11px; color:var(--qp-muted); }
.qp-directory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.qp-directory label { display:flex; align-items:center; gap:10px; border:1px solid var(--qp-line); border-radius:11px; padding:13px 12px; cursor:pointer; min-width:0; }
.qp-directory label:has(:checked) { border-color:#6ea991; background:#f2f9f5; }
.qp-directory strong { display:block; font-size:13px; }
.qp-directory small { font-size:11px; color:var(--qp-muted); }
.qp-package-grid, .qp-difficulty-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.qp-package, .qp-difficulty { border:1px solid var(--qp-line); border-radius:13px; background:#fff; padding:16px 12px; text-align:left; color:var(--qp-ink); min-width:0; position:relative; }
.qp-package[aria-pressed="true"], .qp-difficulty[aria-pressed="true"] { border-color:#4b927a; background:#f0f8f3; box-shadow:inset 0 0 0 1px #4b927a; }
.qp-package strong, .qp-package span, .qp-difficulty strong, .qp-difficulty span, .qp-difficulty small { display:block; }
.qp-package strong, .qp-difficulty strong { font-size:14px; }
.qp-package span, .qp-difficulty > span:not(.qp-level-bars) { font-size:11px; color:var(--qp-muted); margin-top:5px; }
.qp-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:24px; }
.qp-counts > label > span { font-size:12px; font-weight:700; }
.qp-number { display:flex; align-items:center; gap:8px; border:1px solid var(--qp-line); border-radius:10px; margin-top:7px; padding-right:12px; }
.qp-number input { width:100%; min-width:0; padding:10px 12px; border:0; background:transparent; color:var(--qp-ink); font-size:17px; }
.qp-number > span { font-size:12px; color:var(--qp-muted); }
.qp-counts small { display:block; font-size:10px; color:var(--qp-muted); margin-top:6px; }
.qp-difficulty small { font-size:10px; color:#75857e; margin-top:13px; line-height:1.6; }
.qp-difficulty .qp-level-bars { display:flex; align-items:end; gap:3px; height:18px; margin-bottom:10px; }
.qp-level-bars i { width:5px; border-radius:2px; background:#b8d3c6; height:7px; }
.qp-level-bars i:nth-child(2) { height:12px; }
.qp-level-bars i:nth-child(3) { height:17px; }
[data-difficulty="basic"] i:first-child, [data-difficulty="middle"] i:not(:last-child), [data-difficulty="advanced"] i { background:#418670; }
.qp-note { font-size:11px; color:var(--qp-muted); line-height:1.8; margin-top:14px!important; }
.qp-plan { position:sticky; top:24px; padding:26px 22px; border-top:3px solid var(--qp-green); }
.qp-eyebrow { color:#7ba08f; font-size:10px; letter-spacing:.16em; font-weight:700; }
.qp-plan h2 { font-size:20px; margin-top:7px; }
.qp-plan-total { display:flex; align-items:baseline; gap:9px; margin:17px 0 22px; }
.qp-plan-total strong { color:var(--qp-dark); font-size:56px; font-weight:600; line-height:1; font-variant-numeric:tabular-nums; }
.qp-plan-total span { font-size:13px; color:var(--qp-muted); }
.qp-plan dl { margin:0; }
.qp-plan dl > div { display:grid; grid-template-columns:58px minmax(0,1fr); gap:10px; font-size:12px; padding:12px 0; border-top:1px solid #edf2ef; }
.qp-plan dt { color:var(--qp-muted); }
.qp-plan dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.qp-composition { padding:15px 0; color:var(--qp-dark); font-size:12px; font-weight:700; }
.qp-button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:44px; padding:10px 17px; border:1px solid #c6dbd1; border-radius:11px; color:var(--qp-dark); background:#fff; text-decoration:none; font-size:13px; font-weight:650; }
.qp-button:hover { background:#f0f7f3; }
.qp-primary { background:var(--qp-green,#31816e); border-color:var(--qp-green,#31816e); color:#fff; }
.qp-primary:hover { background:#276e5c; color:#fff; }
.qp-wide { width:100%; }
.qp-validation { color:#9b5d2a; font-size:12px; line-height:1.8; }
.qp-validation:not(:empty) { margin-bottom:15px; }
.qp-prototype-note { padding-top:17px; margin-top:20px; border-top:1px solid var(--qp-line); color:#7b8a85; font-size:10px; line-height:1.9; }
.qp-resume { display:flex; justify-content:space-between; gap:16px; padding:13px 18px; border:1px solid #c9dfd3; border-radius:12px; background:#edf7f0; margin-bottom:20px; font-size:13px; }
.qp-resume a { color:var(--qp-dark); white-space:nowrap; font-weight:700; }

/* The paper is a separate document. All question cards remain in normal flow. */
.qp-paper.resource-view { padding-top:34px; }
.qp-paper .qp-page-head { margin:24px 0 28px; display:flex; align-items:flex-start; justify-content:space-between; gap:24px; }
.qp-breadcrumb { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:12px; }
.qp-breadcrumb a { color:var(--qp-muted); text-decoration:none; }
.qp-paper h1 { font-size:32px; letter-spacing:.01em; font-family:"Noto Serif SC","Songti SC","SimSun",serif; margin-bottom:10px; }
.qp-page-head p { color:var(--qp-muted); font-size:13px; }
.qp-meta { display:flex; gap:9px 16px; flex-wrap:wrap; margin-top:15px; font-size:12px; color:var(--qp-dark); }
.qp-layout { display:grid; grid-template-columns:minmax(0,1fr) 238px; grid-template-areas:"questions rail"; align-items:start; gap:22px; }
.qp-question-list { grid-area:questions; min-width:0; }
.qp-rail { grid-area:rail; position:sticky; top:24px; padding:24px 19px; }
.qp-rail h2 { font-size:16px; }
.qp-progress-line { display:flex; justify-content:space-between; gap:8px; margin-top:14px; font-size:12px; }
.qp-progress-track { background:#edf3ef; height:6px; border-radius:8px; overflow:hidden; margin:10px 0 19px; }
.qp-progress-track > span { display:block; height:100%; background:#4a9a7d; transition:width .15s; }
.qp-number-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.qp-answer-map > summary { display:none; cursor:pointer; }
.qp-answer-map > summary:focus-visible { outline:3px solid #73b5a3; outline-offset:3px; }
.qp-number-grid button { min-width:0; min-height:35px; border:1px solid #dbe5df; border-radius:8px; background:#fff; color:#66786e; font-size:12px; position:relative; }
.qp-number-grid button.is-done { background:#e2f2e9; color:#2c7259; border-color:#abcdb9; }
.qp-number-grid button.is-flagged::after { content:""; position:absolute; top:3px; right:3px; width:5px; height:5px; border-radius:50%; background:#c29337; }
.qp-number-grid button.is-wrong { background:#fff1e9; border-color:#e3c3af; color:#9a562b; }
.qp-legend { display:flex; gap:10px; flex-wrap:wrap; margin:13px 0 19px; font-size:10px; color:#738078; }
.qp-legend span { display:flex; align-items:center; gap:4px; }
.qp-legend i { width:7px; height:7px; border:1px solid #cad9cf; border-radius:2px; }
.qp-legend .is-done { background:#aed1bb; }
.qp-legend .is-flagged { background:#c29337; border-color:#c29337; border-radius:50%; }
.qp-storage-note { font-size:10px; color:#7e8984; line-height:1.8; margin-top:14px!important; }
.qp-storage-note.is-error { color:#9b5d2a; }
.qp-group-title { display:flex; align-items:baseline; gap:12px; margin:26px 0 15px!important; font-size:19px; }
.qp-group-title:first-child { margin-top:0!important; }
.qp-group-title small { font-size:11px; font-weight:400; color:var(--qp-muted); }
.qp-question { background:#fff; border:1px solid var(--qp-line); border-radius:18px; padding:25px 27px; margin-bottom:17px; scroll-margin-top:22px; min-width:0; }
.qp-question:focus { outline:2px solid #91bba7; outline-offset:3px; }
.qp-question-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:13px; }
.qp-q-label { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.qp-q-number { color:var(--qp-dark); font-size:18px; font-weight:700; }
.qp-q-tag { color:#708375; background:#f2f6f3; padding:2px 7px; border-radius:5px; font-size:10px; }
.qp-flag { min-height:36px; border:0; background:none; color:#809087; font-size:11px!important; padding:5px; white-space:nowrap; }
.qp-flag[aria-pressed="true"] { color:#a47420; }
.qp-prompt { font-size:15px; line-height:1.95; }
.qp-prompt sub, .qp-prompt sup { line-height:0; }
.qp-options { display:grid; gap:9px; border:0; padding:0; margin:19px 0 0; min-width:0; }
.qp-options legend { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
.qp-option { display:flex; align-items:center; gap:11px; padding:11px 13px; border:1px solid #e2eae5; border-radius:10px; cursor:pointer; font-size:13px; min-height:46px; }
.qp-option:has(:checked) { background:#edf7f1; border-color:#8cbea5; }
.qp-option:has(:disabled) { cursor:default; opacity:1; }
.qp-option input { margin:0; }
.qp-option b { font-weight:600; color:#6e8d7b; }
.qp-part { display:block; margin-top:20px; font-size:13px; }
.qp-part > span { display:block; margin-bottom:9px; line-height:1.8; }
.qp-part textarea { display:block; width:100%; min-height:100px; border:1px solid #d8e4dc; border-radius:10px; background:#fbfdfb; color:var(--qp-ink); padding:12px 14px; resize:vertical; font-size:13px; line-height:1.8; }
.qp-part textarea:disabled { opacity:1; background:#f7faf7; color:#52645a; }
.qp-table-scroll { overflow-x:auto; margin:17px 0; max-width:100%; }
.qp-data-table { width:100%; border-collapse:collapse; font-size:12px; }
.qp-data-table caption { text-align:left; margin-bottom:6px; font-size:11px; color:var(--qp-muted); }
.qp-data-table td, .qp-data-table th { border:1px solid #d9e4dd; padding:9px; text-align:center; }
.qp-data-table th { font-weight:500; background:#f4f8f5; }
.qp-feedback { border-top:1px dashed #d4e3d9; padding-top:17px; margin-top:22px; font-size:13px; }
.qp-feedback h3 { color:#26704e; font-size:14px; margin-bottom:10px; }
.qp-feedback h3.is-wrong { color:#a36b30; }
.qp-feedback p { margin-top:8px; line-height:1.8; }
.qp-feedback .qp-explanation { color:var(--qp-muted); font-size:12px; }
.qp-self-rate { display:flex; gap:7px; flex-wrap:wrap; margin-top:14px; }
.qp-self-rate button { border:1px solid #d3e1d7; border-radius:7px; padding:7px 11px; background:#fff; color:#58745f; font-size:11px; min-height:36px; }
.qp-self-rate button[aria-pressed="true"] { background:#e4f3e9; border-color:#90bca1; color:#276d45; }
.qp-paper-bottom { display:flex; align-items:center; justify-content:space-between; gap:16px; background:#fff; border:1px solid var(--qp-line); padding:18px 22px; border-radius:16px; margin-top:24px; }
.qp-paper-bottom p { font-size:12px; color:var(--qp-muted); }
.qp-report { border-top:3px solid #438e70; margin-bottom:24px; padding:24px 27px; }
.qp-report-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.qp-report-heading h2 { font-size:21px; }
.qp-report-score { font-size:34px; font-weight:600; color:var(--qp-dark); white-space:nowrap; }
.qp-report-score small { font-size:11px; font-weight:400; color:var(--qp-muted); }
.qp-report p { font-size:13px; margin-top:12px; }
.qp-report a { display:inline-block; margin-top:12px; color:var(--qp-dark); font-size:12px; }
.qp-dialog { border:1px solid #cfdfd4; border-radius:20px; box-shadow:0 25px 90px #123a2d33; max-width:min(490px,calc(100vw - 32px)); width:490px; padding:29px; color:#17384a; font-family:"Microsoft YaHei UI","PingFang SC",sans-serif; }
.qp-dialog::backdrop { background:#153d324d; backdrop-filter:blur(3px); }
.qp-dialog h2 { font-size:21px; margin:0 0 14px; }
.qp-dialog p { color:#5f7481; font-size:13px; line-height:1.9; }
.qp-dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; flex-wrap:wrap; }
.qp-dialog label { font-size:13px; display:flex; gap:10px; align-items:center; margin:16px 0; }
.qp-dialog .qp-print-sheet { padding:18px; border:1px solid #dce5df; background:#f6faf7; border-radius:11px; font-size:13px; line-height:2; }
.qp-print-heading { display:none; }
.qp-paper .qp-empty-state { padding:60px 30px; text-align:center; }
.qp-empty-state h1 { font-size:27px; }
.qp-empty-state p { margin:12px 0 25px; }
.qp-studio-nav a { text-decoration:none; }
@media (max-width:1220px) {
  .qp-setup-layout { grid-template-columns:minmax(0,1fr) 245px; gap:17px; }
  .qp-panel { padding:23px 20px; }
  .qp-package-grid { gap:7px; }
  .qp-difficulty-grid { grid-template-columns:1fr; }
  .qp-difficulty { display:grid; grid-template-columns:25px 90px 1fr; align-items:center; gap:4px 8px; padding:12px; }
  .qp-difficulty .qp-level-bars { grid-row:span 2; margin:0; }
  .qp-difficulty small { margin:0; grid-column:3; }
  .qp-difficulty > span:not(.qp-level-bars) { grid-column:3; margin:0; }
  .qp-difficulty strong { grid-row:span 2; }
  .qp-all { flex-wrap:wrap; }
  .qp-all .qp-mini-tag { margin-left:0; }
  .qp-layout { grid-template-columns:minmax(0,1fr) 210px; gap:16px; }
  .qp-question { padding:22px; }
}
@media (max-width:1080px) and (min-width:821px) {
  .qp-setup-layout { grid-template-columns:1fr; }
  .qp-plan { position:static; }
  .qp-plan dl { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
  .qp-plan-total { margin:15px 0; }
}
@media (max-width:820px) {
  [data-portal-current="exams"] .studio-sidebar .studio-sidebar-ornament { display:none; }
  [data-portal-current="exams"] .resource-view { width:100%; padding:25px 16px 35px; }
  [data-portal-current="exams"] .resource-header { min-height:140px; margin-bottom:16px; padding-top:32px; }
  .qp-setup-layout { grid-template-columns:minmax(0,1fr) 240px; gap:16px; }
  .qp-layout { grid-template-columns:minmax(0,1fr) 200px; }
  .qp-directory { grid-template-columns:1fr; }
  .qp-path { font-size:11px; gap:8px; }
  .qp-path i { width:13px; }
  .qp-topline { gap:10px; margin-bottom:18px; }
}
@media (max-width:640px) {
  .qp-setup-layout { grid-template-columns:1fr; }
  .qp-plan { position:static; }
  .qp-panel { border-radius:17px; padding:21px 17px; }
  .qp-section-title { gap:10px; margin-bottom:18px; }
  .qp-section-title h2 { font-size:17px; }
  .qp-section-title p { font-size:11px; }
  .qp-package-grid { gap:6px; }
  .qp-package { padding:12px 8px; border-radius:10px; }
  .qp-package strong { font-size:12px; }
  .qp-package span { font-size:10px; }
  .qp-counts { gap:10px; margin-top:20px; }
  .qp-number input { padding:10px; }
  .qp-counts small { font-size:9px; }
  .qp-segments button { font-size:12px; padding:6px 4px; }
  .qp-all { padding:16px; gap:12px; }
  .qp-all-symbol { display:none; }
  .qp-resume { font-size:11px; gap:8px; }
  .qp-layout { grid-template-columns:1fr; grid-template-areas:"rail" "questions"; gap:20px; }
  .qp-rail { position:static; }
  .qp-rail h2, .qp-rail > .qp-button, .qp-rail > .qp-note { display:none; }
  .qp-rail .qp-progress-line { margin-top:0; }
  .qp-rail .qp-progress-track { margin-bottom:8px; }
  .qp-answer-map > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; color:var(--qp-dark); font-size:12px; }
  .qp-answer-map > summary > span { color:var(--qp-muted); font-size:10px; }
  .qp-rail .qp-storage-note { margin-top:7px!important; }
  .qp-number-grid { grid-template-columns:repeat(8,minmax(0,1fr)); gap:6px; }
  .qp-rail .qp-storage-note { font-size:10px; }
  .qp-rail .qp-button { margin-top:4px; }
  .qp-paper .qp-page-head { display:block; margin:22px 0; }
  .qp-page-head > .qp-button { margin-top:16px; }
  .qp-paper h1 { font-size:28px; }
  .qp-question { padding:21px 17px; }
  .qp-prompt { font-size:14px; line-height:1.9; }
  .qp-option { font-size:13px; padding:12px 10px; }
  .qp-q-tag { font-size:9px; }
  .qp-flag { font-size:10px!important; }
  .qp-paper-bottom { position:sticky; bottom:8px; z-index:2; padding:12px; border-color:#adcdbb; box-shadow:0 4px 25px #17384a14; }
  .qp-paper-bottom p { font-size:10px; }
  .qp-paper-bottom .qp-button { white-space:nowrap; }
  .qp-report-heading { display:block; }
  .qp-report-score { margin-top:12px; }
}
@media (prefers-reduced-motion:reduce) { .qp-progress-track > span { transition:none; } }
@media print {
  @page { size:A4; margin:16mm; }
  body, .studio-shell { background:#fff!important; display:block!important; }
  .studio-shell::before, .studio-shell::after { display:none!important; }
  .studio-sidebar, .organelle-background, .site-record-footer, .qp-breadcrumb, .qp-page-head, .qp-rail, .qp-paper-bottom, .qp-flag, .qp-self-rate, .qp-report, .qp-dialog { display:none!important; }
  .qp-paper.resource-view { width:100%!important; max-width:none; margin:0; padding:0!important; }
  .studio-main, .qp-layout { display:block!important; width:100%; }
  .qp-print-heading { display:block; text-align:center; margin-bottom:22px; }
  .qp-print-heading h1 { font-size:22px; }
  .qp-print-heading p { font-size:11px; }
  .qp-question { border:0; border-radius:0; padding:12px 0; box-shadow:none; margin:0; break-inside:avoid; }
  .qp-question-head { margin-bottom:7px; }
  .qp-group-title { font-size:17px; border-bottom:1px solid #777; padding-bottom:6px; break-after:avoid; }
  .qp-q-tag { background:none; }
  .qp-option { border:0; padding:3px 5px; min-height:0; background:transparent!important; }
  .qp-option input { display:none; }
  .qp-part textarea { height:75px; min-height:75px; border:0; border-bottom:1px solid #aaa; border-radius:0; background:#fff; color:transparent!important; text-shadow:none; resize:none; }
  .qp-options { gap:4px; margin-top:10px; }
  .qp-question-head, .qp-part > span { break-after:avoid; }
  .qp-data-table { font-size:11px; }
  .qp-feedback { display:none; }
  body.qp-print-answers .qp-feedback { display:block; }
  .qp-figure { max-height:150px; }
}
