:root {
  color-scheme: light;
  --navy-950: #0b1f33;
  --navy-900: #123c69;
  --navy-700: #245b91;
  --navy-100: #e8f1f8;
  --jade-700: #157466;
  --jade-100: #e4f4ef;
  --amber-700: #a25d08;
  --amber-100: #fff1d8;
  --red-700: #b4232f;
  --red-100: #fdebed;
  --ink: #14202b;
  --muted: #5d6b78;
  --line: #d9e1e8;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --shadow: 0 14px 36px rgba(11, 31, 51, 0.08);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --focus: 0 0 0 4px rgba(36, 91, 145, .25);
  --duration-fast: 160ms;
  --duration-normal: 220ms;
  --z-nav: 20;
  --z-sticky: 15;
  --z-mobile-nav: 30;
  --z-overlay: 80;
  --z-toast: 100;
  --breakpoint-mobile: 760px;
  --breakpoint-desktop: 1080px;
  --sidebar-width: 260px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
body, button, input, select, textarea { font: inherit; }
button, input, select, textarea { color: inherit; }
button, a, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { box-shadow: var(--focus); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .65rem; font-size: clamp(2rem, 3vw, 3.2rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin-bottom: .6rem; font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.25; }
small { color: var(--muted); }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: .45rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; background: white; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.app-frame { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #eaf4fb; background: var(--navy-950); border-right: 1px solid rgba(255,255,255,.08); z-index: var(--z-nav); }
.brand { display: flex; gap: .75rem; align-items: center; min-height: 64px; padding: .6rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; color: white; background: linear-gradient(145deg, var(--jade-700), #2aa891); font-family: Georgia, serif; font-size: 1.35rem; }
.brand strong, .brand small { display: block; }
.brand small { color: #9fb5c7; }
.sidebar-scroll { flex: 1; overflow: auto; padding: 1rem .75rem; }
.sidebar section + section { margin-top: 1.25rem; }
.sidebar section h2 { padding: 0 .65rem; color: #8fa9bc; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.sidebar section a { display: flex; min-height: 44px; align-items: center; padding: .55rem .75rem; border-radius: 10px; color: #c7d7e4; }
.sidebar section a:hover { background: rgba(255,255,255,.06); }
.sidebar section a.active { color: white; background: linear-gradient(90deg, rgba(42,168,145,.24), rgba(42,168,145,.07)); box-shadow: inset 3px 0 #43c5aa; }
.role-switch { display: flex; align-items: center; gap: .65rem; min-height: 70px; padding: .75rem 1rem; color: white; background: rgba(255,255,255,.04); border: 0; border-top: 1px solid rgba(255,255,255,.08); cursor: pointer; text-align: left; }
.role-switch span span, .role-switch strong, .role-switch small { display: block; }
.role-switch small { color: #9fb5c7; }
.avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--navy-950); background: #dff8ef; font-weight: 800; }
.avatar--large { width: 72px; height: 72px; font-size: 1.5rem; }

.topbar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: .55rem clamp(1rem, 3vw, 2.5rem); background: rgba(244,247,249,.92); border-bottom: 1px solid rgba(217,225,232,.85); backdrop-filter: blur(16px); }
.topbar-start { display: flex; min-width: 0; align-items: center; gap: .85rem; }
.topbar-end { display: flex; flex: 0 0 auto; align-items: center; gap: .75rem; }
.topbar-back { display: inline-flex; min-width: 44px; min-height: 44px; flex: 0 0 auto; align-items: center; justify-content: center; gap: .15rem; padding: .55rem .75rem; color: var(--navy-700); background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; }
.topbar-back:hover { color: var(--navy-900); background: white; border-color: var(--line); }
.topbar-back > span:first-child { font-size: 1.15rem; line-height: 1; }
.topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.topbar-start.has-back .topbar-title { padding-left: .85rem; border-left: 1px solid var(--line); }
.scenario-lab { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem .45rem .75rem; background: white; border: 1px solid var(--line); border-radius: 999px; }
.scenario-lab label { color: var(--muted); font-size: .78rem; }
.scenario-lab select { border: 0; background: transparent; font-weight: 700; }
.scenario-lab span { padding: .2rem .45rem; color: var(--navy-900); background: var(--navy-100); border-radius: 999px; font-size: .68rem; font-weight: 800; }
.menu-button { display: none !important; }
.main-content { width: min(1280px, 100%); min-height: calc(100vh - 64px); margin: 0 auto; padding: clamp(1.5rem, 3vw, 3rem); }
.main-content:focus { outline: none; }
.main-content > * + * { margin-top: var(--space-6); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.page-header .lede { max-width: 760px; color: var(--muted); font-size: 1.05rem; }
.eyebrow, .card-eyebrow, .kicker, .question-label { margin-bottom: .45rem; color: var(--jade-700); font-size: .73rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 750; transition: transform var(--duration-fast) ease, background var(--duration-fast) ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button--primary { color: white; background: var(--navy-900); }
.button--primary:hover:not(:disabled) { background: #0d3157; }
.button--secondary { color: var(--navy-900); background: white; border-color: var(--line); }
.button--quiet { color: var(--navy-700); background: transparent; }
.button--danger { color: white; background: var(--red-700); }
.button--danger:hover:not(:disabled) { background: #8e1822; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.button-column { display: grid; gap: .5rem; }
.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; }

.hero-panel { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.5rem, 4vw, 3rem); color: white; background: radial-gradient(circle at 85% 10%, rgba(68,197,170,.26), transparent 32%), linear-gradient(135deg, var(--navy-950), var(--navy-900)); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.hero-panel p { max-width: 700px; color: #cbdbe8; }
.hero-panel .kicker { color: #70dbc4; }
.hero-panel--soft { color: var(--ink); background: linear-gradient(135deg, white, var(--jade-100)); border: 1px solid #cce8df; }
.hero-panel--soft p { color: var(--muted); }
.hero-ring { display: grid; width: 128px; height: 128px; flex: 0 0 auto; place-items: center; align-content: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--navy-900) 78%, transparent 80% 99%), conic-gradient(#48d1b2 calc(var(--value) * 1%), rgba(255,255,255,.16) 0); }
.hero-ring strong { font-size: 1.75rem; }
.hero-ring span { color: #cbdbe8; font-size: .75rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.metric { min-width: 0; padding: 1.25rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.metric span, .metric strong, .metric small { display: block; }
.metric span { color: var(--muted); font-size: .8rem; }
.metric strong { margin: .25rem 0; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.1; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-width: 0; padding: 1.35rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(11,31,51,.035); }
.card-body { color: var(--muted); }
.card-footer { display: flex; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.course-card { border-top: 4px solid var(--jade-700); }
.course-card--amber { border-top-color: var(--amber-700); }
.course-modules { display: grid; gap: var(--space-5); }
.course-module { min-width: 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(11,31,51,.035); }
.course-module__header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); align-items: center; gap: var(--space-5); padding: var(--space-5); background: linear-gradient(135deg, white, var(--navy-100)); border-bottom: 1px solid var(--line); }
.course-module__header h3 { margin: 0; font-size: 1.35rem; }
.course-module__header p:last-child { margin: var(--space-1) 0 0; color: var(--muted); }
.course-module__progress { min-width: 0; }
.chapter-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); padding: var(--space-5); }
.chapter-link { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; min-height: 72px; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--canvas); border: 1px solid transparent; border-radius: var(--radius-sm); transition: color var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease; }
.chapter-link:hover { color: var(--navy-900); background: white; border-color: #b9cde0; transform: translateY(-1px); }
.chapter-link__marker { width: 8px; height: 8px; background: var(--jade-700); border-radius: 50%; }
.chapter-link__content { min-width: 0; }
.chapter-link__content strong, .chapter-link__content small { display: block; overflow-wrap: anywhere; }
.chapter-link__content small { margin-top: var(--space-1); }
.chapter-link__arrow { color: var(--navy-700); font-size: 1.15rem; }
.course-module__empty { grid-column: 1 / -1; margin: 0; padding: var(--space-4); color: var(--muted); background: var(--canvas); border-radius: var(--radius-sm); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--muted); font-size: .82rem; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: .15rem .5rem; border-radius: 999px; color: #4c5965; background: #edf1f4; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.badge--success { color: #0d6659; background: var(--jade-100); }
.badge--info { color: var(--navy-900); background: var(--navy-100); }
.badge--warning { color: #8a4e05; background: var(--amber-100); }
.badge--danger { color: var(--red-700); background: var(--red-100); }
.progress-wrap + .progress-wrap { margin-top: 1rem; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: .35rem; color: var(--muted); font-size: .76rem; }
.progress { height: 8px; overflow: hidden; background: #e9eef2; border-radius: 99px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--jade-700), #38aa94); border-radius: inherit; }
.progress--indeterminate span { width: 42%; animation: progress-indeterminate 1.25s ease-in-out infinite; }
.import-live-progress { padding: 1rem 1.25rem; background: #effaf7; border: 1px solid #b8e3d9; border-radius: var(--radius); }
.import-live-progress .eyebrow { margin-bottom: .45rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.split-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.split-panel > * { min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.weak-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-bar label { display: grid; gap: .25rem; color: var(--muted); font-size: .75rem; }
.filter-bar select, .filter-bar input { min-width: 150px; min-height: 44px; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: white; }
.tree-panel details { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.tree-panel details + details { margin-top: .75rem; }
.tree-panel summary { display: flex; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; font-weight: 800; }
.tree-children { padding: 0 .75rem .75rem 2rem; }
.tree-children a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: .6rem .75rem; border-top: 1px solid var(--line); }
.tree-children small { display: block; }
.timeline { list-style: none; padding: 0; }
.timeline li { display: flex; align-items: center; gap: .75rem; }
.timeline span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: white; background: var(--navy-900); font-weight: 800; }

.knowledge-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 1rem; }
.knowledge-card, .related-panel { padding: clamp(1.25rem, 3vw, 2rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.knowledge-page-header h1 { font-size: clamp(2rem, 3vw, 2.6rem); }
.page-path { margin-bottom: .75rem; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.page-path__compact { display: none; }
.page-context-meta { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; color: var(--muted); font-size: .86rem; }
.page-context-meta span + span { position: relative; }
.page-context-meta span + span::before { position: absolute; left: -.65rem; content: '·'; }
.knowledge-card > h2 { max-width: 780px; font-size: clamp(1.55rem, 2.5vw, 2rem); }
.answer-block { margin-top: 1.5rem; padding: 1.25rem; background: var(--navy-100); border-left: 4px solid var(--navy-700); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.warning-box { margin-top: 1.25rem; padding: 1rem; color: #70420a; background: var(--amber-100); border: 1px solid #f1d39f; border-radius: var(--radius-sm); }
.warning-box p { margin-bottom: 0; }
.knowledge-card footer { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; color: var(--muted); }
.related-panel { align-self: start; position: sticky; top: 80px; }
.related-panel > .eyebrow { margin-bottom: .75rem; }
.relation { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.relation > span { display: inline-block; margin-bottom: .25rem; color: var(--jade-700); font-size: .72rem; font-weight: 800; }
.relation strong, .relation > a { display: block; font-weight: 800; }
.relation > a { color: var(--navy-900); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .2em; }
.relation p { margin: .25rem 0 0; color: var(--muted); font-size: .85rem; }
.related-empty { margin: 1rem 0 0; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
caption { padding: .75rem 0; color: var(--muted); text-align: left; font-size: .75rem; }
th, td { padding: .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--navy-900); background: #f3f7fa; font-size: .75rem; }
td { font-size: .88rem; }
.compare-controls { display: flex; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.hide-compare-column .compare-col-2 { filter: blur(8px); user-select: none; }

.recall-stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 1rem; }
.recall-question, .recall-answer, .recall-placeholder { min-height: 480px; padding: clamp(1.5rem, 4vw, 3rem); background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.recall-question h2 { max-width: 760px; font-size: clamp(1.45rem, 3vw, 2.3rem); }
.recall-question label, .recall-question textarea { display: block; width: 100%; }
.recall-question label { margin-top: 2rem; font-weight: 700; }
.recall-question textarea { margin-top: .5rem; padding: 1rem; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.recall-placeholder { display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; background: repeating-linear-gradient(-45deg, #f7f9fa, #f7f9fa 12px, #f0f4f6 12px, #f0f4f6 24px); }
.lock { padding: .65rem 1rem; color: var(--navy-900); background: white; border: 1px solid var(--line); border-radius: 999px; font-weight: 800; }
.hint-box { margin-top: 1rem; padding: 1rem; color: var(--navy-900); background: var(--navy-100); border-radius: var(--radius-sm); }
.choice { display: inline-flex; min-height: 44px; align-items: center; gap: .45rem; margin-right: .75rem; }
.choice input { width: auto; }
.question-panel { max-width: 900px; margin-left: auto; margin-right: auto; padding: clamp(1.5rem, 4vw, 3rem); background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.question-meta, .question-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.question-panel h2 { margin: 2rem 0; font-size: clamp(1.25rem, 3vw, 2rem); }
.option-list { display: grid; gap: .75rem; padding: 0; border: 0; }
.option { display: grid; grid-template-columns: auto auto 1fr; min-height: 60px; align-items: center; gap: .85rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.option--selected { border-color: var(--navy-700); box-shadow: var(--focus); }
.option strong { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--navy-100); }
.question-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.diagnosis-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 1rem; }
.result-card { padding: 2rem; color: white; background: linear-gradient(145deg, #6c1720, var(--red-700)); border-radius: var(--radius); }
.result-mark { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 1rem; border: 2px solid rgba(255,255,255,.45); border-radius: 50%; font-size: 2rem; }
.result-card .button { margin-top: 1rem; }
.error-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.error-type { display: grid; grid-template-columns: auto auto 1fr; gap: .6rem; align-items: start; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.error-type > span { color: var(--red-700); font-weight: 850; }
.error-type small { grid-column: 2 / -1; }
.error-type--selected { border-color: var(--red-700); background: var(--red-100); }
.queue-list { display: grid; gap: .75rem; }
.queue-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 1.25rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.queue-item p { margin-bottom: .5rem; color: var(--muted); }
.queue-rank { display: grid; width: 42px; height: 42px; place-items: center; color: white; background: var(--navy-900); border-radius: 50%; font-weight: 850; }
.bar-chart { display: flex; min-height: 180px; align-items: end; justify-content: space-around; gap: .75rem; padding-top: 1rem; border-bottom: 1px solid var(--line); }
.bar-chart div { position: relative; width: 12%; min-height: 20px; background: linear-gradient(var(--jade-700), #48c7ac); border-radius: 8px 8px 0 0; }
.bar-chart span { position: absolute; top: calc(100% + .25rem); width: 100%; color: var(--muted); font-size: .68rem; text-align: center; }

label { font-weight: 700; }
input, select, textarea { width: 100%; padding: .7rem .8rem; background: white; border: 1px solid #bec9d2; border-radius: 10px; }
.form-card { display: grid; max-width: 720px; gap: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.form-card label { display: grid; gap: .4rem; }
.switch { display: flex !important; flex-direction: row !important; align-items: center; gap: .75rem !important; }
.switch input { width: auto; }
.list-panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-panel a, .list-panel > button { display: flex; width: 100%; min-height: 68px; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; background: white; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.list-panel strong, .list-panel small { display: block; }
.list-panel .badge { margin-right: .6rem; }
.favorite-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-bottom: 1px solid var(--line); }
.favorite-row a { border-bottom: 0; }
.favorite-row > .button { margin-right: .75rem; }
.compact-row { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.compact-row strong, .compact-row small { display: block; margin-top: .25rem; }
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 2rem; color: white; background: var(--navy-900); border-radius: var(--radius-lg); }
.profile-card p { margin-bottom: .25rem; color: #cbdbe8; }
.profile-card small { color: #b6c9d7; }

.workflow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.workflow--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workflow a { display: grid; min-height: 150px; align-content: start; padding: 1.15rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.workflow a > span { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 1rem; color: white; background: var(--navy-900); border-radius: 50%; font-weight: 850; }
.workflow small { display: block; margin-top: .35rem; }
.upload-panel { display: grid; max-width: 760px; gap: 1rem; padding: 1.5rem; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.upload-panel > label { display: grid; gap: .4rem; }
.upload-drop { padding: 3rem 1rem; text-align: center; background: #f8fafb; border: 2px dashed #b7c6d2; border-radius: var(--radius); }
.upload-drop > span { display: grid; width: 58px; height: 58px; margin: 0 auto 1rem; place-items: center; color: white; background: var(--navy-900); border-radius: 14px; font-weight: 900; }
.upload-drop input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.notice { padding: 1rem; color: var(--red-700); background: var(--red-100); border-left: 4px solid var(--red-700); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.notice--info { color: var(--navy-900); background: var(--navy-100); border-left-color: var(--navy-700); }
.notice--success { color: #125745; background: #e6f6f1; border-left-color: var(--jade-700); }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.record-list { display: grid; gap: .75rem; }
.record-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 112px; padding: 1.15rem 1.25rem; color: inherit; background: white; border: 1px solid var(--line); border-radius: var(--radius); transition: transform var(--duration-fast) ease, border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease; }
.record-item:hover { transform: translateY(-1px); border-color: #9ab0c0; box-shadow: var(--shadow); }
.record-item:focus-visible { outline: 3px solid var(--jade-700); outline-offset: 2px; }
.record-item__body { min-width: 0; }
.record-item__body h2 { margin-bottom: .25rem; font-size: 1.05rem; }
.record-item__body p { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.record-item__body small { color: var(--muted); }
.record-item__meta { display: grid; min-width: 96px; grid-template-columns: 1fr auto; align-items: center; text-align: right; }
.record-item__meta strong, .record-item__meta small { grid-column: 1; }
.record-item__meta strong { font-size: 1.35rem; }
.record-item__meta small { color: var(--muted); }
.record-item__meta span { grid-column: 2; grid-row: 1 / 3; margin-left: .75rem; color: var(--jade-700); font-size: 1.4rem; }
.import-record-detail { display: grid; gap: 1rem; }
.import-record-detail > .page-header, .import-record-detail > .button-row { margin-bottom: 0; }
.import-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.import-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; min-height: 86px; padding: .9rem; color: var(--muted); background: #f7f9fa; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.import-steps li > span { display: grid; width: 32px; height: 32px; place-items: center; color: white; background: #8da0af; border-radius: 50%; font-weight: 850; }
.import-steps li strong, .import-steps li small { display: block; }
.import-steps li small { margin-top: .2rem; line-height: 1.35; }
.import-steps li.is-complete { color: #125745; background: #f1faf7; border-color: #a9dace; }
.import-steps li.is-complete > span { background: var(--jade-700); }
.import-steps li.is-current { color: var(--navy-900); background: var(--navy-100); border-color: #89a9c2; box-shadow: inset 0 0 0 1px #89a9c2; }
.import-steps li.is-current > span { background: var(--navy-900); }
.detail-section { padding: clamp(1.15rem, 3vw, 1.75rem); background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.detail-section > :last-child { margin-bottom: 0; }
.detail-section--compact { padding-bottom: 1.1rem; }
.definition-list--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.definition-list--wide div { grid-template-columns: 90px minmax(0, 1fr); }
.check-list { list-style: none; padding: 0; }
.check-list li { display: flex; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.state-panel { display: grid; min-height: 420px; place-items: center; align-content: center; padding: 2rem; text-align: center; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.state-panel p { max-width: 560px; color: var(--muted); }
.state-icon { display: grid; width: 64px; height: 64px; place-items: center; margin-bottom: 1rem; color: var(--navy-900); background: var(--navy-100); border-radius: 50%; font-size: 2rem; font-weight: 800; }
.state-panel--error .state-icon { color: var(--red-700); background: var(--red-100); }
.spinner { width: 48px; height: 48px; margin-bottom: 1rem; border: 4px solid var(--navy-100); border-top-color: var(--navy-700); border-radius: 50%; animation: spin .8s linear infinite; }
.skeleton-lines { width: min(440px, 100%); }
.skeleton-lines i { display: block; height: 12px; margin-top: .6rem; background: #e8edf1; border-radius: 8px; }
.skeleton-lines i:nth-child(2) { width: 75%; }
.skeleton-lines i:nth-child(3) { width: 88%; }
.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: var(--z-toast); display: grid; gap: .5rem; }
.toast { max-width: 380px; padding: .85rem 1rem; color: white; background: var(--navy-950); border-radius: 12px; box-shadow: var(--shadow); }
.toast--error { background: var(--red-700); }
.toast--info { background: var(--navy-700); }
.operation-region { position: fixed; top: 76px; right: 1rem; z-index: calc(var(--z-toast) - 1); width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.operation-card { display: grid; gap: .75rem; padding: 1rem; color: var(--ink); background: rgba(255,255,255,.98); border: 1px solid #b9cde0; border-radius: var(--radius); box-shadow: var(--shadow); }
.operation-card p { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.dialog-progress .operation-card { box-shadow: none; background: var(--navy-100); }
.dialog-progress[hidden], .operation-region[hidden] { display: none; }
.menu-backdrop { display: none; }
.sidebar-resizer { position: fixed; top: 0; bottom: 0; left: calc(var(--sidebar-width) - 5px); z-index: calc(var(--z-nav) + 1); width: 10px; padding: 0; background: transparent; cursor: col-resize; touch-action: none; }
.sidebar-resizer::after { position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; content: ''; background: #43c5aa; opacity: 0; transition: opacity var(--duration-fast) ease; }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizing .sidebar-resizer::after { opacity: 1; }
.sidebar-resizer:focus-visible { box-shadow: none; outline: none; }
.sidebar-resizing { cursor: col-resize; user-select: none; }
.sidebar-resizing * { cursor: col-resize !important; }
.mobile-nav { display: none; }
.app-dialog { width: min(620px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; overflow: hidden; background: white; border: 0; border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(11,31,51,.28); }
.app-dialog::backdrop { background: rgba(11,31,51,.58); backdrop-filter: blur(3px); }
.app-dialog form, .app-dialog > article { display: grid; max-height: calc(100vh - 2rem); grid-template-rows: auto minmax(0,1fr) auto; }
.app-dialog header, .app-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.35rem; }
.app-dialog header { border-bottom: 1px solid var(--line); }
.app-dialog header h2 { margin-bottom: 0; }
.app-dialog footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-body { display: grid; gap: 1rem; padding: 1.35rem; overflow-y: auto; }
.dialog-body > label { display: grid; gap: .4rem; }
.dialog-error { scroll-margin-block: 1rem; }
.dialog-error:focus { outline: 3px solid rgba(180,35,47,.2); outline-offset: 2px; }
.markdown-body { color: var(--ink); overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 1.35em 0 .55em; line-height: 1.3; }
.markdown-body h1 { font-size: 1.65rem; }
.markdown-body h2 { padding-bottom: .35rem; border-bottom: 1px solid var(--line); font-size: 1.4rem; }
.markdown-body h3 { font-size: 1.18rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-table-scroll { margin: .8rem 0; }
.markdown-body blockquote { padding: .75rem 1rem; color: var(--muted); background: var(--canvas); border-left: 4px solid var(--jade-700); }
.markdown-body blockquote > :first-child { margin-top: 0; }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body pre { max-width: 100%; padding: 1rem; overflow: auto; color: #eaf4fb; background: var(--navy-950); border-radius: var(--radius-sm); }
.markdown-body code { font-size: .88em; }
.markdown-body :not(pre) > code { padding: .12rem .32rem; background: var(--navy-100); border-radius: 5px; }
.markdown-body a { color: var(--navy-700); text-decoration: underline; text-underline-offset: .18em; }
.markdown-body hr { margin: 1.4rem 0; border: 0; border-top: 1px solid var(--line); }
.markdown-table-scroll { overflow-x: auto; }
.markdown-table-scroll table { min-width: 420px; }
.markdown-table-scroll th, .markdown-table-scroll td { padding: .65rem .75rem; border: 1px solid var(--line); }
.form-label { display: block; margin-bottom: .4rem; font-weight: 700; }
.file-drop-zone { position: relative; display: grid; min-height: 168px; padding: 1.25rem; place-items: center; align-content: center; gap: .45rem; overflow: hidden; text-align: center; color: var(--muted); background: var(--canvas); border: 2px dashed #b5c4cf; border-radius: var(--radius); cursor: pointer; transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease; }
.file-drop-zone:hover, .file-drop-zone:focus-within, .file-drop-zone.is-dragover { background: #effaf7; border-color: var(--jade-700); box-shadow: 0 0 0 3px rgba(21,116,102,.12); }
.file-drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop-zone__icon { display: grid; width: 48px; height: 48px; place-items: center; color: white; background: var(--jade-700); border-radius: 14px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; }
.file-drop-zone strong { color: var(--ink); font-size: 1rem; }
.file-drop-zone > span:not(.file-drop-zone__icon) { font-size: .78rem; }
.file-drop-zone__selection { display: inline-flex; max-width: 100%; min-height: 30px; align-items: center; padding: .3rem .65rem; overflow-wrap: anywhere; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 999px; }
.file-drop-zone.has-file .file-drop-zone__selection { color: var(--jade-700); background: #e9f8f4; border-color: #90d8c8; font-weight: 700; }
.definition-list { display: grid; gap: .75rem; margin: 0; }
.definition-list div { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; overflow-wrap: anywhere; }
.compact-buttons { margin-top: 0; }

.is-login .app-shell { display: block; }
.is-login .sidebar, .is-login .topbar, .is-login .mobile-nav { display: none; }
.is-login .main-content { width: 100%; min-height: 100vh; padding: 0; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); background: var(--navy-950); }
.login-story { display: grid; align-content: center; padding: clamp(2rem, 7vw, 7rem); color: white; background: radial-gradient(circle at 15% 20%, rgba(68,197,170,.24), transparent 28%), linear-gradient(145deg, #0b1f33, #123c69); }
.login-story h1 { max-width: 700px; font-size: clamp(3rem, 7vw, 6rem); }
.login-story > p { max-width: 680px; color: #cbdbe8; font-size: 1.15rem; }
.method-steps { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.method-steps li { padding: .4rem .7rem; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; }
.login-panel { display: grid; align-content: center; padding: clamp(2rem, 6vw, 5rem); background: white; }
.login-panel form { display: grid; gap: .75rem; margin: 1.5rem 0; }
.login-panel fieldset { padding: .75rem; border: 1px solid var(--line); border-radius: 10px; }
.login-panel .choice input { width: auto; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress-indeterminate {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(75%); }
  100% { transform: translateX(240%); }
}

@media (min-width: 761px) {
  html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  html::-webkit-scrollbar { width: 10px; }
  html::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-thumb { background: transparent; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
  html.is-main-scrollbar-active { scrollbar-color: rgba(93,107,120,.58) transparent; }
  html.is-main-scrollbar-active::-webkit-scrollbar-thumb { background: rgba(93,107,120,.58); border-color: transparent; background-clip: padding-box; }
  .sidebar-scroll {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  .sidebar-scroll::-webkit-scrollbar { width: 10px; }
  .sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
  .sidebar-scroll::-webkit-scrollbar-thumb { background: transparent; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
  .sidebar-scroll.is-scrollbar-active { scrollbar-color: rgba(199,215,228,.72) transparent; }
  .sidebar-scroll.is-scrollbar-active::-webkit-scrollbar-thumb { background: rgba(199,215,228,.72); border-color: transparent; background-clip: padding-box; }
}

@media (max-width: 1080px) {
  .app-shell { --sidebar-width: 220px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .knowledge-layout, .recall-stage { grid-template-columns: 1fr; }
  .related-panel { position: static; }
  .recall-placeholder { min-height: 260px; }
}

@media (max-width: 760px) {
  html { scrollbar-gutter: auto; scrollbar-width: auto; scrollbar-color: auto; }
  body.menu-open { overflow: hidden; }
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar-resizer { display: none; }
  .sidebar { position: fixed; right: 0; left: auto; width: min(88vw, 320px); border-right: 0; border-left: 1px solid rgba(255,255,255,.08); transform: translateX(105%); transition: transform var(--duration-normal) ease; box-shadow: var(--shadow); }
  .menu-open .sidebar { z-index: var(--z-overlay); transform: translateX(0); }
  .menu-backdrop { position: fixed; inset: 0; z-index: calc(var(--z-overlay) - 1); display: block; padding: 0; background: rgba(11,31,51,.52); border: 0; opacity: 0; pointer-events: none; transition: opacity var(--duration-normal) ease; -webkit-tap-highlight-color: transparent; }
  .menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  .topbar { min-height: 64px; padding: .55rem .75rem; }
  .topbar-start { flex: 1 1 auto; gap: .35rem; }
  .topbar-end { margin-left: .35rem; }
  .topbar-back { padding-inline: .5rem; }
  .topbar-back__label { display: none; }
  .topbar-start.has-back .topbar-title { padding-left: .55rem; }
  .menu-button { display: grid !important; }
  .scenario-lab label { display: none; }
  .scenario-lab { gap: .25rem; padding-left: .4rem; }
  .scenario-lab select { max-width: 84px; }
  .main-content { min-height: calc(100vh - 64px); padding: 1.15rem; }
  .operation-region { top: 72px; right: .75rem; width: calc(100vw - 1.5rem); }
  .is-immersive .app-shell { padding-bottom: 0; }
  .is-immersive .mobile-nav { display: none; }
  .page-path__full { display: none; }
  .page-path__compact { display: inline; }
  .knowledge-card footer .button-row { width: 100%; }
  .knowledge-card footer [data-action="feedback-knowledge"] { flex-basis: 100%; justify-content: flex-start; }
  .page-header, .hero-panel, .knowledge-card footer, .question-footer { align-items: stretch; flex-direction: column; }
  .page-header .button, .hero-panel > .button { width: 100%; }
  .course-module__header { grid-template-columns: 1fr; padding: var(--space-4); }
  .chapter-link-grid { grid-template-columns: 1fr; padding: var(--space-4); }
  .hero-ring { width: 104px; height: 104px; align-self: flex-end; }
  .card-grid, .split-panel, .diagnosis-grid, .error-types { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-item { grid-template-columns: auto minmax(0, 1fr); }
  .queue-item > :last-child { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-item { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .record-item__status { grid-column: 1 / -1; }
  .record-item__meta { min-width: 70px; }
  .import-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .definition-list--wide { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: var(--z-mobile-nav); display: grid; grid-template-columns: repeat(4, 1fr); min-height: 62px; padding-bottom: env(safe-area-inset-bottom); background: white; border-top: 1px solid var(--line); }
  .mobile-nav a { display: grid; place-items: center; min-height: 56px; color: var(--muted); font-size: .78rem; }
  .mobile-nav a.active { color: var(--navy-900); border-top: 3px solid var(--jade-700); font-weight: 800; }
  th, td { min-width: 130px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-story { min-height: 42vh; padding: 2rem 1.25rem; }
  .login-story h1 { font-size: clamp(2.6rem, 14vw, 4rem); }
  .login-panel { padding: 2rem 1.25rem 3rem; }
}

@media (max-width: 460px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .metric { padding: 1rem; }
  .metric strong { font-size: 1.35rem; }
  .workflow { grid-template-columns: 1fr; }
  .record-item { padding: 1rem; }
  .record-item__meta span { display: none; }
  .import-steps li { min-height: 78px; padding: .75rem; }
  .question-panel, .recall-question, .recall-answer { padding: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.inline-control { display: flex !important; flex-direction: row; align-items: center; gap: .75rem !important; color: var(--ink) !important; font-size: .85rem !important; }
.inline-control select { min-width: 150px; }
.field-help { align-self: center; color: var(--muted); font-size: .78rem; }
