/* =========================================================
   2026 美国中期选举 · 实时开票看板
   深色电视大屏风
   ========================================================= */

:root {
  --bg-0: #05070d;
  --bg-1: #080c16;
  --bg-2: #0c1220;
  --panel: rgba(15, 22, 38, 0.82);
  --panel-solid: #0e1523;
  --line: rgba(120, 150, 200, 0.16);
  --line-strong: rgba(130, 165, 220, 0.30);

  --text: #e8eefc;
  --text-dim: #93a3c0;
  --text-faint: #5d6d8a;

  --dem: #3b7dff;
  --dem-deep: #1b4fd8;
  --dem-glow: rgba(59, 125, 255, 0.55);
  --rep: #ff4b57;
  --rep-deep: #c81e2e;
  --rep-glow: rgba(255, 75, 87, 0.5);
  --gold: #f7b731;
  --teal: #26d0ce;

  --font: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI",
          "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "SF Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 700px at 22% -10%, rgba(38, 80, 190, 0.22), transparent 65%),
    radial-gradient(1000px 600px at 88% 0%, rgba(180, 40, 60, 0.16), transparent 62%),
    radial-gradient(1400px 900px at 50% 120%, rgba(20, 40, 90, 0.30), transparent 70%),
    linear-gradient(180deg, #060912 0%, #04060c 100%);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(90, 130, 200, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 130, 200, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
  z-index: -1;
  pointer-events: none;
}

