/* ============================================================
   AIC 智慧社区总决赛 · 主题与字号
   深色（默认）/ 浅色 / 高对比 + 标准/大/特大字号
   由 theme.js 控制，写入 <html data-theme data-size data-tl>
   ============================================================ */

:root{
  /* 深色为默认基调（各页自带同名变量，这里补齐“表面色”类变量） */
  --surface:#171a1f; --surface2:#151920; --hover:#12161c; --barbg:#1b1f25;
  --warnbg:#1a1410; --warnbd:#3a2a17; --warntx:#f5cf90; --warntx2:#c9a76a;
  --badbg:#2b1518; --badbd:#5d2429; --badtxt:#ff9ea1;
  --sepbg:#17141a; --septx:#b58ea0; --sepbd:#3a2430;
  --wdrowbg:#141013; --wdrowhov:#191316; --wdrowtx:#d3c7cb; --wdrowtx2:#8c8a8c;
  --subbg:#0d1014; --good:#4ec26f; --bad:#ff8f92; --link:#7ea9ff;
  --scroll:#262b33; --scrollhov:#323841; --selbg:#16233a; --lvl0:#3b434e;
  --noticebg:rgba(229,72,77,.08); --noticebd:rgba(229,72,77,.28);
  --zoom:1;
}

/* ---------- 浅色 ---------- */
html[data-theme="light"]{
  --bg:#f1f4f7; --panel:#ffffff; --head:#e8ecf1; --line:#c3ccd6; --line2:#e2e8ee;
  --text:#10141a; --dim:#414b57; --dim2:#55606d;
  --red:#bf2027; --green:#16753a; --amber:#7f5600; --blue:#0a55bf;
  --chip:#e6ebf0; --chip-hover:#d9e0e7;
  --surface:#eceff3; --surface2:#e4e9ee; --hover:#eef2f6; --barbg:#dbe2e9;
  --warnbg:#fff7e6; --warnbd:#dfc287; --warntx:#6a4a00; --warntx2:#78590f;
  --badbg:#fdeaea; --badbd:#e59b9f; --badtxt:#a81f24;
  --sepbg:#f2edef; --septx:#6f5560; --sepbd:#dcc7d0;
  --wdrowbg:#faf4f5; --wdrowhov:#f3eaec; --wdrowtx:#5b4850; --wdrowtx2:#6f6a6c;
  --subbg:#f6f8fa; --good:#0f6b31; --bad:#b3201f; --link:#0a55bf;
  --scroll:#c6ced6; --scrollhov:#aab4bd; --selbg:#dbe8fb; --lvl0:#9aa4b0;
  --noticebg:#fdf0f0; --noticebd:#eab3b5;
}

/* ---------- 高对比（白底纯黑字，视力不佳推荐） ---------- */
html[data-theme="hc"]{
  --bg:#ffffff; --panel:#ffffff; --head:#dde3ea; --line:#77828f; --line2:#b6c0ca;
  --text:#000000; --dim:#252d36; --dim2:#333c47;
  --red:#a81419; --green:#0a5f26; --amber:#6d4600; --blue:#00439a;
  --chip:#e3e8ee; --chip-hover:#d3dae2;
  --surface:#e7ecf1; --surface2:#dde3ea; --hover:#e6ebf0; --barbg:#ccd4dd;
  --warnbg:#fffbe6; --warnbd:#7d600c; --warntx:#4a3300; --warntx2:#4a3300;
  --badbg:#ffe9e9; --badbd:#96383c; --badtxt:#7e1013;
  --sepbg:#eef1f4; --septx:#2b333c; --sepbd:#7d8794;
  --wdrowbg:#f3f6f9; --wdrowhov:#e9eef3; --wdrowtx:#1c242c; --wdrowtx2:#3a424b;
  --subbg:#f1f5f8; --good:#0a5f26; --bad:#a81419; --link:#00439a;
  --scroll:#9aa4ae; --scrollhov:#78838e; --selbg:#cfe0f7; --lvl0:#6c7783;
  --noticebg:#fff0f0; --noticebd:#96383c;
}

/* ---------- 字号 ---------- */
html[data-size="lg"]{ --zoom:1.16 }
html[data-size="xl"]{ --zoom:1.34 }
body > .wrap, body > .box{zoom:var(--zoom)}
dialog{zoom:var(--zoom)}

/* ---------- 切换条 ---------- */
.viewbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:16px;
  padding:9px 12px;background:var(--panel);border:1px solid var(--line);border-radius:9px}
.viewbar .vlabel{color:var(--dim);font-size:12.5px;margin-right:2px}
.viewbar .vsep{width:1px;height:18px;background:var(--line);margin:0 4px}
.vbtn{background:var(--surface);border:1px solid var(--line);color:var(--dim);border-radius:7px;
  padding:6px 13px;font-size:12.5px;cursor:pointer;font-family:inherit;line-height:1.5;
  width:auto;min-width:0;margin:0}
