/* Learning workbench. Brand green is the user's sampled #5cb85c. */
:root {
  --workbench-width:1248px; --focus-ring:var(--primary-strong);
}
body {-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums}
button,input,select,textarea {font-family:inherit}
button,a,input,summary,textarea {touch-action:manipulation}
button {transition:background-color .14s,border-color .14s,box-shadow .14s}
button:focus-visible,a:focus-visible,summary:focus-visible {
  outline:2px solid var(--focus-ring);outline-offset:4px;
}
html body [hidden] {display:none}
header.site-head {
  min-height:72px;padding:12px max(24px,calc((100% - var(--workbench-width))/2));
  flex-wrap:nowrap;gap:20px;border-bottom:1px solid var(--line);
}
.site-head .logo {font-size:25px;font-weight:750;letter-spacing:1.5px;white-space:nowrap}
.site-head .who {gap:10px;min-width:0}
.site-head .who .chip {color:var(--ink-2);background:var(--bg);padding:6px 10px;border-radius:6px}
.site-head .who button {background:transparent;border-color:transparent;min-height:40px;padding:8px 10px}
.site-head .who .settings-toggle {border-color:var(--line);border-radius:8px;width:40px;height:40px;min-height:40px;flex-basis:40px}
nav.tabs {max-width:1280px;gap:7px;margin:16px auto 0;padding:0 24px;border-bottom:1px solid var(--line)}
nav.tabs button {color:var(--ink-2);font-size:14px;min-height:42px;padding:10px 20px;border-color:transparent;background:transparent;border-radius:8px}
nav.tabs button:hover:not(.active) {background:var(--primary-weak);border-color:var(--line)}
nav.tabs button.active {background:var(--primary-strong);color:#fff;box-shadow:0 2px 4px #24332c0a}
.wrap {padding:24px 24px 24px}
.wrap--wide {max-width:1280px}
.card {border-radius:12px;border-color:#DFE6EF;box-shadow:none}
.card h3 {line-height:1.35}
.btn {border-radius:8px;letter-spacing:.02em;font-weight:650;line-height:1.6}
.btn.ghost {border-width:1px}
.btn:disabled {opacity:1}
.btn.sm {min-height:42px;padding:9px 16px}
.banner {border-radius:8px;padding:12px 16px;margin-bottom:22px;line-height:1.7}
.banner button {background:#fff;border:1px solid var(--line);padding:7px 12px;min-height:40px}
/* T1: the full module card is the entry point. */
.modules-grid {grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.modules-grid .module-card {
  cursor:pointer;padding:16px 18px;min-height:0;display:flex;flex-direction:row;
  align-items:center;gap:14px;border:1px solid #DFE6EF;border-radius:12px;background:var(--surface);
  transition:box-shadow .15s,border-color .15s,transform .15s;
}
.modules-grid .module-card:hover {border-color:#b8ccb8;box-shadow:0 6px 18px rgba(23,32,51,.08);transform:translateY(-1px)}
.modules-grid .module-card:focus-visible{outline:2px solid var(--focus-ring);outline-offset:4px}
.module-card .go{margin-left:auto;color:var(--primary);font-size:20px;line-height:1;flex:0 0 auto}
.module-identity {display:flex;align-items:center;gap:14px;margin:0;min-width:0}
.module-illustration {color:var(--primary);width:40px;flex:0 0 40px}
.module-illustration svg {display:block;width:40px;height:40px}
.modules-grid .module-name {margin:0;font-size:18px;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
.resume-card {display:flex;align-items:center;gap:24px;padding:18px 24px;margin-bottom:24px;background:#fff;border-left:3px solid var(--primary)}
.resume-card h3 {flex:none;margin:0;font-size:15px;color:var(--ink-2)}
.resume-card .chips {margin:0;gap:10px;min-width:0;flex:1}
.resume-card .btn {width:auto;margin:0;max-width:100%;overflow-wrap:anywhere;text-align:left}
.topic-groups {gap:20px;align-items:start}
.topic-groups>.topic-group {border-radius:12px;padding:22px 24px}
.topic-heading {padding-bottom:14px;margin-bottom:0;border-bottom:1px solid var(--line)}
.topic-heading h3 {font-size:18px;letter-spacing:.02em}
.topic-heading .badge {font-size:13px;background:var(--bg);color:var(--ink-2);font-weight:400}
.topic-row {padding:16px 0;gap:16px;border-color:#edf1ed}
.topic-row:first-of-type {border-top:0}
.topic-name {font-size:14px;font-weight:550;line-height:1.8}
.topic-count {font-size:13px;margin-top:4px;color:var(--ink-2)}
.topic-row .topic-action {font-size:13px;min-width:96px;min-height:38px;padding:7px 10px;margin:0}
.topic-row .training-progress {background:#f7faf5;border-color:var(--line);max-width:400px}
.course-reference,.legacy-blocks {font-size:13px;color:var(--ink-2);background:transparent}
.course-reference summary,.legacy-blocks summary,.training-rules summary,.knowledge-rules summary {cursor:pointer;padding:2px 0;line-height:1.7}
.wrap--map {max-width:1600px}
/* T5: two clearly ranked rows, with the rules below the tree. */
.card.map-heading {padding:10px 18px;border-radius:12px;margin-bottom:16px}
.map-topline h3 {font-size:20px;font-weight:650;letter-spacing:.03em}
.map-tools .btn {font-size:13px;min-height:40px;padding:7px 12px}
.map-search-box {border-radius:8px;background:var(--surface);height:40px}
.map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:6px;flex-wrap:wrap}
.map-toolbar .map-tools{margin:0;gap:8px;flex:0 0 auto}
.map-toolbar .map-realm-counts{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;width:360px;max-width:100%;margin:0;padding:0;border:0}
.realm-step{display:grid;grid-template-rows:6px auto auto;row-gap:3px;justify-items:stretch;text-align:center;min-width:0;color:var(--realm-color);font-size:13px;line-height:1.35;font-variant-numeric:tabular-nums}
.realm-step i{height:6px;border-radius:3px;background:var(--realm-paint,var(--realm-fill))}
.realm-step strong{font-size:13px;font-weight:600}
/* Rank accents use the requested light hues; readable ink stays in the same hue family. */
.realm-step-0,.knowledge-map .realm-0{--realm-fill:#566276;--realm-color:#566276;--realm-tint:#EEF1F5}
.realm-step-1,.knowledge-map .realm-1{--realm-fill:#AFE6DF;--realm-color:#17675F;--realm-tint:#E8F8F5}
.realm-step-2,.knowledge-map .realm-2{--realm-fill:#8FC2EF;--realm-color:#1B4C7E;--realm-tint:#E6F1FD}
.realm-step-3,.knowledge-map .realm-3{--realm-fill:#D9AE45;--realm-color:#6B4E12;--realm-tint:#FBF1D7;--realm-paint:linear-gradient(110deg,#A9791F 0%,#D9A93B 24%,#F8E49B 46%,#E0B84C 62%,#A9791F 100%)}
.realm-step-4,.knowledge-map .realm-4{--realm-fill:#5B21B6;--realm-color:#4C1D95;--realm-tint:#F1EAFE;--realm-paint:linear-gradient(135deg,#3B1370 0%,#7C3AED 46%,#A78BFA 64%,#4C1D95 100%)}
.realm-step-5,.knowledge-map .realm-5{--realm-fill:#D93232;--realm-color:#9F2424;--realm-tint:#FFF0F0}
.map-root {background:#edf5e9;color:#365c36;border:1px solid #c9ddc3;font-size:13px;border-radius:8px}
.knowledge-map {gap:16px}
.map-module {border-radius:12px;padding:12px;border-color:var(--line)}
.map-trunk {background:#f1f7ed;border-radius:8px;padding:11px 10px;margin-bottom:10px}
.map-trunk h4 {font-size:15px;font-weight:650}
.map-trunk button {font-family:inherit;min-height:32px}
.map-chapter {padding-left:9px;margin-left:5px}
.map-chapter summary {font-size:13px;line-height:1.7;padding:9px 0}
.map-leaf {background:#f8faf7;min-height:32px;border-radius:8px;border-left-width:2px;padding:6px 7px}
.map-leaf span {font-size:13px;line-height:1.65}
.map-leaf small {font-size:13px;color:var(--realm-color)}
.map-xp {font-size:13px;font-variant-numeric:tabular-nums}
.training-rules {margin:16px 0 0;padding:0;color:var(--ink-2);font-size:13px;background:transparent}
.training-rules>summary{min-height:40px;display:flex;align-items:center;width:fit-content;text-decoration:underline;text-underline-offset:3px;color:var(--primary-strong)}
.lesson-main {max-width:940px}
.lesson-topbar {margin-bottom:22px}
.lesson-topbar .btn {background:transparent;border-color:var(--line);font-size:13px}
.lesson-title {margin:0 0 26px;padding-left:2px}
.lesson-title h2 {font-size:29px;font-weight:650;letter-spacing:.03em;line-height:1.55}
.lecture-reading {border-radius:12px;border-color:var(--line)}
.lecture-prose {padding:40px 48px;font-size:17px;line-height:2;letter-spacing:.01em;color:var(--ink)}
.lecture-prose>h3,.lecture-method h3 {color:var(--ink);font-weight:650;line-height:1.7}
.lecture-prose>h3 {font-size:22px;margin-top:32px}
.lecture-prose>p {margin-bottom:18px}
.lecture-method {border-color:var(--line);padding-bottom:28px;margin-bottom:28px}
.lecture-table th {background:#f2f7ef;color:#36543c}
.lecture-table {line-height:1.85}
.lesson-footer {padding:22px 28px}
.lesson-footer .btn {max-width:360px}
body.in-practice {background:#f3f6f1}
.practice-toolbar {padding:4px 2px 24px}
.practice-heading h1 {font-size:23px;font-weight:650;letter-spacing:.02em}
.practice-stage {border-radius:12px;border-color:var(--line);box-shadow:none}
.practice-reading {padding:36px 38px}
.practice-reading .material {background:#f6f8f4;border-color:#e8eee5;border-radius:12px;line-height:1.95}
.practice-reading .stem {font-size:18px;line-height:1.95;font-weight:450}
.practice-answer {padding:36px 32px;border-color:var(--line)}
.practice-answer .opt {border-radius:7px;padding:14px 16px;line-height:1.75}
.practice-answer .opt .k {border-radius:6px;flex:0 0 30px}
.practice-answer .opt.right {border-color:var(--ok);background:var(--ok-bg);box-shadow:none}
.practice-answer .opt.wrong {border-color:var(--bad);background:var(--bad-bg);box-shadow:none}
.practice-answer .opt.right .k {background:var(--ok-bg);color:var(--ok)}
.practice-answer .opt.wrong .k {background:var(--bad-bg);color:var(--bad)}
.practice-answer #btn-confirm {border-radius:7px;min-height:52px;font-size:16px}
.practice-answer .confirm-bar {padding-top:20px}
.practice-scratch textarea {background:#fafcf9;border-radius:8px}
.practice-exit {border-radius:7px;background:transparent;min-height:42px}
.knowledge-hero {padding:20px 24px}
.knowledge-hero h2 {font-size:20px;margin:0;line-height:1.35;font-weight:650}
.knowledge-level {background:#f3f8ef;font-size:28px;border-radius:8px;padding:14px 20px}
.knowledge-metrics {gap:14px}
.knowledge-metrics .card {padding:20px 24px;gap:8px}
.knowledge-metrics b {font-size:28px;font-weight:600;font-variant-numeric:tabular-nums}
.knowledge-subjects .card {padding:24px}
.knowledge-subjects .btn {margin-top:18px;width:auto;min-width:140px}
.knowledge-feedback {background:var(--primary-weak)}
/* T8: one primary action, a quiet register link, then the guest route. */
#view[data-screen="auth"]{max-width:none;padding:32px 16px}
.auth-wrap{width:380px;max-width:100%;margin:24px auto 0}
.auth {padding:34px;border-radius:12px;border-color:var(--line)}
.auth h2 {font-size:25px;margin-bottom:12px;font-weight:650}
.auth .hint {line-height:1.9;margin-bottom:26px}
.auth .field {margin-bottom:18px}
.auth .field input {border-width:1px;border-radius:8px}
.auth .btn {margin-top:10px}
.auth-err:empty {min-height:0;margin:0}
@media(min-width:1600px) {
  .lecture-prose {font-size:18px}
}
@media(max-width:1000px) {
  .practice-reading {padding:28px}.practice-answer {padding:28px}
}
@media(max-width:719px) {
  header.site-head {min-height:72px;padding:14px 18px;gap:10px}
  .site-head .logo {font-size:21px;letter-spacing:.5px}
  .site-head .who {gap:4px}.site-head .who .chip {padding:5px 7px;font-size:13px}
  .site-head .who button:not(.settings-toggle) {font-size:13px;padding:6px;white-space:nowrap}
  nav.tabs {margin-top:16px;padding:0 12px;gap:2px;flex-wrap:nowrap}
  nav.tabs button {font-size:13px;padding:9px 8px;min-height:40px;min-width:44px;white-space:nowrap}
  .wrap {padding:20px 16px 24px}
  .modules-grid {grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
  .modules-grid .module-card {padding:16px 18px;min-height:0}
  .module-identity {margin:0;gap:14px}
  .module-illustration,.module-illustration svg {width:40px;height:40px;flex-basis:40px}
  .modules-grid .module-name {font-size:18px}
  .resume-card {display:block;padding:18px}
  .resume-card h3 {margin-bottom:10px}.resume-card .chips {display:flex;flex-direction:column;align-items:stretch}
  .resume-card .btn {width:100%;font-size:13px;line-height:1.8}
  .topic-groups {grid-template-columns:1fr;gap:14px}
  .topic-groups>.topic-group {padding:18px}.topic-heading h3 {font-size:17px}
  .topic-row {gap:10px;padding:14px 0}.topic-row .topic-action {min-width:86px;font-size:13px;padding:8px}
  .topic-name {font-size:14px}
  .card.map-heading {padding:10px 16px}.map-topline h3 {font-size:19px}
  .map-realm-counts {gap:7px 13px}.map-leaf {min-height:40px}
  .lesson-title h2 {font-size:25px}.lesson-topbar {margin-bottom:18px}
  .lecture-prose {padding:24px 20px;font-size:16px;line-height:1.95}
  .lecture-prose>h3,.lecture-method h3 {font-size:20px}
  .lesson-footer {padding:20px}.lesson-footer .btn {max-width:none}
  .practice-toolbar {padding:0 0 18px;gap:12px}
  .practice-heading h1 {font-size:19px}.practice-tools {gap:10px}
  .practice-exit {font-size:13px;padding:9px 11px}
  .practice-stage {display:block;border-radius:12px;min-height:0}
  .practice-reading {padding:22px 20px}.practice-reading .stem {font-size:17px}
  .practice-answer {padding:22px 20px;border-left:0;border-top:1px solid var(--line)}
  .practice-answer .confirm-bar {margin:24px -20px -22px;padding:16px 20px calc(16px + env(safe-area-inset-bottom));border-radius:0 0 12px 12px}
  .knowledge-hero {padding:20px;gap:14px}.knowledge-hero h2 {font-size:21px}
  .knowledge-level {font-size:22px;padding:12px;white-space:nowrap}
  .knowledge-metrics .card {padding:18px}.knowledge-metrics b {font-size:25px}
  .knowledge-subjects .btn {width:100%}
  .auth {padding:34px}.auth-wrap {margin-top:8px}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation:none;transition:none;scroll-behavior:auto}
}
@media(max-width:719px) {
  .legacy-blocks .blocks-grid {grid-template-columns:minmax(0,1fr)}
  .legacy-blocks .block-card {min-width:0}
}
/* Queue controls stay alongside the existing exit control. */
.practice-defer {background:transparent;border:0;color:var(--ink-2);font:inherit;font-size:13px;cursor:pointer;padding:10px 5px;min-height:40px;white-space:nowrap}
.practice-defer:hover {color:var(--primary)}
.practice-defer:disabled {opacity:.5;cursor:wait}
@media(max-width:719px) {
  .practice-tools {gap:8px;flex-wrap:wrap;justify-content:flex-end;max-width:140px}
  .practice-clock {font-size:13px}
  .practice-defer {font-size:13px;padding:6px 2px;min-height:32px}
}
/* Realm names encode rank; one readable green keeps them distinct from answer states. */
.realm-0{--realm-color:var(--ink-2)}
.realm-1,.realm-2,.realm-3,.realm-4,.realm-5{--realm-color:var(--primary-strong)}

/* Compact realm labels; experience remains internal. */
.training-progress--compact,.topic-row .training-progress--compact {
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:0;margin:6px 0 0;max-width:none;border:0;background:transparent;border-radius:0;
}
.training-progress--compact .training-level {font-size:14px;font-weight:600;line-height:1.7;color:var(--realm-color);white-space:nowrap}
.training-progress--compact progress,.topic-row .training-progress--compact progress {
  flex:0 1 132px;width:132px;height:6px;margin:0;border:0;border-radius:999px;overflow:hidden;
  appearance:none;-webkit-appearance:none;background:#e7ede5;color:var(--realm-color);accent-color:var(--realm-color);
}
.training-progress--compact progress::-webkit-progress-bar,.map-level-row progress::-webkit-progress-bar {background:#e7ede5;border-radius:999px}
.training-progress--compact progress::-webkit-progress-value,.map-level-row progress::-webkit-progress-value {background:var(--realm-color);border-radius:999px}
.training-progress--compact progress::-moz-progress-bar,.map-level-row progress::-moz-progress-bar {background:var(--realm-color);border-radius:999px}
.topic-row>div {flex:1;min-width:0}
.map-leaf {display:flex;flex-direction:column;align-items:stretch;gap:2px;padding:5px 7px}
.map-leaf .map-leaf-name {display:block;font-size:13px;line-height:1.5}
.map-leaf .map-level-row {display:flex;align-items:center;justify-content:space-between;gap:8px;line-height:1.3}
.map-level-row small {font-size:13px}
.map-level-row progress {width:68px;flex:0 1 68px;height:4px;border:0;margin:0;appearance:none;-webkit-appearance:none;border-radius:999px;overflow:hidden;background:#e7ede5;accent-color:var(--realm-color)}
.module-illustration svg {stroke-width:2.1}
.resume-panel {margin-bottom:24px;padding:0 22px;background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--primary);border-radius:12px}
.resume-item {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0}
.resume-item+.resume-item {border-top:1px solid var(--line)}
.resume-label {font-size:15px;font-weight:550;line-height:1.8;overflow-wrap:anywhere;min-width:0}
.resume-item .btn {flex:0 0 auto;width:auto;min-width:100px;margin:0}
.statistics-heading {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
.statistics-heading h2 {font-size:26px;font-weight:650;line-height:1.5}
.statistics-period {display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.statistics-period button {padding:7px 18px;min-height:36px;border:0;border-radius:8px;background:transparent;color:var(--ink-2);font:inherit;font-size:13px;cursor:pointer}
.statistics-period button.active {background:var(--primary-strong);color:#fff}
.answer-metrics {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:16px}
.answer-metric {display:flex;flex-direction:column;gap:4px;padding:10px 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.answer-metric>span {font-size:14px;color:var(--ink-2)}
.answer-metric strong {font-size:24px;font-weight:700;line-height:1.25;font-variant-numeric:tabular-nums;color:var(--ink)}
.answer-metric small {font-size:13px;color:var(--ink-2)}
.statistics-table-wrap {background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.statistics-table {border-collapse:collapse;width:100%;font-size:14px;font-variant-numeric:tabular-nums}
.statistics-table th,.statistics-table td {padding:9px 14px;text-align:right;border-bottom:1px solid var(--line);font-weight:400}
.statistics-table th:first-child {text-align:left;width:45%;line-height:1.8}
.statistics-table thead th {font-size:13px;color:var(--ink-2);background:#F0F4FA}
.statistics-table tbody th {font-weight:550}
.statistics-table tbody tr:last-child>* {border-bottom:0}
.statistics-note {font-size:13px;color:var(--ink-2);margin-top:14px;line-height:1.8}
.visually-hidden {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:719px) {
  .training-progress--compact,.topic-row .training-progress--compact {gap:10px}
  .training-progress--compact .training-level {font-size:13px}
  .topic-row .training-progress--compact progress {flex-basis:72px;width:72px;height:5px}
  .resume-panel {padding:0 16px;margin-bottom:18px}.resume-item {gap:12px;padding:14px 0}
  .resume-label {font-size:13px}.resume-item .btn {min-width:78px;font-size:13px;padding:8px 10px}
  .statistics-heading {margin-bottom:18px;gap:12px}.statistics-heading h2 {font-size:22px}
  .statistics-period button {padding:6px 12px;font-size:13px}
  .answer-metrics {gap:12px;margin-bottom:18px}.answer-metric {padding:20px;gap:12px}
  .answer-metric strong {font-size:36px}.answer-metric>span {font-size:13px}
  .statistics-table {font-size:13px}.statistics-table th,.statistics-table td {padding:13px 10px}
  .statistics-table th:first-child {width:43%}
}
@media(max-width:380px) {
  nav.tabs {gap:2px}
  nav.tabs button {font-size:13px;padding:9px 6px}
  .answer-metric {padding:16px}.answer-metric strong {font-size:36px}
}

/* Chapters expose existing fine topics on demand; the realm belongs to each topic. */
.topic-groups>.topic-group.training-chapter {padding:0;overflow:hidden}
.training-chapter[open] {grid-column:1 / -1}
.chapter-heading {display:flex;align-items:center;gap:12px;list-style:none;cursor:pointer;padding:19px 22px;min-height:68px}
.chapter-heading::-webkit-details-marker {display:none}
.chapter-heading strong {flex:1;min-width:0;font-size:16px;font-weight:650;line-height:1.7}
.chapter-heading>span {font-size:13px;color:var(--ink-2);white-space:nowrap}
.chapter-heading::after {content:"";width:7px;height:7px;flex:0 0 7px;border-right:1.5px solid var(--ink-2);border-bottom:1.5px solid var(--ink-2);transform:rotate(-45deg)}
.training-chapter[open]>.chapter-heading {background:#f2f7ef;border-bottom:1px solid var(--line)}
.training-chapter[open]>.chapter-heading::after {transform:rotate(45deg)}
.chapter-heading:hover {background:var(--primary-weak)}
.chapter-heading:focus-visible {outline-offset:-4px}
.chapter-topic-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px;padding:0 22px 6px}
.chapter-topic-list>.topic-row:nth-child(-n+2) {border-top:0}
.map-chapter>summary {display:flex;align-items:center;gap:6px;list-style:none;min-height:40px}
.map-chapter>summary::-webkit-details-marker {display:none}
.map-chapter>summary::before {content:"";width:5px;height:5px;flex:0 0 5px;border-right:1px solid var(--ink-2);border-bottom:1px solid var(--ink-2);transform:rotate(-45deg);margin-right:3px}
.map-chapter[open]>summary::before {transform:rotate(45deg)}
.map-chapter>summary>span:first-child {flex:1;min-width:0}
.map-chapter>summary>small {white-space:nowrap;font-size:13px;margin-left:0}
@media(max-width:719px) {
  .chapter-heading {padding:15px 17px;min-height:60px;gap:9px}
  .chapter-heading strong {font-size:15px}
  .chapter-topic-list {grid-template-columns:1fr;padding:0 17px 5px}
  .chapter-topic-list>.topic-row:nth-child(2) {border-top:1px solid #edf1ed}
}

/* Practice scope is explicit at chapter and module entry points. */
.module-directory-actions {display:flex;align-items:center;gap:10px;margin-left:auto}
.banner .module-directory-actions button {margin-left:0;white-space:nowrap}
.banner .module-directory-actions .module-mix {background:var(--primary);color:#fff;border-color:var(--primary);padding:7px 14px}
.chapter-practice {padding:13px 22px 0;text-align:right}
.chapter-practice .btn {width:auto;font-size:13px;min-height:36px;padding:6px 12px}
@media(max-width:719px) {
  .module-directory-bar {flex-wrap:wrap;gap:10px}
  .module-directory-actions {gap:7px}
  .banner .module-directory-actions button {font-size:13px;padding:6px 9px}
  .chapter-practice {padding:12px 17px 0}
}

/* T2: accessible action colors; the brand green stays on the logo and illustrations. */
.btn,.btn.orange{background:var(--primary-strong);color:#fff}
.btn:hover,.btn.orange:hover{background:#256428}
.btn.ghost{background:var(--surface);color:var(--primary-strong);border-color:var(--primary-strong)}
.btn.ghost:hover{background:var(--primary-weak)}
.btn.danger,.btn.danger:hover{color:var(--bad);background:var(--bad-bg);border-color:var(--bad)}
.btn:disabled,.practice-answer #btn-confirm:disabled{opacity:1;background:#E7ECF3;color:var(--ink-2)}
.practice-answer #btn-confirm{background:var(--primary-strong);color:#fff;border-radius:8px}
.practice-answer #btn-confirm:hover:not(:disabled){background:#256428}
.practice-answer #btn-confirm:focus-visible{outline-color:var(--primary-strong)}
.practice-answer .opt.selected .k{background:var(--primary-strong);color:#fff}
.fchip.on,.tag-chip.on{color:var(--primary-strong);border-color:var(--primary-strong)}
.banner .module-directory-actions .module-mix{background:var(--primary-strong);border-color:var(--primary-strong);color:#fff}
/* T3: hover is reserved for surfaces that contain an action. */
.topic-groups>.topic-group:hover,.map-module .map-trunk:hover{border-color:#b8ccb8;box-shadow:0 6px 18px rgba(23,32,51,.08)}
.map-module .map-trunk{border:1px solid transparent}
/* T6/T7: keep actual statistics, and give empty pages a useful next step. */
.statistics-table thead th{background:#F0F4FA}
.statistics-table th,.statistics-table td{height:44px;border-right:1px solid var(--line);font-variant-numeric:tabular-nums}
.statistics-table tr>:last-child{border-right:0}
.statistics-table tbody tr:hover{background:#FAFCFE}
.statistics-empty{padding:0;margin-bottom:20px}
.knowledge-empty{max-width:600px;margin:0 auto}
.knowledge-hero>.training-progress{flex:0 1 360px;min-width:0;margin:0}
.knowledge-hero h2{flex:0 0 auto}
.knowledge-review-empty{padding:0}
.realm-milestones .realm-count i{display:none}
.realm-milestones .realm-count{padding:4px 8px;border-radius:6px;background:var(--primary-weak);color:var(--ink-2)}
/* T8: preserve the form order and its existing handlers. */
.auth-local-note{font-size:13px;color:var(--ink-2);margin-bottom:12px}
.auth h2{margin-bottom:24px;line-height:1.35}
.auth .auth-register,.auth .auth-guest{background:transparent;border:0;border-radius:8px}
.auth .auth-register{color:var(--primary-strong);font-size:14px;text-decoration:underline;text-underline-offset:4px;font-weight:550}
.auth .auth-guest{color:var(--ink-2);font-size:13px;font-weight:400}
.auth .auth-register:hover,.auth .auth-guest:hover{background:var(--primary-weak)}
/* T9: readable type and full-size hit areas, including quiet text controls. */
body{line-height:1.6}
h1,h2,h3,h4{line-height:1.35}
button,select,summary{min-height:40px}
a[href]{display:inline-flex;align-items:center;min-height:40px;max-width:100%;overflow-wrap:anywhere}
.site-head .who .chip{max-width:none;min-width:0;overflow:visible;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;border-radius:6px}
.btn,.practice-answer .opt,.practice-answer #btn-confirm,.practice-exit{border-radius:8px}
.badge,.chip,.tag-chip,.fchip{border-radius:6px}
.map-trunk button,.map-tools .btn,.map-leaf,.practice-defer,.statistics-period button,.banner button,.zoom-mini,.tag-chip,.sy-sub .go,.tree-block .go,.rv-row .go,.rv-head .go{min-height:40px}
.zoom-mini{display:inline-flex;align-items:center;justify-content:center;min-width:40px}
.map-search-box:focus-within{outline:2px solid var(--focus-ring);outline-offset:2px;border-color:var(--primary-strong)}
.field input:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.lesson-read{min-height:40px;align-items:center}
.lesson-read input{width:40px;height:40px;flex:0 0 40px;margin:0;accent-color:var(--primary-strong)}
.practice-source>summary,.practice-scratch>summary,.course-reference>summary,.knowledge-rules>summary{min-height:40px;line-height:1.6;padding:8px 0}
p,.stem,.sumline{max-inline-size:68em}
.lecture-prose,.lecture-prose>p,.lecture-method>p:not(.lecture-method-origin),.practice-reading .material,.practice-reading .stem,.sumline{line-height:1.6}
.lecture-prose>h3,.lecture-prose>h4,.lecture-method h3,.lesson-title h2,.practice-heading h1,.analysis-lesson-section .analysis-lesson-heading{line-height:1.35}
.lecture-prose sup,.lecture-prose sub{font-size:max(13px,.73em)}
#view .analysis-category-card>.btn,#view .analysis-group-clock{font-size:13px}
@media(max-width:600px){
 nav.tabs{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;mask-image:none;padding-bottom:0}
 nav.tabs button{flex:0 0 auto;white-space:nowrap;font-size:13px;border-radius:7px 7px 0 0}
 .map-toolbar .map-realm-counts{width:100%}
 .knowledge-hero{padding:16px;gap:12px;flex-wrap:nowrap}
 .knowledge-hero h2{font-size:18px}
 .knowledge-hero>.training-progress{flex:1;gap:10px}
 .statistics-heading{flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto}
 body button,body a,body summary,body .modules-grid .module-card,body .topic-groups .topic-group,body .map-trunk{animation:none;transition:none}
}

/* T5/T9: full hit areas and a compact three-line tree header on phones. */
.map-search-box{height:42px}
.map-search-box input{min-height:40px}
.fchip,.topic-row .topic-action,.chapter-practice .btn{min-height:40px}
@media(max-width:600px){
 .card.map-heading{padding:6px 16px}
 .map-toolbar{gap:4px;margin-top:2px}
 .map-toolbar .realm-step{row-gap:2px}
}


/* Board realms share the compact topic realm, with one whole-card entry. */
.module-card .module-identity{flex:1;min-width:0}
.module-card .module-copy{flex:1;min-width:0}
.module-card .training-progress--compact{margin-top:4px;gap:10px}
.module-card .training-progress--compact .training-level{font-size:13px;line-height:1.6}
.module-card .training-progress--compact progress{flex:1 1 80px;width:80px;min-width:36px;max-width:116px}
.module-directory-identity{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.module-directory-identity>.training-progress{max-width:270px;margin:0}
.module-directory-actions .btn{margin-top:0;width:auto}
.module-level-rules{margin:-8px 0 20px;color:var(--ink-2);font-size:13px;line-height:1.6}
.module-level-rules>summary{display:flex;align-items:center;min-height:40px;width:fit-content;cursor:pointer;color:var(--primary-strong);text-decoration:underline;text-underline-offset:3px}
.module-level-rules p{margin:8px 0;max-width:68em}
.knowledge-subjects.knowledge-subjects--single{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.knowledge-subjects--single>.btn{margin:0;width:auto;min-width:140px}
@media(max-width:719px){
 .module-directory-actions{margin-left:0;flex-wrap:wrap}
 .module-directory-bar .module-directory-identity{flex-basis:100%}
 .module-directory-identity>.training-progress{max-width:240px}
}

/* Keep the assessment action primary, and let nonempty review groups own their cards. */
.banner .module-directory-actions [data-module-assessment]{background:var(--primary-strong);color:#fff;border-color:var(--primary-strong)}
.banner .module-directory-actions [data-module-assessment]:hover{background:#256428}
.knowledge-review-list{display:grid;gap:16px}
.knowledge-review-list>.card{margin:0}

/* Realm trials: compact readiness, focused challenge, one quiet rules introduction. */
.training-progress .realm-trial{flex:0 0 auto;min-height:40px;min-width:44px;padding:7px 10px;border:1px solid var(--primary-strong);border-radius:8px;background:var(--primary-strong);color:#fff;font-size:13px;font-weight:650;line-height:1.5;cursor:pointer}
.training-progress .realm-trial:hover{background:#256428}
.training-progress .realm-trial:focus-visible{outline:3px solid #5cb85c;outline-offset:3px}
.realm-cooldown{flex:0 0 auto;font-size:13px;color:var(--ink-2);white-space:nowrap}
.training-progress--compact:has(.realm-trial){gap:8px}
.module-card:has(.realm-trial){padding-block:8px}
.trial-wrap{max-width:760px;padding-top:24px}
.trial-top{display:flex;justify-content:flex-start;margin-bottom:16px}
.trial-preparation,.trial-result{padding:32px;margin:0}
.trial-preparation h1,.trial-result h1{font-size:28px;line-height:1.4;margin:16px 0 8px;color:var(--ink)}
.trial-emblem{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:2px solid var(--primary-strong);border-radius:12px;color:var(--primary-strong);font-size:28px;font-weight:700;line-height:1}
.trial-failure .trial-emblem{border-color:#91651f;color:#91651f}
.trial-transition{display:flex;flex-wrap:wrap;align-items:baseline;gap:12px;font-size:16px;color:var(--ink-2);margin:12px 0 24px}
.trial-transition strong{font-size:24px;color:var(--primary-strong);font-weight:750}
.trial-subject{margin:0;color:var(--ink-2);font-size:16px}
.trial-conditions{display:grid;grid-template-columns:1fr 1fr;border-block:1px solid var(--line);margin:24px 0;gap:0}
.trial-conditions>div{display:flex;flex-direction:column;gap:8px;min-width:0;padding:20px 16px 20px 0}
.trial-conditions>div+div{border-left:1px solid var(--line);padding-left:24px}
.trial-conditions span,.trial-conditions small{font-size:13px;color:var(--ink-2);line-height:1.6}
.trial-conditions strong{font-size:28px;line-height:1.3;color:var(--ink)}
.trial-notice{font-size:14px;line-height:1.75;color:var(--ink-2);max-width:62ch}
.trial-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.trial-actions>.btn{min-width:140px;margin:0}
.trial-countdown{font-variant-numeric:tabular-nums;font-weight:700;color:var(--primary-strong)}
.trial-countdown.is-urgent{color:#8d4d13}
.realm-introduction>summary{min-height:44px;cursor:pointer;line-height:1.6;font-size:16px;font-weight:650;padding-block:8px}
.realm-guide{max-width:70ch;color:var(--ink-2);font-size:14px;line-height:1.8}
.realm-guide p{margin:12px 0}
@media(max-width:599px){
 .trial-wrap{padding-top:16px}
 .trial-preparation,.trial-result{padding:24px 20px}
 .trial-preparation h1,.trial-result h1{font-size:24px}
 .trial-conditions>div+div{padding-left:16px}
 .trial-conditions strong{font-size:25px}
 .trial-actions>.btn{flex:1;min-width:120px}
 .module-card .training-progress--compact progress{min-width:26px}
}

.trial-top>.btn,.trial-actions>.btn{width:auto}

.trial-progress-gap{font-size:14px;font-weight:600;color:var(--ink);line-height:1.7;margin:6px 0 0;font-variant-numeric:tabular-nums}

@media(max-width:350px){nav.tabs button{padding-inline:4px}}

/* The light accent is repeated on the label, edge and progress fill. */
.map-realm-counts .realm-step>span{background:var(--realm-tint);border-radius:4px;padding:1px 0}
.knowledge-map .map-leaf[class*="realm-"]{border-left-color:var(--realm-fill)}
.knowledge-map .map-level-row small{padding:1px 5px;border-radius:4px;background:var(--realm-tint)}
.knowledge-map .map-level-row progress{color:var(--realm-fill);accent-color:var(--realm-fill)}
.knowledge-map .map-level-row progress::-webkit-progress-value{background:var(--realm-paint,var(--realm-fill))}
.knowledge-map .map-level-row progress::-moz-progress-bar{background:var(--realm-paint,var(--realm-fill))}
.map-topline .map-tools{margin:0;flex:0 0 auto}
/* 知识树内境界名与进度跟随各自色相（筑基蓝、金丹金、元婴紫），其他页面仍用单一绿 */
.knowledge-map .realm-1{--realm-color:#17675F}
.knowledge-map .realm-2{--realm-color:#1B4C7E}
.knowledge-map .realm-3{--realm-color:#6E5720}
.knowledge-map .realm-4{--realm-color:#4C1D95}
.knowledge-map .realm-5{--realm-color:#9F2424}

/* 知识树：脉络线加深，展开按钮落在总脉络根部 */
.map-root-bar{position:relative;display:flex;justify-content:center;margin:0 auto 20px}
.map-root-bar:after{content:"";position:absolute;top:100%;left:50%;width:1px;height:14px;background:#B9A98A}
.map-root-bar .map-tools{margin:0;display:flex;justify-content:center}
.knowledge-map{border-top-color:#C9BBA0}
.knowledge-map .map-module:before{background:#C9BBA0}
.knowledge-map .map-chapter{border-left-color:#C9BBA0}
.knowledge-map .map-trunk{background:#EFE7D6;border:1px solid #DDCFB2}

/* 知识树：居中气泡（标题 + 展开 + 等级图例），脉络从气泡底部接出 */
.tree-bubble{position:relative;max-width:780px;margin:0 auto 24px;padding:18px 22px 16px;border-radius:18px;text-align:center}
.tree-bubble:after{content:"";position:absolute;left:50%;top:100%;width:1px;height:24px;background:#C9BBA0}
.tree-bubble-head{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;min-height:40px}
.tree-bubble-head h3{margin:0;font-size:20px;font-weight:650;letter-spacing:.08em}
.tree-bubble .map-tools{margin:12px auto 0;display:flex;justify-content:center;flex:0 0 auto}
.tree-bubble .map-search-box{position:absolute;right:0;top:50%;transform:translateY(-50%);width:128px;flex:0 0 128px;height:32px;padding:0 7px;font-size:12px}
.tree-bubble .map-realm-counts{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;width:100%;max-width:520px;margin:14px auto 0;padding:0;border:0}
.tree-bubble #map-status{margin-top:8px}
.map-root-bar{display:none}
@media (max-width:719px){
  .tree-bubble{padding:16px}
  .tree-bubble-head{padding-right:0}
  .tree-bubble-head{flex-wrap:wrap}
  .tree-bubble .map-search-box{position:static;transform:none;width:100%;flex:1 1 100%;margin-top:10px}
}

/* 展开按钮在等级图例下方，搜索框缩小（窄屏不再绝对定位） */
.tree-bubble .map-tools .btn{min-height:34px;padding:5px 14px;font-size:13px}
@media (max-width:719px){
  .tree-bubble .map-tools{margin:10px auto 0}
  .tree-bubble .map-search-box{width:100%;flex:1 1 100%;height:36px;font-size:13px}
}

/* 章节等级（加权展示，仅树内） */
.map-chapter summary{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.map-chapter summary>span:first-child{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.chapter-realm{display:inline-flex;align-items:center;flex:0 0 auto;margin-left:auto;font-weight:400;white-space:nowrap}
.chapter-realm-label{font-size:12px;line-height:1.5;padding:1px 6px;border-radius:4px;color:var(--realm-color);background:var(--realm-tint);white-space:nowrap}
.chapter-realm progress{width:54px;height:4px;border:0;margin:0;appearance:none;-webkit-appearance:none;border-radius:999px;overflow:hidden;background:#E7DECB;color:var(--realm-fill);accent-color:var(--realm-fill)}
.chapter-realm progress::-webkit-progress-bar{background:#E7DECB;border-radius:999px}
.chapter-realm progress::-webkit-progress-value{background:var(--realm-paint,var(--realm-fill));border-radius:999px}
.chapter-realm progress::-moz-progress-bar{background:var(--realm-paint,var(--realm-fill));border-radius:999px}
@media (max-width:719px){.chapter-realm progress{width:40px}}
.map-chapter summary small{flex:0 0 60px;margin:0;text-align:right;white-space:nowrap}

/* 常识/政治作为分块训练内的两个小入口 */
.knowledge-entries{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}
.knowledge-entry{display:flex;align-items:center;gap:10px;min-height:56px;padding:10px 16px;text-align:left;
  background:linear-gradient(180deg,var(--surface),#FBF5E9);border:1px solid var(--line);border-radius:10px;
  font-family:inherit;color:var(--ink);cursor:pointer}
.knowledge-entry strong{font-size:15px;font-weight:650}
.knowledge-entry span{font-size:12px;color:var(--ink-2)}
.knowledge-entry i{margin-left:auto;font-style:normal;color:var(--primary-strong)}
.knowledge-entry:hover{border-color:var(--gold,#C9BBA0);box-shadow:0 4px 12px #6b532714}
.knowledge-entry:focus-visible{outline:2px solid var(--primary-strong);outline-offset:2px}
@media (max-width:600px){.knowledge-entries{grid-template-columns:minmax(0,1fr)}}

/* 六个模块（四册 + 常识/政治）同规格：四列宽度、换行居中 */
body[data-ui="xianxia"] .modules-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:16px}
body[data-ui="xianxia"] .module-card{flex:1 1 246px;max-width:252px}
@media (max-width:719px){body[data-ui="xianxia"] .module-card{flex:1 1 100%;max-width:none}}
.module-art img[src$=".svg"]{object-fit:cover}

/* 首页紧凑：继续区域与等级行压缩 */
body[data-ui="xianxia"] .resume-panel{padding:6px 14px}
body[data-ui="xianxia"] .resume-item{padding:8px 0}
body[data-ui="xianxia"] .module-card .training-progress--compact{margin:0;gap:6px}
body[data-ui="xianxia"] .module-card .training-progress--compact progress{flex:0 1 86px;width:86px;height:4px}

/* 首页再收一点底部留白，保证 1440x960 一屏放下 */
body[data-ui="xianxia"] #view.wrap{padding-top:20px;padding-bottom:12px}
body[data-ui="xianxia"] .resume-panel{margin-bottom:12px}
@media (max-height:820px){
  body[data-ui="xianxia"][data-scene="home"] .xianxia-hero{display:none}
  body[data-ui="xianxia"] .module-card{flex-basis:206px;max-width:236px}
}

@media (max-height:820px){
  body[data-ui="xianxia"] .resume-panel{padding:2px 12px;margin-bottom:8px}
  body[data-ui="xianxia"] .resume-item{padding:6px 0}
  body[data-ui="xianxia"] .module-card{flex-basis:196px;max-width:222px}
  body[data-ui="xianxia"] #view.wrap{padding-top:14px}
}

/* 限时反馈与倒计时状态 */
.timing-note{margin:0 0 12px;padding:8px 12px;border-radius:8px;background:#F7E9D8;
  border:1px solid #E0C9A6;color:#7A4A1E;font-size:13px;line-height:1.6}
.timing-note.ok{background:#EAF3E6;border-color:#C3DCC0;color:#2F5A38}
.timer.slow{color:#A66A2A}
.timer.vslow{color:#B4453E}

/* 资料分析组内逐题解析 */
.analysis-group-answers{margin:16px 0 20px;display:flex;flex-direction:column;gap:10px}
.aga-row{position:relative;padding:10px 12px 10px 40px;border-radius:10px;background:#FBF5E9;border:1px solid #E7DBC4}
.aga-row.ok{border-color:#C3DCC0;background:#F3F8EF}
.aga-row.bad{border-color:#E3C6B4;background:#FBF1EA}
.aga-idx{position:absolute;left:12px;top:10px;width:18px;height:18px;line-height:18px;text-align:center;
  border-radius:50%;background:#EFE3C8;color:#6B5327;font-size:12px}
.aga-state{font-size:13px;font-weight:650;margin-right:10px}
.aga-row.ok .aga-state{color:#2F5A38}
.aga-row.bad .aga-state{color:#8A3B2A}
.aga-ans{font-size:12px;color:#7A6A4A}
.aga-exp{margin:6px 0 0;font-size:13px;line-height:1.7;color:#3B4A46}

/* Timing preparation masks the card until resources and the server clock are ready. */
.practice-stage{position:relative}
.timing-preparing>.practice-reading,.timing-preparing>.practice-answer{visibility:hidden}
.timing-preparation{position:absolute;inset:0;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:28px;color:var(--ink-2);text-align:center;background:#FBF5E9;border-radius:inherit}
.opt.pending{border-color:#B9AA88;background:#F3EDDF}
.submitted-note{color:#4B5D53;background:#F0F3E9;border:1px solid #D3DCC8}
.practice-clock{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:719px){
 .practice-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding-bottom:12px}
 .practice-heading h1{margin-top:4px}
 .practice-tools{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;justify-content:space-between;width:100%;max-width:none;gap:6px}
 .practice-clock{font-size:12px;gap:4px;flex:1 1 auto;min-width:0}
 .practice-exit{flex:0 0 auto;padding:7px 8px;font-size:12px}
 .practice-defer{flex:0 0 auto;padding:6px;min-height:32px;font-size:0}
 .practice-defer:after{content:"稍后";font-size:12px}
}

/* Phone reading control: one material pane and one answer pane, same paper theme. */
.practice-reading-tabs,.practice-reading-anchor{display:none}
@media(max-width:900px){
 .practice-reading-anchor{display:block;height:0}
 .practice-reading-tabs{display:flex;position:sticky;top:0;z-index:12;gap:4px;margin:0 0 10px;padding:5px;background:var(--x-paper,#FFFCF6);border:1px solid var(--x-gold-soft,#D8C79C);border-radius:8px;box-shadow:0 3px 9px #1e2c3108}
 .practice-reading-tabs button{flex:1;min-height:42px;border:0;border-radius:5px;background:transparent;color:var(--x-muted,#5B645F);font-size:14px;font-weight:600}
 .practice-reading-tabs button[aria-selected="true"]{background:var(--x-action,#5CB85C);color:var(--x-action-ink,#173C24)}
 .practice-workbench[data-reading-pane="answer"] .practice-reading,.practice-workbench[data-reading-pane="material"] .practice-answer{display:none}
 .practice-workbench[data-reading-pane="material"] .practice-reading{border-right:0;border-bottom:0}
 .practice-workbench[data-reading-pane] .practice-stage{grid-template-columns:minmax(0,1fr)}
 .practice-reading-tabs button:focus-visible{outline:2px solid var(--primary-strong);outline-offset:1px}
}