/* ---------------- 启动遮罩 ---------------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #0b1324, #04060c 70%);
  transition: opacity .5s ease, visibility .5s;
}
.boot.hide { opacity: 0; visibility: hidden; }
.boot-inner { text-align: center; }
.boot-flag { font-size: 56px; filter: drop-shadow(0 0 24px rgba(80,140,255,.5)); }
.boot h1 { font-size: 30px; letter-spacing: .14em; margin: 14px 0 6px; font-weight: 700; }
.boot-sub { color: var(--text-dim); font-size: 13px; letter-spacing: .06em; margin: 0 0 22px; }
.boot-bar { width: 240px; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.boot-bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--dem), var(--teal)); animation: bootslide 1.2s ease-in-out infinite; }
@keyframes bootslide { 0% { transform: translateX(-100%);} 100% { transform: translateX(350%);} }

/* ---------------- 布局 ---------------- */
.app {
  height: 100%;
  display: grid;
  grid-template-rows: 68px 1fr 34px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,18,32,.92), rgba(8,12,20,.65));
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 20;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--dem-glow), transparent 40%, var(--rep-glow), transparent);
  opacity: .55;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 300px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 9px;
  display: grid; place-items: center; line-height: .86;
  font-family: var(--font-num); font-weight: 800; font-size: 13px; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(150deg, #1b4fd8, #0d2a75);
  box-shadow: 0 0 22px rgba(45,100,230,.35), inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-mark span { font-size: 10px; opacity: .75; }
.brand-text h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.brand-text h1 em { font-style: normal; color: var(--gold); text-shadow: 0 0 18px rgba(247,183,49,.35); }
.brand-text p { margin: 2px 0 0; font-size: 10px; letter-spacing: .22em; color: var(--text-faint); }

/* 议会切换 */
.chamber-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.ctab {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 16px 8px; min-width: 116px;
  border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--text-dim);
  font-family: inherit; text-align: left;
  transition: all .18s ease;
}
.ctab .cn { font-size: 14px; font-weight: 700; }
.ctab .en { font-size: 9px; letter-spacing: .18em; opacity: .65; }
.ctab .ct-seats { position: absolute; right: 10px; top: 9px; font-size: 10px; font-family: var(--font-num); color: var(--text-faint); }
.ctab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.ctab.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(70,120,240,.30), rgba(40,70,160,.18));
  box-shadow: inset 0 0 0 1px rgba(90,140,255,.35), 0 2px 18px rgba(40,90,220,.25);
}
.ctab.is-active .cn { color: #fff; }

/* 时钟 */
.clockbox { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.livechip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11px; letter-spacing: .08em;
  border: 1px solid rgba(255,80,80,.3);
  background: rgba(255,60,60,.08);
  color: #ff9aa2;
  white-space: nowrap;
}
.livechip i { width: 7px; height: 7px; border-radius: 50%; background: #ff4b57; box-shadow: 0 0 10px #ff4b57; animation: pulse 1.6s infinite; }
.livechip.is-ok { color: #7ef0c0; border-color: rgba(60,230,170,.3); background: rgba(30,200,140,.08); }
.livechip.is-ok i { background: #2ee6a8; box-shadow: 0 0 10px #2ee6a8; }
.livechip.is-stale { color: #ffce6b; border-color: rgba(255,200,80,.3); background: rgba(255,180,40,.08); }
.livechip.is-stale i { background: #ffb703; box-shadow: 0 0 10px #ffb703; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.82);} }

.clock { text-align: right; line-height: 1.05; }
.clock b { display: block; font-family: var(--font-num); font-size: 19px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.clock span { font-size: 9px; letter-spacing: .16em; color: var(--text-faint); }
.clock-cn b { color: var(--text-dim); font-size: 16px; }

/* ---------------- 舞台 ---------------- */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 396px;
  min-height: 0;
  overflow: hidden;
}

/* 地图区 */
.maparea { display: flex; flex-direction: column; min-width: 0; padding: 14px 10px 6px 18px; }
.map-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 0 8px 10px; }
.map-title h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.map-title p { margin: 3px 0 0; font-size: 12px; color: var(--text-faint); letter-spacing: .02em; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.sw.dem { background: linear-gradient(160deg, #5b93ff, var(--dem-deep)); box-shadow: 0 0 10px var(--dem-glow); }
.sw.rep { background: linear-gradient(160deg, #ff6f78, var(--rep-deep)); box-shadow: 0 0 10px var(--rep-glow); }
.sw.lead { background: repeating-linear-gradient(135deg, #3a71e8 0 3px, #15243c 3px 6px); border: 1px solid rgba(90,140,255,.35); }
.sw.fc { background: linear-gradient(90deg, #1b3252 0 50%, #3c1a22 50% 100%); border: 1px solid rgba(120,150,200,.25); }
.sw.none { background: #1b2436; border: 1px solid rgba(120,150,200,.25); }

.map-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); font-size: 13px; letter-spacing: .1em; }

/* 州 */
.st {
  cursor: pointer;
  stroke: rgba(6, 10, 18, .9);
  stroke-width: .9;
  transition: fill .5s ease, filter .25s ease, opacity .4s ease;
  vector-effect: non-scaling-stroke;
}
.st:hover { filter: brightness(1.45) drop-shadow(0 0 10px rgba(140,190,255,.75)); stroke: rgba(210,230,255,.85); stroke-width: 1.2; }
.st.is-selected { stroke: #fff; stroke-width: 1.8; filter: brightness(1.3) drop-shadow(0 0 14px rgba(255,255,255,.6)); }
.st-label { font-family: var(--font-num); font-size: 11px; font-weight: 700; fill: rgba(255,255,255,.92); pointer-events: none; text-anchor: middle; letter-spacing: .03em; paint-order: stroke; stroke: rgba(3,6,12,.85); stroke-width: 2.6px; }
.st-label.small { font-size: 8.5px; }
.st-dot { pointer-events: none; }

/* 悬停提示 */
.tooltip {
  position: absolute; z-index: 30; pointer-events: none;
  min-width: 190px; max-width: 280px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(8,13,24,.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.03) inset;
  font-size: 12px; line-height: 1.5;
  transform: translate(-50%, -112%);
  transition: opacity .12s;
}
.tooltip h4 { margin: 0 0 5px; font-size: 14px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 10px; color: var(--text-dim); }
.tooltip .tt-row b { color: var(--text); font-family: var(--font-num); }
.tooltip .tt-note { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 11px; }

.map-foot { display: flex; gap: 22px; padding: 8px 10px 0; font-size: 11px; color: var(--text-faint); }
.map-foot b { color: var(--text-dim); font-family: var(--font-num); }

/* ---------------- 右栏 ---------------- */
.rail {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px 10px 6px;
  min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(120,150,200,.3) transparent;
}
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(120,150,200,.28); border-radius: 3px; }

.panel {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  padding: 14px 15px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 13px; letter-spacing: .12em; color: var(--text-dim); font-weight: 700; text-transform: uppercase; }
.panel-head .hint { font-size: 10px; color: var(--text-faint); }
.pill { font-size: 10px; font-family: var(--font-num); padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--text-dim); }

/* 记分牌 */
.scoreboard { flex: 0 0 auto; }
.sb-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.sb-title h3 { margin: 0; font-size: 15px; letter-spacing: .04em; }
.sb-title .sb-majority { font-size: 10px; color: var(--text-faint); letter-spacing: .06em; }
.sb-scores { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin: 6px 0 10px; }
.sb-side { display: flex; flex-direction: column; }
.sb-side.right { align-items: flex-end; text-align: right; }
.sb-num { font-family: var(--font-num); font-size: 40px; font-weight: 800; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sb-side.dem .sb-num { color: var(--dem); text-shadow: 0 0 26px var(--dem-glow); }
.sb-side.rep .sb-num { color: var(--rep); text-shadow: 0 0 26px var(--rep-glow); }
.sb-cap { font-size: 10px; letter-spacing: .16em; color: var(--text-faint); margin-top: 3px; }
.sb-mid { text-align: center; padding-bottom: 4px; }
.sb-mid .need { font-size: 10px; color: var(--text-faint); letter-spacing: .08em; }
.sb-mid .mid-line { font-family: var(--font-num); font-size: 13px; color: var(--text-dim); }

/* 席位条 */
.seatbar { position: relative; height: 26px; border-radius: 7px; overflow: hidden; background: #131c2d; display: flex; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.seatbar .seg { height: 100%; transition: width .8s cubic-bezier(.22,.9,.28,1); position: relative; }
.seatbar .seg.dem { background: linear-gradient(180deg, #4f8bff, #1c4ccb); box-shadow: 0 0 18px var(--dem-glow); }
.seatbar .seg.rep { background: linear-gradient(180deg, #ff6a74, #c11f2e); box-shadow: 0 0 18px var(--rep-glow); }
.seatbar .seg.other { background: #465268; }
.seatbar .seg.existing { opacity: .38; }
.seatbar .mid { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.85); box-shadow: 0 0 10px rgba(255,255,255,.9); }
.seatbar-legend { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10px; color: var(--text-faint); }
.seatbar-legend b { color: var(--text-dim); font-family: var(--font-num); }
.sb-flips { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.flip-chip { font-size: 10px; padding: 2.5px 7px; border-radius: 6px; font-family: var(--font-num); letter-spacing: .04em; border: 1px solid; }
.flip-chip.toD { color: #9dc0ff; border-color: rgba(70,120,255,.45); background: rgba(50,100,230,.14); }
.flip-chip.toR { color: #ffacb2; border-color: rgba(255,80,90,.45); background: rgba(200,40,55,.14); }

/* 焦点列表 */
.focus { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; }
.focus-list { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
.focus-list::-webkit-scrollbar { width: 5px; }
.focus-list::-webkit-scrollbar-thumb { background: rgba(120,150,200,.25); border-radius: 3px; }
.frow { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.022); border: 1px solid transparent; cursor: pointer; transition: all .15s; }
.frow:hover { background: rgba(90,140,255,.1); border-color: rgba(90,140,255,.3); }
.frow .fr-id { font-family: var(--font-num); font-size: 12px; font-weight: 700; min-width: 52px; color: var(--text); }
.frow .fr-meta { flex: 1; min-width: 0; }
.frow .fr-name { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .fr-bar { height: 4px; border-radius: 2px; margin-top: 4px; background: #1a2334; overflow: hidden; display: flex; }
.frow .fr-bar i { height: 100%; display: block; }
.frow .fr-bar i.d { background: var(--dem); }
.frow .fr-bar i.r { background: var(--rep); }
.frow .fr-bar[data-nodata] { background: repeating-linear-gradient(135deg, #1e2a3d 0 3px, #131c2b 3px 6px); }
.frow .fr-rating { font-size: 9px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; font-family: var(--font-num); letter-spacing: .04em; }
.rt-TossUp { background: rgba(247,183,49,.16); color: var(--gold); border: 1px solid rgba(247,183,49,.35); }
.rt-D { background: rgba(59,125,255,.14); color: #9dc0ff; border: 1px solid rgba(59,125,255,.3); }
.rt-R { background: rgba(255,75,87,.14); color: #ffacb2; border: 1px solid rgba(255,75,87,.3); }

/* 最新宣布 */
.calls { flex: 0 0 auto; max-height: 34%; display: flex; flex-direction: column; }
.call-list { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; scrollbar-width: thin; }
.call-list::-webkit-scrollbar { width: 5px; }
.call-list::-webkit-scrollbar-thumb { background: rgba(120,150,200,.25); border-radius: 3px; }
.callrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 5px 7px; border-radius: 7px; background: rgba(255,255,255,.02); animation: slidein .4s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(14px);} to { opacity: 1; transform: none;} }
.callrow .cd { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.callrow .cd.D { background: var(--dem); box-shadow: 0 0 8px var(--dem-glow); }
.callrow .cd.R { background: var(--rep); box-shadow: 0 0 8px var(--rep-glow); }
.callrow .cwho { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.callrow .cwhere { color: var(--text-faint); font-family: var(--font-num); font-size: 10.5px; }
.empty { font-size: 11px; color: var(--text-faint); line-height: 1.6; padding: 4px 2px; }

.drawer[hidden] { display: none; }
.tooltip[hidden] { display: none; }

/* ---------------- 州详情抽屉 ---------------- */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 486px;
  background: linear-gradient(180deg, rgba(10,15,26,.985), rgba(7,11,20,.99));
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0,0,0,.6);
  z-index: 40; display: flex; flex-direction: column;
  animation: drawerIn .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(30,50,100,.18), transparent); }
.drawer-kicker { font-size: 10px; letter-spacing: .26em; color: var(--text-faint); margin-bottom: 6px; }
.drawer-head h2 { margin: 0; font-size: 26px; letter-spacing: .01em; }
.drawer-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--text-dim); }
.close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text-dim); cursor: pointer; font-size: 14px; transition: all .15s; flex: 0 0 auto; }
.close:hover { background: rgba(255,80,90,.16); color: #fff; border-color: rgba(255,80,90,.4); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; scrollbar-width: thin; }
.drawer-body::-webkit-scrollbar { width: 7px; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(120,150,200,.28); border-radius: 4px; }

/* 赛卡片 */
.race-card { border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.022); padding: 13px 14px; margin-bottom: 12px; }
.race-card.is-called { border-color: rgba(255,255,255,.16); }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rc-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rc-title h4 { margin: 0; font-size: 14px; letter-spacing: .02em; }
.rc-title span { font-size: 10px; color: var(--text-faint); font-family: var(--font-num); }
.rc-badges { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 9.5px; padding: 2.5px 7px; border-radius: 5px; letter-spacing: .03em; white-space: nowrap; font-family: var(--font-num); }
.b-callD { background: var(--dem); color: #001028; font-weight: 800; }
.b-callR { background: var(--rep); color: #2a0004; font-weight: 800; }
.b-open { background: rgba(255,255,255,.07); color: var(--text-dim); border: 1px solid var(--line); }
.b-flip { background: rgba(247,183,49,.15); color: var(--gold); border: 1px solid rgba(247,183,49,.4); }
.b-inc { background: rgba(38,208,206,.12); color: var(--teal); border: 1px solid rgba(38,208,206,.3); }

.cand { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.cand + .cand { border-top: 1px solid rgba(255,255,255,.04); }
.cand-av { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: #16203022; filter: saturate(.9); }
.cand-av.ph { display: grid; place-items: center; font-family: var(--font-num); font-weight: 800; font-size: 13px; color: #04080f; }
.cand-main { min-width: 0; }
.cand-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cand-name .pt { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; font-family: var(--font-num); letter-spacing: .04em; }
.pt.D { background: rgba(59,125,255,.2); color: #8fb6ff; }
.pt.R { background: rgba(255,75,87,.2); color: #ff9aa2; }
.pt.O { background: rgba(255,255,255,.12); color: #c3cddf; }
.cand-name .lead { font-size: 9px; color: var(--gold); letter-spacing: .06em; }
.cand-bar { height: 5px; border-radius: 3px; background: #1a2334; margin-top: 5px; overflow: hidden; }
.cand-bar i { display: block; height: 100%; transition: width .6s ease; }
.cand-bar i.D { background: linear-gradient(90deg, #2f6bff, #5b93ff); box-shadow: 0 0 10px var(--dem-glow); }
.cand-bar i.R { background: linear-gradient(90deg, #d2202f, #ff6a74); box-shadow: 0 0 10px var(--rep-glow); }
.cand-bar i.O { background: #5a6b86; }
.cand-num { text-align: right; font-family: var(--font-num); }
.cand-pct { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cand-votes { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cand.winner .cand-name { color: #fff; }
.cand.winner .cand-pct { text-shadow: 0 0 18px currentColor; }

.rc-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.05); font-size: 10.5px; color: var(--text-faint); flex-wrap: wrap; }
.rc-foot b { color: var(--text-dim); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.rc-forecast { font-size: 10px; color: var(--text-faint); margin-top: 6px; }

/* 众议院选区网格 */
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; margin-top: 4px; }
.dist {
  border-radius: 8px; padding: 7px 8px; cursor: pointer; border: 1px solid var(--line);
  background: rgba(255,255,255,.02); transition: all .15s;
}
.dist:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); transform: translateY(-1px); }
.dist .dname { font-family: var(--font-num); font-size: 11px; font-weight: 700; display: flex; justify-content: space-between; }
.dist .dbar { height: 3px; border-radius: 2px; background: #16202f; margin-top: 5px; display: flex; overflow: hidden; }
.dist .dbar[data-nodata] { background: repeating-linear-gradient(135deg, #1e2a3d 0 3px, #131c2b 3px 6px); }
.dist .dbar i { display: block; height: 100%; }
.dist .dstat { font-size: 9px; color: var(--text-faint); margin-top: 4px; }
.dist.D { border-left: 3px solid var(--dem); }
.dist.R { border-left: 3px solid var(--rep); }
.dist.U { border-left: 3px solid #39445a; }

/* 新闻 */
.news-sec { margin-top: 6px; }
.news-sec h4 { font-size: 11px; letter-spacing: .18em; color: var(--text-faint); margin: 18px 0 9px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.news-sec h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.news-item { display: block; text-decoration: none; color: inherit; padding: 9px 10px; border-radius: 9px; transition: background .15s; border-left: 2px solid transparent; }
.news-item:hover { background: rgba(90,140,255,.08); border-left-color: var(--dem); }
.news-item .nt { font-size: 12.5px; line-height: 1.45; color: var(--text); }
.news-item .nm { font-size: 10px; color: var(--text-faint); margin-top: 4px; display: flex; gap: 8px; }
.news-item .lang { padding: 0 5px; border-radius: 3px; background: rgba(255,255,255,.06); }
.news-loading { font-size: 11px; color: var(--text-faint); padding: 8px 0; }

/* ---------------- 底部快讯 ---------------- */
.ticker { display: flex; align-items: center; gap: 0; border-top: 1px solid var(--line); background: rgba(8,12,20,.9); overflow: hidden; position: relative; z-index: 15; }
.ticker-label { flex: 0 0 auto; padding: 0 14px; height: 100%; display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .18em; color: #ff8b93; background: rgba(255,60,70,.08); border-right: 1px solid var(--line); }
.ticker-label i { width: 6px; height: 6px; border-radius: 50%; background: #ff4b57; box-shadow: 0 0 10px #ff4b57; animation: pulse 1.6s infinite; }
.ticker-track { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker-run { position: absolute; white-space: nowrap; will-change: transform; font-size: 11.5px; color: var(--text-dim); display: flex; align-items: center; gap: 34px; height: 100%; animation: marquee 60s linear infinite; }
.ticker-run:hover { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk { display: inline-flex; gap: 7px; align-items: center; }
.tk b { color: var(--text); font-weight: 600; }
.tk .sep { color: var(--text-faint); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1500px) {
  .stage { grid-template-columns: 1fr 350px; }
  .brand { min-width: 240px; }
  .ctab { min-width: 100px; padding: 6px 12px 7px; }
}
@media (max-width: 1240px) {
  .app { grid-template-rows: 62px 1fr 30px; }
  .stage { grid-template-columns: 1fr 320px; }
  .brand-text p { display: none; }
  .clock-cn { display: none; }
  .drawer { width: 100%; }
}
@media (max-width: 900px) {
  .app { height: auto; min-height: 100vh; grid-template-rows: auto auto 32px; }
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 9px 12px; height: auto; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-text h1 { font-size: 14px; }
  .clock { font-size: 15px; }
  .chamber-tabs { order: 5; width: 100%; gap: 6px; padding: 4px; }
  .ctab { flex: 1 1 0; min-width: 0; padding: 5px 6px 6px; }
  .ctab .ctab-name { font-size: 11px; }
  .ctab .ctab-seats { font-size: 9px; }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow: visible; }
  .maparea { padding: 6px 8px 10px; overflow: visible; }
  .map-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .map-title h2 { font-size: 17px; }
  .map-wrap { height: 58vw; min-height: 210px; flex: 0 0 auto; }
  .map-foot { height: auto; flex-wrap: wrap; gap: 4px 10px; font-size: 10px; padding: 6px 2px 0; }
  .rail { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 14px; height: auto; overflow: visible; }
  .rail > .panel { max-height: none; }
  .scoreboard .sb-num { font-size: 34px; }
  .focus-list, .call-list { max-height: none; overflow: visible; }
  .drawer { width: 100%; }
  .drawer-body { padding: 14px 14px 28px; }
  .dist-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .ticker { position: sticky; bottom: 0; }
  .legend { display: none; }
}
@media (max-width: 900px) {
  html, body { overflow-x: hidden; overflow-y: auto; height: auto; }
  .demo-banner { top: auto; bottom: 44px; font-size: 10px; }
}

/* ---------------- 演示模式标记 ---------------- */
.demo-banner {
  position: fixed; left: 50%; top: 78px; transform: translateX(-50%);
  z-index: 60; padding: 5px 14px; border-radius: 99px;
  font-size: 11px; letter-spacing: .14em; font-weight: 700;
  color: #2b0010; background: linear-gradient(180deg, #ff6ad5, #e0399f);
  box-shadow: 0 0 26px rgba(255,80,200,.55), 0 4px 18px rgba(0,0,0,.5);
  animation: demoPulse 2.4s ease-in-out infinite;
}
@keyframes demoPulse { 0%,100% { opacity: .82; } 50% { opacity: 1; } }

/* ---------------- 移动端收尾修正（必须放在文件末尾，覆盖上面的基础规则） ---------------- */
@media (max-width: 900px) {
  .demo-banner { top: auto; bottom: 46px; font-size: 10px; padding: 4px 12px; }
  .stage, .maparea, .rail { min-width: 0; width: 100%; box-sizing: border-box; }
  .map-foot { width: 100%; }
  .map-foot > * { flex: 0 0 auto; }
  .ticker { max-width: 100vw; overflow: hidden; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100vw; }
  .topbar, .stage, .rail, .maparea, .map-wrap, .ticker { min-width: 0; max-width: 100vw; }
  .panel { min-width: 0; }
}

@media (max-width: 900px) {
  .st-label { font-size: 19px; letter-spacing: .02em; }
  .st-label.small { font-size: 14px; }
  .demo-banner { left: 8px; transform: none; bottom: 40px; font-size: 9px; padding: 3px 9px; opacity: .92; }
}

/* ---------------- 抽屉内快捷导航 ---------------- */
.dnav {
  position: sticky; top: -16px; z-index: 5; display: flex; gap: 6px;
  margin: -4px -20px 12px; padding: 10px 20px;
  background: linear-gradient(180deg, rgba(10,15,26,.99) 55%, rgba(10,15,26,.75));
  border-bottom: 1px solid var(--line);
}
.dn {
  flex: 1 1 0; min-width: 0; padding: 6px 4px; border-radius: 7px; cursor: pointer;
  font-size: 11px; font-family: inherit; letter-spacing: .04em;
  color: var(--text-dim); background: rgba(120,150,200,.07);
  border: 1px solid rgba(120,150,200,.16);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all .15s ease;
}
.dn:hover { color: var(--text); background: rgba(120,150,200,.14); }
.dn.on { color: #cfe0ff; background: rgba(59,125,255,.2); border-color: rgba(90,140,255,.5); }
@media (max-width: 900px) { .dnav { margin: -4px -14px 10px; padding: 9px 14px; top: -14px; } }

/* 摇摆州图例：淡蓝淡红对分 */
.sw.swing { background: linear-gradient(90deg, #93b4de 0 50%, #e2a0a8 50% 100%); border: 1px solid rgba(200,215,240,.45); }
