/* ============================================================
   测试板块 —— D&D 阵营测试
   跟随站点红黑金,独立分区
   ============================================================ */

.tests-page {
  --t-crimson: #b8202e;
  --t-crimson-lt: #e04a58;
  --t-gold: #d4a24a;
  --t-gold-lt: #f0d08a;
  --t-ink: #0a0c10;
  --t-panel: rgba(18, 14, 24, .72);
  --t-panel-lt: rgba(30, 24, 42, .8);
  --t-line: rgba(212, 162, 74, .22);
  --t-text: #ece8f0;
  --t-dim: #b9b0c4;
  --t-mute: #8b8299;
}

/* ══════════ 页面骨架 ══════════ */
.tests-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 90px;
}
.tests-hero {
  padding: 70px 0 44px;
  text-align: center;
}
.tests-tag {
  font-size: 11px; letter-spacing: .34em;
  color: var(--t-gold); opacity: .8; margin-bottom: 16px;
}
.tests-title {
  font-size: clamp(30px, 5.4vw, 54px);
  font-weight: 700; letter-spacing: .04em;
  margin: 0 0 18px;
}
.tests-title em {
  font-style: normal;
  color: var(--t-crimson-lt);
}
.tests-lead {
  max-width: 620px; margin: 0 auto;
  font-size: 15px; line-height: 1.9; color: var(--t-dim);
}

/* ══════════ 版本选择 ══════════ */
.ver-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0 0;
}
/* ⭐ 单版本(合并题库)—— 一张卡占满 */
.ver-picker.single { grid-template-columns: 1fr; max-width: 720px; margin-left: auto; margin-right: auto; }
.ver-card.static { border-color: rgba(184, 32, 46, .3); }
.ver-card.static::after { display: none; }
.ver-card {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--t-line);
  border-radius: 4px;
  background: var(--t-panel);
  cursor: pointer;
  text-align: left;
  transition: border-color .25s, background .25s, transform .25s;
  color: inherit;
  font: inherit;
  display: block;
  width: 100%;
}
.ver-card:hover {
  border-color: rgba(212, 162, 74, .55);
  transform: translateY(-3px);
}
.ver-card.sel {
  border-color: var(--t-crimson);
  background: var(--t-panel-lt);
  box-shadow: 0 0 0 1px rgba(184, 32, 46, .35), 0 14px 40px rgba(0, 0, 0, .45);
}
/* ⭐ 选中标记 —— 让用户一眼看出选了哪张 */
.ver-card::after {
  content: "✓";
  position: absolute; top: 14px; right: 16px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; color: transparent;
  border: 1px solid var(--t-line);
  transition: all .25s;
}
.ver-card.sel::after {
  background: var(--t-crimson);
  border-color: var(--t-crimson);
  color: #fff;
}
.ver-card:focus-visible {
  outline: 2px solid var(--t-gold);
  outline-offset: 3px;
}
.ver-badge {
  display: inline-block;
  font-size: 10px; letter-spacing: .2em;
  padding: 3px 9px; border-radius: 2px;
  border: 1px solid var(--t-line);
  color: var(--t-dim);
  margin-bottom: 12px;
}
.ver-card.sel .ver-badge {
  border-color: var(--t-crimson);
  color: var(--t-crimson-lt);
}
.ver-card.nsfw .ver-badge {
  border-color: rgba(184, 32, 46, .5);
  color: var(--t-crimson-lt);
}
.ver-name {
  font-size: 21px; font-weight: 700;
  margin: 0 0 8px;
}
.ver-name-en {
  font-size: 11px; letter-spacing: .16em;
  color: var(--t-mute); margin-bottom: 12px;
  display: block;
}
.ver-desc {
  font-size: 13.5px; line-height: 1.85; color: var(--t-dim);
  margin: 0 0 16px;
}
.ver-facts {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--t-mute);
}
.ver-facts span { display: flex; align-items: center; gap: 5px; }
.ver-facts i { color: var(--t-gold); font-style: normal; }

