/* ==========================================================================
   页面级组件样式：标志卡、手势台、场景动画台、题卡、考试面板
   ========================================================================== */

/* ==========================================================================
   1. 交通标志卡片 & 舞台
   ========================================================================== */
.sign-toolbar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(243,245,249,.92); backdrop-filter: blur(8px);
  padding: 12px 0 10px; margin: 0 0 6px;
  border-bottom: 1px solid var(--line);
}
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 9px; }
.filter-row .fl { font-size: 12px; font-weight: 800; color: var(--text-3); letter-spacing: .04em; }

.search-box { position: relative; flex: 1 1 220px; max-width: 340px; }
.search-box input {
  width: 100%; height: 36px; padding: 0 34px 0 34px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-size: 14px; font-family: inherit;
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,99,216,.13); }
.search-box .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search-box .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--text-3); font-size: 15px; display: none; padding: 3px; }
.search-box input:not(:placeholder-shown) ~ .clear { display: block; }

.sign-grid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
}
.sign-card {
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: 13px 11px 12px; cursor: pointer; text-align: center;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  position: relative; overflow: hidden;
}
.sign-card::after {
  content: ''; position: absolute; inset: 0; border-radius: 15px;
  box-shadow: inset 0 0 0 2px var(--brand); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.sign-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: #CBDBF3; }
.sign-card:hover::after { opacity: .35; }
.sign-card:focus-visible { outline: none; }
.sign-card:focus-visible::after { opacity: 1; }
.sign-card .fig {
  height: 96px; display: grid; place-items: center; margin-bottom: 8px;
}
.sign-card .fig svg { width: 88px; height: 84px; overflow: visible; }
.sign-card .nm { font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--text); }
.sign-card .ct { font-size: 10.5px; font-weight: 700; color: var(--text-3); margin-top: 3px; }
.sign-card .done {
  position: absolute; top: 7px; right: 7px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 11px;
  opacity: 0; transform: scale(.6); transition: all .22s var(--ease-back);
}
.sign-card.is-done .done { opacity: 1; transform: none; }

.sign-more { text-align: center; padding: 16px; }
.sign-more .btn { min-width: 190px; }
.sign-count { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-left: auto; }

