:root {
  --navy: #26201d;
  --navy-2: #b62b30;
  --blue: #b62b30;
  --blue-soft: #f7e9e3;
  --ink: #26201d;
  --muted: #8a817b;
  --line: #e8e4e1;
  --surface: #ffffff;
  --background: #ffffff;
  --green: #39725f;
  --green-soft: #edf5f0;
  --red: #b62b30;
  --red-soft: #f9ece9;
  --amber: #ef9f3c;
  --shadow: none;
}

body, .practice-shell { background: #fff; }
body { color: var(--ink); }
.card, .question-card { background: #fff; border-color: var(--line); box-shadow: none; }
.stat-card, .paper-card { background: #fff; border-color: var(--line); }
.stat-value, .report-stat strong { color: var(--ink); }
.page-heading h1, .login-card h2 { color: var(--ink); letter-spacing: -.02em; }
.divider { background: var(--line); }
.empty { background: #fff; border-color: #ded9d5; }

.brand-logo { display: block; width: 178px; height: auto; mix-blend-mode: multiply; }
.brand-mark { display: none; }
.brand-kicker { margin-bottom: 18px; color: var(--red); font-size: 12px; font-weight: 600; letter-spacing: .18em; }
.login-page { background: #fff; }
.login-hero { position: relative; overflow: hidden; color: var(--ink); background: #fff; border-right: 1px solid var(--line); }
.login-hero::before { content: ""; position: absolute; width: 72%; height: 1px; right: -17%; top: 24%; background: var(--red); opacity: .65; transform: rotate(-27deg); transform-origin: right center; }
.login-hero::after { content: ""; position: absolute; width: 10px; height: 10px; right: 18%; top: 11%; background: var(--amber); border-radius: 50%; }
.login-hero > * { position: relative; z-index: 1; }
.login-hero h1 { color: var(--ink); font-size: clamp(48px, 5vw, 68px); font-weight: 650; letter-spacing: -.045em; }
.login-hero p { color: #746c67; font-size: 17px; line-height: 1.9; }
.brand-login .brand-logo { width: 205px; }
.hero-points span { color: #6d625d; border-color: #ded8d4; background: #fff; }
.login-foot { color: var(--red); font-family: Georgia, serif; font-size: 14px; font-style: italic; letter-spacing: .02em; }
.login-panel { background: #fff; }
.login-card > p, .demo-note { color: var(--muted); }
.demo-account { background: #fff; border-color: var(--line); }
.demo-account:hover { background: var(--blue-soft); border-color: #d8a7a7; }
.demo-account span { color: var(--muted); }

.sidebar { color: var(--ink); background: #fff; border-right: 1px solid var(--line); }
.sidebar .brand { display: block; padding: 0 8px 22px; border-bottom: 1px solid var(--line); }
.sidebar .brand-logo { width: 166px; }
.product-label { display: block; margin-top: 11px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.nav-button { color: #746c67; }
.nav-button:hover { color: var(--red); background: #faf4f1; }
.nav-button.active { color: var(--red); background: var(--blue-soft); }
.nav-index, .nav-button.active .nav-index { color: #a69c96; }
.nav-button.active .nav-index { color: var(--red); }
.sidebar-bottom { border-color: var(--line); }
.user-name { color: var(--ink); }
.user-role { color: var(--muted); }
.logout { color: var(--red); }
.topbar { background: #fff; border-color: var(--line); }
.demo-badge { color: #7b6e67; background: #f7e9e3; }

.btn-primary { color: #fff; background: var(--red); }
.btn-primary:hover:not(:disabled) { background: #8f2227; }
.btn-soft { color: var(--red); background: var(--blue-soft); }
.btn-secondary { color: #5e524c; background: #fff; border-color: #ddd7d2; }
.btn-secondary:hover:not(:disabled) { background: #faf6f4; }
.btn-danger { color: var(--red); border-color: #e4bcbc; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); }
input:focus, select:focus, textarea:focus { border-color: #c68184; box-shadow: 0 0 0 3px rgba(182,43,48,.09); }
.category-option span { color: #625751; background: #fff; border-color: var(--line); }
.category-option input:checked + span { color: var(--red); background: var(--blue-soft); border-color: #c98c8f; box-shadow: inset 0 0 0 1px #c98c8f; }
.difficulty-option span { color: #6c6059; background: #fff; border-color: var(--line); }
.difficulty-option input:checked + span { color: #fff; background: var(--red); border-color: var(--red); }
.available-count strong, .source-label, .card-title, .result-title { color: var(--ink); }
.tag-chip { color: #8b4c4e; background: #f7e9e3; }
button.tag-chip:hover { background: #f1dcd5; }
.knowledge-category { color: var(--red); }
.paper-year { color: var(--muted); }
.paper-card h2 { color: var(--ink); }
.answer-number { color: #746962; background: #fff; border-color: #ddd6d1; }
.answer-number.answered { color: #fff; background: var(--red); border-color: var(--red); }
.answer-number.current { outline-color: var(--red); }
.legend-dot.done { background: var(--red); border-color: var(--red); }
.timer { color: var(--red); background: #f7e9e3; }
.practice-top, .exam-top { background: rgba(255,255,255,.97); border-color: var(--line); }
.answer-area, .solution-block { border-color: var(--line); }
.feedback.correct { color: #2e6552; background: var(--green-soft); }
.feedback.wrong { color: #8c3336; background: var(--red-soft); }
.report-hero { background: #7e1a20; }
th { color: #6f5f58; background: #f7e9e3; }
.status.neutral { color: #776d67; background: #f2efed; }
.score-pill { color: #39725f; background: #edf5f0; }
.modal-card { border: 1px solid var(--line); }
.toast { background: rgba(38,32,29,.96); }

.exam-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.exam-switch .product-label { margin: 0; }
.exam-switch button { padding: 0; color: var(--red); background: none; border: 0; font-size: 11px; white-space: nowrap; }
.exam-selection-page { min-height: 100vh; background: #fff; }
.exam-selection-header { display: flex; align-items: center; justify-content: space-between; padding: 25px 42px; border-bottom: 1px solid var(--line); }
.exam-selection-header .brand-logo { width: 178px; }
.exam-selection-main { width: min(1180px, 100%); margin: 0 auto; padding: 62px 34px 70px; }
.exam-selection-main h1 { margin: 0 0 13px; color: var(--ink); font-size: 36px; letter-spacing: -.03em; }
.exam-selection-main > p { max-width: 680px; margin: 0; color: var(--muted); font-size: 16px; }
.exam-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 35px; }
.exam-card { display: flex; flex-direction: column; min-height: 270px; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.exam-card.available { border-color: #c88e90; box-shadow: inset 0 3px 0 var(--red); }
.exam-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exam-code { color: var(--ink); font-size: 27px; font-weight: 650; }
.exam-card p { color: #746a64; font-size: 13px; }
.exam-data { margin: auto 0 18px; padding-top: 25px; color: var(--muted); font-size: 12px; }
.exam-card.unavailable { background: #fdfcfc; }
.exam-card.unavailable .exam-code { color: #8e8580; }
.exam-selection-note { margin-top: 23px; padding: 13px 16px; color: #7b6c65; background: #f7e9e3; border-left: 3px solid var(--red); font-size: 13px; }

@media (max-width: 1000px) {
  .exam-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { display: flex; align-items: center; justify-content: space-between; border-bottom: 0; }
  .sidebar .brand-logo { width: 148px; }
  .product-label { margin: 0; font-size: 11px; }
  .login-hero { border-right: 0; border-bottom: 1px solid var(--line); }
  .login-hero h1 { margin-top: 34px; }
  .brand-login .brand-logo { width: 170px; }
  .login-hero::before { width: 85%; right: -35%; top: 30%; }
  .login-hero::after { right: 12%; top: 16%; }
  .exam-selection-header { padding: 18px 20px; }
  .exam-selection-header .brand-logo { width: 145px; }
  .exam-selection-main { padding: 38px 20px 50px; }
  .exam-selection-main h1 { font-size: 29px; }
}

@media (max-width: 540px) {
  .exam-card-grid { grid-template-columns: 1fr; }
  .exam-card { min-height: 235px; }
  .exam-selection-header .muted { display: none; }
}

.filter-tags { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.filter-tags summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.filter-tags summary::-webkit-details-marker { display: none; }
.filter-tags summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.tag-filter-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; margin-top: 16px; padding-right: 4px; overflow-y: auto; }
.tag-filter-grid .difficulty-option span { padding: 6px 11px; font-size: 12px; }
.bank-filter-bar { display: grid; grid-template-columns: minmax(280px, 1fr) 150px 150px; gap: 12px; margin-bottom: 16px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.modal-card.modal-wide { width: min(960px, 100%); max-height: 90vh; overflow-y: auto; }
.modal-wide h2 { margin: 0; font-size: 21px; }

@media (max-width: 800px) {
  .bank-filter-bar { grid-template-columns: 1fr 1fr; }
  .bank-filter-bar .tag-search { grid-column: 1 / -1; }
}

.assignment-mode-box { margin: 16px 0; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.assignment-mode-box h3 { margin: 0 0 12px; color: var(--ink); font-size: 14px; }
.assignment-mode-box .form-field:last-child { margin-bottom: 0; }
.assignment-section { border-left: 3px solid var(--red); }
select[multiple] { min-height: 92px; }

.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.account-role-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.account-role-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; color: #756a64; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.account-role-tab span { color: var(--muted); font-size: 11px; }
.account-role-tab.active { color: var(--red); background: var(--blue-soft); border-color: #d6a3a5; }
.account-role-tab.active span { color: var(--red); }
.account-search { display: flex; flex: 0 0 310px; gap: 8px; }
.account-search input { min-height: 37px; }
.account-list-meta { display: flex; justify-content: space-between; gap: 12px; margin: 15px 0 6px; color: var(--muted); font-size: 12px; }
.account-table { min-width: 1040px; }
.account-table td strong { font-weight: 550; }
.account-scope-label { color: var(--ink); font-weight: 550; }
.role-badge { display: inline-flex; padding: 3px 8px; border-radius: 5px; font-size: 11px; }
.role-admin { color: #8b3033; background: #f7e9e3; }
.role-jiaowu { color: #896329; background: #faf2e4; }
.role-teacher { color: #39725f; background: #edf5f0; }
.role-student { color: #5b6f7d; background: #edf2f5; }
.teacher-assign { min-height: 33px; max-width: 125px; padding: 4px 8px; font-size: 12px; }
.account-create-section { margin-top: 24px; }
.account-create-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.account-create-heading .card-subtitle { margin-bottom: 0; }
.account-create-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 20px; align-items: end; }
.account-create-form .form-field { margin-bottom: 0; }
.account-submit .btn { width: 100%; }
.account-form-note { margin: 16px 0 0; }

@media (max-width: 1000px) {
  .account-toolbar { align-items: stretch; flex-direction: column; }
  .account-search { flex: 0 0 auto; width: 100%; }
}

@media (max-width: 600px) {
  .account-create-heading { flex-direction: column; }
  .account-list-meta { flex-direction: column; }
}

.teacher-bank-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.teacher-bank-tabs span { margin-left: auto; color: var(--muted); font-size: 12px; }
.teacher-task-form textarea { resize: vertical; }
.question-edit-form { margin: 20px 0; padding: 18px; background: #f7e9e3; border-radius: 10px; }
.role-academic { color: #6d4d7d; background: #f3edf5; }

@media (max-width: 800px) {
  .teacher-bank-tabs span { width: 100%; margin: 6px 0 0; }
}

.review-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.review-queue { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 18px; }
.review-queue-item { display: flex; gap: 11px; width: 100%; padding: 12px 10px; text-align: left; color: var(--ink); background: #fff; border: 1px solid transparent; border-bottom-color: var(--line); }
.review-queue-item > span { display: grid; place-items: center; flex: 0 0 25px; height: 25px; color: var(--muted); background: #f2efed; border-radius: 50%; font-size: 11px; }
.review-queue-item strong, .review-queue-item small { display: block; }
.review-queue-item strong { font-size: 13px; }
.review-queue-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.review-queue-item.active { background: var(--blue-soft); border-color: #d4a0a2; border-radius: 8px; }
.review-queue-item.active > span { color: #fff; background: var(--red); }
.review-detail textarea { resize: vertical; line-height: 1.8; }
.review-stat-text { font-size: 19px; }
.review-actions { justify-content: flex-end; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.question-text { margin: 10px 0 20px; color: var(--ink); font-size: 17px; line-height: 1.9; }
.solution-text { white-space: pre-wrap; color: #4f4641; line-height: 1.85; }

@media (max-width: 900px) {
  .review-layout { grid-template-columns: 1fr; }
}

.topbar { position: relative; z-index: 30; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.account-menu { position: relative; z-index: 35; }
.account-menu-trigger { display: flex; align-items: center; gap: 9px; padding: 5px 7px; color: var(--ink); background: #fff; border: 1px solid transparent; border-radius: 9px; text-align: left; }
.account-menu-trigger:hover, .account-menu.open .account-menu-trigger { background: #faf4f1; border-color: var(--line); }
.account-avatar { display: grid; place-items: center; flex: 0 0 35px; width: 35px; height: 35px; color: #fff; background: var(--red); border-radius: 50%; font-size: 15px; font-weight: 600; }
.account-trigger-text strong, .account-trigger-text small { display: block; }
.account-trigger-text strong { font-size: 13px; font-weight: 600; }
.account-trigger-text small { color: var(--muted); font-size: 10px; }
.account-chevron { color: var(--muted); font-size: 12px; }
.account-dropdown { position: absolute; top: calc(100% + 9px); right: 0; display: none; width: 225px; padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 14px 36px rgba(38,32,29,.12); }
.account-menu.open .account-dropdown { display: block; }
.account-dropdown-info { padding: 9px 10px 12px; border-bottom: 1px solid var(--line); }
.account-dropdown-info strong, .account-dropdown-info span { display: block; }
.account-dropdown-info strong { font-size: 14px; }
.account-dropdown-info span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-dropdown > button { width: 100%; padding: 9px 10px; text-align: left; color: var(--ink); background: #fff; border: 0; border-radius: 6px; font-size: 13px; }
.account-dropdown > button:hover { background: #faf4f1; }
.account-dropdown > .account-logout { color: var(--red); }
.exam-selection-header { position: relative; z-index: 30; }

@media (max-width: 600px) {
  .topbar-actions .demo-badge { display: none; }
  .account-trigger-text small { display: none; }
  .account-menu-trigger { gap: 6px; }
}
