/*
 * 愚人码头 Editorial UI
 * 唯一视觉源。全真模拟作答页 exam_paper.php 不加载本文件。
 */

:root {
  --canvas: #f5f5f3;
  --canvas-soft: #fafaf8;
  --surface: #ffffff;
  --surface-subtle: #f0efec;
  --ink: #0c0a09;
  --ink-soft: #292524;
  --body: #57534e;
  --muted: #78716c;
  --muted-soft: #a8a29e;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --success: #187345;
  --success-bg: #edf7f1;
  --success-line: #bfe0c9;
  --error: #b42318;
  --error-bg: #fff1f0;
  --error-line: #f1c7c2;
  --warning: #8a4b0f;
  --warning-bg: #fff7e8;
  --warning-line: #ead3ae;
  --on-ink: #ffffff;
  --status-neutral: #a59f98;
  --surface-cool: #f1f2f0;
  --surface-quiet: #fcfcfb;
  --canvas-quiet: #f7f7f4;
  --mint: #a7e5d3;
  --peach: #f4c5a8;
  --lavender: #c8b8e0;
  --sky: #a8c8e8;
  --rose: #e8b8c4;
  --display: "EB Garamond", "Songti SC", "STSong", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --container: 1180px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --pill: 999px;
  --shadow: 0 8px 28px rgba(12, 10, 9, .06);
  --shadow-large: 0 24px 72px rgba(12, 10, 9, .12);
  --ease: 180ms cubic-bezier(.2, .8, .2, 1);

}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--canvas);
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--body);
  background:
    radial-gradient(circle at 8% 3%, rgba(167, 229, 211, .18), transparent 22rem),
    radial-gradient(circle at 92% 5%, rgba(244, 197, 168, .16), transparent 24rem),
    var(--canvas);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--on-ink);
  background: var(--ink-soft);
}

[hidden],
.is-hidden {
  display: none;
}

.native-submit-proxy {
  display: none;
}

#idiotsAjaxBar {
  position: fixed;
  z-index: 2147483647;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: var(--ink-soft);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .42s cubic-bezier(.19, 1, .22, 1), opacity .18s ease;
}

html.ajax-loading #idiotsAjaxBar {
  opacity: 1;
  transform: scaleX(.72);
}

html.ajax-committing #idiotsAjaxBar {
  opacity: 1;
  transform: scaleX(1);
  transition-duration: .12s;
}

html.ajax-loading body {
  cursor: progress;
}

body.ajax-fade {
  opacity: .72;
  transition: opacity .14s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"],
a[href] {
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: .48;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.title,
.page-title,
.header-title,
.hero-title,
.card-title,
.section-title,
.setup-header-title,
.subject-name,
.brand-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 300;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.03;
  letter-spacing: -1.25px;
}

h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.65px;
}

h3 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.2px;
}

p {
  margin: 0;
}

.site-container,
.wrap {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.section-kicker,
.eyebrow,
.library-kicker,
.submission-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-kicker::before,
.eyebrow::before,
.library-kicker::before,
.submission-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

/* Navigation */

.site-header {
  position: relative;
  z-index: 3000;
}

.site-navbar {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  min-height: 64px;
  padding-inline: max(24px, calc((100vw - var(--container)) / 2));
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  color: var(--ink);
  background: rgba(245, 245, 243, .92);
  border-bottom: 1px solid rgba(214, 211, 209, .84);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.site-navbar .logo {
  width: max-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.site-navbar .logo img {
  width: auto;
  height: 26px;
  opacity: .94;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav-link,
.nav-secondary,
.nav-link-button {
  position: relative;
  min-height: 40px;
  padding-inline: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: transparent;
}

.nav-secondary:hover,
.nav-secondary.active,
.nav-link-button:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.nav-link.active {
  font-weight: 650;
  box-shadow: none;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 5px;
  left: 13px;
  height: 2px;
  background: var(--ink);
  border-radius: var(--pill);
}

.nav-secondary.active {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.user-area {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.nav-greeting {
  max-width: 140px;
  margin-right: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-cta {
  min-height: 40px;
  padding-inline: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-ink);
  background: var(--ink-soft);
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--ease), transform var(--ease);
}

.nav-cta:hover {
  background: var(--ink);
  transform: translateY(-1px);
}

.nav-secondary {
  border: 1px solid var(--line-strong);
}

.nav-inline-form {
  display: inline-flex;
  margin: 0;
}

.nav-menu-button {
  display: none;
  min-height: 40px;
  padding: 0 14px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
}

.nav-menu-icon {
  width: 18px;
  display: grid;
  gap: 4px;
}

.nav-menu-icon i {
  height: 1px;
  background: currentColor;
  transition: transform var(--ease);
}

/* Buttons and inputs */

.button,
.btn,
.btn-primary,
.btn-submit,
.submit-btn,
.action-btn,
.setup-action-btn,
.exam-btn,
.link-btn,
.download-link,
.start-btn,
.question-btn,
.comment-submit,
.comm-submit,
.page-jump-btn,
.btn-ink,
.btn-toggle,
.button-link,
.library-primary-action,
.subject-enter,
button[type="submit"]:not(.nav-link-button),
input[type="submit"] {
  min-height: 40px;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--on-ink);
  background: var(--ink-soft);
  border: 1px solid var(--ink-soft);
  border-radius: var(--pill);
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.button:hover,
.btn:hover,
.btn-primary:hover,
.btn-submit:hover,
.submit-btn:hover,
.action-btn:hover,
.setup-action-btn:hover,
.exam-btn:hover,
.link-btn:hover,
.download-link:hover,
.start-btn:hover,
.question-btn:hover,
.comment-submit:hover,
.comm-submit:hover,
.page-jump-btn:hover,
.button-link:hover,
.library-primary-action:hover,
.subject-enter:hover,
button[type="submit"]:not(.nav-link-button):hover,
input[type="submit"]:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(12, 10, 9, .1);
}

.button-outline,
.button-text,
.btn-secondary,
.btn-sso,
.btn-ghost,
.link-btn.secondary,
.setup-action-btn.secondary,
.page-link,
.cancel-link,
.btn-outline,
.btn-link-m,
.btn-secondary-m,
.tab-btn,
.filter-btn,
.filter-clear,
.library-secondary-action,
.back-btn,
.layout-trigger,
.jump-btn,
.wrongbook-trigger,
.board-tool-btn,
.board-page-btn,
.btn-next,
.btn-show,
.btn-comm,
.btn-wrongbook,
.fav-btn,
.setup-back-link {
  min-height: 40px;
  padding: 9px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), border-color var(--ease);
}

.button-text {
  padding-inline: 8px;
  border-color: transparent;
}

.button-outline:hover,
.button-text:hover,
.btn-secondary:hover,
.btn-sso:hover,
.btn-ghost:hover,
.link-btn.secondary:hover,
.setup-action-btn.secondary:hover,
.page-link:hover,
.cancel-link:hover,
.btn-outline:hover,
.btn-link-m:hover,
.btn-secondary-m:hover,
.filter-btn:hover,
.filter-clear:hover,
.library-secondary-action:hover,
.back-btn:hover,
.layout-trigger:hover,
.jump-btn:hover,
.wrongbook-trigger:hover,
.board-tool-btn:hover,
.board-page-btn:hover,
.btn-next:hover,
.btn-show:hover,
.btn-comm:hover,
.btn-wrongbook:hover,
.fav-btn:hover,
.setup-back-link:hover {
  color: var(--ink);
  background: var(--surface-subtle);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn-danger,
.danger,
.delete-btn,
.btn-remove {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error-line);
  box-shadow: none;
}

.btn-danger:hover,
.danger:hover,
.delete-btn:hover,
.btn-remove:hover {
  color: var(--on-ink);
  background: var(--error);
  border-color: var(--error);
}

.btn-warning,
.warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning-line);
}

.btn-small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.btn-wide {
  width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea,
.form-input,
.form-select,
.input-field,
.search-input,
.setup-form-input,
.comment-input,
.comm-input,
.modal-input,
.modal-textarea,
.page-jump-input,
.jump-input,
.num-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-soft);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

input[type="checkbox"],
input[type="radio"],
input[type="range"] {
  accent-color: var(--ink-soft);
}

label,
.input-label,
.modal-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.input-group,
.form-group,
.submission-field,
.report-form-group {
  display: grid;
  gap: 7px;
}

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

.form-row,
.inline-actions,
.action-row,
.action-bar,
.button-row,
.chip-row,
.scope-chips,
.setup-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hint,
.meta,
.muted,
.description,
.subtitle,
.header-desc,
.hero-desc,
.book-meta,
.question-meta,
.summary-note,
.loading-text {
  color: var(--muted);
  font-size: 13px;
}

.badge,
.badge-pill,
.tag,
.meta-tag,
.question-tag,
.q-tag,
.setup-pill,
.feature-pill,
.info-chip,
.scope-chip,
.status-pill,
.status-badge,
.report-summary-chip,
.report-inline-chip,
.wrongbook-modal-badge {
  min-height: 26px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .35px;
}

.badge.status-success,
.meta-tag.status-success,
.setup-pill.status-success,
.board-chip.status-success {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-line);
}

.badge.status-warning,
.meta-tag.status-warning,
.setup-pill.status-warning,
.board-chip.status-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning-line);
}

