: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,
.ai-card h3,
.recent-row h4,
.list-item h4,
.advice-row h4 {
  font-family: var(--font-hei);
}

.page-head p,
.feature-card p,
.ai-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;
}

.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;
}

.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);
}

.ai-card {
  min-height: 144px;
  position: relative;
  overflow: hidden;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid #d8e8ff;
  color: var(--text);
  background: var(--blue-soft);
  box-shadow: var(--shadow-soft);
}

.ai-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.ai-card p {
  max-width: 132px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-card .btn {
  min-height: 34px;
  padding: 0 14px;
  background: var(--blue);
}

.robot {
  width: 84px;
  height: 92px;
  position: absolute;
  right: 12px;
  bottom: -5px;
}

.robot::before {
  content: "";
  width: 60px;
  height: 46px;
  position: absolute;
  left: 12px;
  top: 20px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 21px 24px, #77e8ff 0 4px, transparent 5px),
    radial-gradient(circle at 39px 24px, #77e8ff 0 4px, transparent 5px),
    linear-gradient(180deg, #eef5ff, #adc4ff);
  box-shadow: inset 0 -8px 16px rgba(49, 91, 255, 0.22);
}

.robot::after {
  content: "";
  width: 46px;
  height: 42px;
  position: absolute;
  left: 19px;
  top: 56px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #f7fbff, #b8caff);
}

.antenna {
  width: 2px;
  height: 24px;
  position: absolute;
  left: 41px;
  top: 0;
  background: rgba(255, 255, 255, 0.78);
}

.antenna::after {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  left: -5px;
  top: -2px;
  border-radius: 50%;
  background: #dfe9ff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
}

.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;
}

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

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

.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-radius: 10px;
  background: var(--soft);
  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;
}

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

.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"] .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);
}

.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;
}

.custom-practice-form {
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 2fr) minmax(150px, 220px) auto;
  align-items: end;
}

.custom-practice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

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

.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;
}

.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;
}

.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;
}

.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;
}

: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);
}

.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);
}

.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);
}

.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(4, 1fr);
  gap: 8px;
  align-content: start;
}

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

.law-answer-number.answered {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

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

.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: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #ef4444;
  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-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-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 {
  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-danger-btn {
  border: 1px solid #ef4444;
  color: #fff;
  background: #ef4444;
}

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

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

.practice-end {
  background: var(--blue);
}

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

: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 {
  border-color: #263449;
  color: var(--text);
  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"] .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 {
    min-width: 0;
    padding-bottom: 72px;
    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 {
    min-height: auto;
    border-radius: 0;
    background: transparent;
  }

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

  .brand-mini strong {
    font-size: 16px;
  }

  .page {
    padding: 12px;
  }

  .page-head {
    display: none;
  }

  .home-dashboard {
    gap: 14px;
  }

  .hero-row {
    display: block;
  }

  .stat-card,
  .ai-card {
    display: none;
  }

  .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));
  }

  .mobile-hero small {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-hero strong {
    display: block;
    font-size: 27px;
    line-height: 1;
  }

  .mobile-hero em {
    font-size: 13px;
    font-style: normal;
  }

  .mobile-hero .mini-chart {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
  }

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

  .mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px 8px;
    padding: 18px 6px 8px;
  }

  .quick-action {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
  }

  :root[data-theme="dark"] .quick-action {
    color: var(--text);
  }

  .quick-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 13px;
  }

  .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;
  }

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

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

  .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;
  }

  .mobile-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-kpis .panel {
    min-height: 78px;
    padding: 12px;
    border-radius: 12px;
  }

  .mobile-kpis small {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-kpis strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
  }

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

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

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

  .review-summary-grid {
    gap: 8px;
    margin-bottom: 12px;
  }

  .review-summary-card {
    min-height: 86px;
    padding: 14px;
    border-radius: 12px;
  }

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

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

  .review-item-card .btn,
  .ai-question-card > .tag {
    grid-column: 2;
    justify-self: start;
  }

  .review-index,
  .ai-question-index {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
  }

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

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

  .review-meta,
  .ai-question-meta {
    gap: 6px;
  }

  .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;
  }

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

  .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;
  }

  .law-exam-info div {
    min-height: 62px;
    padding: 10px 12px;
  }

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

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

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

  .law-answer-sheet {
    order: -1;
    display: block;
    padding: 10px;
    overflow: hidden;
    border-radius: 12px;
  }

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

  .law-answer-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .law-side-submit {
    margin-top: 10px;
    min-height: 38px;
  }

  .law-answer-number {
    width: 36px;
    min-width: 36px;
    height: 34px;
  }

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

  .law-question-head {
    align-items: flex-start;
    padding: 10px 12px;
  }

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

  .law-question-tags span {
    min-height: 24px;
    padding: 0 8px;
  }

  .law-question-content {
    padding: 14px 12px;
  }

  .law-question-content h2 {
    margin-bottom: 16px;
    font-size: 18px;
    line-height: 1.75;
  }

  .law-option {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px;
  }

  .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;
  }

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

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

  .law-plain-btn,
  .law-danger-btn,
  .law-review-btn {
    min-width: 0;
    width: 100%;
  }

  .bottom-nav {
    height: 64px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    background: #fff;
    border-top: 1px solid var(--line);
  }

  .bottom-nav a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    color: #64748b;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
  }

  .bottom-nav a::before {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
  }

  .bottom-nav a.active {
    color: var(--blue);
  }
}
