:root {
  --font-hei: "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", "思源黑体 SC", "思源黑体 CN", "思源黑体";
  --font-song: "Source Han Serif SC", "Source Han Serif CN", "Source Han Serif", "思源宋体 SC", "思源宋体 CN", "思源宋体";
  --font-mono: "Source Han Mono SC", "Source Han Mono CN", "Source Han Mono", "思源等宽 SC", "思源等宽 CN", "思源等宽";
  --blue: #4a90ff;
  --blue-deep: #337dff;
  --blue-soft: #eef5ff;
  --purple: #4a90ff;
  --orange: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --bg: #f5f7fa;
  --dark: #1f2937;
  --dark-2: #4b5563;
  --text: #1f2937;
  --muted: #4b5563;
  --soft: #9ca3af;
  --line: #eaecef;
  --card: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.04);
  --radius: 16px;
}

/* White-gray sky-blue commercial theme */
:root:not([data-theme="dark"]) body {
  background: #f5f7fa;
}

:root:not([data-theme="dark"]) .stat-card,
:root:not([data-theme="dark"]) .panel,
:root:not([data-theme="dark"]) .question-card,
:root:not([data-theme="dark"]) .feature-card,
:root:not([data-theme="dark"]) .mobile-hero,
:root:not([data-theme="dark"]) .law-exam-shell,
:root:not([data-theme="dark"]) .law-answer-sheet,
:root:not([data-theme="dark"]) .law-question-panel,
:root:not([data-theme="dark"]) .practice-list-row {
  border-color: #eaecef;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

:root:not([data-theme="dark"]) .btn,
:root:not([data-theme="dark"]) .law-primary-btn,
:root:not([data-theme="dark"]) .law-side-submit,
:root:not([data-theme="dark"]) .side-nav a.active,
:root:not([data-theme="dark"]) .side-bottom a.active {
  background: #4a90ff;
}

:root:not([data-theme="dark"]) .side-nav a.active,
:root:not([data-theme="dark"]) .side-bottom a.active {
  color: #ffffff;
}

:root:not([data-theme="dark"]) .btn.secondary,
:root:not([data-theme="dark"]) .law-plain-btn,
:root:not([data-theme="dark"]) .law-light-btn {
  border-color: #eaecef;
  color: #4b5563;
  background: #ffffff;
}

:root:not([data-theme="dark"]) input,
:root:not([data-theme="dark"]) select,
:root:not([data-theme="dark"]) textarea {
  border-color: #eaecef;
  border-radius: 10px;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --text: #e5edf8;
  --muted: #94a3b8;
  --soft: #738198;
  --line: #263449;
  --card: #111827;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 18px 46px rgba(49, 91, 255, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-hei);
}

html,
body {
  overflow-x: hidden;
}

button,
input,
select,
textarea,
code,
pre,
kbd,
samp {
  font-family: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea,
code,
pre,
kbd,
samp,
.field input,
.field select,
.field textarea,
.stat-card strong,
.mobile-hero strong,
.mobile-kpis strong,
.donut,
.mastery-line,
.recent-meta,
.tag {
  font-family: var(--font-mono);
}

button,
.btn,
.side-nav a,
.side-bottom a,
.bottom-nav a,
.quick-action,
.tabs span,
.field label,
.brand,
.brand-mini,
.page-head h1,
.panel-head h2,
.panel-head h3,
.feature-card h3,
.recent-row h4,
.list-item h4,
.advice-row h4 {
  font-family: var(--font-hei);
}

.page-head p,
.feature-card p,
.advice-row p,
.question-title,
.analysis,
.empty,
.loading,
.error {
  font-family: var(--font-song);
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.42);
  transition: grid-template-columns 0.18s ease;
}

body.side-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

:root[data-theme="dark"] .app-shell {
  background: rgba(15, 23, 42, 0.9);
}

.sidebar {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 34px 18px 24px;
  color: var(--text);
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: none;
  overflow: visible;
  transition: padding 0.18s ease, border-color 0.18s ease;
}

.side-toggle {
  position: absolute;
  top: 50%;
  right: -20px;
  z-index: 12;
  width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--blue);
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  transition: color 0.18s ease, transform 0.18s ease;
}

.side-toggle:hover:not(:disabled) {
  color: #315bff;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%) scale(1.08);
}

body.side-collapsed .sidebar {
  padding-right: 0;
  padding-left: 0;
  border-color: transparent;
}

body.side-collapsed .brand,
body.side-collapsed .side-nav,
body.side-collapsed .side-bottom {
  opacity: 0;
  pointer-events: none;
}

body.side-collapsed .side-toggle {
  right: -40px;
  opacity: 1;
  pointer-events: auto;
}

.brand,
.brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  height: 58px;
  margin: 0 10px 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: #fff;
  color: var(--blue);
  font-weight: 900;
  box-shadow: none;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 13px;
}

.side-nav,
.side-bottom {
  display: grid;
  gap: 8px;
}

.side-nav a,
.side-bottom a {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 18px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.bottom-nav a::before {
  content: attr(data-icon);
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: currentColor;
  font-size: 13px;
  font-weight: 900;
}

.bottom-nav-icon {
  display: inline-grid;
  place-items: center;
}

.bottom-nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-icon .book-page {
  fill: currentColor;
  stroke: currentColor;
}

.bottom-nav-icon .book-crease {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
}

.bottom-nav-icon .dot {
  stroke-width: 5.2;
}

.side-nav a.active,
.side-bottom a.active {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: none;
}

.side-bottom {
  margin-top: auto;
}

.night-toggle {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #ffffff;
}

.night-toggle i {
  width: 44px;
  height: 24px;
  position: relative;
  border-radius: 999px;
  background: #e5e7eb;
}

.night-toggle i::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  right: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--blue);
}

:root[data-theme="dark"] .night-toggle {
  color: #fff;
  background: rgba(49, 91, 255, 0.24);
}

:root[data-theme="dark"] .night-toggle i {
  background: rgba(49, 91, 255, 0.38);
}

:root[data-theme="dark"] .night-toggle i::after {
  right: 23px;
  background: #fff;
}

.main {
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
  border-radius: 0;
}

:root[data-theme="dark"] .main {
  background: #0f172a;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  backdrop-filter: none;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .mobile-top,
:root[data-theme="dark"] .bottom-nav {
  background: #111827;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .option {
  border-color: var(--line);
  background: #0b1220;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-theme-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: #eef3ff;
  font-size: 12px;
  font-weight: 900;
}

:root[data-theme="dark"] .mobile-theme-toggle {
  color: #e5edf8;
  background: rgba(49, 91, 255, 0.18);
}

.icon-btn {
  width: 42px;
  height: 42px;
  position: relative;
  border: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue);
  background: #fff;
  box-shadow: none;
  font-size: 0;
}

.icon-btn::before {
  content: "!";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin: auto;
  border: 2px solid currentColor;
  border-radius: 9px 9px 10px 10px;
  font-size: 13px;
  line-height: 1;
}

