/* ===================================================================
   人工智能训练师（二级）· 理论刷题 —— 样式
   设计基调：浅色卡片 + 蓝紫渐变主色 + 模块专属色（--mc）
   =================================================================== */
:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --card-2: #f6f8fc;
  --text: #17202e;
  --text-2: #55617a;
  --text-3: #8f9cb4;
  --line: #e5eaf3;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-soft: #e9f0ff;
  --ok: #0f9d58;
  --ok-soft: #e4f7ec;
  --bad: #e5484d;
  --bad-soft: #ffe9ea;
  --warn: #d97706;
  --warn-soft: #fff5e3;
  --shadow-sm: 0 2px 10px -4px rgba(22, 40, 80, .16);
  --shadow: 0 12px 32px -18px rgba(22, 40, 80, .34);
  --radius: 16px;
}
html[data-theme="dark"] {
  --bg: #0e131b;
  --card: #161f2a;
  --card-2: #1c2632;
  --text: #e8eef7;
  --text-2: #a3aec2;
  --text-3: #6e7c92;
  --line: #26313f;
  --brand: #5a95ff;
  --brand-2: #a78bfa;
  --brand-soft: #17253c;
  --ok: #3ecb7c;
  --ok-soft: #132e1f;
  --bad: #ff6b6f;
  --bad-soft: #33191b;
  --warn: #f0a92c;
  --warn-soft: #30260f;
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, .7);
  --shadow: 0 12px 32px -18px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.66; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 16px 96px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 940px; margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  box-shadow: 0 4px 12px -5px var(--brand); letter-spacing: .5px;
}
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); line-height: 1.25; }
.spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 通用 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px -9px var(--brand); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.lg { padding: 11px 18px; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 8px;
  border-radius: 99px; background: var(--card-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.bar { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .35s; }
.sec-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; flex-wrap: wrap; }
.sec-title h2 { font-size: 16px; margin: 0; letter-spacing: .3px; }
.sec-title .hint { font-size: 12.5px; color: var(--text-3); }
.muted { color: var(--text-3); font-size: 12.5px; }
.empty { padding: 42px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 30px; margin-bottom: 6px; }
.note { padding: 13px 16px; font-size: 13px; color: var(--text-2); line-height: 1.8; margin-bottom: 6px; }

/* ---------- 首页 ---------- */
.hero {
  margin-top: 18px; padding: 26px 24px; border-radius: 22px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2563eb 0%, #6d4cf6 52%, #8b5cf6 100%);
  box-shadow: 0 20px 46px -26px rgba(37, 99, 235, .95);
}
.hero::after { content: ""; position: absolute; right: -46px; top: -66px; width: 210px; height: 210px; border-radius: 50%; background: rgba(255,255,255,.13); }
.hero::before { content: ""; position: absolute; right: 76px; bottom: -104px; width: 176px; height: 176px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero h1 { margin: 0 0 6px; font-size: 23px; letter-spacing: .5px; position: relative; }
.hero p { margin: 0; font-size: 12.8px; color: rgba(255,255,255,.88); position: relative; }
.hero-stats { display: flex; gap: 24px; margin-top: 18px; position: relative; flex-wrap: wrap; }
.hero-stats b { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.hero-stats span { display: block; font-size: 11px; color: rgba(255,255,255,.82); }

.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 13px; }
.bank {
  padding: 17px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s; display: flex; flex-direction: column; gap: 12px;
  border-left: 3px solid var(--mc, var(--brand));
}
.bank:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bank-top { display: flex; gap: 12px; align-items: flex-start; }
.bank .ico { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 19px; background: var(--card-2); }
.bank h3 { margin: 0; font-size: 15px; }
.bank .full { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }
.bank .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.bank .meta b { color: var(--text); font-variant-numeric: tabular-nums; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 11px; }
.quick {
  padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow-sm); display: flex; gap: 11px; align-items: center; text-align: left; transition: .15s;
}
.quick:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.quick .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--card-2); flex: none; }
.quick b { display: block; font-size: 13.5px; }
.quick span { font-size: 11.5px; color: var(--text-3); }


/* ---------- 真题卷列表 ---------- */
.paper-list { display: flex; flex-direction: column; gap: 10px; }
.paper-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); flex-wrap: wrap;
}
.pi-main { flex: 1; min-width: 180px; }
.pi-main b { display: block; font-size: 14px; }
.pi-main span { font-size: 11.8px; color: var(--text-3); }
.paper-btns { display: flex; gap: 7px; }

