:root {
  --ink: #17233b;
  --muted: #68758c;
  --navy: #102544;
  --navy-soft: #1b3760;
  --primary: #2f6fed;
  --primary-dark: #2457c5;
  --primary-soft: #eaf1ff;
  --teal: #0f9f8f;
  --teal-soft: #e6f7f4;
  --amber: #d97706;
  --amber-soft: #fff5df;
  --danger: #d94b5b;
  --danger-soft: #fff0f2;
  --surface: #ffffff;
  --canvas: #f4f7fc;
  --line: #e3e9f2;
  --shadow-sm: 0 1px 2px rgba(16, 37, 68, .04), 0 6px 18px rgba(16, 37, 68, .05);
  --shadow-md: 0 12px 34px rgba(16, 37, 68, .09);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --ring: 0 0 0 .22rem rgba(47, 111, 237, .18);
  --shadow-lg: 0 24px 60px -28px rgba(16, 37, 68, .28);
  --ease: cubic-bezier(.22, .68, .32, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1000px 460px at 100% -10%, #e8f0ff 0%, rgba(232, 240, 255, 0) 68%),
    var(--canvas);
  background-repeat: no-repeat;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
* { scrollbar-width: thin; scrollbar-color: #c6d2e3 transparent; }
::selection { color: #fff; background: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
a { color: var(--primary); text-decoration: none; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 2000;
  padding: .55rem .9rem;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  transform: translateY(-160%);
  transition: transform .18s var(--ease);
}
.skip-link:focus { color: #fff; transform: translateY(0); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
h1, h2, h3 { line-height: 1.25; }
h4, h5, h6 { line-height: 1.4; }
img { max-width: 100%; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ===== 应用外壳 ===== */
.app-shell { min-height: 100vh; display: flex; align-items: stretch; }
.app-canvas { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* 侧边导航 */
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  flex: 0 0 252px;
  flex-direction: column;
  width: 252px;
  height: 100vh;
  padding: 20px 14px 16px;
  overflow-y: auto;
  color: #c7d3e5;
  background:
    radial-gradient(380px 260px at 12% 0%, rgba(64, 122, 255, .22), transparent 68%),
    radial-gradient(320px 280px at 108% 88%, rgba(15, 159, 143, .13), transparent 70%),
    linear-gradient(180deg, #0d1e36 0%, #0a1627 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 4px 8px 22px; text-decoration: none; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar-brand .brand-copy strong { color: #fff; }
.sidebar-brand .brand-copy small { color: #7f96b8; }
.sidebar-nav { flex: 1 1 auto; }
.sidebar-group + .sidebar-group { margin-top: 18px; }
.sidebar-label { display: block; padding: 0 10px 7px; color: #6b82a5; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .62rem;
  margin-bottom: 2px;
  padding: .58rem .7rem;
  border-radius: 10px;
  color: #b6c5db;
  font-size: .9rem;
  font-weight: 500;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.sidebar-link .icon { width: 18px; height: 18px; color: #7f96b8; transition: color .18s var(--ease); }
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sidebar-link:hover .icon { color: #dbe7f8; }
.sidebar-link.active { color: #fff; background: linear-gradient(90deg, rgba(59, 120, 255, .3), rgba(59, 120, 255, .08)); box-shadow: inset 0 0 0 1px rgba(118, 162, 255, .2); }
.sidebar-link.active .icon { color: #9dc0ff; }
.sidebar-link.active::before { content: ""; position: absolute; left: -14px; top: 50%; width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #5b93ff; transform: translateY(-50%); }
.sidebar-foot { flex: 0 0 auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-tip { display: flex; gap: .55rem; padding: .8rem .85rem; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; color: #8fa4c2; background: rgba(255, 255, 255, .04); font-size: .74rem; line-height: 1.6; }
.sidebar-tip .icon { flex: 0 0 auto; margin-top: 1px; color: #6fd8c9; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 1045; background: rgba(7, 16, 30, .55); backdrop-filter: blur(3px); }

/* 顶栏 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 12px 28px -24px rgba(16, 37, 68, .5);
  backdrop-filter: saturate(150%) blur(16px);
}
.topbar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px clamp(16px, 2.2vw, 32px); }
.topbar-toggle { display: none; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.topbar-toggle:hover { border-color: #c9d8ef; background: #f6f9ff; }
.topbar-mobile-brand { display: none; align-items: center; gap: .5rem; color: var(--ink); font-size: .92rem; }
.topbar-mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.topbar-context { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.topbar-eyebrow { color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.topbar-context strong { overflow: hidden; color: var(--ink); font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.topbar-search { position: relative; flex: 0 1 320px; min-width: 0; }
.topbar-search .icon { position: absolute; top: 50%; left: 13px; color: #8b99ad; transform: translateY(-50%); pointer-events: none; }
.topbar-search input { width: 100%; height: 38px; padding: 0 14px 0 37px; border: 1px solid #dfe7f2; border-radius: 999px; color: var(--ink); background: #f4f7fc; font-size: .86rem; }
.topbar-search input:focus { outline: 0; border-color: #a9c4f7; background: #fff; box-shadow: 0 0 0 .2rem rgba(47, 111, 237, .1); }
.topbar-icon-link { display: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; }
.topbar-icon-link:hover { color: var(--primary); border-color: #c9d8ef; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.app-header .user-trigger { color: var(--ink); }
.app-header .user-trigger:hover, .app-header .user-trigger[aria-expanded="true"] { background: #eef3fb; }
.app-header .user-meta small { color: var(--muted); }
.app-header .avatar { background: linear-gradient(145deg, #4b8bff, #2457c5); }

/* 专注练习模式 */
.app-header-focus .focus-bar { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px clamp(16px, 2.2vw, 32px); }
.focus-brand { display: flex; align-items: center; gap: .6rem; }
.focus-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.focus-brand .brand-copy strong { color: var(--ink); font-size: .9rem; }
.focus-brand .brand-copy small { color: var(--muted); font-size: .58rem; letter-spacing: .14em; }
.focus-title { display: inline-flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.focus-title::before { content: ""; width: 1px; height: 18px; background: var(--line); }
.focus-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.focus-actions .btn { display: inline-flex; }

/* 页面主区 */
.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #4b8bff, #2f6fed 60%, #2457c5);
  box-shadow: 0 8px 20px rgba(47, 111, 237, .28);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { color: #fff; font-size: 1.02rem; letter-spacing: .01em; }
.brand-copy small { color: #9fb3d1; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.user-trigger {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: .6rem;
  border: 0;
  border-radius: 12px;
  padding: .35rem .45rem .35rem .35rem;
  color: #fff;
  background: transparent;
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
.avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #fff;
  background: #315780;
  font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-meta strong { font-size: .86rem; white-space: nowrap; }
.user-meta small { color: #9fb3d1; font-size: .7rem; }
.user-menu { min-width: 220px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: .45rem; }
.user-menu .dropdown-item { border-radius: 9px; padding: .6rem .7rem; }
.user-menu .dropdown-item.text-danger { color: var(--danger); }

.app-main { flex: 1 1 auto; padding: 28px clamp(16px, 2.2vw, 32px) 56px; }
.container-app { width: 100%; max-width: 1400px; margin-inline: auto; }
.app-footer { border-top: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .66); padding-inline: clamp(16px, 2.2vw, 32px); }
.app-footer .container-app { display: flex; justify-content: space-between; gap: 1rem; padding-block: 18px; font-size: .82rem; }

.page-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 26px;
  padding: 2px 0 18px 18px;
  border-bottom: 1px solid var(--line);
}
.page-heading::before { content: ""; position: absolute; top: 4px; bottom: 20px; left: 0; width: 4px; border-radius: 99px; background: linear-gradient(180deg, var(--primary) 0%, #7dabff 55%, rgba(125, 171, 255, 0) 100%); }
.page-heading > div:first-child { min-width: 0; }
.page-heading > .btn, .page-heading > .d-flex, .page-heading > .status-badge { flex: 0 0 auto; }
.page-heading h1, .page-heading h3 { margin: 0 0 .3rem; font-size: clamp(1.45rem, 2vw, 1.85rem); }
.page-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: .92rem; }
.page-heading .eyebrow { margin-bottom: .5rem; padding: .2rem .58rem; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .64rem; }
.page-heading .section-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .55rem;
  color: var(--primary);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin: 32px 0 16px; }
.section-heading h2, .section-heading h4 { margin: 0; font-size: 1.12rem; }
.section-heading a { font-size: .86rem; font-weight: 600; }

/* 页面通用工具条 */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 18px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.segmented .btn { border: 0; border-radius: 8px; padding: .46rem .82rem; color: var(--muted); background: transparent; font-size: .83rem; font-weight: 600; box-shadow: none; }
.segmented .btn:hover { color: var(--primary-dark); background: var(--primary-soft); transform: none; }
.segmented .btn-primary { color: #fff; background: var(--primary); box-shadow: 0 6px 14px -10px rgba(47, 111, 237, .8); }
.segmented .btn-warning { color: #fff; background: #c8820d; box-shadow: 0 6px 14px -10px rgba(200, 130, 13, .8); }
.segmented .btn-outline-primary, .segmented .btn-outline-warning { color: var(--muted); background: transparent; }
.segmented .btn.active { color: #fff; background: #c8820d; box-shadow: 0 6px 14px -10px rgba(200, 130, 13, .8); }
.filter-bar { display: flex; flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: .8rem; padding: 16px 18px; }
.filter-bar .form-label { margin-bottom: .3rem; color: var(--muted); font-size: .76rem; }
.filter-bar .form-control, .filter-bar .form-select, .filter-bar .btn { min-height: 40px; }
.filter-bar .btn { padding-inline: .9rem; }
.filter-bar-title { display: flex; flex: 0 0 100%; align-items: center; gap: .45rem; color: var(--ink); font-size: .9rem; font-weight: 700; }
.filter-bar-title .icon { color: var(--primary); }
.filter-field { flex: 1 1 220px; min-width: min(100%, 200px); }
.search-bar .filter-field { flex: 1 1 360px; }
.folder-manager { margin-bottom: 18px; }
.folder-manager summary { display: flex; align-items: center; gap: .45rem; color: var(--primary-dark); font-size: .88rem; font-weight: 600; cursor: pointer; list-style: none; }
.folder-manager summary::-webkit-details-marker { display: none; }
.folder-manager summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: .8rem; }
.folder-manager[open] summary::after { content: "▴"; }
.section-heading .course-symbol { width: 34px; height: 34px; border-radius: 10px; }
.section-heading .course-symbol .icon { width: 17px; height: 17px; }

/* 面板 */
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 37, 68, .03), 0 20px 44px -36px rgba(16, 37, 68, .42); }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfcff, #fff); }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; }
.panel-body { padding: 20px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel .table-card { border: 0; border-radius: 0; box-shadow: none; }

/* 考试模板章节比例 */
.ratio-editor { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.ratio-editor-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .75rem; margin-bottom: 12px; }
.ratio-editor-head .form-label { color: var(--ink); }
.ratio-editor .input-group-text { max-width: 68%; white-space: normal; text-align: left; }
.ratio-total { padding: .24rem .62rem; border-radius: 999px; color: var(--muted); background: #eef2f7; font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ratio-total.is-valid { color: #087568; background: var(--teal-soft); }
.ratio-total.is-invalid { color: #92560b; background: var(--amber-soft); }
#ratioFields[aria-busy="true"] { opacity: .55; pointer-events: none; }

/* 学习中心欢迎面板 */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 30px;
  padding: clamp(26px, 3.4vw, 40px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(560px 320px at 92% -20%, rgba(77, 137, 255, .48), transparent 66%),
    radial-gradient(380px 280px at -4% 116%, rgba(15, 159, 143, .24), transparent 62%),
    linear-gradient(135deg, #0d1f38 0%, #14335c 58%, #1c4a86 100%);
  box-shadow: var(--shadow-md);
}
.dashboard-hero::after { content: ""; position: absolute; right: -120px; top: -140px; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 0 0 56px rgba(255, 255, 255, .03), 0 0 0 116px rgba(255, 255, 255, .02); pointer-events: none; }
.dashboard-hero-copy { position: relative; z-index: 1; min-width: 0; }
.dashboard-hero .eyebrow { color: #8fb7ff; }
.dashboard-hero h1 { margin: 6px 0 10px; color: #fff; font-size: clamp(1.65rem, 2.6vw, 2.3rem); text-wrap: balance; }
.dashboard-hero p { max-width: 560px; margin: 0 0 22px; color: #b9c8de; font-size: .94rem; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.dashboard-hero-actions .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--navy); --bs-btn-hover-bg: #eaf1ff; --bs-btn-hover-border-color: #eaf1ff; --bs-btn-hover-color: var(--navy); }
.dashboard-hero-actions .btn-outline-light { border-color: rgba(255, 255, 255, .3); color: #eaf1ff; }
.dashboard-hero-actions .btn-outline-light:hover { border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .12); }
.dashboard-hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; color: #dbe7f8; background: rgba(255, 255, 255, .06); transition: background-color .18s var(--ease), border-color .18s var(--ease); }
.hero-stat:hover { color: #fff; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); }
.hero-stat .icon { margin-bottom: 8px; color: #8fb7ff; }
.hero-stat strong { color: #fff; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stat small { color: #9fb3d1; font-size: .72rem; }
.dashboard-section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin: 30px 0 16px; }
.dashboard-section-head h2 { margin: 0; font-size: 1.16rem; }
.dashboard-rail { display: grid; gap: 16px; }
.dashboard-rail .card { padding: 18px; }
.dashboard-rail h2 { margin: 0 0 12px; font-size: .98rem; }
.quick-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-tool { display: flex; flex-direction: column; gap: .3rem; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcff; font-size: .83rem; font-weight: 600; transition: border-color .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease); }
.quick-tool .icon { color: var(--primary); }
.quick-tool:hover { color: var(--primary-dark); border-color: #c9dbfb; background: var(--primary-soft); }
.exam-mini-list { display: grid; }
.exam-mini { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem 0; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: .84rem; }
.exam-mini:last-child { border-bottom: 0; }
.exam-mini:hover { color: var(--primary-dark); }
.exam-mini small { display: block; color: var(--muted); font-size: .72rem; }
.tip-card { display: flex; gap: .65rem; color: #8a5a10; background: var(--amber-soft); border-color: #f3e1b9; font-size: .8rem; line-height: 1.6; }
.tip-card .icon { flex: 0 0 auto; margin-top: 2px; color: var(--amber); }

/* 管理工作流 */
.workflow-list { display: grid; gap: 0; }
.workflow-step { position: relative; display: flex; gap: 14px; padding: 0 0 20px; }
.workflow-step:last-child { padding-bottom: 0; }
.workflow-step:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: 4px; width: 2px; background: linear-gradient(180deg, #dbe7fb, #eef3fa); }
.workflow-index { width: 34px; height: 34px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); font-size: .78rem; font-weight: 750; }
.workflow-step strong { display: block; font-size: .91rem; }
.workflow-step p { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }
.quick-tile-grid { display: grid; gap: 10px; }
.quick-tile { display: flex; align-items: center; gap: .65rem; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfcff; font-size: .85rem; font-weight: 600; }
.quick-tile .icon { color: var(--primary); }
.quick-tile:hover { color: var(--primary-dark); border-color: #c9dbfb; background: var(--primary-soft); }

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 37, 68, .03), 0 20px 44px -36px rgba(16, 37, 68, .42);
}
.card.p-3, .card.p-4, .card.p-5 { border-radius: 18px; }
.card-hover { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.card-hover:hover { transform: translateY(-2px); border-color: #cfdcf1; box-shadow: var(--shadow-md); }
.card-header { border-bottom: 1px solid var(--line); background: transparent; padding: 1rem 1.15rem; }
.card-title { margin: 0; font-size: 1rem; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.surface-pad { padding: 24px; }
.muted { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--teal) !important; }
.text-warning { color: var(--amber) !important; }
.text-danger { color: var(--danger) !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 10px; font-weight: 600; padding: .58rem .95rem; transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }
.btn-primary { --bs-btn-bg-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg-color: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg-color: var(--primary-dark); box-shadow: 0 8px 18px -12px rgba(47, 111, 237, .8); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(47, 111, 237, .85); }
.btn-primary:active { transform: translateY(0); }
.btn-success { --bs-btn-bg-color: var(--teal); --bs-btn-border-color: var(--teal); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: #b9cdf8; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-secondary { --bs-btn-color: #52627a; --bs-btn-border-color: #d5deea; }
.btn-sm { border-radius: 8px; padding: .36rem .62rem; font-size: .8rem; }
.btn-lg { border-radius: 12px; padding: .78rem 1.25rem; }
.btn-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.btn-favorite { color: #8a5a00; background: #fff6dd; border: 1px solid #f0d08a; }
.btn-favorite:hover, .btn-favorite:focus { color: #6f4900; background: #ffeebc; border-color: #e3bc61; }
.btn-favorite.is-active { color: #fff; background: #b8810d; border-color: #a8750b; }
.btn-favorite.is-active:hover, .btn-favorite.is-active:focus { color: #fff; background: #a8750b; border-color: #946607; }
.btn-favorite .icon { fill: currentColor; }

.form-control, .form-select, .input-group-text {
  min-height: 42px;
  border-color: #d7e0ec;
  border-radius: 10px;
  padding: .62rem .78rem;
  font-size: .92rem;
}
.form-control::placeholder { color: #9aa8bc; }
.form-control:focus, .form-select:focus { border-color: #8eb2fb; box-shadow: 0 0 0 .2rem rgba(47, 111, 237, .1); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #e78b97; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { border-color: #e78b97; box-shadow: 0 0 0 .2rem rgba(217, 75, 91, .12); }
.form-label { margin-bottom: .42rem; color: #3d4c64; font-size: .86rem; font-weight: 600; }
.form-label .required-mark { margin-left: .15rem; color: var(--danger); }
.form-check { display: flex; align-items: center; gap: .5rem; min-height: 1.5rem; }
.form-check-input { margin: 0; flex: 0 0 auto; }
.form-check-label { font-size: .9rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: #8eb2fb; box-shadow: 0 0 0 .2rem rgba(47, 111, 237, .1); }
.form-text { color: var(--muted); font-size: .78rem; }
.form-actions { position: sticky; top: 96px; }
.form-actions .btn { min-height: 42px; }
textarea.form-control { min-height: 96px; }
.input-group-text { color: #52627a; background: #f6f8fc; font-size: .82rem; }
.input-group > .form-control, .input-group > .form-select { border-radius: 0 10px 10px 0; }
.input-group-text { border-radius: 10px 0 0 10px; }

.alert { border: 1px solid transparent; border-radius: 12px; padding: .85rem 1rem; font-size: .9rem; }
.alert-info { color: #2457a6; background: #edf4ff; border-color: #d8e6ff; }
.alert-success { color: #087568; background: #eaf8f5; border-color: #cceee7; }
.alert-warning { color: #92560b; background: #fff7e8; border-color: #f8e5bd; }
.alert-danger { color: #a63443; background: #fff1f3; border-color: #f5d3d8; }
.flash-stack { display: grid; gap: .65rem; margin-bottom: 20px; }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 16px; }
.metric-card { position: relative; overflow: hidden; padding: 20px 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.metric-card::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 2px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), rgba(47, 111, 237, 0)); opacity: .45; }
.metric-card:hover { transform: translateY(-2px); border-color: #cfdcf1; box-shadow: var(--shadow-md); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.metric-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.metric-card.success .metric-icon { color: var(--teal); background: var(--teal-soft); }
.metric-card.success::after { background: linear-gradient(90deg, var(--teal), rgba(15, 159, 143, 0)); }
.metric-card.warning .metric-icon { color: var(--amber); background: var(--amber-soft); }
.metric-card.warning::after { background: linear-gradient(90deg, var(--amber), rgba(217, 119, 6, 0)); }
.metric-card.danger .metric-icon { color: var(--danger); background: var(--danger-soft); }
.metric-card.danger::after { background: linear-gradient(90deg, var(--danger), rgba(217, 75, 91, 0)); }
.metric-value { margin-top: 10px; font-size: 1.95rem; font-weight: 750; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-link { display: inline-flex; align-items: center; gap: .3rem; margin-top: 12px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.metric-link:hover { color: var(--primary); gap: .45rem; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.course-card { position: relative; display: flex; flex-direction: column; min-height: 236px; padding: 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 18px 18px 0 0; background: linear-gradient(90deg, var(--primary), #7db1ff 55%, rgba(125, 177, 255, 0)); opacity: .65; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cfdcf1; }
.course-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.course-symbol { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.course-card h3 { margin: 18px 0 .45rem; font-size: 1.08rem; }
.course-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.course-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 16px 0 20px; }
.meta-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .55rem; border-radius: 999px; color: #52627a; background: #f2f5fa; font-size: .76rem; }
.course-card .btn { margin-top: auto; align-self: flex-start; }
.course-card code { color: #74829a; font-size: .7rem; letter-spacing: .05em; }

.table-card { overflow: hidden; }
.table-card .table { margin: 0; }
.table-responsive { scrollbar-width: thin; }
.comment-row { cursor: pointer; }
.comment-row:focus-visible { outline: 3px solid rgba(47, 111, 237, .28); outline-offset: -3px; }
.table { --bs-table-color: #334157; --bs-table-hover-color: #223047; }
.table > :not(caption) > * > * { padding: .88rem 1rem; border-bottom-color: #edf1f6; }
.table > thead > tr > th { color: #718096; background: #f8fafd; border-bottom: 1px solid var(--line); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table > tbody > tr { transition: background-color .16s var(--ease); }
.table > tbody > tr:hover > * { background: #f8fbff; }
.table-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.table-actions .btn { white-space: nowrap; }
.table-title { display: flex; align-items: center; gap: .45rem; }
.table-subtitle { color: var(--muted); font-size: .78rem; }
.sort-controls { display: inline-flex; align-items: center; gap: .3rem; }
.sort-controls form { margin: 0; }
.sort-position { display: inline-flex; min-width: 1.5rem; justify-content: center; color: var(--muted); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sort-btn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; font-size: .82rem; line-height: 1; }

/* ===== 课程详情 ===== */
.course-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 30px;
  align-items: center;
  padding: clamp(24px, 3.4vw, 38px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(620px 320px at 88% -30%, rgba(77, 137, 255, .5), transparent 66%),
    radial-gradient(420px 300px at -6% 118%, rgba(15, 159, 143, .26), transparent 62%),
    linear-gradient(135deg, #0e2039 0%, #14335c 58%, #1c4a86 100%);
  box-shadow: var(--shadow-md);
}
.course-hero-copy { position: relative; z-index: 1; min-width: 0; }
.course-hero .eyebrow { color: #8fb7ff; }
.course-hero h1 { margin: 8px 0 10px; color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.course-hero-desc { max-width: 640px; margin: 0; color: #b9c8de; font-size: .94rem; }
.course-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.course-hero-meta span { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .68rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; color: #dbe7f8; background: rgba(255, 255, 255, .07); font-size: .78rem; }
.course-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.course-hero-actions .btn { display: inline-flex; align-items: center; gap: .35rem; }
.course-hero-actions .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--navy); --bs-btn-hover-bg: #eaf1ff; --bs-btn-hover-border-color: #eaf1ff; --bs-btn-hover-color: var(--navy); }
.course-hero-actions .btn-outline-light { border-color: rgba(255, 255, 255, .3); color: #eaf1ff; }
.course-hero-actions .btn-outline-light:hover { border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .12); }
.course-hero-progress { position: relative; z-index: 1; display: grid; gap: 18px; padding: 20px 22px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; background: rgba(255, 255, 255, .06); backdrop-filter: blur(6px); }
.course-stat { display: grid; gap: 6px; }
.course-stat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; color: #d7e3f5; font-size: .82rem; }
.course-stat-head strong { color: #fff; font-size: 1.5rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.course-stat .progress { height: 7px; background: rgba(255, 255, 255, .14); }
.course-stat .progress-bar { background: #7db1ff; }
.course-stat.is-success .progress-bar { background: #4bd0bf; }
.course-stat small { color: #9fb3d1; font-size: .74rem; }
.course-workspace { align-items: start; }
.course-side { position: sticky; top: calc(var(--header-height, 72px) + 16px); display: grid; gap: 16px; }
.course-nav-card, .course-tools-card { padding: 18px; }
.course-panel-label { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.course-panel-label h2, .course-tools-card h2 { margin: 4px 0 0; font-size: 1rem; }
.course-tools-card h2 { margin: 0 0 12px; }
.bank-type-nav { display: grid; gap: 6px; margin-top: 12px; }
.bank-type-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .62rem .72rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.bank-type-item:hover { background: #f5f8fd; border-color: var(--line); }
.bank-type-item.active { color: var(--primary-dark); background: var(--primary-soft); border-color: #c9dbfb; }
.bank-type-name { font-size: .9rem; font-weight: 600; }
.bank-type-meta { margin-left: auto; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.bank-type-item.active .bank-type-meta { color: var(--primary-dark); }
.course-tool { display: flex; gap: .7rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.course-tool + .course-tool { margin-top: 8px; }
.course-tool-icon { width: 34px; height: 34px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.course-tool-icon.is-amber { color: var(--amber); background: var(--amber-soft); }
.course-tool-icon.is-teal { color: var(--teal); background: var(--teal-soft); }
.course-tool-body { flex: 1; min-width: 0; }
.course-tool-body strong { display: block; font-size: .87rem; }
.course-tool-body small { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.course-tool form { display: grid; gap: 6px; margin: 8px 0 0; }
.course-tool .form-select { font-size: .8rem; }
.course-tool .btn { justify-self: start; }
.chapter-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 14px; }
.chapter-panel-head h2 { margin: 2px 0 2px; font-size: 1.25rem; }
.chapter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 14px; padding: .6rem .9rem; border: 1px dashed var(--line); border-radius: 12px; background: rgba(255, 255, 255, .6); }
.chapter-selection { color: var(--primary-dark); font-size: .8rem; font-weight: 600; }
.chapter-selection:empty::before { content: "勾选章节后可批量练习或测试"; color: var(--muted); font-weight: 400; }
.chapter-toolbar form { margin: 0; }
.chapter-toolbar .btn:disabled { background: #e9eef5; border-color: #e9eef5; color: var(--muted); box-shadow: none; }
.chapter-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chapter-toolbar-actions form { margin: 0; }
#chapterTestModal .modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
#chapterTestModal .modal-header, #chapterTestModal .modal-footer { background: #fbfcff; }
#chapterTestModal .modal-header { border-radius: 16px 16px 0 0; }
#chapterTestModal .modal-footer { border-radius: 0 0 16px 16px; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.chapter-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease); }
.chapter-card:hover { border-color: #cfdcf1; box-shadow: var(--shadow-sm); }
.chapter-card.selected { border-color: #9dbcfb; background: #f6faff; box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.chapter-card-head { display: flex; align-items: center; gap: .6rem; width: 100%; }
.chapter-index { width: 34px; height: 34px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); font-size: .76rem; font-weight: 750; letter-spacing: .02em; }
.chapter-card.selected .chapter-index { color: #fff; background: var(--primary); }
.chapter-card-select { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.chapter-card-select .form-check-input { margin: 0; flex: 0 0 auto; }
.chapter-card-title { font-size: .94rem; font-weight: 600; line-height: 1.4; }
.chapter-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chapter-code { margin-left: auto; color: #93a1b5; font-size: .7rem; letter-spacing: .04em; }
.chapter-progress { display: grid; gap: 5px; align-self: stretch; }
.chapter-progress-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .74rem; }
.chapter-progress .progress { height: 6px; background: #eef2f8; }
.chapter-progress .progress-bar { background: linear-gradient(90deg, #4b8bff, #2f6fed); }
.chapter-progress-sub { color: #8b98ab; font-size: .7rem; }
.chapter-card-action { display: flex; align-self: stretch; margin-top: auto; padding-top: 2px; }
.chapter-card-action .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.chapter-card-action form { display: flex; width: 100%; }
.bank-type-panel[hidden] { display: none; }
@media (max-width: 991.98px) {
  .course-side { position: static; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .course-hero { padding: 22px 20px; }
  .course-hero-progress { grid-template-columns: 1fr; }
  .chapter-toolbar { align-items: flex-start; flex-direction: column; }
}
.embedded-session .app-shell { min-height: 0; }
.embedded-session .app-canvas { min-height: 0; }
.embedded-session .app-main { padding: 14px 12px 10px; }
.embedded-session .container-app { max-width: none; }
.embedded-session .page-heading { display: none; }
.embedded-session .flash-stack { margin-bottom: 12px; }
img[data-zoomable] { cursor: zoom-in; }
html.viewer-lock { overflow: hidden; }
.image-viewer { position: fixed; inset: 0; z-index: 1090; display: flex; flex-direction: column; background: rgba(7, 14, 26, .94); backdrop-filter: blur(4px); }
.image-viewer[hidden] { display: none; }
.viewer-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px 10px; color: #dbe7f8; }
.viewer-zoom { margin-right: 6px; color: #b9c8de; font-size: .82rem; font-variant-numeric: tabular-nums; }
.viewer-btn { min-width: 40px; height: 38px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; color: #eaf1ff; background: rgba(255, 255, 255, .08); font-size: 1rem; line-height: 1; }
.viewer-btn:hover { background: rgba(255, 255, 255, .18); }
.viewer-close { margin-left: 10px; font-size: 1.4rem; }
.viewer-stage { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 16px; background: rgba(255, 255, 255, .03); cursor: grab; touch-action: none; }
.viewer-stage.is-dragging { cursor: grabbing; }
.viewer-image { flex: 0 0 auto; max-width: none; max-height: none; transform-origin: center center; user-select: none; -webkit-user-drag: none; will-change: transform; }
.viewer-hint { margin: 0; padding: 12px 18px 16px; color: #8fa4c2; font-size: .76rem; text-align: center; }
@media (max-width: 991.98px) {
  .practice-mode-nav { position: static; }
  .practice-stage { min-height: 0; }
  .practice-stage iframe { height: calc(100vh - 260px); min-height: 560px; }
}
.status-badge { display: inline-flex; align-items: center; gap: .32rem; padding: .28rem .58rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.success { color: #087568; background: var(--teal-soft); }
.status-badge.warning { color: #92560b; background: var(--amber-soft); }
.status-badge.danger { color: #a63443; background: var(--danger-soft); }
.status-badge.info { color: #2457a6; background: var(--primary-soft); }
.status-badge.neutral { color: #64748b; background: #eef2f7; }

.chapter-block { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.chapter-block ul { padding-left: 1.1rem; color: var(--muted); font-size: .86rem; }
.chapter-block li { list-style: none; }
.chapter-block li .btn { padding: 0; }

.question-card { padding: clamp(18px, 2.3vw, 30px); }
.stem-editor { overflow: hidden; border: 1px solid #ced8e6; border-radius: 12px; background: #fff; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.stem-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.stem-editor.is-invalid { border-color: #dc3545; }
.stem-editor .stem-editor-input { border: 0; border-radius: 0; background: transparent; box-shadow: none; resize: none; }
.stem-editor .stem-editor-input:focus { border: 0; box-shadow: none; }
.stem-editor-assets { padding: 4px 12px 12px; border-top: 1px dashed #dbe4f0; }
.stem-editor-asset-row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.stem-editor-asset { margin: 0; max-width: min(320px, 100%); }
.stem-editor-asset img { display: block; max-width: 100%; max-height: 280px; width: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stem-editor-hint { display: flex; align-items: center; gap: .3rem; margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
.field-assets { margin: -.45rem 0 1rem; padding: 12px 14px; border: 1px dashed #cfdcf0; border-radius: 12px; background: #f8fafd; }
.field-assets-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-bottom: 10px; font-size: .82rem; font-weight: 600; }
.field-assets-head .icon { color: var(--primary); }
.field-assets-head .muted { font-weight: 400; }
.field-assets-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field-asset { margin: 0; max-width: min(340px, 100%); }
.field-asset img { display: block; max-width: 100%; max-height: 260px; width: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field-asset figcaption { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.question-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.question-progress { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .84rem; font-weight: 600; }
.question-progress::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.auto-next-toggle { display: inline-flex; align-items: center; gap: .45rem; margin: 0; color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; user-select: none; }
.auto-next-toggle input { appearance: none; -webkit-appearance: none; position: relative; width: 32px; height: 18px; margin: 0; border-radius: 999px; background: #d7e0ec; cursor: pointer; transition: background-color .18s var(--ease); }
.auto-next-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 37, 68, .2); transition: transform .18s var(--ease); }
.auto-next-toggle input:checked { background: var(--primary); }
.auto-next-toggle input:checked::after { transform: translateX(14px); }
.auto-next-toggle input:focus-visible { outline: 3px solid rgba(47, 111, 237, .25); outline-offset: 2px; }
.auto-next-toggle:hover { color: var(--primary); }
.question-content { font-size: 1.04rem; line-height: 1.88; white-space: pre-wrap; overflow-wrap: anywhere; }
.question-content img, .analysis img { max-width: 100%; height: auto; border-radius: 10px; }
.sidebar-card { min-width: 0; }
.sidebar-card > .card { padding: 8px; }
.session-actions { display: grid; gap: 8px; margin-bottom: 10px; padding: 10px; }
.session-heading { align-items: center; }
.session-heading h1 { margin-bottom: .2rem; }
.session-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.my-note-panel { padding: 14px 16px; border: 1px solid #d8e6fb; border-left: 4px solid var(--primary); border-radius: 10px; background: #f7faff; }
.my-note-head { display: flex; align-items: center; gap: .4rem; color: var(--primary-dark); font-size: .82rem; font-weight: 700; }
.my-note-head .icon { color: var(--primary); }
.my-note-content { margin-top: 6px; color: #3d4c64; font-size: .9rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-composer { display: flex; align-items: flex-start; gap: .7rem; }
.comment-composer-body { flex: 1; min-width: 0; }
.comment-composer-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-top: .55rem; }
.comment-composer .comment-avatar, .comment-list .comment-avatar { border-radius: 50%; }
@media (min-width: 992px) {
  .session-viewport { height: 100vh; overflow: hidden; }
  .session-viewport .app-canvas { height: 100vh; min-height: 0; }
  .session-viewport .app-main { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 16px clamp(16px, 2.2vw, 32px) 14px; overflow: hidden; }
  .session-viewport .app-main > .container-app { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-width: 1480px; }
  .session-viewport .app-footer { display: none; }
  .session-viewport .flash-stack { flex: 0 0 auto; }
  .session-viewport .session-heading { flex: 0 0 auto; margin-bottom: 14px; padding-top: 0; padding-bottom: 12px; }
  .session-viewport .session-heading::before { top: 0; bottom: 14px; }
  .session-viewport .session-heading p { font-size: .84rem; }
  .session-viewport .session-workspace { --bs-gutter-y: 0; flex: 1 1 auto; min-height: 0; }
  .session-viewport .session-main-column,
  .session-viewport .session-sidebar-column { height: 100%; min-height: 0; }
  .session-viewport .session-main-scroll { height: 100%; padding-right: 8px; overflow-y: auto; overscroll-behavior: contain; }
  .session-viewport .session-sidebar { height: 100%; padding-right: 4px; overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 768px) {
  .session-sidebar.is-fixed { position: fixed; z-index: 20; }
}
@media (max-width: 767.98px) { .session-sidebar { position: static; } }

#commentsPanel { padding: 20px 22px; }
#commentsPanel > summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none; font-weight: 700; }
#commentsPanel > summary::-webkit-details-marker { display: none; }
#commentsPanel > summary::after { content: "展开"; margin-left: auto; color: var(--muted); font-size: .76rem; font-weight: 600; }
#commentsPanel[open] > summary::after { content: "收起"; }
.comment-form { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.comment-form .form-select, .comment-form .form-control { background: #fff; }
.comment-list { display: grid; gap: 0; margin-top: 8px; }
.comment-item { display: flex; gap: .7rem; padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-avatar { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: #315780; font-size: .8rem; font-weight: 700; }
.comment-body { min-width: 0; flex: 1; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.comment-meta strong { font-size: .86rem; }
.comment-meta time { color: var(--muted); font-size: .72rem; }
.comment-text { margin-top: .2rem; color: #3d4c64; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.comment-delete { margin-top: .15rem; }
.comment-empty { padding: 1.2rem 0; color: var(--muted); font-size: .86rem; text-align: center; }
.comment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem; margin-top: .3rem; }
.comment-actions .btn-link { color: var(--primary); font-size: .78rem; font-weight: 600; text-decoration: none; }
.comment-actions .btn-link:hover { color: var(--primary-dark); }
.comment-actions .btn-link.text-danger { color: var(--danger) !important; }
.comment-actions .icon { margin-right: .2rem; }
.comment-reply { margin-top: .4rem; padding-left: .85rem; border-left: 3px solid #dbe7f8; border-bottom: 0; }
.comment-reply .comment-avatar { width: 26px; height: 26px; border-radius: 8px; font-size: .7rem; }
.comment-reply .comment-text { font-size: .86rem; }
.comment-reply-form { margin-top: .6rem; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.comment-reply-form .form-control { background: #fff; }
.option { cursor: pointer; border: 1px solid #dce4ee; border-radius: 12px; padding: 13px 16px; margin: 10px 0; transition: background-color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease); }
.option:hover { background: #f6f9ff; border-color: #b9cdf8; transform: translateX(2px); }
.option:focus-visible { outline: 3px solid rgba(47, 111, 237, .28); outline-offset: 2px; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px rgba(47, 111, 237, .08); }
.option.correct { border-color: #45b5a7; background: var(--teal-soft); }
.option.wrong { border-color: #e78b97; background: var(--danger-soft); }
.option-label { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: .55rem; border-radius: 8px; color: #52627a; background: #eef2f7; font-size: .8rem; font-weight: 700; }
.option.selected .option-label { color: #fff; background: var(--primary); }
.option.correct .option-label { color: #fff; background: var(--teal); }
.option.wrong .option-label { color: #fff; background: var(--danger); }
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; padding: 2px 4px 2px 2px; }
.number-btn { position: relative; aspect-ratio: 1; border: 1px solid #dce4ee; border-radius: 7px; color: #52627a; background: #fff; font-size: .75rem; font-weight: 600; }
.number-btn:hover { border-color: #9dbcfb; color: var(--primary); }
.number-btn.answered { border-color: #b9cdf8; color: #2457a6; background: #e4edff; }
.number-btn.correct { border-color: #a9dfd5; color: #087568; background: #dff5f0; }
.number-btn.wrong { border-color: #f1c0c7; color: #a63443; background: #ffe6ea; }
.number-btn.current { outline: 3px solid rgba(47, 111, 237, .25); border-color: var(--primary); }
.number-btn small { position: absolute; right: 3px; bottom: 0; font-size: .58rem; }
.analysis { background: #f7f9fc; border-left: 4px solid #7aa7d8; padding: 16px 18px; border-radius: 0 12px 12px 0; white-space: pre-wrap; }
.exam-timer { display: inline-flex; align-items: center; gap: .55rem; padding: .55rem .85rem; border: 1px solid #f3dfb8; border-radius: 12px; color: #92560b; background: var(--amber-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.result-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 28px; }
.result-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.result-kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.result-kpi strong { display: block; font-size: 1.2rem; line-height: 1.25; }
.result-kpi span { color: var(--muted); font-size: .76rem; }
.score-ring { width: 112px; height: 112px; display: grid; place-items: center; flex: 0 0 auto; border: 9px solid #dff5f0; border-radius: 50%; color: var(--teal); background: #fff; }
.score-ring strong { font-size: 1.8rem; line-height: 1; }
.score-ring small { color: var(--muted); font-size: .72rem; }
.review-list { display: grid; gap: 14px; }
.review-item { padding: 20px; }
.review-item-content { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-list { display: grid; gap: 14px; }
.note-item { padding: 20px; }
.note-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; color: var(--muted); font-size: .78rem; }
.note-question { margin-top: 10px; font-weight: 600; line-height: 1.6; }
.note-content { margin: 10px 0 0; padding: 12px 14px; border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; background: #f7faff; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 12px; }
.practice-launcher { margin-bottom: 18px; padding: 20px 22px; border-left: 4px solid var(--primary); }
.launcher-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.launcher-head .icon-lg { flex: 0 0 auto; }
.preview-trigger { flex: 1; min-width: 0; margin: -.25rem; padding: .25rem; border-radius: 10px; cursor: pointer; transition: background-color .16s var(--ease); }
.preview-trigger:hover { background: #f3f7ff; }
.preview-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.preview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fav-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; color: var(--amber); background: var(--amber-soft); }
.empty-state { padding: 54px 24px; text-align: center; }
.empty-state .btn { align-self: center; }
.empty-state .metric-icon { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 18px; }
.empty-state h3 { font-size: 1.05rem; }
.empty-state p { max-width: 460px; margin: .4rem auto 0; color: var(--muted); font-size: .88rem; }

.upload-zone { position: relative; padding: 26px; border: 1px dashed #b9c9e2; border-radius: 16px; background: #f9fbff; text-align: center; transition: .18s ease; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone .metric-icon { width: 52px; height: 52px; margin-bottom: 12px; border-radius: 16px; }
.upload-zone strong { display: block; }
.upload-zone small { color: var(--muted); }
.upload-zone input[type="file"] { margin-top: 14px; }
.info-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.info-list li { display: flex; gap: .65rem; color: #52627a; font-size: .86rem; }
.info-list .icon { margin-top: 2px; color: var(--teal); }
.preview-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.preview-stat { padding: 18px 12px; text-align: center; background: #fff; }
.preview-stat strong { display: block; font-size: 1.55rem; line-height: 1.2; }
.preview-stat span { color: var(--muted); font-size: .76rem; }

.asset-list { display: grid; gap: 14px; }
.asset-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.asset-preview { width: 132px; height: 112px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; color: #7b8aa1; background: #f1f5fa; }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview .icon { width: 34px; height: 34px; }
.asset-body { min-width: 0; }
.asset-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.asset-url { margin: .25rem 0 .55rem; overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.asset-reason { margin: .55rem 0; padding: .6rem .75rem; border-radius: 9px; color: #92560b; background: var(--amber-soft); font-size: .82rem; }
.asset-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.asset-actions form { margin: 0; }
.asset-details { margin-top: .75rem; color: var(--muted); font-size: .76rem; }
.asset-details summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.crop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .75rem; }

#pageModal .modal-content {
  max-height: calc(100vh - 3.5rem);
  max-height: calc(100dvh - 3.5rem);
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
#pageModal .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 3.5rem);
  max-height: calc(100dvh - 3.5rem);
}
#pageModal .modal-header {
  flex: 0 0 auto;
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 18px 18px 0 0;
}
#pageModal .modal-title { font-size: 1.08rem; }
#pageModal .modal-footer {
  flex: 0 0 auto;
  padding: .95rem 1.35rem;
  border-top: 1px solid var(--line);
  background: #fbfcff;
  border-radius: 0 0 18px 18px;
}
#pageModal .modal-body {
  min-height: 0;
  padding: 1.3rem 1.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#pageModal .modal-body > .card { box-shadow: none; }

.pagination { gap: .3rem; }
.page-link { border: 1px solid var(--line); border-radius: 9px !important; color: #52627a; padding: .45rem .7rem; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-item.disabled .page-link { color: #a0adbf; background: #f8fafd; }
.badge { border-radius: 7px; font-weight: 600; }

.error-state { max-width: 620px; margin: 50px auto; padding: 54px 32px; text-align: center; }
.error-code { color: var(--primary); font-size: 4.5rem; font-weight: 800; line-height: 1; letter-spacing: -.06em; }
.error-state h1 { margin: 16px 0 8px; font-size: 1.5rem; }
.error-state p { color: var(--muted); }

/* ===== 公开页面 ===== */
.public-header .topbar { min-height: 68px; }
.public-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.public-brand .brand-copy strong { color: var(--ink); font-size: .98rem; }
.public-brand .brand-copy small { color: var(--muted); }
.public-nav { display: flex; align-items: center; gap: 4px; margin-right: 8px; }
.public-nav a { padding: .45rem .8rem; border-radius: 9px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.public-nav a:hover { color: var(--primary-dark); background: var(--primary-soft); }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(620px 360px at 90% -18%, rgba(77, 137, 255, .5), transparent 64%),
    radial-gradient(420px 320px at -4% 112%, rgba(15, 159, 143, .26), transparent 62%),
    linear-gradient(135deg, #0c1d34 0%, #14335c 56%, #1b4680 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after { content: ""; position: absolute; right: -130px; top: -150px; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 0 0 60px rgba(255, 255, 255, .03), 0 0 0 124px rgba(255, 255, 255, .02); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; min-width: 0; }
.hero .eyebrow { color: #8fb7ff; }
.hero h1 { max-width: 640px; margin: 10px 0 16px; color: #fff; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.14; letter-spacing: -.03em; }
.hero p { max-width: 540px; margin: 0 0 26px; color: #b9c8de; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-actions .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--navy); --bs-btn-hover-bg: #eaf1ff; --bs-btn-hover-border-color: #eaf1ff; --bs-btn-hover-color: var(--navy); }
.hero-actions .btn-outline-light { border-color: rgba(255, 255, 255, .3); color: #eaf1ff; }
.hero-actions .btn-outline-light:hover { border-color: rgba(255, 255, 255, .45); color: #fff; background: rgba(255, 255, 255, .12); }
.hero-panel { position: relative; z-index: 1; padding: 22px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 20px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); }
.hero-panel-title { display: flex; align-items: center; gap: .5rem; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #dbe7f8; font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.hero-step { display: flex; gap: .8rem; padding: 12px 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); }
.hero-step:last-child { border-bottom: 0; padding-bottom: 2px; }
.hero-step-number { flex: 0 0 auto; color: #8fb7ff; font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.hero-step strong { display: block; color: #fff; font-size: .9rem; }
.hero-step small { color: #9fb3d1; font-size: .76rem; }

.landing-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.landing-stat { padding: 18px 20px; }
.landing-stat strong { display: block; font-size: 1.15rem; }
.landing-stat span { color: var(--muted); font-size: .8rem; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature-card { padding: 22px; }
.feature-card h3 { margin: 14px 0 6px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: .86rem; }
.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.landing-step { padding: 24px; }
.landing-step-index { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); font-size: .8rem; font-weight: 750; }
.landing-step h3 { margin: 0 0 6px; font-size: 1rem; }
.landing-step p { margin: 0; color: var(--muted); font-size: .86rem; }
.landing-cta { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: clamp(24px, 3vw, 36px); border-radius: 22px; color: #fff; background: radial-gradient(420px 240px at 92% -30%, rgba(77, 137, 255, .42), transparent 66%), linear-gradient(120deg, #0e2039, #1b4680); }
.landing-cta h2 { margin: 0 0 4px; color: #fff; font-size: 1.3rem; }
.landing-cta p { margin: 0; color: #b9c8de; font-size: .9rem; }

/* 登录 */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); max-width: 1080px; margin: clamp(20px, 4vw, 52px) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow-lg); }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 4vw, 52px); color: #fff; background: radial-gradient(460px 300px at 88% -14%, rgba(77, 137, 255, .46), transparent 64%), linear-gradient(150deg, #0c1d34, #163a68 62%, #1c4a86); }
.auth-aside::after { content: ""; position: absolute; right: -110px; bottom: -130px; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 0 0 50px rgba(255, 255, 255, .03); pointer-events: none; }
.auth-brand { display: inline-flex; align-items: center; gap: .7rem; margin-bottom: 34px; text-decoration: none; }
.auth-aside h1 { position: relative; z-index: 1; margin: 0 0 14px; color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.35rem); }
.auth-aside p { position: relative; z-index: 1; max-width: 380px; margin: 0; color: #b9c8de; font-size: .92rem; }
.auth-points { position: relative; z-index: 1; display: grid; gap: 10px; }
.auth-point { display: flex; align-items: center; gap: .55rem; color: #dbe7f8; font-size: .85rem; }
.auth-point .icon { color: #6fd8c9; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(30px, 4.2vw, 56px); }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { margin-bottom: .3rem; font-size: 1.6rem; }
.auth-form > p { margin-bottom: 22px; color: var(--muted); font-size: .9rem; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 7px; width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; transform: translateY(-50%); }
.password-toggle:hover { color: var(--primary); background: var(--primary-soft); }

@media (max-width: 1199.98px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform .26s var(--ease);
    box-shadow: 28px 0 60px -30px rgba(4, 12, 26, .6);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  body.sidebar-open { overflow: hidden; }
  .topbar-toggle { display: inline-grid; }
  .topbar-mobile-brand { display: inline-flex; }
  .topbar-context { display: none; }
  .topbar-search { flex: 0 1 300px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-panel { max-width: 620px; }
}
@media (max-width: 991.98px) {
  html { scroll-padding-top: calc(var(--header-height, 64px) + 24px); }
  .practice-stage { scroll-margin-top: calc(var(--header-height, 64px) + 24px); }
  .topbar-search { display: none; }
  .topbar-icon-link { display: grid; }
  .topbar { gap: 10px; }
  .app-header .user-trigger { padding: .3rem; }
  .app-header .user-meta { display: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { min-height: 310px; padding: 34px; }
  .auth-aside h1 { font-size: 1.9rem; }
  .auth-points { display: none; }
  .preview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .app-main { padding: 20px 14px 40px; }
  .app-footer { padding-inline: 14px; }
  .page-heading { flex-direction: column; align-items: stretch; }
  .page-heading > .btn, .page-heading > .d-flex, .page-heading > .status-badge { align-self: flex-start; }
  .page-heading > .d-flex .btn { flex: 1 1 auto; }
  .form-actions { position: static; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .metrics-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 1.65rem; }
  .metric-icon { width: 34px; height: 34px; border-radius: 10px; }
  .course-grid, .feature-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 30px 24px; border-radius: 20px; }
  .hero h1 { font-size: 2.15rem; }
  .auth-layout { border-radius: 18px; }
  .auth-aside { min-height: 250px; padding: 28px; }
  .auth-main { padding: 28px 22px; }
  .asset-card { grid-template-columns: 1fr; }
  .asset-preview { width: 100%; height: 180px; }
  .asset-heading { flex-direction: column; }
  .result-hero { align-items: flex-start; flex-direction: column; }
  .crop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-footer .container-app { flex-direction: column; gap: .25rem; }
  .table-responsive { border-radius: var(--radius); }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tbody tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack tbody td { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .32rem 0 !important; border: 0; text-align: right; }
  .table-stack tbody td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-align: left; }
  .table-stack tbody td[data-label=""]::before { content: none; }
  .table-stack tbody td.table-actions { justify-content: flex-end; flex-wrap: wrap; gap: .4rem; padding-top: .55rem !important; }
  .table-stack tbody tr:hover > * { background: transparent; }
  .table-stack .table-title { justify-content: flex-start; flex-wrap: wrap; width: 100%; text-align: left; }
  .table-stack tbody td:has(> strong:only-child),
  .table-stack tbody td:has(> .table-title) { flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; }
  .table-stack tbody td:has(> strong:only-child)::before,
  .table-stack tbody td:has(> .table-title)::before { font-size: .7rem; }
  .table-stack .btn-link { text-align: right; white-space: normal; }
  .result-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-hero { padding: 24px 20px; border-radius: 20px; }
  .dashboard-hero::after { display: none; }
  .dashboard-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-hero-actions .btn { flex: 1 1 auto; }
  .page-toolbar { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented .btn { flex: 1 1 auto; text-align: center; }
  .user-meta { display: none; }
  .app-header-focus .brand-copy, .focus-title { display: none; }
  .public-nav { display: none; }
  .landing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-steps { grid-template-columns: 1fr; }
  .landing-cta { align-items: flex-start; flex-direction: column; }
  .hero-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 575.98px) {
  #pageModal .modal-content,
  #pageModal .modal-content > form {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  #pageModal .modal-dialog { margin: .5rem; }
  #pageModal .modal-header, #pageModal .modal-footer { padding-inline: 1rem; }
  #pageModal .modal-body { padding: 1rem; }
  .practice-stage iframe { min-height: 520px; height: calc(100dvh - 230px); }
  .result-kpis { grid-template-columns: 1fr; }
  .landing-stats { grid-template-columns: 1fr; }
  .question-topline .btn { flex: 1 1 auto; }
  #commentsPanel { padding: 18px 16px; }
  .comment-form { padding: 12px; }
  .dashboard-hero-stats { grid-template-columns: 1fr; }
  .quick-tool-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