.bell-dot::after {
  content: "8";
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  position: absolute;
  right: 4px;
  top: 2px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.user-pill {
  display: grid;
  grid-template-columns: 42px auto 16px;
  align-items: center;
  gap: 12px;
}

.admin-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #d8e8ff;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

:root[data-theme="dark"] .admin-link,
:root[data-theme="dark"] .tag,
:root[data-theme="dark"] .tabs span.active {
  background: rgba(49, 91, 255, 0.16);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(#fff 0 0) center 9px / 16px 16px no-repeat,
    linear-gradient(#dbeafe 0 0) center 28px / 28px 16px no-repeat,
    var(--blue);
  color: #fff;
  font-size: 0;
  box-shadow: none;
}

.user-pill strong,
.user-pill small {
  display: block;
}

.user-pill strong {
  font-size: 15px;
}

.user-pill small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.page {
  padding: 18px 36px 34px;
}

.page:has(.course-learning-embed) {
  min-height: 100%;
  padding: 0;
}

.course-learning-embed {
  height: calc(100vh - 24px);
  min-height: 640px;
  background: #f6f8fc;
}

.course-learning-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.site-footer {
  min-height: 0;
  padding: 0 36px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-footer:empty {
  display: none;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-head p {
  margin: 6px 0 0;
  color: #44546b;
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

.cards-4 {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.cards-2 {
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
}

.home-dashboard {
  display: grid;
  gap: 22px;
}

.hero-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) 235px;
  gap: 18px;
}

.stat-card,
.panel,
.question-card,
.mobile-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .question-card {
  background: var(--card);
}

.stat-card {
  min-height: 144px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.stat-card small,
.muted {
  color: var(--muted);
}

.stat-card small {
  font-size: 15px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 31px;
  line-height: 1;
}

:root[data-theme="dark"] .stat-card strong,
:root[data-theme="dark"] .donut {
  color: var(--text);
}

.stat-card strong em {
  margin-left: 4px;
  font-size: 14px;
  font-style: normal;
}

.stat-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.up {
  color: #16a34a;
}

.down {
  color: #ef4444;
}

.stat-icon,
.feature-visual,
.quick-icon {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: none;
}

.bg-blue {
  background: var(--blue);
}

.bg-green {
  background: var(--green);
}

.bg-orange {
  background: var(--orange);
}

.bg-purple {
  background: var(--blue);
}

.bg-red {
  background: var(--red);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 22px;
}

.feature-card {
  min-height: 172px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  box-shadow: var(--shadow);
  background: #ffffff;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.feature-card p {
  margin: 0 0 26px;
  color: #40516a;
  line-height: 1.5;
}

.feature-card.blue {
  background: #ffffff;
}

:root[data-theme="dark"] .feature-card.blue,
:root[data-theme="dark"] .feature-card.green,
:root[data-theme="dark"] .feature-card.orange,
:root[data-theme="dark"] .feature-card.purple {
  background: #111827;
}

:root[data-theme="dark"] .feature-card p {
  color: var(--muted);
}

.feature-card.green {
  background: #ffffff;
}

.feature-card.orange {
  background: #ffffff;
}

.feature-card.purple {
  background: #ffffff;
}

.feature-card.blue h3 {
  color: var(--blue);
}

.feature-card.green h3 {
  color: #0aa36f;
}

.feature-card.orange h3 {
  color: #f08300;
}

.feature-card.purple h3 {
  color: var(--purple);
}

.feature-visual {
  width: 82px;
  height: 82px;
  position: absolute;
  right: 18px;
  bottom: 14px;
  border-radius: 24px;
  font-size: 30px;
  transform: rotate(-8deg);
  box-shadow: none;
}

.feature-card.green .feature-visual {
  transform: rotate(8deg);
}

.feature-card.orange .feature-visual {
  border-radius: 50%;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

:root[data-theme="dark"] .btn.secondary {
  border-color: var(--line);
  background: #0b1220;
  color: var(--text);
}

.btn.green {
  background: var(--green);
}

.btn.orange {
  background: var(--orange);
}

.btn.danger {
  background: #ef4444;
}

.panel {
  padding: 22px 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.tabs {
  display: flex;
  gap: 10px;
}

.tabs span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.tabs span.active {
  color: var(--blue);
  background: #eef3ff;
}

.list {
  display: grid;
  gap: 12px;
}

.recent-list {
  display: grid;
  gap: 15px;
}

.recent-row,
.list-item,
.advice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
}

.recent-row:last-child,
.list-item:last-child,
.advice-row:last-child {
  border-bottom: 0;
}

.recent-row h4,
.list-item h4,
.advice-row h4 {
  margin: 0 0 5px;
  font-size: 15px;
}

.knowledge-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.knowledge-overview-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.knowledge-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.knowledge-chip-list span {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.knowledge-chip-list .empty-chip {
  color: var(--muted);
  background: #f8fafc;
}

.paper-preview-list {
  display: grid;
  gap: 14px;
}

.past-paper-list {
  display: grid;
  gap: 12px;
}

.past-paper-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  text-align: left;
  cursor: pointer;
}

.past-paper-row strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.past-paper-row span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.past-paper-row .past-paper-preview-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #4a90ff 0%, #2563eb 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
  font-family: var(--font-hei);
  font-size: 13px;
  font-weight: 900;
}

.past-paper-row:hover .past-paper-preview-badge {
  background: linear-gradient(135deg, #337dff 0%, #1d4ed8 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.mobile-paper-preview-nav {
  display: none;
}

.exam-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.paper-list-grid {
  gap: 12px;
}

.paper-list-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.paper-row-main {
  min-width: 0;
}

.paper-row-main h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
}

.paper-row-meta,
.paper-row-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.paper-row-desc {
  margin-top: 5px;
}

.paper-row-tools,
.paper-row-start {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paper-preview-item h3 {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.8;
}

.preview-options {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.preview-options p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.preview-options p.correct {
  color: #0f766e;
  background: #ecfdf5;
}

.answer-block {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.answer-block strong {
  color: var(--text);
  font-size: 14px;
}

.answer-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.ai-question-item {
  align-items: flex-start;
}

.review-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.review-summary-card {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.review-summary-card span,
.review-summary-card small {
  color: var(--muted);
  font-weight: 800;
}

.review-summary-card strong {
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
}

.review-panel {
  padding-bottom: 10px;
}

.wrong-book-panel {
  padding: 18px;
}

.review-list,
.ai-question-list {
  display: grid;
  gap: 12px;
}

.wrong-answer-list {
  display: grid;
  gap: 12px;
}

.wrong-answer-card {
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.wrong-question-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wrong-question-number {
  color: var(--text);
}

.wrong-subject,
.wrong-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

.wrong-count {
  color: #b45309;
  background: #fff7ed;
}

.wrong-answer-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wrong-options {
  display: grid;
  gap: 8px;
}

.wrong-option {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.wrong-option.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.wrong-option.correct {
  border-color: var(--green);
  background: #e8fff7;
}

.wrong-option.wrong {
  border-color: #ef4444;
  background: #fff1f2;
}

.wrong-option-key {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: #f1f5f9;
  font-weight: 900;
}

.wrong-option.active .wrong-option-key,
.wrong-option.correct .wrong-option-key {
  color: #fff;
  background: var(--blue);
}

.wrong-option.correct .wrong-option-key {
  background: var(--green);
}

.wrong-option.wrong .wrong-option-key {
  color: #fff;
  background: #ef4444;
}

.wrong-option-text {
  min-width: 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.wrong-submit {
  justify-self: start;
  min-height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.wrong-submit:disabled {
  color: #94a3b8;
  background: #e2e8f0;
  cursor: not-allowed;
}

.wrong-result {
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff7ed;
  line-height: 1.6;
}

.review-item-card,
.ai-question-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.review-index,
.ai-question-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--font-mono);
  font-weight: 900;
}

.review-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-title h3,
.ai-question-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
}

.review-count {
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #b45309;
  background: #fff7ed;
  font-size: 12px;
  font-weight: 900;
}

.review-meta,
.ai-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.review-meta span,
.ai-question-meta span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #edf1f6;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ai-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  margin-bottom: 16px;
}

.ai-config-panel {
  min-height: 210px;
}

.ai-config-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.ai-knowledge-field {
  grid-column: span 2;
}

.ai-generate-btn {
  min-height: 44px;
  background: var(--blue);
}

.ai-side-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border: 1px solid #d8e8ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: var(--shadow);
}

.ai-side-card strong {
  color: var(--text);
  font-size: 18px;
}

.ai-side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ai-side-card div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.ai-side-card div span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
}

.ai-result-panel {
  min-height: 260px;
}

.ai-question-card {
  grid-template-columns: 46px minmax(0, 1fr) 70px;
}

.ai-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-options span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  line-height: 1.6;
}

.ai-answer-box {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #fff;
}

.ai-answer-box strong {
  color: var(--text);
  font-size: 13px;
}

.ai-answer-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

:root[data-theme="dark"] .review-summary-card,
:root[data-theme="dark"] .review-item-card,
:root[data-theme="dark"] .wrong-answer-card,
:root[data-theme="dark"] .wrong-option,
:root[data-theme="dark"] .ai-question-card,
:root[data-theme="dark"] .ai-options span,
:root[data-theme="dark"] .ai-answer-box,
:root[data-theme="dark"] .review-meta span,
:root[data-theme="dark"] .ai-question-meta span,
:root[data-theme="dark"] .ai-side-card {
  border-color: var(--line);
  background: var(--card);
}

:root[data-theme="dark"] .wrong-subject {
  background: #1f2937;
}

:root[data-theme="dark"] .wrong-option-key {
  background: #263449;
}

.recent-meta {
  display: grid;
  grid-template-columns: 74px 1fr 54px 78px;
  align-items: center;
  gap: 16px;
  color: #55647d;
  font-size: 14px;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf5;
}

:root[data-theme="dark"] .progress,
:root[data-theme="dark"] .letter,
:root[data-theme="dark"] .analysis,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .loading {
  background: #0b1220;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.tag.green {
  background: #ecfdf5;
  color: var(--green);
}

.tag.orange {
  background: #fffbeb;
  color: var(--orange);
}

.tag.red {
  background: #fee2e2;
  color: var(--red);
}

.mastery-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.donut {
  width: 154px;
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 53%, transparent 54%),
    conic-gradient(var(--blue) 0 76%, #e8edf6 76% 100%);
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
}

.donut span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mastery-bars {
  display: grid;
  gap: 16px;
}

.mastery-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.advice-list {
  display: grid;
  gap: 2px;
}

.advice-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.advice-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.advice-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chart {
  width: 100%;
  height: 255px;
}

.mobile-hero,
.mobile-kpis,
.mobile-quick-grid {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.practice-tools {
  margin-bottom: 12px;
}

.custom-practice-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
}

.custom-practice-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--orange);
  font-weight: 900;
  cursor: pointer;
}

.custom-practice-toggle em {
  font-size: 12px;
  font-style: normal;
  opacity: 0.88;
}

.custom-practice-panel.expanded {
  display: grid;
  gap: 14px;
}

.custom-practice-form {
  grid-template-columns: minmax(118px, 0.72fr) minmax(170px, 1fr) minmax(132px, 0.72fr) minmax(150px, 0.82fr) minmax(150px, 0.82fr) auto;
  align-items: center;
  gap: 12px;
}

.custom-practice-form[hidden] {
  display: none;
}

.custom-practice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  white-space: nowrap;
}

.custom-practice-title h2 {
  margin: 0;
  font-size: 18px;
}

.custom-practice-form .field {
  min-width: 0;
}

.custom-practice-form .field label {
  white-space: nowrap;
}

.custom-practice-form .field select {
  width: 100%;
  min-width: 0;
}

.custom-practice-extra,
.mini-custom-options {
  display: contents;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-custom-options {
  display: grid;
  align-items: stretch;
  gap: 10px;
}

.custom-practice-choice-group {
  min-width: 0;
}

.custom-practice-choice-group select {
  width: 100%;
  min-width: 0;
}

.mini-custom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px 12px;
  background: rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

.mini-custom-sheet {
  width: calc(100vw - 24px);
  max-width: 520px;
  max-height: min(86vh, 640px);
  position: relative;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18);
  animation: miniSheetIn 0.18s ease-out;
}

.mini-custom-title {
  display: grid;
  gap: 4px;
  padding-right: 32px;
}

.mini-custom-title strong {
  color: var(--text);
  font-size: 18px;
}

.mini-custom-title span {
  color: var(--muted);
  font-size: 12px;
}

.mini-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 10px;
}

.mini-custom-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-custom-row select,
.mini-custom-save {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.mini-custom-row select {
  padding: 0 20px 0 8px;
  border: 1px solid #e7e9ee;
  color: #333;
  background: #f7f8fa;
}

.mini-custom-save {
  border: 0;
  color: #fff;
  background: #1677ff;
  letter-spacing: 0;
}

.mini-custom-actions {
  display: grid;
  gap: 8px;
}

.mini-custom-save:hover {
  background: #4096ff;
}

.mini-custom-close {
  width: 44px;
  height: 44px;
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #666;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.toast-message {
  position: fixed;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  z-index: 1400;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  font-size: 14px;
  font-weight: 800;
}

@keyframes miniSheetIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.practice-tools input {
  width: min(420px, 100%);
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  color: #1a1a1a;
  background: #fff;
  outline: 0;
}

.practice-subject-grid {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 14px;
  background: #fff;
}

.practice-list-row {
  --row-color: #8aa4a1;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.practice-list-row:last-child {
  border-bottom: 0;
}

.practice-list-row:hover {
  position: relative;
  z-index: 1;
  transform: translateY(-1px);
  background: #fbfcff;
}

.practice-list-row.hidden {
  display: none;
}

.practice-subject-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.practice-subject-main em {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--row-color);
  background: color-mix(in srgb, var(--row-color) 13%, #fff);
  font-family: var(--font-mono);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.practice-subject-main strong {
  min-width: 0;
  overflow: hidden;
  color: #1a1a1a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 900;
}

.practice-row-progress {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.practice-stars {
  display: flex;
  gap: 3px;
  color: #dcdfe6;
  font-size: 16px;
  line-height: 1;
}

.practice-stars span.active {
  color: #ffc107;
}

.practice-row-progress small {
  color: #86909c;
  font-size: 13px;
  font-weight: 800;
}

.practice-number {
  color: #333333;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
}

.practice-continue {
  color: #ff7d39;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.practice-row-arrow {
  color: #c0c4cc;
  font-size: 28px;
  line-height: 1;
}

.practice-list-row.theme-blue {
  --row-color: #315bff;
}

.practice-list-row.theme-purple {
  --row-color: #6c4dff;
}

.practice-list-row.theme-orange {
  --row-color: #ff7d39;
}

.practice-list-row.theme-moss {
  --row-color: #8aa4a1;
}

.practice-list-row.theme-mist {
  --row-color: #8da9c4;
}

.practice-list-row.theme-clay {
  --row-color: #c79a83;
}

.practice-list-row.theme-iris {
  --row-color: #9b93c9;
}

.practice-list-row.theme-sage {
  --row-color: #9caf88;
}

.practice-list-row.theme-rose {
  --row-color: #c88f9c;
}

.practice-list-row.theme-steel {
  --row-color: #8291a3;
}

.practice-list-row.theme-sand {
  --row-color: #c7aa78;
}

:root[data-theme="dark"] .practice-tools input,
:root[data-theme="dark"] .practice-subject-grid,
:root[data-theme="dark"] .practice-list-row {
  border-color: var(--line);
  color: var(--text);
  background: var(--card);
}

:root[data-theme="dark"] .practice-list-row:hover {
  background: #151f2f;
}

:root[data-theme="dark"] .practice-subject-main strong {
  color: var(--text);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: 0;
}

.field textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

.profile-panel + .profile-panel {
  margin-top: 18px;
}

.score-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-summary strong {
  color: var(--text);
  font-size: 15px;
}

.attempt-modal.wide {
  width: min(860px, 100%);
}

.attempt-list,
.knowledge-stat-list {
  display: grid;
  gap: 10px;
  padding: 18px 22px 22px;
}

.attempt-row,
.knowledge-stat-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.attempt-row em,
.knowledge-stat-row em,
.attempt-row small,
.knowledge-stat-row small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.confirm-modal {
  overflow: hidden;
}

.confirm-modal .modal-head {
  border-bottom: 0;
  padding-bottom: 8px;
}

.confirm-modal .modal-head p {
  margin: 0;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 22px;
}

.confirm-actions .btn {
  min-width: 108px;
}

.icon-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.password-modal .password-form {
  padding: 22px;
}

.password-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.success-text,
.error-text {
  font-size: 13px;
  font-weight: 800;
}

.success-text {
  color: #16a34a;
}

.error-text {
  color: #dc2626;
}

.settings-modal {
  width: min(620px, 100%);
}

.settings-modal-body {
  display: grid;
  gap: 18px;
  padding: 20px 22px 22px;
}

.settings-modal-section {
  display: grid;
  gap: 12px;
}

.settings-modal-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.mobile-ai-page,
.profile-page {
  display: grid;
  gap: 14px;
}

.mobile-ai-page {
  min-height: calc(100vh - 170px);
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
}

.mobile-ai-header,
.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-ai-header h2,
.profile-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.mobile-ai-header p,
.profile-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mobile-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: auto;
}

.mobile-ai-message {
  max-width: min(82%, 680px);
  align-self: flex-start;
}

.mobile-ai-message div {
  padding: 11px 13px;
  border-radius: 14px 14px 14px 4px;
  color: var(--text);
  background: #f1f5f9;
  line-height: 1.75;
  white-space: pre-wrap;
}

.mobile-ai-message.user {
  align-self: flex-end;
}

.mobile-ai-message.user div {
  border-radius: 14px 14px 4px 14px;
  color: #fff;
  background: var(--blue);
}

.mobile-ai-message.error div {
  color: #dc2626;
  background: #fff1f2;
}

.mobile-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.mobile-ai-form textarea {
  min-height: 48px;
  max-height: 130px;
  padding: 11px 12px;
  border: 1px solid #d8e1ee;
  border-radius: 12px;
  resize: vertical;
  outline: none;
  font: inherit;
}

.profile-card {
  justify-content: flex-start;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #fff;
  background: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.profile-panel {
  box-shadow: var(--shadow);
}

.ai-quota-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-quota-card > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe7f6;
  border-radius: 12px;
  background: #f8fbff;
}

.ai-quota-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ai-quota-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.ai-quota-card strong.danger {
  color: #dc2626;
}

.theme-choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.theme-choice {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.theme-choice.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 50%;
}

.theme-light {
  background: #4a90ff;
}

.theme-dark {
  background: #0f172a;
}

.full-width {
  width: 100%;
}

.learning-data-panel {
  overflow: hidden;
}

.learning-data-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.22fr) minmax(280px, 0.82fr);
  gap: 16px;
  padding: 0 22px 22px;
}

.learning-progress-card,
.learning-record-card,
.learning-progress-metrics {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.learning-progress-card {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.78), rgba(255, 255, 255, 0.92)),
    #fff;
}

.learning-record-card {
  background: #fbfdff;
}

.learning-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.learning-progress-head span,
.learning-record-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.learning-progress-head strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.learning-progress-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.learning-progress-summary span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  color: #35506f;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.learning-progress-summary b {
  color: var(--blue);
}

.learning-progress-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.course-progress-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.course-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.course-progress-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-progress-row b {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.course-progress-row .learning-progress-bar {
  grid-column: 1 / -1;
  height: 6px;
}

.learning-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
}

.learning-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #0ea5e9);
}