/* 版本说明条 */
.ver-note {
  margin: 22px 0 0;
  padding: 16px 20px;
  border-left: 2px solid var(--t-gold);
  background: rgba(212, 162, 74, .06);
  font-size: 13.5px; line-height: 1.9; color: var(--t-dim);
}
.ver-note strong { color: var(--t-gold-lt); font-weight: 600; }
.ver-note .hint { display: block; margin-top: 6px; color: var(--t-mute); font-size: 12.5px; }

/* 年龄确认 */
.age-gate {
  margin: 22px 0 0;
  padding: 18px 20px;
  border: 1px solid rgba(184, 32, 46, .38);
  border-radius: 4px;
  background: rgba(184, 32, 46, .07);
}
.age-gate-title {
  font-size: 14px; font-weight: 600; color: var(--t-crimson-lt);
  margin-bottom: 10px;
}
.age-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; line-height: 1.7; color: var(--t-dim);
  cursor: pointer;
}
.age-check input {
  margin: 3px 0 0; width: 16px; height: 16px;
  accent-color: var(--t-crimson); flex: 0 0 auto; cursor: pointer;
}

/* 开始按钮 */
.tests-start {
  margin: 30px 0 0; text-align: center;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 42px;
  background: linear-gradient(135deg, var(--t-crimson), #8e1520);
  color: #fff; border: none; border-radius: 3px;
  font-size: 15px; font-weight: 600; letter-spacing: .08em;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 8px 26px rgba(184, 32, 46, .32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(184, 32, 46, .42); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ══════════ 答题区 ══════════ */
.quiz {
  display: none;
}
.quiz.on { display: block; }

.quiz-top {
  position: sticky; top: 62px; z-index: 20;
  background: rgba(10, 12, 16, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--t-line);
  padding: 14px 0 0;
  margin-bottom: 30px;
}
.quiz-bar {
  height: 3px; background: rgba(212, 162, 74, .13);
  border-radius: 2px; overflow: hidden; margin-bottom: 12px;
}
.quiz-bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--t-crimson), var(--t-gold));
  transition: width .4s var(--ease);
}
.quiz-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; font-size: 12.5px; color: var(--t-mute);
  margin-bottom: 14px;
}
.quiz-meta b { color: var(--t-gold-lt); font-weight: 600; }
.quiz-ver-tag {
  display: inline-block; padding: 2px 8px;
  border: 1px solid var(--t-line); border-radius: 2px;
  font-size: 10.5px; letter-spacing: .16em;
}
.quiz-ver-tag.nsfw { border-color: rgba(184,32,46,.5); color: var(--t-crimson-lt); }

.q-card {
  border: 1px solid var(--t-line);
  border-radius: 4px;
  background: var(--t-panel);
  padding: 30px 28px 26px;
}
.q-text {
  font-size: 17px; line-height: 1.85;
  margin: 0 0 24px; color: var(--t-text);
}
.q-ref {
  font-size: 11.5px; color: var(--t-mute);
  margin: -12px 0 20px; padding-left: 11px;
  border-left: 2px solid rgba(212, 162, 74, .3);
  line-height: 1.7;
}
.q-opts { display: grid; gap: 11px; }
.q-opt {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 18px;
  border: 1px solid var(--t-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .015);
  cursor: pointer;
  font-size: 14.5px; line-height: 1.75;
  color: var(--t-dim);
  transition: border-color .2s, background .2s, color .2s;
  text-align: left; font-family: inherit; width: 100%;
}
.q-opt:hover {
  border-color: rgba(212, 162, 74, .5);
  background: rgba(212, 162, 74, .05);
  color: var(--t-text);
}
.q-opt.sel {
  border-color: var(--t-crimson);
  background: rgba(184, 32, 46, .1);
  color: var(--t-text);
}
.q-opt-key {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--t-line);
  display: grid; place-items: center;
  font-size: 11.5px; color: var(--t-mute);
  margin-top: 1px;
  transition: all .2s;
}
.q-opt.sel .q-opt-key {
  background: var(--t-crimson); border-color: var(--t-crimson);
  color: #fff;
}