.badge.status-error,
.meta-tag.status-error,
.setup-pill.status-error,
.board-chip.status-error {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.badge.status-neutral,
.meta-tag.status-neutral,
.setup-pill.status-neutral,
.board-chip.status-neutral {
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-color: var(--line);
}

.q-score-badge.status-success {
  color: var(--success);
}

.q-score-badge.status-error {
  color: var(--error);
}

.alert,
.flash,
.error-box,
.error-msg,
.modal-status,
.submission-alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.success,
.alert.success,
.flash.success,
.modal-status.success,
.submission-alert.success,
.status-on,
.is-success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-line);
}

.error,
.alert.error,
.flash.error,
.error-box,
.error-msg,
.modal-status.error,
.submission-alert.error,
.status-off,
.is-error {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error-line);
}

/* Common page surfaces */

.page,
.container,
.library-shell,
.submission-shell,
.quiz-container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
  padding-top: 112px;
  padding-bottom: 88px;
}

.page-header,
.header-section {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto 28px;
  padding-top: 116px;
  display: grid;
  gap: 12px;
}

.page-header p,
.header-section p {
  max-width: 700px;
  color: var(--muted);
  font-size: 15px;
}

.page-header .action-bar {
  margin-top: 14px;
}

.card,
.hero-card,
.section,
.tool-card,
.question-card,
.q-item,
.filter-panel,
.config-card,
.book-card,
.stat-card,
.score-card,
.summary-card,
.result-hero,
.submission-panel,
.category-panel,
.library-toolbar,
.empty-state,
.notice-box,
.review-card,
.report-card,
.user-admin-card,
.question-preview-card,
.side-card,
.permission-pill,
.tile-link,
.board-question-card,
.board-summary-card,
.board-panel,
.comments-section,
.analysis-box,
.comments-box,
.comm-box,
.explain-card {
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.card:hover,
.tool-card:hover,
.question-card:hover,
.book-card:hover,
.review-card:hover,
.report-card:hover,
.user-admin-card:hover,
.tile-link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.section,
.tool-card,
.question-card,
.q-item,
.filter-panel,
.config-card,
.book-card,
.score-card,
.summary-card {
  padding: 24px;
}

.section {
  margin-bottom: 18px;
}

.section-header,
.section-head,
.panel-head,
.submission-panel-head,
.filter-panel-head {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-header h2,
.section-head h2,
.submission-panel-head h2,
.filter-panel-head h2 {
  font-size: 28px;
}

.section-header p,
.section-head p,
.submission-panel-head p,
.filter-panel-head p {
  max-width: 720px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.section-grid,
.content-grid,
.stats-grid,
.book-grid,
.subject-grid {
  display: grid;
  gap: 16px;
}

.section-grid,
.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.book-grid,
.subject-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.empty-state {
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--body);
}

.table-wrap,
.resource-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--ink-soft);
  background: var(--canvas-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--canvas-soft);
}

.pagination,
.pagination-group,
.page-links,
.resource-admin-pagination {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-link {
  min-width: 40px;
  padding-inline: 11px;
}

.page-link.active,
.page-link.is-active {
  color: var(--on-ink);
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

/* Homepage */

.page-home {
  background: var(--canvas);
}

.home-page {
  padding-top: 64px;
}

.home-hero {
  padding: 92px 0 44px;
  border-bottom: 1px solid var(--line);
}

.home-hero-grid {
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  align-items: center;
  gap: 72px;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
}

.home-hero-copy h1 {
  max-width: 720px;
  margin: 18px 0 22px;
}

.home-hero-copy > p {
  max-width: 590px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.75;
}

.home-hero-copy .button-row {
  margin-top: 30px;
}

.home-atmosphere {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.atmosphere-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(14px);
  opacity: .82;
}

.atmosphere-mint {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -40px;
  background: radial-gradient(circle, var(--mint), transparent 68%);
}

.atmosphere-peach {
  width: 300px;
  height: 300px;
  top: 40px;
  right: -100px;
  background: radial-gradient(circle, var(--peach), transparent 68%);
}

.atmosphere-lavender {
  width: 300px;
  height: 300px;
  left: 80px;
  bottom: -130px;
  background: radial-gradient(circle, var(--lavender), transparent 68%);
}

.atmosphere-note {
  position: absolute;
  z-index: 1;
  left: 34px;
  bottom: 32px;
  max-width: 255px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
}

.atmosphere-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}

.atmosphere-note strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 300;
  line-height: 1.25;
}

.home-metrics {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.home-metrics > div {
  padding: 22px 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
  border-right: 1px solid var(--line);
}

.home-metrics > div:last-child {
  border-right: 0;
  padding-left: 22px;
}

.home-metrics > div:nth-child(2) {
  padding-left: 22px;
}

.home-metrics strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 31px;
  font-weight: 300;
}

.home-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.home-section {
  padding: 92px 0;
  border-bottom: 1px solid var(--line);
}

.home-section-soft {
  background: rgba(250, 250, 248, .74);
}

.section-heading {
  margin-bottom: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
  align-items: end;
  gap: 48px;
}

.section-heading h2 {
  margin-top: 13px;
}

.section-heading > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.exam-feature {
  position: relative;
  min-height: 315px;
  padding: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr);
  align-items: center;
  gap: 44px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.exam-feature::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -170px;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(168, 200, 232, .8), transparent 38%),
    radial-gradient(circle at 62% 62%, rgba(232, 184, 196, .62), transparent 42%);
  filter: blur(18px);
}

.exam-feature-copy,
.exam-feature-score {
  position: relative;
  z-index: 1;
}

.exam-feature-copy h3 {
  max-width: 600px;
  margin: 18px 0 13px;
  font-size: clamp(30px, 3.5vw, 42px);
}

.exam-feature-copy p {
  max-width: 620px;
  color: var(--muted);
}

.exam-feature-copy .chip-row {
  margin-top: 22px;
}