.learning-record-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.learning-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding-bottom: 9px;
}

.learning-record-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-record-row span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.learning-record-row p {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.learning-progress-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.8), #fff),
    #fff;
}

.learning-metric-row {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #fff;
}

.learning-metric-row::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.learning-metric-row strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 21px;
  line-height: 1;
}

.learning-metric-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-metric-row.blue::before {
  background: #2f80ed;
}

.learning-metric-row.green::before {
  background: #16a34a;
}

.learning-metric-row.cyan::before {
  background: #0891b2;
}

.learning-metric-row.indigo::before {
  background: #4f46e5;
}

.learning-metric-row.rose::before {
  background: #e11d48;
}

.learning-metric-row.amber::before {
  background: #d97706;
}

:root[data-theme="dark"] .learning-progress-card,
:root[data-theme="dark"] .learning-record-card,
:root[data-theme="dark"] .learning-progress-metrics,
:root[data-theme="dark"] .learning-metric-row {
  border-color: var(--line);
  background: var(--card);
}

:root[data-theme="dark"] .learning-progress-summary span {
  border-color: var(--line);
  color: #cbd5e1;
  background: #0f172a;
}

.empty.compact {
  min-height: auto;
  padding: 12px;
}

.loading.compact {
  min-height: 96px;
  padding: 18px;
  box-shadow: none;
}

.fast-load-error {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid #fde68a;
  border-radius: 14px;
  color: #92400e;
  background: #fffbeb;
  font-weight: 800;
}

.fast-load-error .btn {
  flex: 0 0 auto;
}

.soft-warning {
  margin-bottom: 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255, 251, 235, 0.88);
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
}

.question-card {
  padding: 26px;
}

