/* ============================================================
   深色大屏主题（参考 BigDataView 那类政务大屏的观感）
   只覆盖变量与观感，不动版式骨架 —— 开关是 body.theme-dark
   主色抄自模板实测值：#0EFCFF 霓虹青 / #3E94CD→#56D4F1 渐变
   ============================================================ */
body.theme-dark{
  --paper:#04102a;
  --panel:#071c3a;
  --panel-2:#0b2447;
  --ink:#d6e9ff;
  --ink-2:#8fb4d9;
  --ink-3:#6b8cb3;
  --rule:rgba(14,252,255,.14);
  --rule-strong:rgba(14,252,255,.28);
  --accent:#0EFCFF;
  --accent-soft:rgba(14,252,255,.16);
  --on:#19CA88;
  --near:#F6D10E;
  --watch:#FD9133;
  --risk:#F6580E;

  background:
    radial-gradient(1100px 620px at 18% -10%, rgba(46,140,255,.20), transparent 60%),
    radial-gradient(900px 520px at 92% 8%, rgba(14,252,255,.12), transparent 62%),
    linear-gradient(180deg,#04102a 0%,#061733 45%,#04102a 100%);
  background-attachment:fixed;
  color:var(--ink);
}

/* 背景网格 + 一层极淡的扫描光 */
body.theme-dark::before{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(14,252,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,252,255,.045) 1px, transparent 1px);
  background-size:44px 44px, 44px 44px;
  mask-image:radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
}
body.theme-dark::after{
  content:""; position:fixed; inset:-20% -20% auto -20%; height:60vh; z-index:0; pointer-events:none;
  background:radial-gradient(50% 60% at 50% 0%, rgba(14,252,255,.10), transparent 70%);
  animation:aurora 14s ease-in-out infinite alternate;
}
@keyframes aurora{
  from{opacity:.55; transform:translate3d(-2%,0,0)}
  to{opacity:.95; transform:translate3d(2%,1%,0)}
}
body.theme-dark .shell,
body.theme-dark .main{position:relative; z-index:1}