.vbtn:hover{color:var(--text)}
.vbtn.on{background:var(--red);border-color:var(--red);color:#fff;font-weight:600}
@media (max-width:560px){
  .viewbar{padding:8px 10px;gap:5px}
  .vbtn{padding:6px 10px;font-size:12px}
}

/* ============================================================
   浅色 / 高对比下，覆盖各页写死的深色值
   ============================================================ */
html[data-tl="1"] a{color:var(--link)}
html[data-tl="1"] .notice{background:var(--noticebg);
  border-top-color:var(--noticebd);border-right-color:var(--noticebd);border-bottom-color:var(--noticebd)}
html[data-tl="1"] .notice b{color:var(--warntx)}
html[data-tl="1"] .notice span{color:var(--warntx2)}
html[data-tl="1"] .notice .ntext{color:var(--text)}
html[data-tl="1"] .notice .ntext b{color:var(--text)}
html[data-tl="1"] .notice .ntext .warn{color:var(--amber)}
html[data-tl="1"] th{background:var(--surface2)}
html[data-tl="1"] td{border-bottom-color:var(--line2)}
html[data-tl="1"] tbody tr:hover td{background:var(--hover)}
html[data-tl="1"] .good{color:var(--good)}
html[data-tl="1"] .bad{color:var(--bad)}
html[data-tl="1"] .code{color:var(--dim)}
html[data-tl="1"] .sch{color:var(--dim2)}
html[data-tl="1"] .empty{color:var(--dim2)}
html[data-tl="1"] .bar{background:var(--barbg)}
html[data-tl="1"] .lvnone{background:var(--barbg);color:var(--dim2)}
html[data-tl="1"] .subtbl{background:var(--subbg)}
html[data-tl="1"] .legend{background:var(--subbg)}
html[data-tl="1"] .foot a{color:var(--link)}
html[data-tl="1"] .chip{color:var(--dim)}
html[data-tl="1"] .chip:hover{color:var(--text)}
html[data-tl="1"] .card-head .right a{color:var(--dim)}
html[data-tl="1"] .stat.g .v{color:var(--good)}
html[data-tl="1"] .stat.a .v{color:var(--amber)}
html[data-tl="1"] .stat.r .v{color:var(--bad)}
html[data-tl="1"] .card.g .v{color:var(--good)}
html[data-tl="1"] .card.r .v{color:var(--bad)}
html[data-tl="1"] .rcell.done b{color:var(--good)}
html[data-tl="1"] .rcell .rb u{background:var(--barbg)}
html[data-tl="1"] .wdtag{background:var(--badbg);border-color:var(--badbd);color:var(--badtxt)}
html[data-tl="1"] .st.wd{color:var(--badtxt)}
html[data-tl="1"] tr.sep td{background:var(--sepbg);color:var(--septx);
  border-top-color:var(--sepbd);border-bottom-color:var(--sepbd)}
html[data-tl="1"] tr.wdrow td{background:var(--wdrowbg);color:var(--wdrowtx);opacity:1}
html[data-tl="1"] tr.wdrow:hover td{background:var(--wdrowhov)}
html[data-tl="1"] tr.wdrow .nm{color:var(--wdrowtx)}
html[data-tl="1"] tr.wdrow .code{color:var(--wdrowtx2)}
html[data-tl="1"] ::-webkit-scrollbar-thumb{background:var(--scroll)}
html[data-tl="1"] ::-webkit-scrollbar-thumb:hover{background:var(--scrollhov)}
html[data-tl="1"] input{background:var(--surface)}
html[data-tl="1"] .err{color:var(--bad)}
html[data-tl="1"] .card.c5{border-color:var(--warnbd);background:var(--warnbg)}
html[data-tl="1"] .mini:hover{color:var(--bad)}
html[data-tl="1"] .tabs a{background:var(--surface)}
html[data-tl="1"] .filt button{background:var(--surface)}
html[data-tl="1"] .acts a{background:var(--surface)}
html[data-tl="1"] .acts button{background:var(--surface)}
html[data-tl="1"] .lvbtn button{background:var(--surface)}
html[data-tl="1"] .lvbtn button.sel{background:var(--selbg)}
html[data-tl="1"] .lvbtn .l0{border-left-color:var(--lvl0)}
html[data-tl="1"] dialog input{background:var(--surface)}
html[data-tl="1"] .rbtn button{background:var(--surface)}
html[data-tl="1"] #wdSearch{background:var(--surface)}
html[data-tl="1"] .qrow{border-bottom-color:var(--line2)}
html[data-tl="1"] .card .v small{color:var(--dim)}