.question-title {
  margin: 14px 0 20px;
  font-size: 21px;
  line-height: 1.8;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.option.active {
  border-color: var(--blue);
  background: #eef3ff;
}

.option.correct {
  border-color: var(--green);
  background: #e8fff7;
}

.option.wrong {
  border-color: #ef4444;
  background: #fee2e2;
}

.letter {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 900;
}

.option.active .letter,
.option.correct .letter {
  background: var(--blue);
  color: #fff;
}

.analysis {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  line-height: 1.8;
}

.learning-report {
  display: grid;
  gap: 16px;
}

.learning-report section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.learning-report h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.learning-report p,
.learning-report ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.result-page {
  display: grid;
  gap: 18px;
}

.result-hero {
  min-height: 156px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.result-hero span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 900;
}

.result-hero h1 {
  margin: 12px 0 8px;
  color: var(--text);
  font-family: var(--font-hei);
  font-size: 34px;
  line-height: 1.18;
}

.result-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-close-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-stat-grid.cards-4,
.exam-result-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.practice-result-hero {
  border-color: #dbeafe;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef6ff 100%);
}

.practice-advice-panel {
  overflow: hidden;
}

.exam-result-hero {
  border-color: #e9d5ff;
  background: linear-gradient(135deg, #ffffff 0%, #faf7ff 58%, #f5f3ff 100%);
}

.exam-result-hero span {
  color: #6d28d9;
  background: #f3e8ff;
}

.exam-close-btn {
  border-color: #7c3aed;
  background: #7c3aed;
}

.exam-score-card {
  padding: 28px;
  border: 1px solid #e9d5ff;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(88, 28, 135, 0.08);
}

.exam-score-card span {
  color: #6d28d9;
  font-size: 14px;
  font-weight: 900;
}

.exam-score-card strong {
  display: block;
  margin: 12px 0 8px;
  color: #111827;
  font-size: 52px;
  line-height: 1;
}

.exam-score-card strong em {
  color: var(--muted);
  font-size: 24px;
  font-style: normal;
}

.exam-score-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.practice-result-list {
  display: grid;
  gap: 12px;
  max-height: 70vh;
  overflow: auto;
}

.practice-result-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.practice-result-item.correct {
  border-color: rgba(32, 201, 151, 0.38);
}

.practice-result-item.wrong {
  border-color: rgba(239, 68, 68, 0.34);
}

.result-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-title span {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 900;
}

.practice-result-item.wrong .result-title span {
  color: #ef4444;
}

.practice-result-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-dashboard {
  max-width: 1180px;
  margin: 0 auto;
  gap: 22px;
}

.result-summary-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 42px 28px 36px;
  border: 1px solid #e5eefb;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
}

.result-summary-card.practice {
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}

.result-summary-card.exam {
  background: linear-gradient(180deg, #fff 0%, #f6f9ff 100%);
}

.result-summary-card .result-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.result-success-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.result-success-title span {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2f80ed, #1d4ed8);
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.24);
}

.result-success-title h1 {
  margin: 0;
  color: #101828;
  font-family: var(--font-hei);
  font-size: 34px;
  line-height: 1.15;
}

.result-summary-card > p {
  max-width: 680px;
  margin: 0;
  color: #475467;
  font-size: 16px;
  line-height: 1.7;
}

.result-score-display {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.result-score-display strong {
  color: #1f7ae0;
  font-size: 104px;
  font-weight: 900;
  line-height: 0.95;
}

.result-score-display em {
  margin-bottom: 16px;
  color: #101828;
  font-size: 30px;
  font-style: normal;
  font-weight: 900;
}

.result-score-meta {
  color: #344054 !important;
  font-size: 18px !important;
  font-weight: 800;
}

.result-score-meta b {
  color: #1f7ae0;
  font-size: 24px;
}

.result-section-card {
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.result-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.result-section-title span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 900;
}

.result-section-title h2 {
  margin: 0;
  color: #101828;
  font-size: 20px;
}

.result-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
}

.result-metric-item {
  min-height: 132px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid #eef2f7;
  text-align: center;
}

.result-metric-item:last-child {
  border-right: 0;
}

.result-mini-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

.result-mini-icon.green {
  color: #10b981;
  background: #ecfdf5;
}

.result-mini-icon.red {
  color: #ef4444;
  background: #fff1f2;
}

.result-mini-icon.cyan {
  color: #0284c7;
  background: #e0f2fe;
}

.result-mini-icon.indigo {
  color: #4f46e5;
  background: #eef2ff;
}

.result-metric-item strong {
  color: #101828;
  font-size: 34px;
  line-height: 1;
}

.result-metric-item small {
  color: #475467;
  font-size: 15px;
  font-weight: 900;
}

.result-metric-item em {
  color: #667085;
  font-size: 13px;
  font-style: normal;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 22px;
}

.result-type-bars {
  display: grid;
  gap: 22px;
}

.result-type-row {
  display: grid;
  gap: 10px;
}

.result-type-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #101828;
  font-weight: 800;
}

.result-type-row strong {
  color: #344054;
}

.result-type-row i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.result-type-row b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #1d7be8);
}

.result-ai-card {
  border-color: #d8e8ff;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.result-ai-card p {
  margin: 0 0 18px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
}

.result-ai-card h3 {
  margin: 18px 0 10px;
  color: #1d4ed8;
  font-size: 16px;
}

.result-ai-card ul {
  margin: 0;
  padding-left: 20px;
  color: #1f2937;
  line-height: 1.8;
}

.result-weak-list {
  display: grid;
  gap: 8px;
}

.result-weak-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.result-weak-row span {
  min-width: 0;
  overflow: hidden;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(219, 234, 254, 0.8);
  color: #1e3a8a;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-weak-row strong {
  color: #344054;
  font-size: 14px;
}

.result-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 26px;
}

.result-knowledge-item {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 0;
  text-align: center;
}

.result-ring {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#1f7ae0 var(--percent), #e5eef8 0);
}

.result-ring span {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #101828;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
}

.result-knowledge-item strong {
  max-width: 100%;
  overflow: hidden;
  color: #344054;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="dark"] .result-summary-card,
:root[data-theme="dark"] .result-section-card {
  border-color: #263449;
  background: #111827;
  box-shadow: none;
}

:root[data-theme="dark"] .result-summary-card.practice,
:root[data-theme="dark"] .result-summary-card.exam,
:root[data-theme="dark"] .result-ai-card {
  background: #111827;
}

:root[data-theme="dark"] .result-success-title h1,
:root[data-theme="dark"] .result-section-title h2,
:root[data-theme="dark"] .result-score-display em,
:root[data-theme="dark"] .result-type-row div,
:root[data-theme="dark"] .result-ring span,
:root[data-theme="dark"] .result-metric-item strong {
  color: var(--text);
}

:root[data-theme="dark"] .result-summary-card > p,
:root[data-theme="dark"] .result-score-meta,
:root[data-theme="dark"] .result-metric-item small,
:root[data-theme="dark"] .result-metric-item em,
:root[data-theme="dark"] .result-type-row strong,
:root[data-theme="dark"] .result-weak-row strong,
:root[data-theme="dark"] .result-knowledge-item strong,
:root[data-theme="dark"] .result-ai-card p,
:root[data-theme="dark"] .result-ai-card ul {
  color: #cbd5e1 !important;
}

:root[data-theme="dark"] .result-type-row i {
  background: #263449;
}

:root[data-theme="dark"] .result-ring span {
  background: #0f172a;
}

:root[data-theme="dark"] .analysis {
  border-color: var(--line);
}

:root[data-theme="dark"] .learning-report section,
:root[data-theme="dark"] .practice-result-item {
  background: var(--card);
}

:root[data-theme="dark"] .mobile-ai-header,
:root[data-theme="dark"] .mobile-ai-messages,
:root[data-theme="dark"] .mobile-ai-form,
:root[data-theme="dark"] .mobile-ai-form textarea,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .ai-quota-card > div,
:root[data-theme="dark"] .mobile-ai-message div {
  border-color: var(--line);
  color: var(--text);
  background: var(--card);
}

.law-exam-shell {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.practice-run-shell {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.law-exam-top {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.law-system-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.law-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
}

.law-system-title strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
}

.law-system-title span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.law-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.law-light-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #d8e1ee;
  border-radius: 10px;
  color: #334155;
  background: #fff;
  font-weight: 800;
}

.law-light-btn.danger {
  border-color: #fecaca;
  color: #dc2626;
  background: #fff7f7;
}

.law-exam-info {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(130px, 0.8fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.practice-info {
  grid-template-columns: 1fr;
}

.practice-info .practice-info-line {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: #64748b;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.practice-info .practice-info-line strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 15px;
}

.practice-info .practice-info-line span {
  color: inherit;
}

.practice-info .practice-info-line span:not(:first-child)::before {
  content: "";
  width: 3px;
  height: 3px;
  display: inline-block;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: #cbd5e1;
}

.law-exam-info div {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px 16px;
  background: #fff;
}

.law-exam-info span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.law-exam-info strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
}

.law-exam-info .time {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1;
}

.law-exam-info .time.is-warning {
  color: #dc2626;
}

.law-exam-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  gap: 16px;
  padding: 16px;
}

.law-answer-sheet,
.law-question-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.law-answer-sheet {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  overflow: auto;
}

.law-sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e9f2;
}

.law-sheet-title strong {
  color: #0f172a;
  font-size: 16px;
}

.law-sheet-title span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.law-sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  color: #475569;
  font-size: 12px;
}