.exam-feature-score {
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.exam-feature-score > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.exam-feature-score > strong {
  display: block;
  margin: 7px 0 22px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 62px;
  font-weight: 300;
  line-height: 1;
}

.practice-layout {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 20px;
}

.practice-summary {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.practice-summary > div {
  padding: 0 0 19px;
  margin-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.practice-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.practice-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 300;
}

.text-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

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

.subject-preview-card {
  min-height: 225px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.subject-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.subject-index {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 600;
}

.subject-preview-card h3 {
  margin: 14px 0 9px;
}

.subject-preview-card p {
  color: var(--muted);
  font-size: 13px;
}

.subject-preview-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.subject-preview-footer a {
  color: var(--ink);
  font-weight: 500;
}

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

.resource-column {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.column-heading {
  margin-bottom: 17px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.column-heading h3 {
  margin-top: 6px;
}

.column-heading > a {
  color: var(--muted);
  font-size: 12px;
}

.editorial-list {
  border-top: 1px solid var(--line);
}

.editorial-list-row {
  min-height: 68px;
  padding-block: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}

.editorial-list-row:hover strong {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.list-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
}

.editorial-list-row > span:nth-child(2) {
  min-width: 0;
}

.editorial-list-row strong,
.editorial-list-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editorial-list-row strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.editorial-list-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.editorial-list-row i {
  color: var(--muted-soft);
  font-style: normal;
}

.empty-inline {
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
}

.notice-layout {
  display: grid;
  grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr);
  gap: 70px;
}

.notice-layout h2 {
  margin-top: 12px;
}

.notice-content {
  min-height: 150px;
  padding: 26px;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.markdown-body > * + * {
  margin-top: 10px;
}

.markdown-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  padding: 84px 0 46px;
}

.footer-grid {
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  align-items: end;
  gap: 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.footer-grid h2 {
  margin-top: 13px;
}

.footer-grid p {
  color: var(--muted);
}

.footer-grid .button-row {
  margin-top: 22px;
}

/* Authentication */

.page-auth {
  min-height: 100vh;
  padding: 48px 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 25%, rgba(167, 229, 211, .38), transparent 20rem),
    radial-gradient(circle at 74% 72%, rgba(200, 184, 224, .36), transparent 22rem),
    var(--canvas);
}

.login-card,
.register-card {
  width: min(430px, 100%);
  padding: 36px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-large);
}

.logo-area,
.logo-box {
  margin-bottom: 26px;
  text-align: center;
}

.logo-area img,
.logo-box img {
  width: auto;
  height: 30px;
  margin: 0 auto 18px;
}

.login-card .title,
.register-card h1 {
  font-size: 35px;
}

.login-card .subtitle,
.register-card .subtitle {
  margin-top: 7px;
  color: var(--muted);
}

.login-card form,
.register-card form {
  display: grid;
  gap: 16px;
}

.login-card .btn-primary,
.register-card .btn-submit,
.login-card .btn-sso {
  width: 100%;
}

.divider {
  margin: 26px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-soft);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.divider span {
  background: transparent;
}

.sso-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 22px;
  object-fit: contain;
}

.btn-sso.disabled {
  color: var(--muted-soft);
  background: var(--canvas-soft);
  border-color: var(--line);
}

.footer-link,
.footer-links,
.login-link {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-link a,
.footer-links a,
.login-link a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

/* Quiz library */

.quiz-library-toolbar {
  width: min(100%, 980px);
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

.quiz-library-search {
  min-width: 0;
  min-height: 58px;
  padding: 5px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(24, 21, 19, .035);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.quiz-library-search:focus-within {
  background: var(--surface);
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(36, 31, 28, .07), 0 8px 22px rgba(24, 21, 19, .045);
}

.quiz-library-search-icon {
  width: 32px;
  height: 32px;
  margin-left: 2px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--canvas-soft);
  border-radius: 10px;
}

.quiz-library-search-icon::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.quiz-library-search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  margin: 12px 0 0 11px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.quiz-library-search .search-input {
  min-width: 0;
  min-height: 42px;
  padding: 8px 7px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  font-size: 15px;
}

.quiz-library-search .search-input:focus {
  border: 0;
  box-shadow: none;
}

.quiz-library-search .search-input::placeholder {
  color: var(--muted-soft);
}

.quiz-library-search .search-input::-webkit-search-cancel-button {
  appearance: none;
}

.quiz-library-search-clear {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.quiz-library-search-clear:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.quiz-library-search-clear[hidden] {
  display: none;
}

.quiz-library-search button.quiz-library-search-submit {
  min-height: 42px;
  padding: 8px 15px;
  color: var(--ink-soft);
  background: var(--canvas-soft);
  border: 0;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}

.quiz-library-search button.quiz-library-search-submit:hover {
  color: var(--on-ink);
  background: var(--ink-soft);
}

.quiz-library-search-clear:focus-visible,
.quiz-library-search button.quiz-library-search-submit:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.quiz-library-toolbar .exam-btn {
  min-height: 58px;
  padding-inline: 22px;
  border-radius: 16px;
}

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

.category-group {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.category-title {
  min-height: 64px;
  padding: 10px 14px;
  padding-left: calc(14px + var(--level, 0) * 16px);
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.category-title::-webkit-details-marker {
  display: none;
}

.category-title:hover {
  background: var(--canvas-soft);
}

.category-disclosure {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.category-disclosure::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-1px) rotate(-45deg);
  transition: transform var(--ease);
}

.category-group[open] > .category-title .category-disclosure::before {
  transform: translateY(-1px) rotate(45deg);
}

.category-name {
  font-size: 14px;
  font-weight: 600;
}

.category-count {
  color: var(--muted);
  font-size: 12px;
}

.category-expand-label {
  padding: 6px 9px;
  color: var(--muted);
  background: var(--canvas-soft);
  border-radius: var(--pill);
  font-size: 11px;
}

.category-expand-close,
.category-group[open] > .category-title .category-expand-open {
  display: none;
}

.category-group[open] > .category-title .category-expand-close {
  display: inline;
}

.category-icon,
.icon-box,
.setup-header-icon,
.setup-mode-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  border-radius: 50%;
}

.category-desc {
  padding: 0 18px 14px;
  padding-left: calc(62px + var(--level, 0) * 16px);
  color: var(--muted);
  font-size: 12px;
}

.category-body {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--canvas-soft);
}

.subject-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subject-card {
  min-height: 220px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.subject-card.is-clickable {
  cursor: pointer;
}

.subject-card.is-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.card-top,
.q-header,
.question-top,
.user-admin-head,
.report-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.subject-card .fav-btn {
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--muted-soft);
  border-radius: 50%;
}

.subject-card .fav-btn.active {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.subject-card .card-title {
  margin-top: 16px;
  font-size: 24px;
}

.card-desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.progress-area {
  margin-top: auto;
  padding-top: 18px;
}

.progress-labels,
.card-footer,
.stats-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-labels,
.stat-item {
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: var(--pill);
}

.progress-fill {
  height: 100%;
  background: var(--ink-soft);
  border-radius: inherit;
}

.card-footer {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--muted-soft);
}

.dot-success {
  background: var(--success);
}

.dot-error {
  background: var(--error);
}

.setup-modal-overlay,
.modal-overlay,
.report-modal-overlay,
.wrongbook-modal-overlay {
  position: fixed;
  z-index: 5000;
  inset: 0;
  padding: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 9, .38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.setup-modal-overlay.show,
.modal-overlay.show,
.report-modal-overlay.open,
.wrongbook-modal-overlay.show {
  display: flex;
}

.setup-modal,
.modal-card,
.modal,
.report-modal,
.wrongbook-modal {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  padding: 26px;
  overflow: auto;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-large);
}

.setup-modal-head,
.modal-head,
.report-modal-head,
.wrongbook-modal-head {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.setup-modal-close,
.modal-close,
.report-close,
.wrongbook-modal-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
}

.setup-modal-close:hover,
.modal-close:hover,
.report-close:hover,
.wrongbook-modal-close:hover {
  background: var(--surface-subtle);
  border-color: var(--ink);
}

.modal-open {
  overflow: hidden;
}

.setup-modal {
  width: min(880px, 100%);
  max-height: min(90vh, 780px);
  padding: 0;
  overflow: auto;
  border-radius: 20px;
}

.setup-sheet-head {
  padding: 24px 26px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.setup-subject-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.setup-header-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 20px;
}

.setup-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.setup-header-title {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-header-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.setup-stat-strip {
  padding-inline: 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--canvas-soft);
  border-block: 1px solid var(--line);
}

.setup-stat-strip > div {
  padding: 15px 16px;
  border-right: 1px solid var(--line);
}

.setup-stat-strip > div:first-child {
  padding-left: 0;
}

.setup-stat-strip > div:last-child {
  border-right: 0;
}

.setup-stat-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.setup-stat-strip strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.1;
}

.setup-mode-list {
  padding: 18px 26px;
  display: grid;
  gap: 9px;
}

.setup-mode-card {
  min-height: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color var(--ease), background var(--ease);
}

.setup-mode-card:hover {
  background: var(--canvas-soft);
  border-color: var(--line-strong);
}

.setup-mode-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-subtle);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.setup-mode-copy {
  min-width: 0;
}

.setup-mode-heading,
.setup-mode-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.setup-mode-title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
}

.setup-mode-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.setup-mode-actions {
  justify-content: flex-end;
}

.setup-mode-actions .setup-action-btn {
  min-width: 104px;
}

.setup-random-actions {
  flex-wrap: nowrap;
}

.setup-form-input {
  width: 138px;
  min-height: 40px;
}

.setup-sheet-foot {
  padding: 13px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.setup-back-link {
  min-height: 34px;
  padding: 6px 12px;
}

/* Resource library */

.library-shell {
  width: min(1240px, calc(100% - 48px));
}

.library-hero,
.submission-header,
.result-hero,
.page-software .hero,
.page-wrongbook .hero {
  position: relative;
  margin-bottom: 24px;
  padding: 38px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}

.library-hero::after,
.submission-header::after,
.result-hero::after,
.page-software .hero::after,
.page-wrongbook .hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -90px;
  top: -150px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, rgba(167, 229, 211, .72), transparent 38%),
    radial-gradient(circle at 65% 64%, rgba(244, 197, 168, .62), transparent 44%);
  filter: blur(20px);
}

.library-hero > *,
.submission-header > *,
.result-hero > *,
.page-software .hero > *,
.page-wrongbook .hero > * {
  position: relative;
  z-index: 1;
}

.library-hero h1,
.submission-header h1 {
  margin-top: 14px;
}

.library-hero p,
.submission-header p {
  max-width: 680px;
  margin-top: 15px;
  color: var(--muted);
}

.library-hero-actions {
  display: flex;
  gap: 9px;
}

.library-stats {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.library-stat {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.library-stat:last-child {
  border-right: 0;
}

.library-stat strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 300;
}

.library-stat span {
  color: var(--muted);
  font-size: 11px;
}

.library-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.category-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  padding: 17px;
  overflow: auto;
}

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

.category-panel-head h2 {
  font-size: 20px;
}

.category-panel-head span {
  color: var(--muted);
  font-size: 11px;
}