.paper-tbl { padding: 6px 14px 12px; overflow-x: auto; }.paper-tbl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.paper-tbl th, .paper-tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.paper-tbl th { font-size: 12px; color: var(--text-3); font-weight: 600; }
.paper-tbl tr:last-child td { border-bottom: 0; }

/* ---------- 模块页 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 11px; }
.stat { padding: 13px 15px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--text-3); }

.act-bar { padding: 14px; display: flex; gap: 9px; flex-wrap: wrap; }
.tag-list { display: flex; flex-direction: column; gap: 9px; }
.tag-row {
  padding: 13px 15px; border-radius: 13px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s;
}
.tag-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateX(2px); }
.tag-h { display: flex; align-items: center; gap: 9px; }
.tag-h b { font-size: 14px; }
.anchor { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

/* ---------- 知识框架 ---------- */
.mod-card {
  padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); margin-bottom: 12px; border-top: 3px solid var(--mc, var(--brand));
}
.mod-h { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.mod-no {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--mc, var(--brand)); color: #fff; font-size: 12.5px; font-weight: 800;
}
.mod-h b { display: block; font-size: 14.5px; }
.mod-h span { font-size: 11.5px; color: var(--text-3); }
.mod-stat { margin-left: auto; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mod-tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 11px; }
.chip {
  text-align: left; padding: 9px 11px; border-radius: 11px; border: 1px dashed var(--line);
  background: var(--card-2); color: var(--text); display: flex; flex-direction: column; gap: 2px; transition: .15s;
}
.chip:hover { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.chip b { font-size: 13px; }
.chip span { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.chip i { font-size: 10.5px; color: var(--brand); font-style: normal; }
.mod-foot { margin-top: 11px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tpl { padding: 15px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tpl-h { font-weight: 700; font-size: 13.5px; color: var(--brand); margin-bottom: 8px; }
.tpl ol { margin: 0; padding-left: 20px; font-size: 12.8px; color: var(--text-2); line-height: 1.85; }
.tpl-tip { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--warn); }

/* ---------- 答题页 ---------- */
.phead { display: flex; align-items: center; gap: 10px; margin: 14px 0 11px; }
.phead .name { font-weight: 700; font-size: 15px; }
.phead .sub { font-size: 11.5px; color: var(--text-3); }
.phead .timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); font-size: 15px; }

.qcard { padding: 20px; }
.qmeta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.qstem { font-size: 16.5px; line-height: 1.8; font-weight: 500; margin: 0 0 16px; white-space: pre-wrap; word-break: break-word; }

.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: flex; gap: 11px; align-items: flex-start; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 12px; background: var(--card-2); color: var(--text);
  border: 1.5px solid transparent; transition: .15s; line-height: 1.6;
}
.option:hover { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.option .k {
  width: 23px; height: 23px; flex: none; border-radius: 7px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; background: var(--card); color: var(--text-2);
  border: 1px solid var(--line); margin-top: 1px;
}
.option .t { flex: 1; word-break: break-word; }
.option.sel { border-color: var(--brand); background: var(--brand-soft); }
.option.sel .k { background: var(--brand); color: #fff; border-color: var(--brand); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct .k { background: var(--ok); color: #fff; border-color: var(--ok); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .k { background: var(--bad); color: #fff; border-color: var(--bad); }
.option[data-locked="1"] { cursor: default; }

.verdict { margin-top: 16px; padding: 14px 15px; border-radius: 13px; background: var(--card-2); border: 1px solid var(--line); }
.verdict.ok { background: var(--ok-soft); border-color: transparent; }
.verdict.bad { background: var(--bad-soft); border-color: transparent; }
.verdict .l1 { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 5px; }
.verdict.ok .l1 { color: var(--ok); }
.verdict.bad .l1 { color: var(--bad); }
.verdict .ans { font-size: 13.5px; color: var(--text-2); }
.verdict .ans b { color: var(--text); }

/* 解析四段 */
.ex { margin-top: 12px; }
.ex-h { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.ex-i {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; flex: none;
}
.ex-b { font-size: 13.8px; line-height: 1.8; color: var(--text); background: color-mix(in srgb, var(--card) 60%, transparent); padding: 9px 12px; border-radius: 10px; }
.ex-ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.85; color: var(--text); }
.ex-ol li { margin-bottom: 3px; }
.ex-opts { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.ex-opts > div { display: flex; gap: 8px; align-items: baseline; }
.ex-opts b {
  flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  background: var(--bad-soft); color: var(--bad); font-size: 11.5px;
}
.ex-opts span { color: var(--text-2); }
.ex-trap {
  margin-top: 11px; padding: 9px 12px; border-radius: 10px; font-size: 12.8px; line-height: 1.75;
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}

/* 问答题 */
.essay-ask {
  padding: 13px 15px; border-radius: 12px; background: var(--brand-soft); border: 1px dashed color-mix(in srgb, var(--brand) 40%, transparent);
  font-size: 13px; color: var(--text-2); margin-bottom: 12px;
}
.essay-ask b { display: block; color: var(--brand); font-size: 13px; margin-bottom: 3px; }
.essay-ask span { display: block; line-height: 1.75; }
.ref { margin-top: 12px; border-radius: 12px; background: var(--card-2); padding: 12px 14px; }
.ref-h { font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.ref-b { font-size: 13.6px; line-height: 1.9; white-space: pre-wrap; }
.pts { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.85; color: var(--text-2); }
.self { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.self-btns { display: flex; gap: 9px; margin-top: 9px; flex-wrap: wrap; }

.pfoot { display: flex; align-items: center; gap: 9px; margin-top: 13px; flex-wrap: wrap; }
.pfoot .spacer { flex: 1; }

.acard { margin-top: 14px; padding: 15px; }
details.acard > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.acard > summary::-webkit-details-marker { display: none; }
details.acard > summary::after { content: "▾"; font-size: 11px; color: var(--text-3); transition: .2s; }
details.acard[open] > summary::after { transform: rotate(180deg); }
details.acard[open] > summary { margin-bottom: 8px; }
.acard .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(33px, 1fr)); gap: 5px; margin-top: 9px; }
.acard .cell { height: 31px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); color: var(--text-2); font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.acard .cell.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.acard .cell.sel { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.acard .cell.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.acard .cell.cur { outline: 2px solid var(--brand); outline-offset: 1px; font-weight: 700; }
.acard .legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.acard .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }

/* ---------- 结果 ---------- */
.score { padding: 28px 22px; text-align: center; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #0f9d58, #0b8f7a); box-shadow: 0 18px 44px -24px rgba(15,157,88,.9); }
.score.mid { background: linear-gradient(135deg, #d97706, #c2410c); }
.score.low { background: linear-gradient(135deg, #e5484d, #b91c1c); }
.score b { font-size: 44px; font-weight: 800; letter-spacing: -1px; }
.score small { font-size: 14px; opacity: .85; }
.score p { margin: 6px 0 0; font-size: 13px; opacity: .92; }
.rev-item { padding: 15px; border-bottom: 1px solid var(--line); }
.rev-item:last-child { border-bottom: 0; }
.rev-stem { font-size: 14.5px; margin-bottom: 4px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; gap: 11px; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); text-align: left; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--card-2); }
.row .main { flex: 1; min-width: 0; }
.row .stem { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.prog-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.prog-row:last-child { border-bottom: 0; }
.prog-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 124px; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bnum { font-size: 11px; color: var(--text-3); }
.bbar { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--brand), var(--brand-2)); position: relative; overflow: hidden; }
.bfill { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.4); }
.bday { font-size: 10.5px; color: var(--text-3); }

.search-box { display: flex; gap: 9px; }
.search-box input {
  flex: 1; padding: 11px 14px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); font-size: 14.5px; font-family: inherit; outline: none;
}
.search-box input:focus { border-color: var(--brand); }

/* ---------- 设置 ---------- */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch .lbl b { display: block; font-size: 14px; }
.switch .lbl span { font-size: 11.5px; color: var(--text-3); }
.toggle { width: 44px; height: 25px; border-radius: 99px; background: var(--line); border: 0; position: relative; transition: .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.toggle.on { background: var(--brand); }
.toggle.on::after { left: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: rgba(23,32,44,.95); color: #fff; padding: 9px 17px; border-radius: 11px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 12px 112px; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 20px; }
  .hero-stats { gap: 18px; }
  .qcard { padding: 15px; }
  .qstem { font-size: 15.5px; }
  .pfoot .btn { flex: 1; }
  .topbar-in { padding: 8px 12px; }
  .brand small { display: none; }
  .mod-tags { grid-template-columns: 1fr; }
}
