:root {
    --navy: #082b4c;
    --navy-2: #0d416f;
    --blue: #1267a5;
    --cyan: #20a4b9;
    --gold: #d9a441;
    --ink: #172535;
    --muted: #667789;
    --line: #dce4eb;
    --bg: #f3f6f8;
    --white: #fff;
    --danger: #bd3c3c;
    --success: #287a55;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.65; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .btn { min-height: 38px; border: 0; border-radius: 4px; padding: 8px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { color: #fff; background: var(--blue); }
.btn-secondary { color: var(--navy); background: #e6eef4; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-outline { color: var(--navy); border: 1px solid #aac0d0; background: #fff; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.site-header { height: 68px; padding: 0 clamp(20px, 5vw, 76px); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.brand { color: #fff; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border: 2px solid var(--cyan); display: grid; place-items: center; color: var(--cyan); font-weight: 800; font-size: 21px; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 4px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: 0; }
.brand small { font-size: 9px; color: #91b2ca; }
.site-nav { display: flex; align-items: center; gap: 9px; }
.site-nav a { color: #d8e7f2; padding: 7px 12px; }
.site-nav .nav-primary { background: var(--cyan); color: #fff; border-radius: 4px; }
.site-main { width: min(1180px, calc(100% - 32px)); margin: 32px auto; min-height: calc(100vh - 150px); }
.site-footer { text-align: center; color: #7f8c97; border-top: 1px solid var(--line); padding: 18px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 22px; }
.page-heading h1 { font-size: 28px; margin: 0; color: var(--navy); }
.page-heading p { color: var(--muted); margin: 5px 0 0; }
.panel, .auth-panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 3px 14px rgba(18,51,75,.06); }
.panel { padding: 22px; margin-bottom: 20px; }
.auth-shell { min-height: calc(100vh - 190px); display: grid; place-items: center; }
.auth-panel { width: min(430px, 100%); padding: 32px; border-top: 4px solid var(--cyan); }
.auth-panel h1 { margin: 0 0 6px; color: var(--navy); font-size: 25px; }
.auth-panel .intro { color: var(--muted); margin: 0 0 24px; }
.form-group { margin-bottom: 17px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-control { width: 100%; min-height: 40px; border: 1px solid #bccbd6; border-radius: 4px; padding: 8px 11px; background: #fff; color: var(--ink); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-control:focus { outline: 2px solid rgba(32,164,185,.2); border-color: var(--cyan); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-error, .alert-error { color: #922b2b; background: #fceaea; border: 1px solid #efc1c1; padding: 9px 12px; border-radius: 4px; margin-bottom: 15px; }
.alert-success { color: #1f6948; background: #e8f5ee; border: 1px solid #b8dfca; padding: 9px 12px; border-radius: 4px; margin-bottom: 15px; }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 22px; top: 84px; z-index: 1000; max-width: 380px; color: #fff; padding: 12px 18px; border-radius: 4px; box-shadow: 0 8px 28px rgba(0,0,0,.2); transition: .25s; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.bank-selector-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px; background: #f5f8fa; border: 1px solid var(--line); border-radius: 4px; }
.bank-selector-bar label { color: var(--navy); font-weight: 700; white-space: nowrap; }
.bank-selector-bar .form-control { max-width: 420px; }
.set-selector { min-width: 150px; }
.tabs button { color: var(--muted); background: transparent; border-radius: 0; border-bottom: 3px solid transparent; min-width: 120px; }
.tabs button.active { color: var(--navy); border-color: var(--cyan); font-weight: 700; }
.tabs .category-tab { color: var(--muted); padding: 8px 18px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs .category-tab.active { color: var(--navy); border-color: var(--cyan); font-weight: 700; }
.bank-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.bank-card { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 20px; position: relative; overflow: hidden; }
.bank-card:before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--cyan); }
.bank-card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bank-card-title h3 { min-width: 0; }
.bank-card-title .btn { flex-shrink: 0; white-space: nowrap; }
.bank-card-title h3, .bank-card p, .instant-feedback { overflow-wrap: break-word; }
.category-tabs .category-tab { flex: 1; text-align: center; }
.category-band { margin-bottom: 28px; }
.category-band-heading { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 14px; padding-bottom: 8px; }
.category-band-heading h2 { margin: 0; color: var(--navy); font-size: 20px; }
.category-band-heading span { color: var(--muted); font-size: 12px; }
.bank-card h3 { margin: 0 0 9px; color: var(--navy); font-size: 18px; }
.bank-card p { color: var(--muted); min-height: 46px; }
.bank-meta { display: flex; justify-content: space-between; padding: 12px 0; margin: 10px 0 15px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.empty { padding: 52px 20px; text-align: center; color: var(--muted); border: 1px dashed #b8c8d5; background: #fafcfd; }
.practice-layout { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 20px; align-items: start; }
.question-column { min-width: 0; }
.question-nav { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.question-nav-title, .question-nav .completion-text { flex-shrink: 0; }
.question-nav-title { color: var(--navy); font-weight: 700; font-size: 16px; }
.completion-text { color: var(--muted); margin: 6px 0 14px; font-size: 12px; }
.question-numbers { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); grid-auto-rows: max-content; gap: 7px; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.question-number-link { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: #fff; border-radius: 3px; }
.question-number-link.done { color: #075781; border-color: #83c7e7; background: #d9f1ff; }
.practice-question.answered { border-left: 4px solid #9ed6ee; }
.instant-feedback { position: static; width: 100%; margin-top: 15px; padding: 12px 15px; border-radius: 4px; background: #f5f8fa; border: 1px solid var(--line); }
.instant-feedback.feedback-correct { color: #1e6848; background: #e8f5ee; border-color: #b8dfca; }
.instant-feedback.feedback-wrong { color: #922b2b; background: #fceaea; border-color: #efc1c1; }
.instant-feedback p { margin: 4px 0 0; white-space: pre-wrap; }
.exam-submit-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: -5px 0 20px; }
.exam-timer { color: var(--muted); }
.exam-next-row { margin-top: 15px; display: flex; justify-content: flex-end; }
.result-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.result-summary > div { padding: 18px; border: 1px solid var(--line); background: #fff; border-top: 3px solid var(--cyan); border-radius: 5px; }
.result-summary span, .result-summary strong { display: block; }
.result-summary span { color: var(--muted); }
.result-summary strong { color: var(--navy); font-size: 26px; }
.result-wrong { border-left: 4px solid var(--danger); }
.modal-lock { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: rgba(4,24,42,.92); }
.modal-lock .modal { width: min(480px,100%); background: #fff; border-radius: 6px; padding: 30px; border-top: 5px solid var(--gold); }
.modal h2 { margin: 0 0 8px; color: var(--navy); }
.modal p { color: var(--muted); }
.question-card { border: 1px solid var(--line); background: #fff; padding: 22px; margin-bottom: 16px; border-radius: 6px; }
.question-number { color: var(--blue); font-weight: 700; font-size: 12px; }
.question-stem { font-size: 16px; font-weight: 600; margin: 8px 0 16px; white-space: pre-wrap; }
.question-options { display: grid; gap: 8px; }
.question-options label { border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; cursor: pointer; }
.question-options label.selected { border-color: var(--cyan); background: #eefafd; }
.question-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.question-head > div:first-child { min-width: 0; flex: 1; }
.question-submit-button { flex: 0 0 auto; margin-top: 18px; white-space: nowrap; }
.answer-box { border-left: 3px solid var(--gold); margin-top: 14px; padding: 12px 15px; background: #fff9ea; }
.answer-box p { margin: 5px 0; white-space: pre-wrap; }
.hidden { display: none !important; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 130px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { color: #526779; background: #f5f8fa; font-size: 12px; }
td.wrap { white-space: normal; min-width: 220px; }
.badge { display: inline-block; border-radius: 12px; padding: 2px 9px; font-size: 12px; background: #e7edf2; color: #526779; }
.badge-success { background: #def2e7; color: #26704e; }
.badge-danger { background: #f8e1e1; color: #a03333; }
.badge-warning { background: #f7edd3; color: #84621c; }
.pagination { display: flex; gap: 5px; padding-top: 18px; }
.pagination a { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 3px; }
.pagination a.active { color: #fff; border-color: var(--blue); background: var(--blue); }
@media (max-width: 820px) {
    .bank-grid, .profile-grid { grid-template-columns: 1fr; }
    .practice-layout { grid-template-columns: 1fr; }
    .question-nav { position: static; order: -1; max-height: min(360px, calc(100vh - 40px)); }
    .question-numbers { grid-template-columns: repeat(10,1fr); }
    .result-summary { grid-template-columns: 1fr; }
    .site-header { padding: 0 16px; }
    .brand small { display: none; }
    .site-nav a { padding: 6px; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .brand strong { font-size: 14px; }
    .brand-mark { display: none; }
    .site-main { width: min(100% - 20px,1180px); margin-top: 18px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .auth-panel, .panel { padding: 20px; }
    .question-head { flex-wrap: wrap; gap: 8px; }
    .question-submit-button { margin-top: 0; }
}