.quiz-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 22px;
}
.btn-ghost {
  padding: 11px 26px;
  background: transparent;
  border: 1px solid var(--t-line);
  border-radius: 3px;
  color: var(--t-dim);
  font-size: 13.5px; cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(212, 162, 74, .5); color: var(--t-text);
}
.btn-ghost:disabled { opacity: .3; cursor: not-allowed; }
.btn-ghost.on { border-color: var(--t-crimson); color: var(--t-crimson-lt); }

/* ══════════ 结果区 ══════════ */
.result { display: none; }
.result.on { display: block; }

.res-card {
  border: 1px solid var(--t-line);
  border-radius: 4px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(184, 32, 46, .12), transparent 62%),
    var(--t-panel);
  padding: 36px 30px 30px;
  text-align: center;
}
.res-kicker {
  font-size: 10.5px; letter-spacing: .3em;
  color: var(--t-gold); opacity: .85; margin-bottom: 14px;
}
.res-name {
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 700; margin: 0 0 8px; letter-spacing: .04em;
}
.res-name-en {
  font-size: 13px; letter-spacing: .2em;
  color: var(--t-mute); margin-bottom: 22px;
}
.res-sub {
  font-size: 15px; color: var(--t-gold-lt);
  margin: 0 0 30px; line-height: 1.8;
}