.law-sheet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.law-sheet-legend i {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.law-sheet-legend i.done {
  border-color: var(--green);
  background: var(--green);
}

.law-sheet-legend i.current {
  border-color: var(--blue);
  background: var(--blue);
}

.law-sheet-legend i.review {
  border-color: #f59e0b;
  background: #f59e0b;
}

.law-answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  align-content: start;
  max-height: min(52vh, 560px);
  overflow-y: auto;
  padding-right: 2px;
}

.law-answer-number {
  width: 100%;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #1f2937;
  background: #f8fafc;
  font-family: var(--font-mono);
  font-weight: 900;
}

.law-answer-number.answered {
  border-color: #bbf7d0;
  color: #166534;
  background: #ecfdf5;
}

.law-answer-number.current {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.law-answer-number.review {
  border-color: #f59e0b;
  color: #7c2d12;
  background: #fffbeb;
}

.law-answer-number.current.review {
  color: #fff;
  background: var(--blue);
}

.law-side-submit {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #6aa6ff;
  font-size: 13px;
  font-weight: 900;
}

.law-question-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 14px;
}

.law-question-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.law-question-index {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.law-question-count {
  margin-left: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.law-mobile-end-btn {
  display: none;
}

.law-question-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.law-question-tags span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.law-question-content {
  min-height: 0;
  padding: 22px 24px;
  overflow: auto;
  background: #fff;
}

.law-question-content h2 {
  margin: 0 0 22px;
  color: var(--text);
  font-family: var(--font-song);
  font-size: 22px;
  line-height: 1.9;
  font-weight: 800;
}

.law-question-stem {
  display: block;
}

.law-question-type-label {
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  color: #2563eb;
  font-family: var(--font-hei);
  font-weight: 900;
}

.law-question-stem-text {
  color: var(--text);
}

.law-options {
  display: grid;
  gap: 12px;
}

.law-options.judge {
  grid-template-columns: repeat(2, minmax(120px, 180px));
}

.law-option {
  min-height: 48px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #111827;
  background: #fff;
  text-align: left;
}

.law-option:hover {
  border-color: #d8e8ff;
  background: var(--blue-soft);
}

.law-option.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.law-option.correct {
  border-color: var(--green);
  background: #ecfdf5;
}

.law-option.wrong {
  border-color: var(--red);
  background: #fef2f2;
}

.law-option-key {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #b6c4d7;
  border-radius: 50%;
  color: var(--blue);
  background: #f8fafc;
  font-family: var(--font-mono);
  font-weight: 900;
}

.law-option.active .law-option-key {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.law-option.correct .law-option-key {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.law-option.wrong .law-option-key {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.law-option-text {
  min-width: 0;
  font-family: var(--font-song);
  font-size: 17px;
  line-height: 1.7;
}

.law-option-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  font-family: var(--font-hei);
  font-size: 13px;
  font-weight: 900;
}

.law-option.active .law-option-check {
  color: #fff;
  background: var(--blue);
}

.law-option.correct .law-option-check {
  color: #fff;
  background: var(--green);
}

.law-option.wrong .law-option-check {
  color: #fff;
  background: var(--red);
}

.law-options.judge .law-option {
  grid-template-columns: minmax(0, 1fr) 22px;
  justify-items: center;
  min-height: 52px;
  text-align: center;
}

.law-options.judge .law-option-text {
  font-family: var(--font-hei);
  font-size: 16px;
  font-weight: 900;
}

.law-text-answer {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: 0;
  resize: vertical;
  background: #fff;
  font-family: var(--font-song);
  font-size: 16px;
  line-height: 1.8;
}

.law-exam-footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.law-plain-btn,
.law-primary-btn,
.law-danger-btn,
.law-review-btn,
.law-ai-btn {
  min-width: 112px;
  min-height: 38px;
  border-radius: 10px;
  font-weight: 900;
}

.law-plain-btn {
  border: 1px solid #cbd5e1;
  color: #1f2937;
  background: #fff;
}

.law-primary-btn {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.law-plain-btn:disabled,
.law-primary-btn:disabled,
.law-danger-btn:disabled,
.law-review-btn:disabled,
.law-ai-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.law-danger-btn {
  border: 1px solid #ef4444;
  color: #fff;
  background: #ef4444;
}

.law-review-btn {
  border: 1px solid #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.law-ai-btn {
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.law-review-btn.active {
  color: #fff;
  background: #f59e0b;
}

.practice-end {
  background: #6aa6ff;
}

:root:not([data-theme="dark"]) .practice-end {
  background: #6aa6ff;
}

.practice-analysis {
  margin-top: 20px;
}

.practice-inline-ai-wrap {
  padding: 0 16px 16px;
}

.inline-ai-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.inline-ai-loading,
.inline-ai-error,
.inline-ai-answer,
.inline-generated-question {
  padding: 14px;
  border: 1px solid #d8e8ff;
  border-radius: 12px;
  background: #f8fbff;
}

.inline-ai-loading {
  color: #1d4ed8;
  font-weight: 900;
}

.inline-ai-error {
  color: #dc2626;
  background: #fff1f2;
  border-color: #fecdd3;
  font-weight: 900;
}

.inline-ai-answer {
  display: grid;
  gap: 10px;
}

.inline-ai-answer strong,
.inline-generated-head strong {
  color: var(--text);
  font-size: 15px;
}

.inline-ai-answer p {
  margin: 0;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.inline-ai-generate,
.inline-ai-submit-generated {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.inline-ai-generate:disabled,
.inline-ai-submit-generated:disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  background: #e2e8f0;
}

.inline-generated-question {
  display: grid;
  gap: 12px;
  background: #fff;
}

.inline-generated-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-generated-head span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 900;
}

.inline-generated-question h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-song);
  font-size: 17px;
  line-height: 1.8;
}

.inline-question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.inline-question-actions .wrong-submit,
.inline-question-actions .law-ai-btn {
  flex: 1 1 150px;
}

.inline-generated-analysis {
  margin-top: 0;
}

:root[data-theme="dark"] .law-exam-shell {
  border-color: #263449;
  background: #0b1220;
}

:root[data-theme="dark"] .law-answer-sheet,
:root[data-theme="dark"] .law-question-panel,
:root[data-theme="dark"] .law-option,
:root[data-theme="dark"] .law-text-answer,
:root[data-theme="dark"] .law-exam-info div,
:root[data-theme="dark"] .law-exam-top,
:root[data-theme="dark"] .law-question-content,
:root[data-theme="dark"] .inline-ai-answer,
:root[data-theme="dark"] .inline-generated-question {
  border-color: #263449;
  color: var(--text);
  background: #111827;
}

:root[data-theme="dark"] .inline-ai-loading {
  border-color: #263449;
  background: #111827;
}

:root[data-theme="dark"] .law-question-head,
:root[data-theme="dark"] .law-exam-footer {
  border-color: #263449;
  background: #0f172a;
}

:root[data-theme="dark"] .law-question-content h2,
:root[data-theme="dark"] .law-question-index,
:root[data-theme="dark"] .law-sheet-title strong,
:root[data-theme="dark"] .law-exam-info strong,
:root[data-theme="dark"] .law-system-title strong {
  color: var(--text);
}

:root[data-theme="dark"] .practice-info .practice-info-line {
  color: #94a3b8;
  background: #111827;
}

:root[data-theme="dark"] .practice-info .practice-info-line strong {
  color: #93c5fd;
}

:root[data-theme="dark"] .practice-info .practice-info-line span:not(:first-child)::before {
  background: #475569;
}

:root[data-theme="dark"] .law-question-tags span,
:root[data-theme="dark"] .law-plain-btn,
:root[data-theme="dark"] .law-option-key {
  border-color: #334155;
  color: var(--text);
  background: #0b1220;
}

.empty,
.loading,
.error {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
}

.error {
  color: #dc2626;
  background: #fff7f7;
}

.mobile-top,
.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    background: #f5f7fb;
  }

  :root[data-theme="dark"] body {
    background: #0f172a;
  }

  .app-shell {
    display: block;
    min-height: auto;
    background: transparent;
  }

  .sidebar,
  .topbar,
  .admin-link {
    display: none;
  }

  .main {
    width: 100%;
    min-height: auto;
    min-width: 0;
    padding-left: 0;
    border-radius: 0;
    background: transparent;
  }

  .mobile-top {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .brand-mini {
    gap: 8px;
    min-width: 0;
  }

  .brand-mark.small {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 13px;
  }

  .brand-mini strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-theme-toggle {
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  .page {
    padding: 8px;
  }

  .result-page {
    gap: 12px;
    padding: 8px 4px 18px;
  }

  .result-hero {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border-radius: 14px;
  }

  .result-hero h1 {
    font-size: 25px;
  }

  .result-hero p {
    font-size: 14px;
  }

  .result-close-btn {
    width: 100%;
    min-height: 42px;
  }

  .result-stat-grid,
  .result-stat-grid.cards-4,
  .exam-result-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .exam-score-card {
    padding: 20px;
    border-radius: 14px;
  }

  .exam-score-card strong {
    font-size: 42px;
  }

  body.home-route {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    height: auto;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    background: #f5f7fb;
    touch-action: auto;
  }

  body.home-route .mobile-top {
    width: 100%;
    max-width: 100%;
    display: flex !important;
  }

  body.home-route .bottom-nav {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    z-index: 40;
  }

  body.home-route .app-shell {
    width: 100%;
    min-height: auto;
    display: block;
    overflow: visible;
    margin: 0;
    transform: none;
    background: transparent;
  }

  body.home-route .sidebar {
    display: none !important;
  }

  body.home-route .main {
    width: 100%;
    min-height: auto;
    padding-left: 0;
    background: transparent;
  }

  body.home-route .page {
    padding: 14px 12px 0;
  }

  body.course-learning-route {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  body.course-learning-route .mobile-top {
    display: none !important;
  }

  .page-head {
    display: none;
  }

  .home-dashboard .page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 0;
  }

  .home-dashboard .page-head h1 {
    font-size: 29px;
  }

  .home-dashboard .page-head p {
    font-size: 16px;
  }

  .paper-list-section {
    gap: 6px;
    margin-bottom: 8px;
  }

  .paper-list-head {
    min-height: 32px;
    margin: 0;
    padding: 0 2px;
  }

  .paper-list-head h2 {
    font-size: 17px;
  }

  .paper-list-grid {
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .paper-list-row {
    min-height: 75px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px 58px;
    gap: 5px;
    align-items: center;
    padding: 8px 2px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .paper-list-row:last-child {
    border-bottom: 0;
  }

  .paper-row-main h3 {
    overflow: hidden;
    margin: 0 0 5px;
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .paper-row-meta {
    overflow: hidden;
    color: #7b8797;
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .paper-row-desc {
    display: none;
  }

  .paper-row-tools {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .paper-row-start {
    min-width: 0;
  }

  .paper-row-tools .btn,
  .paper-row-start .btn {
    min-width: 0;
    width: 100%;
    min-height: 32px;
    padding: 0 2px;
    border-radius: 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .paper-row-start .btn {
    min-height: 36px;
    background: var(--blue);
  }

  .home-dashboard {
    gap: 14px;
  }

  .hero-row {
    display: block;
  }

  .stat-card,
  .mobile-hero {
    display: grid;
    grid-template-columns: 1fr 1fr 76px;
    align-items: center;
    min-height: 118px;
    padding: 18px;
    border: 0;
    color: #fff;
    background:
      radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.22), transparent 20%),
      linear-gradient(135deg, var(--blue), var(--purple));
  }

  .desktop-feature-grid {
    display: none;
  }

  .home-dashboard .hero-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-dashboard .stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    min-height: 116px;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .home-dashboard .stat-card small {
    font-size: 12px;
    line-height: 1.35;
  }

  .home-dashboard .stat-card strong {
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .home-dashboard .stat-card strong em {
    margin-left: 2px;
    font-size: 11px;
  }

  .home-dashboard .stat-card p {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.35;
  }

  .home-dashboard .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 15px;
  }

  .home-dashboard .desktop-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-dashboard .feature-card {
    min-height: 136px;
    padding: 14px;
    border-radius: 14px;
  }

  .home-dashboard .feature-card h3 {
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.35;
  }

  .home-dashboard .feature-card p {
    max-width: none;
    margin-bottom: 34px;
    padding-right: 34px;
    font-size: 12px;
    line-height: 1.45;
  }

  .home-dashboard .feature-card .btn {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 12px;
  }

  .home-dashboard .feature-visual {
    width: 44px;
    height: 44px;
    right: 10px;
    bottom: 10px;
    border-radius: 14px;
    font-size: 18px;
    transform: none;
  }

  .home-dashboard .feature-card.green .feature-visual {
    transform: none;
  }

  .home-dashboard .cards-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cards-4,
  .cards-2,
  .review-summary-grid,
  .ai-workbench,
  .ai-config-grid,
  .form-row,
  .custom-practice-form,
  .mastery-panel {
    grid-template-columns: 1fr;
  }

  .form-row {
    gap: 10px;
  }

  .custom-practice-title {
    justify-content: space-between;
  }

  .field {
    gap: 6px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 42px;
    border-radius: 9px;
    font-size: 15px;
  }

  .practice-subject-grid {
    grid-template-columns: 1fr;
    border-radius: 12px;
  }

  .custom-practice-panel {
    margin-bottom: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .custom-practice-panel .field,
  .custom-practice-panel .btn,
  .custom-practice-extra,
  .custom-practice-title .tag {
    display: none;
  }

  .custom-practice-form {
    display: block;
  }

  .custom-practice-title {
    min-height: 0;
  }

  .custom-practice-title h2 {
    width: 100%;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid #b8d7ff;
    border-radius: 999px;
    color: #1677ff;
    background: #f5f9ff;
    font-size: 13px;
  }

  .practice-tools {
    margin-bottom: 10px;
  }

  .practice-tools input {
    width: 100%;
    height: 40px;
  }

  .past-paper-section {
    margin: 0;
  }

  .past-paper-list {
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .past-paper-row {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .past-paper-row:last-child {
    border-bottom: 0;
  }

  .past-paper-row strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .past-paper-row span {
    display: inline-flex;
  }

  .past-paper-row .past-paper-preview-badge {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    box-shadow: none;
    font-size: 12px;
  }

  .mobile-paper-preview-nav {
    min-height: 50px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -8px -8px 8px;
    padding: 3px 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .paper-preview-head .page-head {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0 2px;
  }

  .paper-preview-head .page-head > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .paper-preview-head .page-head h1,
  .paper-preview-head .page-head p {
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
  }

  .paper-preview-head .page-head h1 {
    flex: 0 0 auto;
    font-size: 16px;
  }

  .paper-preview-head .page-head p {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    text-overflow: ellipsis;
  }

  .paper-preview-head .page-head .btn {
    display: none;
  }

  .mobile-preview-back,
  .mobile-preview-end {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    color: #1677ff;
    background: transparent;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-preview-end {
    color: #475569;
  }

  .paper-preview-page {
    gap: 10px;
  }

  .paper-preview-item {
    border-radius: 10px;
  }

  .mini-custom-backdrop {
    align-items: end;
    padding: 0;
  }

  .mini-custom-sheet {
    width: 100vw;
    max-width: none;
    max-height: min(88vh, 680px);
    border-radius: 18px 18px 0 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .mini-custom-row {
    grid-template-columns: 1fr;
  }

  .custom-choice-row label {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .practice-list-row {
    min-height: 88px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 13px 14px;
  }

  .practice-subject-main {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .practice-subject-main em {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 12px;
  }

  .practice-subject-main strong {
    font-size: 17px;
  }

  .practice-row-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 42px;
  }

  .practice-continue {
    grid-column: 1;
    grid-row: 3;
    padding-left: 42px;
  }

  .practice-row-arrow {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .panel-head {
    margin-bottom: 12px;
  }

  .panel-head h2,
  .panel-head h3 {
    font-size: 15px;
  }

  .review-summary-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px;
    margin-bottom: 8px;
    overflow: hidden;
  }

  .review-summary-card {
    min-width: 0;
    min-height: 68px;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    text-align: center;
  }

  .review-summary-card span,
  .review-summary-card small {
    font-size: 10px;
    line-height: 1.25;
  }

  .review-summary-card strong {
    font-size: 20px;
  }

  .review-panel {
    padding: 10px;
  }

  .wrong-book-panel {
    padding: 10px;
  }

  .review-panel .panel-head {
    margin-bottom: 8px;
  }

  .review-list,
  .ai-question-list {
    gap: 8px;
  }

  .review-item-card,
  .ai-question-card {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
  }

  .review-item-card .btn,
  .ai-question-card > .tag {
    grid-column: 2;
    justify-self: start;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .review-index,
  .ai-question-index {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 11px;
  }

  .review-title {
    display: grid;
    gap: 6px;
  }

  .review-title h3,
  .ai-question-card h3 {
    font-size: 14px;
    line-height: 1.55;
  }

  .review-meta,
  .ai-question-meta {
    gap: 4px;
    margin-top: 7px;
  }

  .review-meta span,
  .ai-question-meta span,
  .review-count {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .wrong-answer-list {
    gap: 8px;
  }

  .wrong-answer-card {
    gap: 9px;
    padding: 10px;
    border-radius: 10px;
  }

  .wrong-question-top {
    gap: 5px;
    font-size: 11px;
  }

  .wrong-subject,
  .wrong-count {
    min-height: 20px;
    padding: 0 6px;
  }

  .wrong-answer-card h3 {
    font-size: 14px;
    line-height: 1.6;
  }

  .wrong-options {
    gap: 6px;
  }

  .wrong-option {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 9px;
  }

  .wrong-option-key {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 12px;
  }

  .wrong-option-text {
    font-size: 13px;
    line-height: 1.55;
  }

  .wrong-submit {
    width: 100%;
    min-height: 32px;
    border-radius: 9px;
    font-size: 12px;
  }

  .wrong-result {
    padding: 7px 8px;
    font-size: 12px;
  }

  .ai-workbench {
    gap: 12px;
  }

  .ai-config-panel {
    min-height: 0;
  }

  .ai-knowledge-field {
    grid-column: auto;
  }

  .ai-generate-btn {
    width: 100%;
  }

  .ai-side-card {
    padding: 14px;
    border-radius: 12px;
  }

  .recent-meta {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .recent-meta .progress {
    grid-column: 1 / -1;
  }

  .chart {
    display: block;
    height: 150px;
  }

  .mastery-panel,
  .desktop-only {
    display: none;
  }

  .home-dashboard .mastery-panel {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 34px;
  }

  .home-dashboard .desktop-only {
    display: grid;
  }

  .home-dashboard .mastery-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
  }

  .home-dashboard .mastery-bars {
    width: 100%;
    gap: 10px;
  }

  .home-dashboard .mastery-line {
    grid-template-columns: minmax(86px, 1fr) minmax(0, 1.2fr) 36px;
    gap: 8px;
    width: 100%;
    font-size: 12px;
  }

  .home-dashboard .donut {
    width: 132px;
    height: 132px;
    font-size: 25px;
  }

  .home-dashboard .advice-row {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .home-dashboard .advice-row .btn {
    grid-column: 2;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12px;
  }

  .law-exam-shell {
    min-height: calc(100vh - 58px);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .law-exam-top {
    min-height: 58px;
    gap: 10px;
    padding: 12px 14px;
  }

  .law-system-title strong {
    font-size: 14px;
  }

  .law-system-title span {
    display: none;
  }

  .law-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .law-top-actions {
    gap: 6px;
  }

  .law-light-btn {
    min-height: 32px;
    padding: 0 9px;
    border-radius: 9px;
    font-size: 12px;
  }

  .law-exam-info {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .practice-info {
    grid-template-columns: 1fr;
  }

  .practice-info .practice-info-line {
    min-height: 34px;
    gap: 5px;
    padding: 6px 10px;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 11px;
  }

  .practice-info .practice-info-line strong {
    font-size: 13px;
  }

  .practice-info .practice-info-line span:not(:first-child)::before {
    margin-right: 5px;
  }

  .law-exam-info div {
    min-height: 54px;
    padding: 8px 10px;
  }

  .law-exam-info strong {
    font-size: 14px;
  }

  .law-exam-info .time {
    font-size: 20px;
  }

  .law-exam-body {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px;
  }

  .law-answer-sheet {
    order: -1;
    display: block;
    padding: 7px 8px;
    overflow: visible;
    border-radius: 10px;
  }

  .law-sheet-title,
  .law-sheet-legend {
    display: none;
  }

  .law-answer-grid {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 1px;
  }

  .law-side-submit {
    margin-top: 7px;
    min-height: 32px;
    border-radius: 9px;
    font-size: 12px;
  }

  .law-answer-number {
    width: 31px;
    min-width: 31px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }

  .law-question-panel {
    min-height: calc(100vh - 218px);
    border-radius: 10px;
  }

  .law-question-head {
    align-items: flex-start;
    min-height: 42px;
    padding: 8px 10px;
    gap: 8px;
  }

  .law-question-index {
    font-size: 14px;
  }

  .law-question-count {
    margin-left: 5px;
    font-size: 11px;
  }

  .law-question-tags span {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .law-question-content {
    padding: 11px 10px;
  }

  .law-question-content h2 {
    margin-bottom: 12px;
    font-size: 17px;
    line-height: 1.65;
  }

  .law-options {
    gap: 8px;
  }

  .law-option {
    min-height: 42px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 9px;
    border-radius: 10px;
  }

  .law-option-key {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .law-option-check {
    display: none;
  }

  .law-options.judge {
    grid-template-columns: 1fr 1fr;
  }

  .law-options.judge .law-option {
    grid-template-columns: 1fr;
  }

  .law-option-text {
    font-size: 15px;
    line-height: 1.55;
  }

  .law-exam-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .practice-run-shell .law-exam-footer {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .law-primary-btn {
    grid-column: auto;
    grid-row: auto;
  }

  .law-plain-btn,
  .law-danger-btn,
  .law-review-btn,
  .law-ai-btn {
    min-width: 0;
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 12px;
  }

  .law-primary-btn {
    min-height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 12px;
  }

  body.practice-run-route {
    padding-bottom: 0;
    overflow: hidden;
    background: #f8fafc;
    --practice-run-head-font: 17px;
    --practice-run-meta-font: 11px;
    --practice-run-stem-font: 18px;
    --practice-run-option-font: 16px;
    --practice-run-analysis-font: 14px;
  }

  body.exam-run-route {
    padding-bottom: 0;
    overflow: hidden;
    background: #f8fafc;
    --exam-run-head-font: 17px;
    --exam-run-meta-font: 11px;
    --exam-run-stem-font: 18px;
    --exam-run-option-font: 16px;
  }

  body.practice-run-route .mobile-top,
  body.practice-run-route .bottom-nav,
  body.practice-run-route .site-footer,
  body.practice-run-route .practice-info,
  body.practice-run-route .law-answer-sheet,
  body.exam-run-route .mobile-top,
  body.exam-run-route .bottom-nav,
  body.exam-run-route .site-footer,
  body.exam-run-route .law-exam-top,
  body.exam-run-route .law-exam-info,
  body.exam-run-route .law-answer-sheet {
    display: none;
  }

  body.practice-run-route .main,
  body.exam-run-route .main {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.practice-run-route .page,
  body.exam-run-route .page {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
  }

  body.practice-run-route .law-exam-shell,
  body.practice-run-route .practice-run-shell,
  body.exam-run-route .law-exam-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    border: 0;
    background: #fff;
    overflow: hidden;
  }

  body.practice-run-route .law-exam-body,
  body.exam-run-route .law-exam-body {
    min-height: 0;
    display: block;
    padding: 0 12px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.practice-run-route .law-question-panel,
  body.exam-run-route .law-question-panel {
    min-height: auto;
    border: 0;
    border-radius: 0;
    touch-action: pan-y;
  }

  body.practice-run-route .law-question-head,
  body.exam-run-route .law-question-head {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 50px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  body.practice-run-route .law-question-head > div:first-child,
  body.exam-run-route .law-question-head > div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
  }

  body.practice-run-route .law-mobile-end-btn {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-family: var(--font-hei);
    font-size: 12px;
    font-weight: 900;
  }

  body.practice-run-route .law-question-index {
    font-size: var(--practice-run-head-font);
  }

  body.exam-run-route .law-question-index,
  body.exam-run-route .law-question-count {
    display: none;
  }

  body.practice-run-route .law-question-count {
    margin-left: 0;
    font-size: 12px;
  }

  body.practice-run-route .law-question-tags {
    gap: 5px;
  }

  body.practice-run-route .law-question-tags span,
  body.exam-run-route .law-question-tags span {
    min-height: 24px;
    padding: 0 8px;
    border-color: #d1d5db;
    color: #1f2937;
    background: #fff;
    font-size: var(--practice-run-meta-font);
  }

  body.exam-run-route .law-question-tags {
    justify-content: flex-start;
    gap: 5px;
  }

  body.exam-run-route .law-question-tags span:not(:first-child) {
    display: none;
  }

  body.exam-run-route .law-question-tags span {
    font-size: var(--exam-run-meta-font);
  }

  body.practice-run-route .law-question-tags span:last-child:nth-child(3) {
    display: none;
  }

  body.practice-run-route .law-question-content,
  body.exam-run-route .law-question-content {
    padding: 14px 0 14px;
    overflow: visible;
  }

  body.practice-run-route .law-question-content h2,
  body.exam-run-route .law-question-content h2 {
    margin-bottom: 12px;
    line-height: 1.62;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.practice-run-route .law-question-content h2 {
    font-size: var(--practice-run-stem-font);
  }

  body.exam-run-route .law-question-content h2 {
    font-size: var(--exam-run-stem-font);
  }

  body.practice-run-route .law-question-type-label {
    margin-right: 6px;
    color: #2563eb;
  }

  body.practice-run-route .law-options,
  body.exam-run-route .law-options {
    gap: 8px;
  }

  body.practice-run-route .law-option,
  body.exam-run-route .law-option {
    min-height: 54px;
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    gap: 9px;
    padding: 11px 10px;
    border-color: #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.03);
  }

  body.practice-run-route .law-option-key,
  body.exam-run-route .law-option-key {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  body.practice-run-route .law-option-text,
  body.exam-run-route .law-option-text {
    line-height: 1.52;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.practice-run-route .law-option-text {
    font-size: var(--practice-run-option-font);
  }

  body.exam-run-route .law-option-text {
    font-size: var(--exam-run-option-font);
  }

  body.practice-run-route .law-option-check,
  body.exam-run-route .law-option-check {
    display: grid;
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  body.practice-run-route .law-options.judge .law-option,
  body.exam-run-route .law-options.judge .law-option {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  body.practice-run-route .law-options.judge .law-option-text,
  body.exam-run-route .law-options.judge .law-option-text {
    font-size: 15px;
  }

  body.practice-run-route .practice-analysis {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    font-size: var(--practice-run-analysis-font);
    line-height: 1.65;
  }

  body.practice-run-route .law-text-answer,
  body.exam-run-route .law-text-answer {
    min-height: 180px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.65;
  }

  body.practice-run-route .inline-ai-panel {
    gap: 9px;
    margin-top: 12px;
  }

  body.practice-run-route .inline-ai-loading,
  body.practice-run-route .inline-ai-error,
  body.practice-run-route .inline-ai-answer,
  body.practice-run-route .inline-generated-question {
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
  }

  body.practice-run-route .inline-ai-answer p {
    line-height: 1.65;
  }

  body.practice-run-route .law-exam-footer,
  body.practice-run-route .practice-run-shell .law-exam-footer,
  body.exam-run-route .law-exam-footer {
    position: relative;
    z-index: 4;
    display: flex;
    grid-template-columns: none;
    min-height: 62px;
    gap: 7px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef2f7;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  body.practice-run-route .law-exam-footer button,
  body.exam-run-route .law-exam-footer button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    border-radius: 12px;
    font-size: 13px;
    padding: 0 6px;
  }

  body.exam-run-route .law-exam-footer button:disabled {
    opacity: 0.48;
  }

  .bottom-nav {
    width: auto;
    max-width: 396px;
    min-height: 82px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 20;
    margin: 0 auto;
    box-sizing: border-box;
    column-gap: 0;
    padding: 13px 14px 10px;
    transform: none;
    background: #fff;
    border: 1px solid rgba(238, 242, 247, 0.95);
    border-radius: 34px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    overflow: visible;
  }

  .bottom-nav a,
  .bottom-nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 0 2px;
    color: #2f3337;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav a::before,
  .bottom-nav button::before {
    display: none;
  }

  .bottom-nav-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #303235;
    transition: color 0.16s ease, transform 0.16s ease;
  }

  .bottom-nav-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 3.4;
  }

  .bottom-nav-label {
    max-width: 100%;
    overflow: visible;
    color: currentColor;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-ai-page {
    min-height: calc(100vh - 160px);
  }

  .mobile-ai-header,
  .profile-card {
    padding: 14px;
    border-radius: 12px;
  }

  .mobile-ai-header h2,
  .profile-card h2 {
    font-size: 18px;
  }

  .mobile-ai-messages {
    min-height: 320px;
    padding: 10px;
    border-radius: 12px;
  }

  .mobile-ai-message {
    max-width: 90%;
  }

  .ai-quota-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-quota-card > div {
    padding: 10px;
  }

  .ai-quota-card strong {
    font-size: 20px;
  }

  .mobile-ai-form {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 12px;
  }

  .mobile-ai-form .btn {
    width: 100%;
  }

  .bottom-nav a:hover,
  .bottom-nav a.active,
  .bottom-nav button:hover {
    color: #111827;
    background: transparent;
  }

  .bottom-nav a:hover .bottom-nav-icon,
  .bottom-nav a.active .bottom-nav-icon,
  .bottom-nav button:hover .bottom-nav-icon {
    color: #006b50;
    background: transparent;
    transform: translateY(-1px);
  }

  .bottom-nav.learning-bottom-nav {
    max-width: none;
    min-height: 72px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 4px;
    padding: 9px 9px 8px 6px;
    border-color: rgba(255, 255, 255, 0.7);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.13);
    backdrop-filter: blur(14px);
  }

  .learning-nav-items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    min-width: 0;
  }

  .bottom-nav.course-learning-bottom-nav .learning-nav-items {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .bottom-nav.learning-bottom-nav .learning-nav-toggle {
    width: 30px;
    min-width: 30px;
    height: 54px;
    min-height: 54px;
    display: grid;
    grid-template-rows: 20px 18px;
    align-items: center;
    justify-content: center;
    align-self: center;
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 999px;
    padding: 0;
    color: #0284c7;
    background: rgba(224, 242, 254, 0.96);
    box-shadow: 0 8px 18px rgba(56, 189, 248, 0.22);
  }

  .bottom-nav.learning-bottom-nav .learning-nav-toggle-icon,
  .bottom-nav.learning-bottom-nav .learning-nav-toggle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0284c7;
  }

  .bottom-nav.learning-bottom-nav .learning-nav-toggle-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav.learning-bottom-nav .learning-nav-toggle-arrow {
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-item {
    min-height: 54px;
    gap: 4px;
    padding: 0;
    border: 0;
    color: #27323a;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
  }

  .bottom-nav.global-bottom-nav .bottom-nav-item {
    font-size: 12px;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-icon {
    width: 23px;
    height: 23px;
  }

  .bottom-nav.global-bottom-nav .bottom-nav-icon {
    width: 27px;
    height: 27px;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-icon svg {
    stroke-width: 3.1;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-item:disabled,
  .bottom-nav.learning-bottom-nav .bottom-nav-item[aria-disabled="true"] {
    color: #9ca3af;
    pointer-events: none;
  }

  .bottom-nav.learning-bottom-nav.learning-nav-collapsed {
    right: auto;
    width: 54px;
    min-height: 68px;
    grid-template-columns: 1fr !important;
    padding: 7px;
    border-radius: 999px;
  }

  .bottom-nav.learning-bottom-nav.learning-nav-collapsed .learning-nav-items {
    display: none;
  }

  .bottom-nav.learning-bottom-nav.learning-nav-collapsed .learning-nav-toggle {
    width: 40px;
    min-width: 40px;
    height: 54px;
  }

  .settings-modal-body {
    padding: 16px;
  }

  .theme-choice-row,
  .learning-data-grid {
    grid-template-columns: 1fr;
  }

  .learning-record-row {
    gap: 4px;
    grid-template-columns: 1fr;
  }

  .learning-record-row strong,
  .learning-record-row span {
    white-space: normal;
  }

  .learning-record-row p {
    grid-column: 1;
  }

  .page:has(.course-learning-embed) {
    padding: 0;
  }

  .course-learning-embed {
    height: 100vh;
    min-height: 100vh;
    padding-bottom: 0;
    background: #fff;
  }

  .course-learning-embed iframe {
    height: 100%;
  }

  :root[data-theme="dark"] .bottom-nav {
    border-color: rgba(38, 52, 73, 0.9);
    background: #111827;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  }

  :root[data-theme="dark"] .bottom-nav a {
    color: #e5e7eb;
  }

  :root[data-theme="dark"] .bottom-nav a:hover,
  :root[data-theme="dark"] .bottom-nav a.active {
    color: #fff;
  }

  :root[data-theme="dark"] .bottom-nav a:hover .bottom-nav-icon,
  :root[data-theme="dark"] .bottom-nav a.active .bottom-nav-icon,
  :root[data-theme="dark"] .bottom-nav button:hover .bottom-nav-icon {
    color: #34d399;
  }

  :root[data-theme="dark"] .bottom-nav.learning-bottom-nav {
    background: rgba(17, 24, 39, 0.82);
  }
}

@media (max-width: 360px) {
  body.practice-run-route,
  body.exam-run-route {
    --practice-run-head-font: 16px;
    --practice-run-stem-font: 17px;
    --practice-run-option-font: 15px;
    --practice-run-analysis-font: 13px;
    --exam-run-head-font: 16px;
    --exam-run-stem-font: 17px;
    --exam-run-option-font: 15px;
  }

  body.practice-run-route .law-exam-body,
  body.exam-run-route .law-exam-body {
    padding-inline: 10px;
  }

  body.practice-run-route .law-question-head,
  body.exam-run-route .law-question-head {
    min-height: 48px;
  }

  body.practice-run-route .law-question-tags span,
  body.exam-run-route .law-question-tags span {
    min-height: 22px;
    padding-inline: 7px;
  }

  body.practice-run-route .law-option,
  body.exam-run-route .law-option {
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    gap: 8px;
    padding: 10px 9px;
  }

  body.practice-run-route .law-exam-footer,
  body.practice-run-route .practice-run-shell .law-exam-footer,
  body.exam-run-route .law-exam-footer {
    gap: 6px;
    padding-inline: 10px;
  }

  body.practice-run-route .law-exam-footer button,
  body.exam-run-route .law-exam-footer button {
    min-height: 40px;
    font-size: 12px;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    padding-inline: 10px;
  }

  .bottom-nav a,
  .bottom-nav button {
    font-size: 16px;
  }

  .bottom-nav-icon {
    width: 33px;
    height: 33px;
  }

  .bottom-nav.learning-bottom-nav {
    padding-inline: 7px;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-icon {
    width: 23px;
    height: 23px;
  }

  .bottom-nav.learning-bottom-nav .bottom-nav-item {
    font-size: 10px;
  }
}

@media (max-width: 900px) {
  body:has(.result-dashboard) {
    width: 100%;
    max-width: 100%;
  }

  body:has(.result-dashboard) .app-shell,
  body:has(.result-dashboard) .main,
  body:has(.result-dashboard) .page,
  body:has(.result-dashboard) .mobile-top {
    width: 100%;
    max-width: 100%;
  }

  .result-dashboard {
    max-width: none;
    gap: 12px;
    padding: 8px 4px 22px;
  }

  .result-summary-card {
    gap: 10px;
    padding: 22px 16px 18px;
    border-radius: 12px;
  }

  .result-summary-card .result-close-btn {
    position: static;
    order: 10;
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
  }

  .result-success-title {
    gap: 10px;
  }

  .result-success-title span {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .result-success-title h1 {
    font-size: 27px;
  }

  .result-summary-card > p {
    font-size: 14px;
  }

  .result-score-display strong {
    font-size: 74px;
  }

  .result-score-display em {
    margin-bottom: 10px;
    font-size: 21px;
  }

  .result-score-meta {
    font-size: 15px !important;
  }

  .result-score-meta b {
    font-size: 19px;
  }

  .result-section-card {
    padding: 16px;
    border-radius: 8px;
  }

  .result-section-title {
    margin-bottom: 14px;
  }

  .result-section-title h2 {
    font-size: 17px;
  }

  .result-metric-grid,
  .result-metric-grid.exam-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .result-metric-item {
    min-height: 118px;
    border: 1px solid #eef2f7;
    border-radius: 8px;
  }

  .result-metric-item:last-child {
    border-right: 1px solid #eef2f7;
  }

  .result-metric-grid.exam-metrics .result-metric-item:last-child {
    grid-column: 1 / -1;
  }

  .result-metric-item strong {
    font-size: 28px;
  }

  .result-detail-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .result-type-bars {
    gap: 16px;
  }

  .result-ai-card p,
  .result-ai-card ul {
    font-size: 14px;
  }

  .result-weak-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .result-weak-row span {
    white-space: normal;
  }

  .result-knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .result-ring {
    width: 78px;
    height: 78px;
  }

  .result-ring span {
    width: 58px;
    height: 58px;
    font-size: 17px;
  }
}