/* ---------------- 左栏 ---------------- */
body.theme-dark .rail{
  background:linear-gradient(180deg, rgba(7,28,58,.92), rgba(4,16,42,.92));
  border-right:1px solid rgba(14,252,255,.18);
  backdrop-filter:blur(2px);
}
body.theme-dark .brand-mark{
  color:#fff;
  text-shadow:0 0 14px rgba(14,252,255,.55);
  letter-spacing:.02em;
}
body.theme-dark .brand-sub{color:var(--ink-3)}
body.theme-dark .rail-label{color:var(--ink-3)}
body.theme-dark .class-btn{color:var(--ink-2)}
body.theme-dark .class-btn:hover{background:rgba(14,252,255,.08); color:#fff}
body.theme-dark .class-btn[aria-current="true"]{
  background:rgba(14,252,255,.10); color:#fff; font-weight:600;
  box-shadow:inset 0 0 0 1px rgba(14,252,255,.38), 0 0 18px -6px rgba(14,252,255,.5);
}
body.theme-dark .class-static .cn{color:#fff}
body.theme-dark .role-switch{background:rgba(255,255,255,.05)}
body.theme-dark .role-switch button{color:var(--ink-2)}
body.theme-dark .role-switch button[aria-pressed="true"]{
  background:linear-gradient(180deg, rgba(14,252,255,.20), rgba(14,252,255,.08));
  color:#fff; box-shadow:inset 0 0 0 1px rgba(14,252,255,.35);
}
body.theme-dark input[type=range]{background:rgba(14,252,255,.22)}
body.theme-dark input[type=range]::-webkit-slider-thumb{
  background:#0EFCFF; border-color:#04102a;
  box-shadow:0 0 0 1px #0EFCFF, 0 0 14px rgba(14,252,255,.8);
}
body.theme-dark .week-val{color:#fff; text-shadow:0 0 12px rgba(14,252,255,.5)}
body.theme-dark .ghost-btn{
  border-color:rgba(14,252,255,.35); color:#bfe9ff; background:rgba(14,252,255,.06);
}
body.theme-dark .ghost-btn:hover{
  border-color:#0EFCFF; color:#fff; background:rgba(14,252,255,.14);
  box-shadow:0 0 18px -4px rgba(14,252,255,.55);
}
body.theme-dark .link{color:#0EFCFF}

/* ---------------- 标题与分区 ---------------- */
body.theme-dark .top h1,
body.theme-dark .stu-name{
  color:#fff; text-shadow:0 0 22px rgba(14,252,255,.30);
}
body.theme-dark h2{color:#bfe9ff}
body.theme-dark h2 .hint{color:var(--ink-3)}
body.theme-dark .meta,
body.theme-dark .stu-sub{color:var(--ink-3)}

/* 摘要条：上下用发光线代替细实线 */
body.theme-dark .summary{
  border-top:1px solid rgba(14,252,255,.45);
  border-bottom:1px solid rgba(14,252,255,.14);
  color:var(--ink-2);
}
body.theme-dark .summary .big{
  color:#fff;
  text-shadow:0 0 18px rgba(14,252,255,.65), 0 0 42px rgba(14,252,255,.25);
}
body.theme-dark .summary .sep{color:rgba(14,252,255,.35)}

/* ---------------- 六条 KR 的横条 ---------------- */
body.theme-dark .kr-table{border-top:1px solid rgba(14,252,255,.45)}
body.theme-dark .kr-row{border-bottom:1px solid rgba(14,252,255,.10)}
body.theme-dark .kr-name{color:var(--ink)}
body.theme-dark .kr-name em{color:var(--ink-3)}
body.theme-dark .track{background:rgba(255,255,255,.07); box-shadow:inset 0 0 0 1px rgba(14,252,255,.10)}
body.theme-dark .fill{box-shadow:0 0 14px -2px var(--c,currentColor)}
body.theme-dark .track .tick{background:rgba(255,255,255,.35)}

/* ---------------- 分布条 ---------------- */
body.theme-dark .dist-bar{background:rgba(255,255,255,.06)}
body.theme-dark .dist-bar i{box-shadow:0 0 10px -2px var(--c,currentColor)}
body.theme-dark .dist-row{color:var(--ink-2)}
body.theme-dark .dist-n{color:var(--ink)}

/* ---------------- 学生台账 ---------------- */
body.theme-dark .ledger-wrap{border-top:1px solid rgba(14,252,255,.45)}
body.theme-dark .ledger thead th{
  background:#071c3a; color:var(--ink-3);
  border-bottom:1px solid rgba(14,252,255,.20);
}
body.theme-dark .ledger thead th button{color:inherit}
body.theme-dark .ledger thead th[aria-sort] button{color:#0EFCFF}
body.theme-dark .ledger td{border-bottom:1px solid rgba(14,252,255,.08)}
body.theme-dark .ledger tbody tr:hover{background:rgba(14,252,255,.07)}
body.theme-dark .ledger td.name{color:var(--ink)}
body.theme-dark .ledger td.name .sid{color:var(--ink-3)}
body.theme-dark .cellbox{box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
body.theme-dark .ledger td.rate{color:#e8f4ff}
body.theme-dark .pill{border-color:currentColor; background:rgba(255,255,255,.03)}
body.theme-dark .pill.ghost{color:var(--ink-3); border-color:rgba(255,255,255,.18)}

body.theme-dark .filters{background:rgba(255,255,255,.06)}
body.theme-dark .filters button{color:var(--ink-2)}
body.theme-dark .filters button[aria-pressed="true"]{
  background:rgba(14,252,255,.16); color:#fff; box-shadow:inset 0 0 0 1px rgba(14,252,255,.35);
}

/* 右侧「需要找的人」 */
body.theme-dark .watch-ul{border-top:1px solid rgba(14,252,255,.45)}
body.theme-dark .watch-ul li{border-bottom:1px solid rgba(14,252,255,.10)}
body.theme-dark .watch-ul li:hover{background:rgba(14,252,255,.07)}
body.theme-dark .watch-ul .wn{color:var(--ink)}
body.theme-dark .watch-ul .wk{color:var(--ink-3)}

/* ---------------- 学生端 ---------------- */
body.theme-dark .score-band{border-bottom:1px solid rgba(14,252,255,.45)}
body.theme-dark .score-num{text-shadow:0 0 26px currentColor}
body.theme-dark .stu-note{
  background:rgba(14,252,255,.07);
  border:1px solid rgba(14,252,255,.18);
  color:var(--ink-2);
}
body.theme-dark .stu-note b{color:#fff}
body.theme-dark .kr-list{border-top:0; padding:16px 16px 8px; margin-top:20px;
  background:linear-gradient(180deg, rgba(11,36,71,.55), rgba(7,28,58,.35));
  border:1px solid rgba(14,252,255,.16)}
body.theme-dark .pair > div{padding:16px 16px 12px;
  background:linear-gradient(180deg, rgba(11,36,71,.55), rgba(7,28,58,.35));
  border:1px solid rgba(14,252,255,.16)}
body.theme-dark .kr-item{border-bottom:1px solid rgba(14,252,255,.10)}
body.theme-dark .kr-item .n{color:var(--ink)}
body.theme-dark .kr-item .adv{color:var(--ink-3)}
body.theme-dark .kr-item.focus .adv{color:#FD9133}
body.theme-dark .cmp-track{background:rgba(255,255,255,.07)}
body.theme-dark .cmp-track b{background:rgba(255,255,255,.55)}

/* ---------------- 提示、空态、骨架 ---------------- */
body.theme-dark .tip{background:#0b2447; color:#e8f4ff; box-shadow:0 8px 24px -8px #000, 0 0 0 1px rgba(14,252,255,.35)}
body.theme-dark .empty,
body.theme-dark .mini-empty{
  border-color:rgba(14,252,255,.25); color:var(--ink-2);
  background:rgba(14,252,255,.04);
}
body.theme-dark .empty code,
body.theme-dark .mono-code{background:rgba(14,252,255,.10); color:#bfe9ff}
body.theme-dark .skel{background:linear-gradient(90deg,#0a2445 0%,#12335c 40%,#0a2445 80%); background-size:200% 100%}
body.theme-dark .legend{color:var(--ink-3)}

/* ---------------- 滚动条 ---------------- */
body.theme-dark::-webkit-scrollbar-thumb,
body.theme-dark *::-webkit-scrollbar-thumb{
  background:rgba(14,252,255,.28); border-color:transparent;
}

/* ---------------- 面板四角括线：大屏最认这一口 ---------------- */
body.theme-dark .grid-2 > section,
body.theme-dark .grid-3 > section,
body.theme-dark .watchlist,
body.theme-dark .ledger-grid > div:first-child,
body.theme-dark .kr-list,
body.theme-dark .pair > div{
  position:relative;
  padding:16px 16px 14px;
  background:linear-gradient(180deg, rgba(11,36,71,.55), rgba(7,28,58,.35));
  border:1px solid rgba(14,252,255,.16);
  border-radius:2px;
}
body.theme-dark .grid-2 > section::before,
body.theme-dark .grid-2 > section::after,
body.theme-dark .grid-3 > section::before,
body.theme-dark .grid-3 > section::after,
body.theme-dark .watchlist::before,
body.theme-dark .watchlist::after,
body.theme-dark .ledger-grid > div:first-child::before,
body.theme-dark .ledger-grid > div:first-child::after,
body.theme-dark .kr-list::before,
body.theme-dark .kr-list::after,
body.theme-dark .pair > div::before,
body.theme-dark .pair > div::after{
  content:""; position:absolute; width:14px; height:14px; pointer-events:none;
  border-color:#0EFCFF; border-style:solid; border-width:0;
  filter:drop-shadow(0 0 6px rgba(14,252,255,.8));
}
body.theme-dark .grid-2 > section::before,
body.theme-dark .grid-3 > section::before,
body.theme-dark .watchlist::before,
body.theme-dark .ledger-grid > div:first-child::before,
body.theme-dark .kr-list::before,
body.theme-dark .pair > div::before{
  top:-1px; left:-1px; border-top-width:2px; border-left-width:2px;
}
body.theme-dark .grid-2 > section::after,
body.theme-dark .grid-3 > section::after,
body.theme-dark .watchlist::after,
body.theme-dark .ledger-grid > div:first-child::after,
body.theme-dark .kr-list::after,
body.theme-dark .pair > div::after{
  right:-1px; bottom:-1px; border-bottom-width:2px; border-right-width:2px;
}
/* 面板里原来的顶部粗线让位给边框 */
body.theme-dark .kr-table,
body.theme-dark .dist + h2,
body.theme-dark .ledger-wrap,
body.theme-dark .watch-ul{border-top-color:rgba(14,252,255,.22)}

/* 台账面板里表格贴边，别让内边距把表头挤歪 */
body.theme-dark .ledger-grid > div:first-child{padding:14px 10px 10px}
body.theme-dark .grid-2{gap:20px}

/* ---------------- 入场：让首屏"亮起来" ---------------- */
@media (prefers-reduced-motion: no-preference){
  body.theme-dark .top,
  body.theme-dark .summary,
  body.theme-dark .grid-2 > section,
  body.theme-dark .ledger-head{
    animation:fadeUp .5s cubic-bezier(.2,.7,.2,1) both;
  }
  body.theme-dark .grid-2 > section:nth-child(2){animation-delay:.06s}
  body.theme-dark .ledger-head{animation-delay:.12s}
  @keyframes fadeUp{
    from{opacity:0; transform:translateY(6px)}
    to{opacity:1; transform:none}
  }
  body.theme-dark .cellbox{animation:glowIn .5s ease-out both}
  @keyframes glowIn{
    from{opacity:0; box-shadow:0 0 22px 2px var(--c,currentColor)}
    to{opacity:1}
  }
}

/* ---------------- 移动端：面板内边距收紧，别把指标名挤成两行 ---------------- */
@media (max-width:980px){
  body.theme-dark .grid-2 > section,
  body.theme-dark .watchlist,
  body.theme-dark .ledger-grid > div:first-child{padding:13px 11px 11px}
  body.theme-dark .grid-2{gap:16px}
}
@media (max-width:560px){
  body.theme-dark h2 .hint{display:none}
  body.theme-dark .summary .sep{display:none}
  body.theme-dark .kr-row{gap:8px}
  body.theme-dark .kr-name{font-size:12px; white-space:nowrap}
  body.theme-dark .kr-val{font-size:12px}
  body.theme-dark .kr-w{font-size:11px}
  body.theme-dark h2{font-size:12.5px}
}

/* ============================================================
   顶部大标题栏（参考 011 模板的 .head：标题 + 实时时钟 + 装饰边）
   ============================================================ */
:root{ --tb-h:72px; }
.topbar{
  position:relative; z-index:20; height:var(--tb-h);
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:16px;
  padding:0 26px;
  background:linear-gradient(180deg, rgba(6,24,52,.96), rgba(4,16,42,.72));
  border-bottom:1px solid rgba(14,252,255,.20);
  box-shadow:0 10px 30px -22px #000;
}
/* 底边一条流动的霓虹线 */
.topbar::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background:linear-gradient(90deg, transparent, rgba(14,252,255,.15) 12%, #0EFCFF 50%, rgba(14,252,255,.15) 88%, transparent);
  background-size:220% 100%;
  animation:tbflow 6s linear infinite;
  opacity:.85;
}
@keyframes tbflow{ from{background-position:0 0} to{background-position:220% 0} }

.tb-center{ text-align:center; position:relative; padding:0 34px; }
.tb-center h1{
  margin:0; font-size:23px; font-weight:600; letter-spacing:.10em; color:#eaf6ff;
  text-shadow:0 0 22px rgba(14,252,255,.55), 0 0 46px rgba(14,252,255,.22);
  white-space:nowrap;
}
.tb-sub{ margin-top:3px; font-size:11px; letter-spacing:.22em; color:rgba(143,180,217,.85) }
/* 两侧装饰括线 */
.tb-center::before, .tb-center::after{
  content:""; position:absolute; top:6px; bottom:2px; width:88px;
  border-top:1px solid rgba(14,252,255,.55);
  border-bottom:1px solid rgba(14,252,255,.22);
  filter:drop-shadow(0 0 6px rgba(14,252,255,.5));
}
.tb-center::before{ left:-10px; border-left:2px solid rgba(14,252,255,.7); transform:skewX(-28deg) }
.tb-center::after{ right:-10px; border-right:2px solid rgba(14,252,255,.7); transform:skewX(28deg) }

.tb-left{ display:flex; align-items:center; gap:8px; justify-self:start; min-width:0 }
.tb-chip{
  font-size:11.5px; color:#8fb4d9; padding:4px 10px; border-radius:2px;
  border:1px solid rgba(14,252,255,.22); background:rgba(14,252,255,.06);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:35vw;
}
.tb-chip.tb-strong{ color:#bfe9ff; border-color:rgba(14,252,255,.42); background:rgba(14,252,255,.12) }

.tb-right{ justify-self:end; text-align:right; line-height:1.15 }
.tb-clock{
  font-size:24px; font-weight:600; color:#0EFCFF; letter-spacing:.06em;
  text-shadow:0 0 16px rgba(14,252,255,.7);
}
.tb-date{ font-size:11px; color:#6b8cb3; letter-spacing:.06em; margin-top:2px }

/* 有顶栏时，主区高度要扣掉 */
body:has(.topbar) .shell{ height:calc(100vh - var(--tb-h)) }

@media (max-width:980px){
  :root{ --tb-h:58px }
  .topbar{ grid-template-columns:minmax(0,1fr) auto; padding:0 12px; gap:10px }
  .tb-left{ display:none }
  .tb-center{ padding:0 16px; justify-self:start; text-align:left }
  .tb-center h1{ font-size:15px; letter-spacing:0; overflow:hidden; text-overflow:ellipsis }
  .tb-center::before, .tb-center::after{ display:none }
  .tb-clock{ font-size:16px; letter-spacing:0 }
  .tb-sub{ display:none }
  body:has(.topbar) .shell{ height:auto }
}

/* ---------------- 卡片悬浮放大 ---------------- */
@media (hover:hover) and (prefers-reduced-motion: no-preference){
  body.theme-dark .grid-2 > section,
  body.theme-dark .watchlist,
  body.theme-dark .ledger-grid > div:first-child,
  body.theme-dark .kr-list,
  body.theme-dark .pair > div,
  body.theme-dark .grid-3 > section{
    transition:transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .25s;
  }
  body.theme-dark .grid-2 > section:hover,
  body.theme-dark .watchlist:hover,
  body.theme-dark .ledger-grid > div:first-child:hover,
  body.theme-dark .kr-list:hover,
  body.theme-dark .pair > div:hover,
  body.theme-dark .grid-3 > section:hover{
    transform:translateY(-3px) scale(1.006);
    border-color:rgba(14,252,255,.42);
    box-shadow:0 22px 46px -30px #000, 0 0 34px -14px rgba(14,252,255,.45);
  }
}