/* 详情弹窗 */
.sign-detail { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 22px; }
.sign-detail .stage {
  background: linear-gradient(170deg, #F6F8FC, #EAF0F9);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden;
}
.sign-detail .stage svg { width: 100%; max-width: 172px; height: auto; overflow: visible;
  filter: drop-shadow(0 5px 12px rgba(16,32,58,.13)); }
.sign-detail .stage .halo-wrap { position: absolute; inset: 0; pointer-events: none; }
.sign-detail .meta > div + div { margin-top: 12px; }
.sign-detail .lb {
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--text-3);
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.sign-detail .lb::before { content: ''; width: 3px; height: 11px; border-radius: 2px; background: var(--brand); }
.sign-detail .tx { font-size: 14px; color: var(--text-2); line-height: 1.68; }
.sign-detail .tx.tip { color: #0A5C30; }
.sign-detail .tx.exam { color: #8C1810; }
.sign-detail .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.sign-detail .nav-row { display: flex; gap: 8px; margin-top: 16px; }

/* 动画控制条 */
.anim-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.anim-lbl { font-size: 12px; font-weight: 800; color: var(--text-3); }
.anim-chip {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  transition: all .15s var(--ease);
}
.anim-chip:hover { border-color: #B9CCE8; color: var(--text); transform: translateY(-1px); }
.anim-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 标志图例（一排小标志） */
.legend-row { display: flex; gap: 18px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-item svg { width: 56px; height: 56px; flex: none; overflow: visible; }
.legend-item .lt { font-size: 13px; font-weight: 700; }
.legend-item .ls { font-size: 12px; color: var(--text-3); }

/* ==========================================================================
   2. 标线 / 场景 SVG 演示
   ========================================================================== */
.road-stage {
  background: #4A5568; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,.3);
}
.road-stage svg { display: block; width: 100%; height: auto; }

.demo-panel { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .demo-panel { grid-template-columns: minmax(0,1fr); } }

/* ==========================================================================
   3. 记忆卡片（数字类知识点）
   ========================================================================== */
.mem-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.mem-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 17px; position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.mem-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.mem-card .mem-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.mem-card .mem-num {
  font-family: var(--mono); font-weight: 900; font-size: 26px; letter-spacing: -.03em;
  color: var(--brand-deep); line-height: 1;
}
.mem-card .mem-unit { font-size: 12px; font-weight: 800; color: var(--text-3); }
.mem-card .mem-t { font-size: 14.5px; font-weight: 800; }
.mem-card .mem-d { font-size: 13.5px; color: var(--text-2); line-height: 1.66; }
.mem-card .mem-x {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: #0A5C30; background: none;
}
.mem-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand), #6FB0FF);
}
.mem-card.lv12::before { background: linear-gradient(180deg, #D92D20, #FF7A6B); }
.mem-card.lv9::before  { background: linear-gradient(180deg, #E8590C, #FFA94D); }
.mem-card.lv6::before  { background: linear-gradient(180deg, #E0A800, #FFD43B); }
.mem-card.lv3::before  { background: linear-gradient(180deg, #2F9E44, #69DB7C); }
.mem-card.lv1::before  { background: linear-gradient(180deg, #1C7ED6, #74C0FC); }

/* 分值大色块 */
.score-hero { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); margin-bottom: 22px; }
.score-hero .sh {
  border-radius: var(--r-lg); padding: 14px 16px; color: #fff; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s; position: relative; overflow: hidden;
}
.score-hero .sh:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.score-hero .sh .n { font-family: var(--mono); font-size: 34px; font-weight: 900; line-height: 1.05; letter-spacing: -.04em; }
.score-hero .sh .u { font-size: 12.5px; font-weight: 800; opacity: .9; }
.score-hero .sh .d { font-size: 12.5px; margin-top: 6px; opacity: .95; line-height: 1.5; }
.sh.s12 { background: linear-gradient(140deg, #B21F16, #E8593F); }
.sh.s9  { background: linear-gradient(140deg, #C1570A, #EE8B2B); }
.sh.s6  { background: linear-gradient(140deg, #B58A00, #E8B923); }
.sh.s3  { background: linear-gradient(140deg, #1F7A38, #46B85E); }
.sh.s1  { background: linear-gradient(140deg, #175E9E, #3E93D8); }

/* ==========================================================================
   4. 题卡 / 考试
   ========================================================================== */
.qcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-1); }
.qhead { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; flex-wrap: wrap; }
.qhead .qidx { font-family: var(--mono); font-weight: 800; color: var(--text-3); font-size: 13px; }
.qhead .qtags { margin-left: auto; display: flex; gap: 6px; }
.qtext { font-size: 16.5px; font-weight: 700; line-height: 1.65; margin-bottom: 16px; }
.qtext .qn { color: var(--brand); font-family: var(--mono); margin-right: 6px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  padding: 12px 15px; border-radius: var(--r); border: 1.5px solid var(--line);
  background: #fff; font-size: 14.5px; line-height: 1.6; color: var(--text);
  transition: all .16s var(--ease); width: 100%;
}
.opt:hover:not(.locked) { border-color: #A9C6EE; background: #F8FBFF; transform: translateX(2px); }
.opt .k {
  width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; font-family: var(--mono); color: var(--text-3);
  transition: all .16s;
}
.opt:hover:not(.locked) .k { border-color: var(--brand); color: var(--brand); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .k { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.locked { cursor: default; }
.opt .mk { margin-left: auto; font-size: 15px; font-weight: 900; flex: none; }
.opt.right .mk { color: var(--ok); }
.opt.wrong .mk { color: var(--bad); }

.explain {
  margin-top: 15px; padding: 13px 16px; border-radius: var(--r);
  background: #F7F9FD; border-left: 4px solid var(--brand); font-size: 14px; line-height: 1.7;
  animation: dkRise .32s var(--ease) both;
}
.explain .eh { font-weight: 800; color: var(--brand-deep); margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.explain.right-ans { border-left-color: var(--ok); background: var(--ok-soft); }
.explain.right-ans .eh { color: #0A5C30; }
.explain.wrong-ans { border-left-color: var(--bad); background: var(--bad-soft); }
.explain.wrong-ans .eh { color: #8C1810; }

.qbar { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.qbar .spacer { flex: 1; }

/* 考试面板 */
.exam-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px 17px; box-shadow: var(--sh-1); margin-bottom: 15px;
  position: sticky; top: calc(var(--header-h) + 6px); z-index: 35;
}
.exam-top .stat { text-align: center; min-width: 62px; }
.exam-top .stat .v { font-family: var(--mono); font-size: 20px; font-weight: 900; line-height: 1.15; letter-spacing: -.03em; }
.exam-top .stat .l { font-size: 11px; font-weight: 800; color: var(--text-3); letter-spacing: .04em; }
.exam-top .stat.ok .v { color: var(--ok); }
.exam-top .stat.bad .v { color: var(--bad); }
.exam-top .stat.warn .v { color: var(--warn); }
.timer.warn .v { color: var(--warn); }
.timer.danger .v { color: var(--bad); animation: dkPulse 1s ease-in-out infinite; }

.sheet { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.sheet button {
  height: 38px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff;
  font-family: var(--mono); font-weight: 800; font-size: 13px; color: var(--text-2);
  transition: all .15s;
}
.sheet button:hover { border-color: #A9C6EE; transform: translateY(-1px); }
.sheet button.cur { border-color: var(--ink); background: var(--ink); color: #fff; }
.sheet button.right { background: var(--ok-soft); border-color: var(--ok); color: #0A5C30; }
.sheet button.wrong { background: var(--bad-soft); border-color: var(--bad); color: #8C1810; }
.sheet button.flag { box-shadow: inset 0 -3px 0 var(--warn); }

/* 结果页 */
.result-hero { text-align: center; padding: 28px 20px 22px; }
.result-hero .score {
  font-family: var(--mono); font-size: 76px; font-weight: 900; line-height: 1;
  letter-spacing: -.05em; background: linear-gradient(135deg, #1E63D8, #58A6FF);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.result-hero.fail .score { background: linear-gradient(135deg, #D92D20, #FF8A75);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.result-hero .verdict { font-size: 21px; font-weight: 800; margin: 8px 0 4px; }
.result-hero .sub { color: var(--text-2); font-size: 14px; }
.result-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 20px 0; }
.result-stats .rs { background: #F7F9FD; border-radius: var(--r); padding: 12px; text-align: center; }
.result-stats .rs .v { font-family: var(--mono); font-size: 22px; font-weight: 900; }
.result-stats .rs .l { font-size: 11.5px; font-weight: 800; color: var(--text-3); }

/* ==========================================================================
   5. 交警手势台
   ========================================================================== */
.police-stage {
  background: linear-gradient(175deg, #E8EEF7, #D3DFEF);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.police-stage svg { display: block; width: 100%; height: auto; }
.hand-sign-list { display: grid; gap: 11px; }
.hand-item {
  display: flex; gap: 13px; align-items: center; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: #fff;
  cursor: pointer; transition: all .18s var(--ease); text-align: left;
}
.hand-item:hover { border-color: #A9C6EE; transform: translateX(3px); }
.hand-item.on { border-color: var(--brand); background: var(--brand-soft); }
.hand-item .hi-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: #F1F5FB; color: var(--brand-deep);
}
.hand-item.on .hi-ico { background: #fff; }
.hand-item .hi-t { font-size: 14.5px; font-weight: 800; }
.hand-item .hi-s { font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   6. 通用：分节锚点导航
   ========================================================================== */
.anchor-nav {
  display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.anchor-nav a {
  font-size: 13px; font-weight: 700; color: var(--text-2); padding: 5px 11px;
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
  transition: all .15s;
}
.anchor-nav a:hover { border-color: #A9C6EE; color: var(--brand); text-decoration: none; }

/* 空状态 */
.empty { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty .eico { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.empty .et { font-size: 16px; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }

/* 关键数字高亮 */
.num-hl { color: var(--bad); font-weight: 800; font-family: var(--mono); font-size: .96em;
  letter-spacing: -.01em; }
.note.tip .num-hl { color: #0A7A3C; }

/* 口诀块 */
.chant {
  background: linear-gradient(135deg, #FFF9E6, #FFF3CC);
  border: 1px solid #FFE39B; border-radius: var(--r); padding: 11px 15px;
  font-size: 14px; font-weight: 700; color: #7A5200; line-height: 1.7;
}
.chant::before { content: '口诀 '; font-size: 11px; font-weight: 900; letter-spacing: .08em;
  color: #B8860B; }

@media (max-width: 860px) {
  .sign-detail { grid-template-columns: minmax(0,1fr); }
  .sign-detail .stage svg { max-width: 132px; }
}