/* 四条倾向条 */
.axes {
  display: grid; gap: 14px;
  max-width: 520px; margin: 0 auto 28px;
  text-align: left;
}
.axis-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; }
.axis-name { font-size: 13px; color: var(--t-dim); }
.axis-name.right { text-align: right; }
.axis-track {
  height: 8px; border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  position: relative; overflow: hidden;
}
.axis-fill {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--t-gold), var(--t-gold-lt));
  border-radius: 4px;
  transition: width .8s var(--ease);
}
.axis-fill.right { background: linear-gradient(90deg, #6a3f8c, #9b6fc4); }
.axis-fill.evil { background: linear-gradient(90deg, #6b1414, var(--t-crimson-lt)); }
.axis-pct { font-size: 13px; color: var(--t-gold-lt); font-weight: 600; }
.axis-pct.right { text-align: right; }

/* 阵营说明 */
.res-desc {
  max-width: 640px; margin: 0 auto 28px;
  font-size: 14.5px; line-height: 2; color: var(--t-dim);
  text-align: left;
  padding: 20px 22px;
  border-left: 2px solid var(--t-gold);
  background: rgba(212, 162, 74, .05);
}
.res-desc b { color: var(--t-gold-lt); font-weight: 600; }

/* 结果操作 */
.res-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.btn-copy {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  background: transparent; border: 1px solid var(--t-line);
  border-radius: 3px; color: var(--t-dim);
  font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: all .2s;
}
.btn-copy:hover { border-color: rgba(212, 162, 74, .55); color: var(--t-text); }
.btn-copy.done { border-color: #4a8f5c; color: #7fce94; }

/* 截图提示 */
.shot-tip {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin: 0 auto 26px; padding: 12px 18px;
  border: 1px dashed rgba(212, 162, 74, .4);
  border-radius: 3px;
  background: rgba(212, 162, 74, .05);
  font-size: 13px; color: var(--t-gold-lt);
  max-width: 520px;
  text-align: left; line-height: 1.7;
}
.shot-tip svg { flex: 0 0 auto; opacity: .9; }

/* ══════════ 逐题回顾 ══════════ */
.review { margin-top: 34px; }
.review-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--t-line);
}
.review-head h3 { font-size: 17px; margin: 0; font-weight: 600; }
.review-head span { font-size: 12px; color: var(--t-mute); }
.rv-item {
  padding: 16px 18px;
  border: 1px solid var(--t-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .012);
  margin-bottom: 10px;
}
.rv-q { font-size: 14px; line-height: 1.8; color: var(--t-dim); margin-bottom: 10px; }
.rv-a { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.75; }
.rv-badge {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 2px;
  font-size: 10.5px; letter-spacing: .1em;
  border: 1px solid var(--t-line); color: var(--t-mute);
  margin-top: 2px;
}
.rv-badge.lg { border-color: rgba(212,162,74,.5); color: var(--t-gold-lt); }
.rv-badge.le { border-color: rgba(184,32,46,.5); color: var(--t-crimson-lt); }
.rv-badge.lc { border-color: rgba(120,90,160,.5); color: #b79ae0; }
.rv-badge.ln { border-color: rgba(255,255,255,.16); color: var(--t-mute); }
.rv-badge.ll { border-color: rgba(212,162,74,.45); color: var(--t-gold-lt); }
.rv-badge.cg { border-color: rgba(90,150,120,.5); color: #7fc9a0; }
.rv-badge.ce { border-color: rgba(184,32,46,.5); color: var(--t-crimson-lt); }
.rv-badge.cn { border-color: rgba(120,90,160,.5); color: #b79ae0; }
.rv-badge.ng { border-color: rgba(90,150,120,.5); color: #7fc9a0; }
.rv-badge.ne { border-color: rgba(184,32,46,.45); color: #d98390; }
.rv-badge.nn { border-color: rgba(255,255,255,.16); color: var(--t-mute); }
.rv-text { color: var(--t-text); }

/* ══════════ 历史 ══════════ */
.hist { margin-top: 40px; }
.hist-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--t-line);
}
.hist-head h3 { font-size: 16px; margin: 0; font-weight: 600; }
.hist-clear {
  background: none; border: none; color: var(--t-mute);
  font-size: 12px; cursor: pointer; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0;
}
.hist-clear:hover { color: var(--t-crimson-lt); }
.hist-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--t-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .012);
  margin-bottom: 8px;
}
.hist-main { flex: 1; min-width: 0; }
.hist-name { font-size: 14px; font-weight: 600; color: var(--t-text); }
.hist-meta { font-size: 11.5px; color: var(--t-mute); margin-top: 3px; }
.hist-del {
  background: none; border: none; color: var(--t-mute);
  font-size: 12px; cursor: pointer; font-family: inherit;
  padding: 4px 8px; border-radius: 2px; flex: 0 0 auto;
}
.hist-del:hover { color: var(--t-crimson-lt); background: rgba(184,32,46,.1); }
.hist-empty { font-size: 13px; color: var(--t-mute); padding: 18px 0; text-align: center; }

/* ══════════ 免责 ══════════ */
.tests-note {
  margin-top: 44px; padding-top: 20px;
  border-top: 1px solid var(--t-line);
  font-size: 12px; line-height: 1.9; color: var(--t-mute);
}
.tests-note a { color: var(--t-dim); }

/* ══════════ 移动端 ══════════ */
@media (max-width: 700px) {
  .tests-wrap { padding: 0 16px 70px; }
  .tests-hero { padding: 48px 0 34px; }
  .ver-picker { grid-template-columns: 1fr; gap: 12px; }
  .ver-card { padding: 20px 18px; }
  .q-card { padding: 22px 18px 20px; }
  .q-text { font-size: 15.5px; }
  .q-opt { padding: 13px 14px; font-size: 13.5px; }
  .quiz-top { top: 56px; }
  .res-card { padding: 26px 18px 24px; }
  .axis-row { grid-template-columns: 38px 1fr 38px; gap: 9px; }
  .axis-name, .axis-pct { font-size: 11.5px; }
  .shot-tip { font-size: 12px; padding: 11px 14px; }
}
