/* ===== 金融从业考试押题网 · 公共样式（蓝白 / 专业 / 响应式） ===== */
:root {
  /* 统一设计变量：前台 theme.css 与后台 admin.css 共用 */
  --brand: #164A9F;
  --brand-2: #2563EB;
  --brand-dark: #0F3A7E;
  --brand-soft: #EAF1FE;
  --brand-softer: #F4F8FF;
  --ink: #172B4D;
  --ink-2: #33445F;
  --muted: #64748B;
  --line: #E4EAF2;
  --line-2: #EEF3F9;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --ok: #0F7A55;
  --ok-soft: #E7F6EE;
  --warn: #A96508;
  --warn-soft: #FFF4E2;
  --danger: #C93B38;
  --danger-soft: #FDECEB;
  --shadow: 0 1px 2px rgba(18, 46, 88, .04), 0 6px 20px rgba(18, 46, 88, .05);
  --shadow-lg: 0 14px 36px rgba(18, 46, 88, .11);
  --radius: 14px;
  --radius-lg: 16px;
  --radius-btn: 9px;
  --maxw: 1320px;
  /* 8px 倍数间距系统 */
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; --sp-5: 40px; --sp-6: 48px;
  --t: 180ms cubic-bezier(.4, 0, .2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: 64px;
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; height: 100%; padding: 0 22px;
  display: flex; align-items: center; gap: 34px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, #164A9F, #2563EB); color: #fff;
  font-weight: 700; font-size: 18px; letter-spacing: 0;
  box-shadow: 0 3px 9px rgba(22, 74, 159, .22);
}
.brand-text { font-size: 17px; font-weight: 700; line-height: 1.1; letter-spacing: .3px; }
.brand-text small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: 1.6px; }
.nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-link {
  padding: 8px 14px; border-radius: 8px; color: var(--ink-2); font-size: 14.5px;
  font-weight: 500; transition: .15s; white-space: nowrap;
}
.nav-link:hover { background: var(--brand-softer); color: var(--brand); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); font-weight: 650; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 14px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 18px;
  font-size: 14.5px; font-weight: 600; cursor: pointer; transition: .16s;
  white-space: nowrap; background: var(--brand); color: #fff; line-height: 1.4;
}
.btn:hover:not(:disabled) { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { background: #fff; color: var(--brand); border-color: #bcd0f5; }
.btn-outline:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b93432; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { background: #0e6c49; }
.btn-warn { background: #e8891a; color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 12px 26px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5dfee; border-radius: 8px;
  background: #fff; color: var(--ink); outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.textarea { resize: vertical; min-height: 82px; line-height: 1.6; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ---------- 布局 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }
#view { min-height: calc(100vh - 64px - 74px); padding: 26px 0 46px; }
.section-title { font-size: 20px; margin-bottom: 4px; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }
.crumb-sep { color: #c3ccdb; }
.crumb span:last-child { color: var(--ink-2); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.grid { display: grid; gap: 18px; }

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(120deg, #123f9e 0%, #1a56db 52%, #3c86f0 100%);
  border-radius: 16px; padding: 44px 46px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 12px 34px rgba(26,86,219,.18);
}
.hero::after {
  content: ''; position: absolute; right: -70px; top: -90px; width: 340px; height: 340px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(255,255,255,.035), 0 0 0 130px rgba(255,255,255,.025);
}
.hero-tag {
  display: inline-block; font-size: 12.5px; letter-spacing: 1px; padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.4); border-radius: 20px; margin-bottom: 16px;
  background: rgba(255,255,255,.1);
}
.hero h1 { font-size: 32px; letter-spacing: .5px; margin-bottom: 12px; position: relative; z-index: 1; }
.hero p { font-size: 15.5px; color: rgba(255,255,255,.9); max-width: 620px; position: relative; z-index: 1; }
.hero-meta { display: flex; gap: 28px; margin-top: 26px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-meta div { font-size: 13px; color: rgba(255,255,255,.82); }
.hero-meta b { display: block; font-size: 22px; color: #fff; font-weight: 700; line-height: 1.3; }

.home-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 32px 0 18px; }
.home-head h2 { font-size: 21px; }
.home-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px 20px; box-shadow: var(--shadow); transition: .18s;
  display: flex; flex-direction: column; min-height: 224px;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c3d6f7; }
.cat-icon {
  width: 46px; height: 46px; border-radius: 11px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-size: 21px;
  font-weight: 700; margin-bottom: 15px;
}
.cat-card h3 { font-size: 18px; margin-bottom: 7px; }
.cat-card p { color: var(--muted); font-size: 13.5px; flex: 1; line-height: 1.6; }
.cat-stat { font-size: 12.5px; color: var(--muted); margin: 12px 0 14px; }
.cat-stat b { color: var(--brand); font-weight: 650; }
.cat-card .btn { align-self: flex-start; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.step b { color: var(--brand); font-size: 13px; letter-spacing: 1px; }
.step h4 { font-size: 15.5px; margin: 6px 0 5px; }
.step p { color: var(--muted); font-size: 13.5px; }

/* ---------- 科目 / 试卷列表 ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.subject-card { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.subject-card:hover { border-color: #c3d6f7; box-shadow: var(--shadow-lg); }
.subject-card .sc-left { min-width: 0; }
.subject-card h3 { font-size: 17px; margin-bottom: 5px; }
.subject-card p { color: var(--muted); font-size: 13.5px; }
.sc-badge { color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 3px 9px; font-size: 12.5px; display: inline-block; margin-top: 10px; }

.paper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.paper-card { padding: 20px; display: flex; flex-direction: column; position: relative; }
.paper-card:hover { box-shadow: var(--shadow-lg); border-color: #c3d6f7; }
.paper-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.paper-top h3 { font-size: 17px; }
.paper-no {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none;
}
.status-badge { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.st-not { background: #f0f3f8; color: #77849a; }
.st-ing { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-guest { background: #f0f3f8; color: #77849a; }
.paper-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 12px 0; margin-bottom: 12px; }
.paper-meta div { text-align: center; font-size: 12px; color: var(--muted); }
.paper-meta b { display: block; color: var(--ink); font-size: 16px; font-weight: 650; }
.paper-best { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.paper-best b { color: var(--brand); font-size: 15px; }
.paper-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.paper-actions .btn { flex: 1; min-width: 96px; padding: 8px 10px; font-size: 13.5px; }
/* ---------- 答题页 ---------- */
.exam-wrap { padding-bottom: 74px; }
.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.exam-head h2 { font-size: 18px; }
.exam-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.exam-tools { display: flex; align-items: center; gap: 10px; }
.timer {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 13px; font-variant-numeric: tabular-nums;
  font-weight: 650; color: var(--ink-2); font-size: 14px;
}
.timer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.progress-line { height: 5px; background: #e7edf7; border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.progress-line i { display: block; height: 100%; background: linear-gradient(90deg, #1a56db, #4b91f5); border-radius: 6px; transition: width .25s; }
.exam-grid { display: grid; grid-template-columns: minmax(0, 1fr) 298px; gap: 20px; align-items: start; }
.q-card { padding: 26px 28px 22px; min-height: 430px; }
.q-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.q-no { font-size: 15px; font-weight: 700; color: var(--brand); }
.q-type { font-size: 12.5px; background: var(--brand-soft); color: var(--brand); padding: 3px 10px; border-radius: 5px; font-weight: 600; }
.q-score { font-size: 12.5px; color: var(--muted); }
.q-stem { font-size: 17px; line-height: 1.85; color: var(--ink); margin-bottom: 22px; white-space: pre-wrap; word-break: break-word; }
.q-options { display: flex; flex-direction: column; gap: 11px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  cursor: pointer; transition: .14s; text-align: left; width: 100%; color: var(--ink);
  font-size: 15px; line-height: 1.65;
}
.opt:hover { border-color: #a9c4f5; background: #fafcff; }
.opt-key {
  flex: none; width: 27px; height: 27px; border-radius: 50%; border: 1.5px solid #ccd7e8;
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: var(--muted);
  background: #fff; transition: .14s;
}
.opt-text { padding-top: 1px; word-break: break-word; }
.opt.selected { border-color: var(--brand); background: var(--brand-softer); }
.opt.selected .opt-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.multi .opt-key { border-radius: 6px; }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.q-nav .tip { color: var(--muted); font-size: 12.5px; }
.q-nav-right { display: flex; gap: 10px; }

.side-card { position: sticky; top: 80px; padding: 18px; }
.side-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-title h3 { font-size: 15.5px; }
.card-stat { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.card-stat b { font-size: 16px; }
.card-stat .s-done b { color: var(--brand); }
.card-stat .s-left b { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-height: 330px; overflow-y: auto; padding: 2px; }
.card-cell {
  aspect-ratio: 1/1; border: 1.5px solid var(--line); border-radius: 7px; background: #fff;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  display: grid; place-items: center; transition: .13s; padding: 0;
}
.card-cell:hover { border-color: var(--brand); color: var(--brand); }
.card-cell.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.card-cell.current { outline: 2.5px solid #f0a333; outline-offset: 1px; color: var(--brand); border-color: var(--brand); font-weight: 800; }
.card-cell.current.done { color: #fff; }
.card-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 14px 0 16px; }
.card-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.lg-done { background: var(--brand); }
.lg-todo { background: #fff; border: 1.5px solid var(--line); }
.lg-cur { border: 2px solid #f0a333; }
.side-card .btn-submit { margin-top: 4px; }

.mobile-bar { display: none; }
.drawer-mask { display: none; }

/* ---------- 成绩页 ---------- */
.result-hero { padding: 32px; text-align: center; margin-bottom: 18px; }
.result-hero .rh-label { color: var(--muted); font-size: 14px; }
.result-score { font-size: 54px; font-weight: 750; color: var(--brand); line-height: 1.2; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.result-score small { font-size: 19px; color: var(--muted); font-weight: 500; }
.result-verdict { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-top: 8px; }
.v-pass { background: var(--ok-soft); color: var(--ok); }
.v-fail { background: var(--warn-soft); color: var(--warn); }
.result-meta { color: var(--muted); font-size: 13px; margin-top: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 12px; text-align: center; }
.stat-box b { display: block; font-size: 25px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-box span { font-size: 12.5px; color: var(--muted); }
.stat-box.ok b { color: var(--ok); }
.stat-box.bad b { color: var(--danger); }
.stat-box.blue b { color: var(--brand); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; }

/* ---------- 解析页 ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-btn {
  padding: 7px 16px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 20px; font-size: 13.5px; cursor: pointer; font-weight: 500;
}
.filter-btn:hover { border-color: #b6ccf4; color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.review-item { padding: 22px 24px; margin-bottom: 14px; }
.rev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rev-no { font-weight: 700; color: var(--brand); font-size: 15px; }
.rev-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 5px; }
.rs-correct { background: var(--ok-soft); color: var(--ok); }
.rs-wrong { background: var(--danger-soft); color: var(--danger); }
.rs-partial { background: var(--warn-soft); color: var(--warn); }
.rs-blank { background: #f0f3f8; color: #77849a; }
.rev-stem { font-size: 15.5px; line-height: 1.8; margin-bottom: 14px; white-space: pre-wrap; }
.rev-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rev-opt { display: flex; gap: 10px; padding: 9px 13px; border-radius: 7px; border: 1px solid var(--line-2); font-size: 14.5px; align-items: flex-start; }
.rev-opt .k { font-weight: 700; flex: none; }
.rev-opt.is-right { background: var(--ok-soft); border-color: #b7e3cd; color: #0d6d49; }
.rev-opt.is-picked { border-color: #f0b8b7; background: var(--danger-soft); }
.rev-opt.is-right.is-picked { background: var(--ok-soft); border-color: #b7e3cd; }
.rev-opt .mark { margin-left: auto; font-size: 12px; font-weight: 600; flex: none; }
.rev-answer { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; padding: 12px 14px; background: var(--brand-softer); border-radius: 8px; margin-bottom: 12px; }
.rev-answer b { font-weight: 700; }
.ans-right { color: var(--ok); }
.ans-wrong { color: var(--danger); }
.rev-analysis { font-size: 14px; line-height: 1.8; color: var(--ink-2); background: #f8fafd; border-left: 3px solid #c9d9f5; padding: 12px 15px; border-radius: 0 7px 7px 0; white-space: pre-wrap; }
.rev-foot { margin-top: 14px; display: flex; justify-content: flex-end; }

/* ---------- 列表 / 表格 ---------- */
.list-row { padding: 18px 22px; margin-bottom: 12px; display: flex; align-items: center; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.list-row h3 { font-size: 16px; margin-bottom: 5px; }
.list-row .lr-sub { color: var(--muted); font-size: 13px; }
.list-row .lr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lr-score { font-size: 22px; font-weight: 700; color: var(--brand); }
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.tbl th { background: #f7fafe; color: var(--ink-2); font-weight: 650; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafcff; }

/* ---------- 登录 ---------- */
.auth-wrap { max-width: 430px; margin: 30px auto; padding: 30px 30px 26px; }
.auth-tabs { display: flex; gap: 6px; background: #f2f6fc; padding: 4px; border-radius: 9px; margin-bottom: 22px; }
.auth-tab { flex: 1; text-align: center; padding: 9px; border-radius: 7px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--muted); border: none; background: transparent; }
.auth-tab.active { background: #fff; color: var(--brand); box-shadow: 0 1px 5px rgba(20,50,100,.09); }
.auth-wrap h2 { font-size: 21px; margin-bottom: 6px; }
.auth-wrap .auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ---------- 空态 / 加载 / 提示 ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 27px; font-weight: 700; }
.empty-state h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 14px; margin-bottom: 18px; }
.error-state .empty-icon { background: var(--danger-soft); color: var(--danger); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 90px 0; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid #cfdcf3; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 30, 58, .45); z-index: 200;
  display: grid; place-items: center; padding: 18px; opacity: 0; transition: opacity .2s;
}
.modal-mask.in { opacity: 1; }
.modal {
  width: min(100%, 430px); max-height: 88vh; overflow: auto; background: #fff;
  border-radius: 13px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98);
  transition: transform .2s;
}
.modal-mask.in .modal { transform: none; }
.modal-wide { width: min(100%, 680px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal-head h3 { font-size: 17px; }
.modal-x { border: none; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-body { padding: 4px 22px 18px; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }
.modal-text { white-space: pre-wrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line-2); }
.submit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.submit-stats div { background: #f6f9fe; border-radius: 9px; padding: 13px 8px; text-align: center; }
.submit-stats b { display: block; font-size: 23px; color: var(--brand); font-weight: 700; }
.submit-stats span { font-size: 12.5px; color: var(--muted); }
.submit-alert { background: var(--warn-soft); border: 1px solid #f3ddb0; color: #855c0c; border-radius: 8px; padding: 11px 13px; font-size: 13.5px; margin-top: 10px; }
#toast-root { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); border-radius: 9px; padding: 10px 16px; font-size: 14px;
  color: var(--ink); opacity: 0; transform: translateY(-8px); transition: .22s; max-width: 90vw;
}
.toast.in { opacity: 1; transform: none; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.toast-error .toast-dot { background: var(--danger); }
.toast-success .toast-dot { background: var(--ok); }
.toast-warn .toast-dot { background: #e8a020; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 18px 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.footer-link { font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .paper-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .exam-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
  .card-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 780px) {
  .topbar { height: 56px; }
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .brand-text { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; }
  .nav { gap: 0; flex: 1; justify-content: flex-start; }
  .nav-link { padding: 6px 8px; font-size: 12.5px; white-space: nowrap; }
  .btn-reg, .user-name { display: none; }
  #btn-logout { padding: 5px 9px; font-size: 12px; }
  .top-right { gap: 6px; }
  .container { padding: 0 14px; }
  #view { padding: 16px 0 34px; min-height: calc(100vh - 56px - 90px); }
  .hero { padding: 30px 24px; border-radius: 13px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero-meta { gap: 20px; margin-top: 20px; }
  .hero-meta b { font-size: 19px; }
  .subject-grid, .steps { grid-template-columns: 1fr; }
  .paper-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .result-hero { padding: 26px 16px; }
  .result-score { font-size: 46px; }
  .q-card { padding: 20px 18px; min-height: 0; }
  .q-stem { font-size: 16px; }
  .exam-grid { grid-template-columns: 1fr; }
  .side-card { display: none; }
  .exam-wrap { padding-bottom: 78px; }
  .mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: #fff; border-top: 1px solid var(--line); padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    gap: 9px; box-shadow: 0 -3px 14px rgba(20,50,100,.07);
  }
  .mobile-bar .btn { flex: 1; padding: 11px 8px; }
  .mobile-bar .mb-card { flex: 0 0 92px; background: var(--brand-soft); color: var(--brand); }
  .drawer-mask {
    position: fixed; inset: 0; z-index: 120; background: rgba(15,30,58,.42);
    display: none; align-items: flex-end;
  }
  .drawer-mask.show { display: flex; }
  .drawer {
    background: #fff; width: 100%; border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    max-height: 78vh; overflow: auto; animation: slideUp .24s ease;
  }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .drawer .card-grid { grid-template-columns: repeat(6, 1fr); max-height: 44vh; }
  .drawer .btn-submit { margin-top: 16px; }
  .q-nav { display: none; }
  .card-legend { margin-top: 12px; }
  .footer-inner { justify-content: center; text-align: center; }
  .list-row { padding: 16px; }
  .auth-wrap { margin: 14px auto; padding: 24px 20px; }
  .filter-btn { padding: 6px 12px; font-size: 13px; }
  .review-item { padding: 18px 16px; }
  .result-actions { padding: 16px; }
  .result-actions .btn { flex: 1 1 45%; }
}
@media (max-width: 400px) {
  .cat-grid { grid-template-columns: 1fr; }
  .topbar-inner { gap: 8px; padding: 0 10px; }
  .nav-link { padding: 5px 5px; font-size: 12px; }
  .top-right { gap: 4px; }
  .top-right .btn { padding: 5px 8px; font-size: 12px; }
  .card-grid, .drawer .card-grid { grid-template-columns: repeat(5, 1fr); }
}