.category-level {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-level .category-level {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.category-link,
.category-all {
  min-height: 40px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--body);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.category-link:hover,
.category-link.is-active,
.category-all:hover,
.category-all.is-active {
  color: var(--ink);
  background: var(--surface-subtle);
}

.category-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.category-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-main {
  min-width: 0;
}

.library-toolbar {
  margin-bottom: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.library-search {
  position: relative;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.library-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.library-search-icon {
  position: relative;
  z-index: 0;
  justify-self: center;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.library-search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: var(--muted);
  border-radius: 999px;
  transform: rotate(45deg);
  transform-origin: center;
}

.library-search input[type="search"] {
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px 8px 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.library-search input[type="search"]:focus {
  border: 0;
  box-shadow: none;
}

.library-search input[type="search"]::-webkit-search-decoration,
.library-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.library-search input[type="search"]::-ms-clear,
.library-search input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.library-search button {
  position: static;
  align-self: stretch;
  margin: 3px;
  min-height: 36px;
}

.library-context {
  min-width: 125px;
  padding: 6px 10px;
  display: grid;
  align-content: center;
  text-align: right;
}

.library-context strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.library-context span {
  color: var(--muted);
  font-size: 10px;
}

.resource-grid {
  display: grid;
  gap: 9px;
}

.resource-card {
  min-width: 0;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.resource-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.resource-type {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 600;
}

.resource-card-body,
.resource-card-heading {
  min-width: 0;
}

.resource-card-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.resource-card h3 {
  flex: 1;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-eyebrow,
.resource-description,
.resource-meta {
  color: var(--muted);
  font-size: 10px;
}

.resource-eyebrow {
  max-width: 45%;
  display: flex;
  gap: 6px;
}

.resource-description {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.resource-actions,
.resource-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.resource-reaction,
.resource-download {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 500;
}

.resource-reaction {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.resource-reaction:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.resource-like.is-active {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-line);
}

.resource-dislike.is-active {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.resource-download {
  color: var(--on-ink);
  background: var(--ink-soft);
}

.resource-empty {
  padding: 55px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

/* Upload */

.submission-shell {
  width: min(1080px, calc(100% - 48px));
}

.submission-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: end;
  gap: 35px;
}

.review-flow {
  padding: 16px;
  display: grid;
  gap: 10px;
  background: rgba(250, 250, 248, .78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.review-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
}

.review-step > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface-subtle);
  border-radius: 50%;
  font-size: 10px;
}

.review-step strong,
.review-step small {
  display: block;
}

.review-step strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.review-step small {
  color: var(--muted);
  font-size: 10px;
}

.submission-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: start;
  gap: 20px;
}

.submission-panel {
  overflow: hidden;
}

.submission-panel-head {
  margin: 0;
  padding: 19px 22px;
  background: var(--canvas-soft);
  border-bottom: 1px solid var(--line);
}

.submission-form {
  padding: 22px;
  display: grid;
  gap: 17px;
}

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

.submission-field.is-wide {
  grid-column: 1 / -1;
}

.submission-form-note,
.submission-review-note {
  padding: 11px 12px;
  color: var(--muted);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.submission-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submission-actions a {
  color: var(--muted);
  font-size: 12px;
}

.submission-history {
  position: sticky;
  top: 84px;
}

.submission-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.submission-item {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.submission-item:last-child {
  border-bottom: 0;
}

.submission-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.submission-item h3 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}

.submission-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.submission-empty {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
}

/* Profile and wrongbooks */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 18px;
}

.hero-card {
  padding: 30px;
}

.hero-card p {
  margin-top: 10px;
  color: var(--muted);
}

.hero-tags,
.book-tags,
.hero-badges {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.stats-grid {
  margin: 18px 0;
}

.stat-card {
  min-height: 110px;
}

.stat-card strong,
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.stat-card span,
.stat-value {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 31px;
  font-weight: 300;
  line-height: 1.1;
}

.stack,
.meta-list,
.subject-list,
.list-stack {
  display: grid;
  gap: 13px;
}

.meta-row {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.meta-row strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.meta-row span {
  color: var(--ink-soft);
  font-size: 13px;
  text-align: right;
}

.subject-list {
  grid-template-columns: 1fr;
}

.subject-list .subject-card {
  min-height: 0;
}

.subject-top,
.subject-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.subject-foot {
  margin-top: 16px;
  padding-top: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.subject-name {
  font-size: 22px;
}

.subject-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.page-software .hero,
.page-wrongbook .hero {
  margin-bottom: 18px;
}

.page-software .hero-card,
.page-software .stat-card {
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
}

.page-software .section {
  padding: 26px;
}

.search-form {
  position: relative;
  width: min(540px, 100%);
}

.book-card {
  min-height: 240px;
  display: flex;
  flex-direction: column;
}

.book-card h3 {
  font-size: 24px;
}

.book-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.book-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.book-actions,
.hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-status:empty,
.inline-status:empty {
  display: none;
}

.quota-line {
  color: var(--muted);
  font-size: 12px;
}

.page-wrongbook .hero {
  display: block;
}

.question-card {
  margin-bottom: 14px;
}

.question-body,
.q-body,
.q-content,
.board-question-content {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.question-meta {
  margin-top: 9px;
}

.question-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.option-list,
.options-list,
.q-options,
.opt-list,
.board-options {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.option-item,
.opt-row,
.opt-item,
.board-option {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font: inherit;
  text-align: left;
}

.option-item:hover,
.opt-row:hover,
.board-option:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.option-item:disabled,
.board-option:disabled {
  cursor: default;
  opacity: 1;
}

.analysis-box,
.comments-box,
.comm-box,
.q-analysis,
.explain-card {
  display: none;
  margin-top: 14px;
  padding: 18px;
  background: var(--canvas-soft);
}

.comment-input-row,
.comm-input-wrapper,
.comm-input-box,
.board-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.comment-item,
.comm-item,
.board-comment-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.comment-item:last-child,
.comm-item:last-child,
.board-comment-item:last-child {
  border-bottom: 0;
}

.comment-meta,
.comm-user,
.c-meta,
.board-comment-head {
  color: var(--muted);
  font-size: 11px;
}

.comment-content,
.comm-text,
.c-content,
.board-comment-text {
  margin-top: 4px;
  color: var(--ink-soft);
}

.comment-empty,
.empty-comm,
.board-comment-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

/* Filters, favorites and exam setup */

.filter-panel {
  margin-bottom: 18px;
}

.scope-picker {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.scope-picker-head {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.scope-picker-head h2,
.scope-picker-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.15px;
}

.scope-picker-head p {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.scope-search {
  position: relative;
  min-height: 42px;
  padding: 4px 5px 4px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  font-size: 11px;
}

.scope-search::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.scope-search::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  margin: 12px 0 0 10px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.scope-search > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.scope-search input[type="search"] {
  min-height: 32px;
  padding: 4px 10px 4px 2px;
  background: transparent;
  border: 0;
  border-radius: var(--pill);
  box-shadow: none;
}

.scope-picker-toolbar {
  min-height: 46px;
  padding: 7px 12px 7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--canvas-soft);
  border-bottom: 1px solid var(--line);
}

.scope-selection-count {
  color: var(--muted);
  font-size: 12px;
}

.scope-selection-count strong {
  color: var(--ink);
  font-weight: 700;
}

.scope-tree-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.scope-tree-actions button {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--pill);
  font-size: 11px;
  cursor: pointer;
}

.scope-tree-actions button:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.filter-tree {
  max-height: 420px;
  padding: 8px;
  overflow: auto;
  overscroll-behavior: contain;
}

.scope-item[hidden] {
  display: none !important;
}

.scope-branch:not(.is-open) > .scope-children {
  display: none;
}

.scope-category-row {
  margin-left: calc(var(--scope-level, 0) * 16px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}

.scope-category-row:hover,
.scope-item.is-selected > .scope-category-row {
  background: var(--canvas-soft);
}

.scope-expand-button {
  min-width: 0;
  min-height: 62px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.scope-disclosure {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.scope-disclosure::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-1px) rotate(-45deg);
  transition: transform var(--ease);
}

.scope-branch.is-open > .scope-category-row .scope-disclosure::before {
  transform: translateY(-1px) rotate(45deg);
}

.scope-node-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  border-radius: 10px;
  font-size: 15px;
}

.scope-node-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.scope-node-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-node-copy small,
.scope-node-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.scope-expand-label {
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  border-radius: var(--pill);
}

.scope-expand-button:hover .scope-expand-label {
  color: var(--ink);
  background: var(--surface);
}

.scope-category-select {
  min-height: 36px;
  margin-right: 10px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  cursor: pointer;
  font-size: 11px;
}

.scope-category-select input,
.scope-bank-option > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scope-category-select:has(input:disabled) {
  opacity: .45;
  cursor: not-allowed;
}

.scope-checkbox {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}

.scope-checkbox::after {
  content: "";
  width: 7px;
  height: 4px;
  margin-top: -2px;
  border-left: 1.5px solid var(--on-ink);
  border-bottom: 1.5px solid var(--on-ink);
  opacity: 0;
  transform: rotate(-45deg) scale(.7);
  transition: opacity var(--ease), transform var(--ease);
}

.scope-category-select input:checked + .scope-checkbox,
.scope-bank-option > input:checked + .scope-checkbox {
  background: var(--ink);
  border-color: var(--ink);
}

.scope-category-select input:checked + .scope-checkbox::after,
.scope-bank-option > input:checked + .scope-checkbox::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.scope-category-select:focus-within,
.scope-bank-option:focus-within,
.scope-expand-button:focus-visible,
.scope-tree-actions button:focus-visible,
.scope-chip-remove:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.scope-bank-option {
  min-height: 58px;
  margin-left: calc(var(--scope-level, 0) * 16px);
  padding: 7px 12px 7px 18px;
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--ease);
}

.scope-bank-option:hover,
.scope-bank-option.is-selected {
  background: var(--canvas-soft);
}

.scope-bank-option.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.scope-selection {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  background: var(--canvas-soft);
  border-top: 1px solid var(--line);
}

.scope-selection[hidden] {
  display: none;
}

.scope-selection > span {
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.scope-selection .scope-chips {
  margin: 0;
  gap: 6px;
}

.scope-chip-remove {
  cursor: pointer;
}

.scope-chip-remove span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.filter-empty {
  margin: 0;
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.filter-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-favorites .q-item {
  margin-bottom: 14px;
}

.q-header {
  margin-bottom: 14px;
}

.q-analysis,
.comments-box {
  display: none;
}

.ans-label {
  color: var(--success);
  font-weight: 600;
}

.exp-text {
  margin-top: 8px;
  color: var(--body);
}

.page-jump-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.page-jump-input {
  width: 72px;
}

.page-exam-setup .container,
.page-exam-result .container {
  width: min(1040px, calc(100% - 48px));
}

.page-exam-setup .header-section {
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.page-exam-setup .scope-picker {
  margin-top: 18px;
}

.config-list {
  display: grid;
  gap: 10px;
}

.config-row,
.range-row,
.time-setting {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.config-name {
  min-width: 150px;
  color: var(--ink-soft);
  font-weight: 500;
}

.range-input,
.num-input {
  width: 100px;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

/* Practice page */

.page-quiz-play {
  padding-top: 64px;
  background: var(--canvas);
}

.page-quiz-play > .navbar {
  position: fixed;
  z-index: 3000;
  inset: 0 0 auto;
  min-height: 64px;
  padding-inline: max(24px, calc((100vw - 980px) / 2));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: rgba(245, 245, 243, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-center {
  min-width: 0;
  text-align: center;
}

.page-title {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.jump-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jump-input {
  width: 58px;
  min-height: 36px;
}

.quiz-container {
  width: min(920px, calc(100% - 48px));
  padding-top: 28px;
}

.card-box,
.board-question-card,
.board-summary-card,
.board-panel,
.comments-section {
  margin-bottom: 14px;
  padding: 24px;
}

.q-meta,
.board-card-top,
.board-card-meta,
.board-card-actions,
.board-tools,
.board-summary-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.q-head-actions,
.board-card-actions {
  margin-left: auto;
}

.q-content,
.board-question-content {
  margin-top: 18px;
}

.q-type-badge,
.opt-label,
.board-option-label,
.board-chip {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}

.option-item,
.board-option {
  cursor: pointer;
}

.option-item.selected,
.board-option.selected {
  background: var(--surface-subtle);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.option-item.selected .opt-label,
.board-option.selected .board-option-label {
  color: var(--on-ink);
  background: var(--ink-soft);
}

.option-item.correct,
.board-option.correct,
.msg-correct,
.board-result.correct {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-line);
}

.option-item.wrong,
.board-option.wrong,
.msg-wrong,
.board-result.wrong {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.result-msg,
.btn-next {
  display: none;
}

.result-msg,
.board-result {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.explain-title,
.board-panel-title {
  color: var(--ink-soft);
  font-weight: 600;
}

.explain-text,
.board-explanation-body {
  margin-top: 8px;
}

.comm-header,
.board-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal {
  width: min(560px, 100%);
}

.layout-modal-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.layout-choice {
  padding: 17px;
  color: var(--body);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}

.layout-choice:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.layout-choice strong {
  display: block;
  color: var(--ink-soft);
}

.layout-choice p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.modal-btn-group {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.practice-board {
  display: grid;
  gap: 14px;
}

.board-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
}

.board-summary-title {
  color: var(--ink);
  font-family: var(--display);
  font-size: 30px;
}

.board-summary-sub,
.board-panel-hint {
  color: var(--muted);
  font-size: 12px;
}

.board-side-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.board-panel.open {
  display: block;
}

.board-panel:not(.open) .board-explanation-body,
.board-panel:not(.open) .board-comments-list,
.board-panel:not(.open) .board-comment-form {
  display: none;
}

.board-batch-submit-wrap {
  display: flex;
  justify-content: center;
}

.board-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.score-board {
  padding: 40px;
  text-align: center;
}

.score-circle {
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  border-radius: 50%;
}

.score-val {
  color: var(--ink);
  font-family: var(--display);
  font-size: 46px;
}

.score-detail {
  margin-top: 12px;
  color: var(--muted);
}

/* Profile metrics */

.page-profile .stat-card {
  min-height: 148px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-profile .stat-card span {
  margin-top: 20px;
  font-variant-numeric: tabular-nums;
}

/* Exam result */

.page-exam-result .result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.hero-user {
  color: var(--muted);
}

.page-exam-result .hero-head,
.page-exam-result .score-layout,
.page-exam-result .summary-card,
.page-exam-result .summary-item {
  min-width: 0;
}

.page-exam-result .score-layout {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: stretch;
}

.page-exam-result .score-card {
  text-align: center;
}

.score-label,
.score-max,
.score-meta {
  color: var(--muted);
  font-size: 12px;
}

.score-card .score-val {
  display: block;
  margin: 12px 0 4px;
  font-size: 64px;
}

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

.summary-item {
  padding: 13px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.summary-label {
  color: var(--muted);
  font-size: 11px;
}

.summary-value {
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 27px;
}

.review-list {
  margin-top: 18px;
  display: grid;
  gap: 13px;
}

.q-score-badge {
  color: var(--ink-soft);
  font-weight: 600;
}

.user-right,
.val-r {
  color: var(--success);
}

.user-wrong,
.val-u {
  color: var(--error);
}

/* Admin */

.page-admin {
  background: var(--canvas);
}

.admin-shell {
  width: min(1440px, calc(100% - 40px));
  margin-inline: auto;
  padding: 22px 0 60px;
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.sidebar {
  position: sticky;
  top: 22px;
  min-height: calc(100vh - 44px);
  padding: 17px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.brand {
  padding: 4px 3px 17px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--on-ink);
  background: var(--ink-soft);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 19px;
}

.brand-title {
  font-size: 20px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 10px;
}

.nav-list {
  margin-top: 14px;
  display: grid;
  gap: 3px;
}

.nav-item {
  min-height: 40px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  color: var(--body);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: var(--surface-subtle);
}

.nav-item.active {
  font-weight: 600;
}

.nav-footer {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.main {
  min-width: 0;
}

.topbar {
  margin-bottom: 18px;
  padding: 15px 3px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin-top: 8px;
  font-size: clamp(36px, 4.5vw, 52px);
}

.topbar p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
}

.quick-status {
  flex: 0 0 240px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.impersonation-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-md);
}

.page-admin .stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 18px;
}

.page-admin .stat-card {
  min-height: 92px;
  padding: 15px;
}

.page-admin .section {
  padding: 23px;
}

.page-admin .section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  padding: 18px;
}

.tool-card-wide {
  grid-column: 1 / -1;
}

.operations-section {
  overflow: hidden;
}

.operations-section-header {
  align-items: flex-end;
}

.operations-status-grid,
.operations-detail-grid,
.operations-control-grid {
  display: grid;
  gap: 12px;
}

.operations-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operations-status-card {
  width: 100%;
  min-height: 158px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.operations-status-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(28, 24, 20, .06);
}

.operations-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.operations-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--status-neutral);
}

.operations-status-card strong {
  margin-top: auto;
  color: var(--ink);
  font-family: var(--display);
  font-size: 27px;
  font-weight: 300;
}

.operations-status-card p {
  min-height: 33px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.operations-card-action {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.operations-status-card:hover .operations-card-action {
  color: var(--ink);
}

.operations-status-card.is-ok {
  background: var(--surface);
  border-color: var(--success-line);
}

.operations-status-card.is-ok .operations-dot {
  background: var(--success);
}

.operations-status-card.is-alert {
  background: var(--error-bg);
  border-color: var(--error-line);
}

.operations-status-card.is-alert .operations-dot {
  background: var(--error);
}

.operations-status-card.is-muted .operations-dot {
  background: var(--status-neutral);
}

.operations-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operations-detail-card {
  min-width: 0;
}

.operations-detail-heading {
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.operations-detail-heading h3,
.operations-control-card h3 {
  color: var(--ink);
  font-size: 17px;
}

.operations-detail-list {
  margin: 0;
  display: grid;
}

.operations-detail-list > div {
  min-width: 0;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(76px, .65fr) minmax(0, 1.35fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.operations-detail-list > div:last-child {
  border-bottom: 0;
}

.operations-detail-list dt {
  color: var(--muted);
  font-size: 11px;
}

.operations-detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.operations-control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operations-control-card {
  min-height: 285px;
  display: flex;
  flex-direction: column;
}

.operations-control-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 18px;
}

.operations-control-card h3 {
  margin-top: 15px;
}

.operations-control-card p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.operations-control-card form,
.operations-control-card .btn-wide {
  margin-top: auto;
}

.operations-control-critical {
  background: var(--error-bg);
  border-color: var(--error-line);
}

.operations-dialog {
  width: min(650px, calc(100% - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 70px rgba(28, 24, 20, .22);
}

.operations-dialog::backdrop {
  background: rgba(28, 24, 20, .38);
  backdrop-filter: blur(3px);
}

.operations-dialog-shell {
  padding: 25px;
}

.operations-dialog-header {
  padding-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.operations-dialog-header h2 {
  margin-top: 7px;
  color: var(--ink);
  font-size: 31px;
}

.operations-dialog-close {
  min-height: 34px;
  padding: 7px 12px;
  flex: 0 0 auto;
}

.operations-dialog-list {
  margin-top: 8px;
}

.operations-dialog-list code {
  padding: 2px 5px;
  color: var(--ink-soft);
  background: var(--canvas-soft);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
}

.operations-dialog-note {
  margin-top: 16px;
  padding: 14px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.operations-dialog-note strong {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
}

.operations-dialog-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.operations-dialog-note .operations-dialog-steps {
  padding-top: 9px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.operations-dialog-note.is-ok {
  background: var(--success-bg);
  border-color: var(--success-line);
}

.operations-dialog-note.is-alert {
  background: var(--error-bg);
  border-color: var(--error-line);
}

.tile-link {
  min-height: 120px;
  padding: 20px;
  display: block;
}

.tile-link h3 {
  font-size: 23px;
}

.tile-link p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.resource-admin-metrics {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.resource-admin-metric {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.resource-admin-metric strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 300;
}

.resource-admin-metric span {
  color: var(--muted);
  font-size: 11px;
}

.review-list,
.category-admin-list,
.user-admin-list,
.report-list {
  display: grid;
  gap: 10px;
}

.review-card,
.category-admin-row,
.user-admin-card,
.report-card {
  padding: 17px;
}

.category-admin-row {
  margin-left: calc(var(--depth, 0) * 12px);
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(140px, .8fr) minmax(180px, 1fr) 90px 80px auto;
  align-items: end;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.category-meta,
.review-meta,
.report-card-meta,
.report-preview-meta {
  color: var(--muted);
  font-size: 10px;
}

.resource-filter-bar,
.resource-bulk-bar,
.resource-row-edit-form,
.category-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.resource-filter-keyword,
.resource-bulk-note {
  grid-column: span 2;
}

.resource-filter-actions,
.resource-row-actions,
.review-actions,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-data-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.resource-bulk-bar {
  margin: 12px 0;
  padding: 13px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.danger-card {
  background: var(--error-bg);
  border-color: var(--error-line);
}

.report-summary-row,
.report-filter-row {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-filter-chip {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill);
}

.report-filter-chip.active {
  color: var(--on-ink);
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  gap: 14px;
}

.report-workspace {
  min-width: 0;
}

.report-card-title,
.user-admin-title h3 {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.report-description {
  margin-top: 9px;
  color: var(--body);
  font-size: 12px;
}

.question-preview-card {
  padding: 17px;
}

.question-preview-content {
  color: var(--ink-soft);
}

.question-preview-options {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.question-preview-answer {
  margin-top: 12px;
  padding: 10px;
  color: var(--success);
  background: var(--success-bg);
  border-radius: var(--radius-sm);
}

.question-preview-explanation {
  margin-top: 10px;
  color: var(--muted);
}

.report-editor-grid,
.user-meta-grid,
.user-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-editor-wide {
  grid-column: 1 / -1;
}

.user-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
}

.user-meta-item,
.user-stat-item {
  padding: 10px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.user-meta-item strong,
.user-stat-item strong {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.user-meta-item div,
.user-stat-item div {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.permissions-panel {
  padding: 13px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.permission-pill {
  padding: 8px 10px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Shared widgets */

.report-modal,
.wrongbook-modal {
  width: min(560px, 100%);
}

.report-modal-head h3,
.wrongbook-modal-head h3,
.wrongbook-modal-item-title {
  color: var(--ink);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 300;
}

.report-modal-head p,
.wrongbook-modal-head p,
.wrongbook-modal-item-desc,
.wrongbook-modal-item-meta,
.report-feedback {
  color: var(--muted);
  font-size: 12px;
}

.report-inline-meta,
.wrongbook-modal-meta,
.report-actions,
.wrongbook-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-inline-meta {
  margin-bottom: 14px;
}

.report-actions,
.wrongbook-modal-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.report-btn,
.wrongbook-modal-item-btn,
.wrongbook-modal-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-weight: 500;
}

.report-btn.primary,
.wrongbook-modal-item-btn {
  color: var(--on-ink);
  background: var(--ink-soft);
  border: 1px solid var(--ink-soft);
}

.report-btn.secondary,
.wrongbook-modal-link {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.report-feedback {
  min-height: 20px;
  margin-top: 8px;
}

.wrongbook-modal-list {
  display: none;
  gap: 9px;
}

.wrongbook-modal-item {
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.wrongbook-modal-status {
  padding: 16px;
  color: var(--muted);
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

/* Semantic layout helpers used by server-rendered views */

.compact,
.form-group.compact,
.hint.compact {
  margin: 0;
}

.form-block {
  margin-bottom: 18px;
}

.form-block-top,
.nav-return,
.spaced-note,
.quick-status-note {
  margin-top: 12px;
}

.full-row {
  width: 100%;
  grid-column: 1 / -1;
}

.form-group-grow {
  flex: 1 1 240px;
  margin-bottom: 0;
}

.field-medium {
  width: min(220px, 100%);
}

.stack-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row-nowrap {
  flex-wrap: nowrap;
}

.row-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.actions-end {
  margin-top: 0;
  justify-content: flex-end;
}

.pagination-row {
  margin-top: 14px;
  justify-content: space-between;
}

.filter-form {
  margin-bottom: 16px;
}

.table-spaced {
  width: 100%;
  margin-top: 8px;
}

.select-compact {
  width: 88px;
}

.details-full {
  width: 100%;
}

.details-trigger {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
}

.details-trigger::-webkit-details-marker {
  display: none;
}

.inline-check {
  padding-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.compact-check {
  padding: 0;
  gap: 5px;
  font-size: 11px;
}

.panel-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.textarea-medium {
  min-height: 190px;
}

.textarea-large {
  min-height: 280px;
}

.compact-tool-card {
  margin-bottom: 14px;
  padding: 14px;
}

.preview-spaced {
  margin-top: 16px;
  background: var(--surface);
}

.quick-status-value {
  margin-top: 10px;
}

.stat-value-compact {
  font-size: 22px;
}

.empty-state-left {
  text-align: left;
}

.empty-state-spaced,
.book-grid-results {
  margin-top: 18px;
}

.empty-state-featured {
  min-height: 210px;
  padding: 42px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}

.empty-state-icon,
.score-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 34px;
}

.page-status {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.status-card {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-large);
}

.status-card h1 {
  margin-top: 14px;
}

.status-card p {
  max-width: 48ch;
  margin: 16px 0 26px;
  color: var(--muted);
}

.filter-empty {
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.setting-label {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.range-label,
.field-note,
.config-description {
  color: var(--muted);
  font-size: 13px;
}

.field-note {
  margin-top: 8px;
}

.duration-input {
  width: 100px;
}

.theme-option {
  cursor: pointer;
}

.theme-option-copy {
  min-width: 0;
  flex: 1;
}

.theme-option .config-name {
  min-width: 0;
}

.config-description {
  margin-top: 5px;
  line-height: 1.55;
}

.question-source {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.comment-login-note {
  margin-bottom: 14px;
}

.summary-value-text {
  font-size: 24px;
}

.answer-row {
  margin-bottom: 8px;
}

.correct-answer-note {
  color: var(--success);
  font-size: 12px;
}

.analysis-title {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-weight: 600;
}

.comment-error,
.question-data-error {
  padding: 10px;
  color: var(--error);
  background: var(--error-bg);
  border-radius: var(--radius-sm);
}

.modal-title {
  font-size: 26px;
}

.modal-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.skeleton-card {
  animation: editorialPulse 1.2s ease-in-out infinite alternate;
}

.skeleton-2 {
  opacity: .92;
}

.skeleton-3 {
  opacity: .84;
}

.skeleton-copy {
  min-height: 72px;
  color: var(--muted-soft);
}

.board-score-copy {
  width: 100%;
}

.comm-item.is-new {
  animation: editorialReveal .28s ease both;
}

.wrongbook-modal-list:not([hidden]) {
  display: grid;
}

.btn-modal,
.btn-primary-m,
.comm-btn,
.board-submit-btn,
.board-batch-submit-btn,
.board-comment-submit {
  min-height: 40px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-ink);
  background: var(--ink-soft);
  border: 1px solid var(--ink-soft);
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-modal:hover,
.btn-primary-m:hover,
.comm-btn:hover,
.board-submit-btn:hover,
.board-batch-submit-btn:hover,
.board-comment-submit:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.modal-btn-group .btn-modal {
  flex: 1 1 160px;
}

.jump-label,
.comm-count,
.pagination-meta,
.page-jump-label,
.page-ellipsis,
.page-gap,
.board-comment-time {
  color: var(--muted);
  font-size: 12px;
}

.fav-icon,
.board-fav-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--muted-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
}

.fav-icon.active,
.board-fav-btn:not(.inactive) {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.fill-input,
.board-fill,
.board-comment-input,
.comm-textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.comm-avatar,
.c-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.comm-item,
.comm-list-container .comm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comm-body,
.c-body,
.opt-text,
.board-option-text {
  min-width: 0;
  flex: 1;
}

.comm-list,
.comm-list-container,
.comment-list {
  margin-top: 12px;
}

.math-flow {
  min-width: 0;
  max-width: 100%;
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.math-token {
  max-width: 100%;
  display: inline-block;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
  white-space: nowrap;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.math-token.is-display {
  width: 100%;
  margin: 8px 0;
  display: block;
}

.math-token > mjx-container {
  max-width: none;
  margin-block: 0 !important;
}

.math-token > mjx-container > svg {
  max-width: none;
}

.page-quiz-play .question-focus-card,
.page-quiz-play .board-question-card,
.page-quiz-play .q-content,
.page-quiz-play .board-question-content,
.page-quiz-play .options-list,
.page-quiz-play .board-options,
.page-quiz-play .option-item,
.page-quiz-play .board-option,
.page-quiz-play .opt-text,
.page-quiz-play .board-option-text {
  min-width: 0;
  max-width: 100%;
}

.page-quiz-play .option-item,
.page-quiz-play .board-option {
  width: 100%;
}

.page-quiz-play .opt-text,
.page-quiz-play .board-option-text {
  overflow-wrap: anywhere;
}

.fill-res {
  margin-top: 14px;
  padding: 14px;
  background: var(--canvas-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.label-u {
  display: inline-block;
  min-width: 78px;
  color: var(--muted);
  font-size: 12px;
}

.toggle-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.board-index {
  color: var(--ink);
  font-family: var(--display);
  font-size: 24px;
}

.board-batch-submit-wrap {
  display: flex;
  justify-content: flex-end;
}

.hint-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hero-top,
.report-preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.review-description {
  margin-top: 8px;
  color: var(--body);
  line-height: 1.65;
}

.review-link {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(220px, 1.3fr) auto;
  align-items: end;
  gap: 10px;
}

.resource-selected-count {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.resource-selected-count strong {
  margin-right: 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 300;
}

.resource-bulk-category {
  grid-column: span 1;
}

.resource-admin-table {
  min-width: 920px;
}

.resource-check-cell {
  width: 42px;
  text-align: center;
}

.resource-title-cell {
  min-width: 220px;
}

.resource-code {
  padding: 3px 7px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-radius: var(--pill);
  font-size: 10px;
}

.resource-description-muted {
  font-style: italic;
}

.resource-pagination {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.resource-row-check,
.subject-check,
.user-check {
  width: 17px;
  height: 17px;
}

.user-admin-main {
  min-width: 0;
}

.user-admin-side {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.user-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.role-select {
  display: grid;
  gap: 8px;
}

.card-seq {
  background: var(--surface);
  border-left: 3px solid var(--mint);
}

.card-rand {
  background: var(--surface);
  border-left: 3px solid var(--peach);
}

.card-fav {
  background: var(--surface);
  border-left: 3px solid var(--lavender);
}

.category-name-field {
  min-width: 0;
}

.comm-time {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.is-like {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-line);
}

.is-dislike {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-line);
}

.status-error {
  color: var(--error);
}

.board-score-card {
  text-align: center;
}

/* Focused practice workspace */

.page-quiz-play {
  padding-top: 72px;
  background: var(--surface-cool);
}

.practice-toolbar {
  position: fixed;
  z-index: 3000;
  inset: 0 0 auto;
  min-height: 72px;
  background: rgba(250, 250, 248, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.practice-toolbar-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.practice-toolbar .back-btn {
  min-height: 38px;
  padding: 7px 13px;
  gap: 7px;
  background: var(--surface);
}

.practice-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.practice-context span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .2px;
}

.practice-context strong {
  padding-left: 8px;
  color: var(--ink);
  border-left: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 600;
}

.practice-toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.practice-progress {
  min-width: 78px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.page-quiz-play .jump-box {
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(12, 10, 9, .025);
}

.page-quiz-play .jump-box label {
  padding-inline: 7px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.page-quiz-play .jump-input-wrap {
  min-height: 34px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--canvas-soft);
  border: 1px solid transparent;
  border-radius: 10px;
}

.page-quiz-play .jump-input-wrap:focus-within {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(42, 37, 34, .08);
}

.page-quiz-play .jump-input {
  width: 58px;
  min-width: 58px;
  height: 32px;
  min-height: 32px;
  padding: 3px 6px;
  flex: 0 0 58px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.page-quiz-play .jump-input::-webkit-outer-spin-button,
.page-quiz-play .jump-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.page-quiz-play .jump-label {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#quizIndexResultsRoot {
  transition: opacity 180ms ease;
}

#quizIndexResultsRoot.is-loading {
  opacity: .45;
  pointer-events: none;
}

.fav-btn.is-bouncing {
  animation: favorite-bounce 320ms ease;
}

@keyframes favorite-bounce {
  50% {
    transform: translateY(-2px) scale(1.08);
  }
}

.page-quiz-play .jump-btn,
.page-quiz-play .layout-trigger {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.page-quiz-play .jump-btn {
  color: var(--on-ink);
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.page-quiz-play .jump-btn:hover {
  color: var(--on-ink);
  background: var(--ink);
  border-color: var(--ink);
}

.page-quiz-play .quiz-container {
  width: min(900px, calc(100% - 40px));
  margin-inline: auto;
  padding: 28px 0 72px;
}

.page-quiz-play.layout-board .quiz-container {
  width: min(1060px, calc(100% - 40px));
}

.page-quiz-play .card-box,
.page-quiz-play .board-question-card,
.page-quiz-play .board-summary-card,
.page-quiz-play .board-panel {
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 3px 12px rgba(12, 10, 9, .025);
}

.page-quiz-play .question-focus-card {
  margin: 0;
  padding: 28px 30px 26px;
}

.page-quiz-play .q-meta {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.page-quiz-play .q-type-badge {
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 5px 10px;
  border-radius: var(--pill);
}

.page-quiz-play .q-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-quiz-play .wrongbook-trigger,
.page-quiz-play .board-tool-btn {
  min-height: 34px;
  padding: 7px 11px;
  color: var(--body);
  background: transparent;
  border-color: var(--line);
  font-size: 12px;
}

.page-quiz-play .q-content,
.page-quiz-play .board-question-content {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.82;
}

.page-quiz-play .options-list,
.page-quiz-play .board-options {
  margin-top: 20px;
  gap: 9px;
}

.page-quiz-play .option-item,
.page-quiz-play .board-option {
  min-height: 52px;
  padding: 11px 13px;
  align-items: center;
  background: var(--surface-quiet);
  border-color: var(--line);
  border-radius: 11px;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}

.page-quiz-play .option-item:hover,
.page-quiz-play .board-option:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  transform: translateX(2px);
}

.page-quiz-play .option-item:disabled:hover,
.page-quiz-play .board-option:disabled:hover {
  transform: none;
}

.page-quiz-play .opt-label,
.page-quiz-play .board-option-label {
  flex: 0 0 auto;
}

.page-quiz-play .action-bar {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.page-quiz-play .action-bar .btn-submit,
.page-quiz-play .action-bar .btn-next {
  min-width: 112px;
}

.page-quiz-play .result-msg {
  margin-top: 14px;
}

.page-quiz-play .explain-card {
  margin-top: 16px;
  padding: 17px 18px;
  background: var(--canvas-quiet);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.page-quiz-play .discussion-card {
  margin: 14px 0 0;
  padding: 20px 22px;
}

.page-quiz-play .comm-header {
  align-items: center;
}

.discussion-heading {
  display: grid;
}

.discussion-heading strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.discussion-heading span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.page-quiz-play .comm-count {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  border-radius: var(--pill);
}

.page-quiz-play .comm-input-box {
  margin-top: 14px;
}

.page-quiz-play .comm-textarea {
  min-height: 44px;
  max-height: 120px;
}

.page-quiz-play .comm-list {
  margin-top: 8px;
}

.page-quiz-play .empty-comm {
  padding: 12px 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.page-quiz-play .modal {
  width: min(500px, 100%);
  padding: 24px;
  border-radius: 18px;
}

.page-quiz-play .layout-modal-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.page-quiz-play .layout-choice {
  position: relative;
  padding: 16px 16px 16px 56px;
  min-height: 86px;
  border-radius: 12px;
}

.layout-choice-index {
  position: absolute;
  left: 15px;
  top: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-subtle);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
}

.page-quiz-play .practice-board {
  gap: 12px;
}

.page-quiz-play .board-summary-card {
  margin: 0 0 4px;
  padding: 18px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.page-quiz-play .board-summary-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
}

.page-quiz-play .board-summary-sub {
  max-width: 64ch;
  margin-top: 3px;
  line-height: 1.5;
}

.page-quiz-play .board-summary-stats {
  justify-content: flex-end;
}

.page-quiz-play .board-chip {
  width: auto;
  min-width: 0;
  height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
}

.page-quiz-play .board-question-card {
  margin: 0;
  padding: 24px 26px;
}

.page-quiz-play .board-card-top {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.page-quiz-play .board-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ink-soft);
  border-radius: 9px;
  color: var(--on-ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.page-quiz-play .board-card-actions {
  margin-top: 17px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.page-quiz-play .board-tools {
  gap: 6px;
}

.page-quiz-play .board-result {
  width: 100%;
}

.page-quiz-play .board-side-panels {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.page-quiz-play .board-panel {
  margin: 0;
  padding: 17px 18px;
  background: var(--canvas-quiet);
  box-shadow: none;
}

.page-quiz-play .board-panel:not(.open) {
  display: none;
}

.page-quiz-play .board-panel.open {
  display: block;
}

.page-quiz-play .board-comment-form {
  margin-top: 12px;
}

.page-quiz-play .board-batch-submit-wrap {
  position: sticky;
  z-index: 5;
  bottom: 14px;
  padding: 10px;
  justify-content: center;
  background: rgba(245, 245, 243, .9);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  backdrop-filter: blur(12px);
}

.page-quiz-play .board-batch-submit-btn {
  min-width: 180px;
}

.page-quiz-play .board-pagination {
  margin-top: 4px;
}

.page-quiz-play .score-board {
  padding: 38px;
}

@keyframes editorialPulse {
  to { opacity: .58; }
}

@keyframes editorialReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */

@media (max-width: 1120px) {
  .site-navbar {
    padding-inline: 20px;
    grid-template-columns: 145px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .nav-link {
    padding-inline: 9px;
  }

  .nav-greeting {
    display: none;
  }

  .home-hero-grid {
    gap: 40px;
  }

  .subject-grid,
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-admin-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-navbar {
    grid-template-columns: auto 1fr auto;
  }

  .nav-menu-button {
    display: inline-flex;
    justify-self: center;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-large);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
  }

  .site-header.is-menu-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .site-header.is-menu-open .nav-menu-icon i:first-child {
    transform: translateY(2.5px) rotate(45deg);
  }

  .site-header.is-menu-open .nav-menu-icon i:last-child {
    transform: translateY(-2.5px) rotate(-45deg);
  }

  .nav-links .nav-link {
    justify-content: flex-start;
  }

  .nav-links .nav-link.active::after {
    right: auto;
    bottom: 7px;
    left: 10px;
    width: 16px;
  }

  .scope-picker-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-title {
    grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  }

  .category-count {
    display: none;
  }

  .home-hero-grid,
  .section-heading,
  .notice-layout,
  .footer-grid,
  .submission-header,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .home-hero-grid {
    min-height: 0;
  }

  .home-atmosphere {
    min-height: 320px;
  }

  .exam-feature,
  .practice-layout,
  .score-layout,
  .page-exam-result .score-layout,
  .submission-grid,
  .hero,
  .report-layout,
  .user-admin-card {
    grid-template-columns: 1fr;
  }

  .exam-feature-score {
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .library-layout {
    grid-template-columns: 1fr;
  }

  .category-panel,
  .submission-history {
    position: static;
    max-height: none;
  }

  .category-level {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .category-level .category-level {
    display: none;
  }

  .category-link,
  .category-all {
    flex: 0 0 auto;
    border: 1px solid var(--line);
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-status {
    width: 100%;
    flex-basis: auto;
  }

  .page-quiz-play {
    padding-top: 116px;
  }

  .practice-toolbar-inner {
    width: calc(100% - 28px);
    min-height: 116px;
    padding-block: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    gap: 8px 12px;
  }

  .practice-context {
    justify-self: end;
    text-align: right;
  }

  .practice-toolbar-controls {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .user-admin-side {
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .site-container,
  .wrap,
  .page,
  .container,
  .library-shell,
  .submission-shell,
  .quiz-container,
  .page-header,
  .header-section {
    width: calc(100% - 28px);
  }

  .site-navbar {
    padding-inline: 13px;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 7px;
  }

  .site-navbar .logo img {
    height: 23px;
  }

  .nav-menu-button {
    justify-self: start;
    padding-inline: 11px;
  }

  .nav-menu-label {
    display: none;
  }

  .user-area {
    gap: 3px;
  }

  .nav-secondary,
  .nav-cta,
  .nav-link-button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .nav-inline-form:first-of-type:not(:last-child) {
    display: none;
  }

  .quiz-library-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quiz-library-search {
    min-height: 54px;
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
  }

  .quiz-library-search-icon {
    width: 30px;
    height: 30px;
  }

  .quiz-library-search .search-input {
    min-height: 40px;
    padding-inline: 4px;
    font-size: 14px;
  }

  .quiz-library-search button.quiz-library-search-submit {
    min-height: 40px;
    padding-inline: 13px;
  }

  .quiz-library-toolbar .exam-btn {
    min-height: 50px;
    width: 100%;
  }

  h1 {
    font-size: clamp(39px, 12vw, 52px);
    letter-spacing: -.7px;
  }

  .home-hero-copy h1 {
    font-size: clamp(36px, 10.8vw, 42px);
    line-height: 1.04;
    letter-spacing: -.45px;
  }

  h2 {
    font-size: 34px;
  }

  .home-hero {
    padding-top: 68px;
  }

  .home-hero-copy .button-row,
  .footer-grid .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero-copy .button,
  .footer-grid .button {
    width: 100%;
  }

  .home-atmosphere {
    min-height: 270px;
  }

  .home-metrics {
    grid-template-columns: 1fr;
  }

  .home-metrics > div,
  .home-metrics > div:nth-child(2),
  .home-metrics > div:last-child {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-metrics > div:last-child {
    border-bottom: 0;
  }

  .home-section {
    padding: 70px 0;
  }

  .exam-feature,
  .footer-grid,
  .library-hero,
  .submission-header,
  .result-hero,
  .page-software .hero,
  .page-wrongbook .hero {
    padding: 26px;
  }

  .subject-preview-grid,
  .resource-columns,
  .subject-grid,
  .book-grid,
  .section-grid,
  .content-grid,
  .stats-grid,
  .setup-mode-grid,
  .layout-modal-grid,
  .board-side-panels,
  .summary-card,
  .submission-form-grid,
  .report-editor-grid,
  .user-meta-grid,
  .user-stat-grid,
  .page-admin .stats-grid,
  .resource-admin-metrics,
  .resource-filter-bar,
  .resource-bulk-bar,
  .resource-row-edit-form,
  .category-create-grid {
    grid-template-columns: 1fr;
  }

  .page-profile .stats-grid,
  .page-admin .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-status-grid,
  .operations-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-hero {
    align-items: start;
  }

  .library-hero-actions {
    flex-wrap: wrap;
  }

  .library-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .library-stat:nth-child(2) {
    border-right: 0;
  }

  .library-stat:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .library-context {
    text-align: left;
  }

  .resource-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .resource-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .resource-card-heading {
    display: block;
  }

  .resource-eyebrow {
    max-width: 100%;
    margin-bottom: 3px;
  }

  .resource-description {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .comment-input-row,
  .comm-input-wrapper,
  .comm-input-box,
  .board-comment-form,
  .review-form {
    grid-template-columns: 1fr;
  }

  .scope-picker {
    border-radius: var(--radius-md);
  }

  .scope-picker-head {
    padding: 16px;
  }

  .scope-picker-head h2,
  .scope-picker-head h3 {
    font-size: 16px;
  }

  .scope-picker-toolbar {
    padding-left: 14px;
  }

  .filter-tree {
    max-height: 56vh;
    padding: 6px;
  }

  .scope-category-row,
  .scope-bank-option {
    margin-left: calc(var(--scope-level, 0) * 9px);
  }

  .scope-expand-button {
    min-height: 60px;
    padding-inline: 6px;
    grid-template-columns: 28px 32px minmax(0, 1fr);
    gap: 8px;
  }

  .scope-node-icon {
    width: 32px;
    height: 32px;
  }

  .scope-expand-label {
    display: none;
  }

  .scope-category-select {
    margin-right: 5px;
    padding-inline: 7px;
  }

  .scope-category-select > span:last-child {
    display: none;
  }

  .scope-bank-option {
    padding: 7px 8px;
    grid-template-columns: 18px 32px minmax(0, 1fr);
    gap: 8px;
  }

  .scope-bank-option .scope-node-count {
    grid-column: 3;
  }

  .scope-selection {
    padding: 11px 14px;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .scope-selection > span {
    padding-top: 0;
  }

  .category-title {
    padding-inline: 9px;
    padding-left: calc(9px + var(--level, 0) * 10px);
    grid-template-columns: 28px 32px minmax(0, 1fr);
    gap: 8px;
  }

  .category-expand-label {
    display: none;
  }

  .page-quiz-play > .navbar {
    padding-inline: 10px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .page-quiz-play .top-actions {
    display: none;
  }

  .practice-toolbar-inner {
    width: calc(100% - 20px);
  }

  .practice-toolbar .back-btn {
    padding-inline: 11px;
  }

  .practice-context span {
    display: none;
  }

  .practice-progress {
    display: none;
  }

  .practice-toolbar-controls {
    gap: 6px;
  }

  .page-quiz-play .jump-box {
    min-width: 0;
    flex: 1;
  }

  .page-quiz-play .jump-box label {
    display: none;
  }

  .page-quiz-play .jump-input-wrap {
    flex: 1;
    justify-content: center;
  }

  .page-quiz-play .layout-trigger {
    flex: 0 0 auto;
  }

  .page-quiz-play .quiz-container,
  .page-quiz-play.layout-board .quiz-container {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .page-quiz-play .question-focus-card,
  .page-quiz-play .board-question-card {
    padding: 18px;
    border-radius: 14px;
  }

  .page-quiz-play .q-content,
  .page-quiz-play .board-question-content {
    margin-top: 18px;
    font-size: 16px;
  }

  .page-quiz-play .q-head-actions {
    width: 100%;
    margin: 6px 0 0;
  }

  .page-quiz-play .discussion-card {
    padding: 17px;
  }

  .page-quiz-play .board-summary-card {
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-quiz-play .board-summary-stats {
    justify-content: flex-start;
  }

  .page-quiz-play .board-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-quiz-play .board-tools {
    width: 100%;
  }

  .setup-modal-overlay {
    padding: 10px;
  }

  .setup-modal {
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .setup-sheet-head {
    padding: 18px;
  }

  .setup-header-icon {
    width: 40px;
    height: 40px;
  }

  .setup-header-title {
    font-size: 18px;
  }

  .setup-stat-strip {
    padding-inline: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-stat-strip > div,
  .setup-stat-strip > div:first-child {
    padding: 12px 10px;
  }

  .setup-stat-strip > div:nth-child(2) {
    border-right: 0;
  }

  .setup-stat-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .setup-mode-list {
    padding: 14px 18px;
  }

  .setup-mode-card {
    padding: 14px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .setup-mode-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .setup-mode-actions .setup-action-btn,
  .setup-mode-actions .setup-form-input {
    min-width: 0;
    flex: 1 1 120px;
  }

  .setup-sheet-foot {
    padding: 11px 18px;
  }

  .setup-sheet-foot > span {
    display: none;
  }

  .admin-shell {
    width: calc(100% - 18px);
    padding-top: 9px;
  }

  .page-admin .section,
  .tool-card {
    padding: 17px;
  }

  .operations-status-grid,
  .operations-detail-grid,
  .operations-control-grid {
    grid-template-columns: 1fr;
  }

  .category-admin-row {
    margin-left: 0;
    grid-template-columns: 1fr;
  }

  .impersonation-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}
