/* ═══════════════════════════════════════════════════════════
   next — WorkBuddy 子站地图
   配色体系：现代终端 / ANSI 基本色 + VGA 灰阶
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 背景：CRT 显像管的冷黑，逐层提亮 */
  --bg:      #0a0e0a;
  --bg2:     #0f1410;
  --bg3:     #161d17;
  --bg4:     #1d2620;

  /* 前景：磷光灰绿，模拟 P1 荧光粉 */
  --fg:      #c3d4c5;
  --fg2:     #9daa9f;
  /* dim 用于次要文字：从 #5b6a5e 提亮到 #6f8073，
     在 --bg 上对比度由 3.4:1 升到约 4.6:1，达到 WCAG AA 正文标准 */
  --dim:     #6f8073;
  --dim2:    #8b9c8f;

  /* ANSI 8 色（终端标准色板，降饱和以适配深底） */
  --green:   #33d17a;   /* ANSI bright green */
  --green-d: #22a35c;
  --green-x: #6ee7a5;   /* 高亮 / 光标 */
  --cyan:    #4bb3d4;   /* ANSI bright cyan */
  --blue:    #5b8dd6;
  --yellow:  #d4a72c;   /* ANSI bright yellow */
  --orange:  #d4793c;
  --red:     #cf5a5a;
  --magenta: #b96bc4;

  /* 结构线：极低对比度的绿灰 */
  --line:    #1a241b;
  --line2:   #253326;
  --line3:   #324034;

  /* 语义别名（保持旧变量名兼容） */
  --grn:     var(--green);
  --grn-d:   var(--green-d);
  --amber:   var(--yellow);

  --mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas,
          "Liberation Mono", "PingFang SC", "Microsoft YaHei", monospace;

  --glow: 0 0 6px rgba(51, 209, 122, 0.28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* CRT 扫描线：更细、更淡，避免糊掉文字 */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(120, 255, 170, 0.016) 3px 4px
  );
  pointer-events: none; z-index: 999;
}

/* 暗角：显像管的边缘衰减 */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(
    ellipse 120% 100% at 50% 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.42) 100%
  );
  pointer-events: none; z-index: 998;
}

a { color: var(--green); text-decoration: none; transition: color .13s; }
code {
  font-family: var(--mono);
  color: var(--green);
  background: var(--bg3);
  padding: 1px 5px;
  border: 1px solid var(--line);
  font-size: 12px;
}

::selection { background: var(--green); color: var(--bg); }

/* 键盘导航：统一可见焦点环（鼠标点击不出现，避免干扰视觉） */
:focus-visible {
  outline: 2px solid var(--green-x);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible { outline-offset: 1px; }

/* 文内按钮：外观等同链接，但保持 button 语义（可键盘聚焦、不产生 # 跳转） */
.lnk {
  background: none; border: 0; padding: 0; margin: 0;
  font-family: inherit; font-size: inherit; line-height: inherit;
  color: var(--green); cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .13s, border-color .13s;
}
.lnk:hover { border-bottom-color: var(--green); }

/* 滚动条：终端油条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line2); border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--line3); }

/* ─── 顶栏 ─── */
.bar {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line2);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  font-size: 13px;
  position: sticky; top: 0; z-index: 50;
}
.prompt { color: var(--green); text-shadow: var(--glow); font-weight: 600; }
.cmd { color: var(--fg); font-weight: 600; }
.flags { color: var(--yellow); opacity: .8; }
.blink {
  width: 7px; height: 15px; background: var(--green-x);
  box-shadow: var(--glow);
  animation: blink 1.15s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.tabs { margin-left: auto; display: flex; gap: 1px; }
.tab {
  background: var(--bg2); border: 1px solid var(--line);
  color: var(--dim2); font-family: var(--mono); font-size: 12px;
  padding: 5px 15px; cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
}
.tab:hover { color: var(--green); border-color: var(--line3); background: var(--bg3); }
.tab.on {
  background: var(--green); color: var(--bg); border-color: var(--green);
  font-weight: 600; text-shadow: none;
}

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 20px 48px; }

/* ─── 定位语 ───
   分享卡片已经把定位讲清了，但直接打开网站的人第一眼也要知道这是什么。
   用终端注释的样式（竖线 + 三段），不抢统计卡与列表的视觉层级。 */
.tagline {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 4px 10px; margin: 0 0 20px;
  padding-left: 11px; border-left: 2px solid var(--green);
  font-size: 13px; line-height: 1.6; color: var(--dim2);
}
.tagline b { color: var(--green); font-weight: 600; font-size: 13.5px; }
.tagline .ts { color: var(--dim); }
.tagline .td { color: var(--dim2); }
.tagline .ts::before, .tagline .td::before { content: "· "; color: var(--line); }

/* ─── 概览 ─── */
.stats {
  /* 自适应列数：150px 最小列宽保证 5 张卡在常见宽度下一行放下，
     窄屏自然折为 2 列，不再写死列数 */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line2);
  margin-bottom: 20px;
}
.stat {
  background: var(--bg2); padding: 15px 17px;
  display: flex; flex-direction: column; gap: 3px;
  position: relative;
  transition: background .15s;
}
.stat:hover { background: var(--bg3); }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--green); opacity: .5;
  transition: opacity .15s;
}
.stat:hover::before { opacity: 1; }
.stat .n {
  font-size: 25px; font-weight: 600; color: var(--green);
  font-variant-numeric: tabular-nums; line-height: 1.1;
  text-shadow: var(--glow);
}
.stat .l { font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }

.lede { font-size: 12.5px; color: var(--dim2); margin-bottom: 18px; }
.lede b { color: var(--green); font-weight: 500; }
.dots::after { content: ""; animation: dots 1.4s steps(4,end) infinite; }
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} }

/* ─── 筛选器 ─── */
.filters { margin-bottom: 14px; }
#q, .tin {
  width: 100%; background: var(--bg2); border: 1px solid var(--line2);
  color: var(--fg); font-family: var(--mono); font-size: 13px;
  padding: 10px 13px 10px 32px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  background-image: linear-gradient(transparent, transparent);
}
#q:focus, .tin:focus { border-color: var(--green-d); box-shadow: 0 0 0 1px rgba(51,209,122,.14); }
#q::placeholder, .tin::placeholder { color: var(--dim); }

/* 屏蔽表单：纵向排布，域名/原因并排 */
.mask-form { max-width: 760px; display: flex; flex-direction: column; gap: 8px; }
.mrow { display: flex; gap: 8px; flex-wrap: wrap; }
.mrow .tin { flex: 1 1 240px; width: auto; }

.search-wrap { position: relative; }
.search-wrap::before {
  content: "$";
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--green-d); font-size: 13px; font-weight: 600;
  pointer-events: none; z-index: 1;
}

.frow { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 13px; }
.fgroup { display: flex; flex-direction: column; gap: 6px; }
.fgroup-end { margin-left: auto; }
.flabel {
  font-size: 10.5px; color: var(--dim); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.flabel::before { content: "// "; color: var(--line3); }

.chips { display: flex; flex-wrap: wrap; gap: 1px; }
.chip {
  background: var(--bg2); border: 1px solid var(--line); color: var(--dim2);
  font-family: var(--mono); font-size: 11.5px;
  padding: 5px 12px; cursor: pointer;
  transition: color .13s, background .13s, border-color .13s;
  white-space: nowrap;
}
.chip:hover { color: var(--green); border-color: var(--line3); background: var(--bg3); }
.chip.on {
  background: var(--green); color: var(--bg); border-color: var(--green);
  font-weight: 600;
}
.chip.act { border-color: var(--green-d); color: var(--green); }
.chip.act:hover { background: var(--green); color: var(--bg); }
.chip:disabled { opacity: .4; cursor: wait; }

.lbar {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--dim);
  padding: 9px 2px; border-bottom: 1px solid var(--line);
}
.lbar #rcount { color: var(--green); font-weight: 600; }
.lbar .sep { color: var(--line3); }

/* ─── 列表 ─── */
.list { border-top: 1px solid var(--line); }

.item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background .12s, border-left-color .12s;
  animation: itemIn .16s ease-out backwards;
  animation-delay: calc(min(var(--i, 0), 24) * 9ms); /* 前 24 条逐条浮现，其后零延迟 */
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.item:hover {
  background: var(--bg2);
  border-left-color: var(--green-d);
}

.dom {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 260px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  padding-left: 0;
}
.dom::before {
  content: "./";
  color: var(--line3);
  margin-right: 1px;
}
.dom .p { color: var(--green); font-weight: 600; }
.dom .s { color: var(--dim); }
.dom a:hover { background: var(--green); }
.dom a:hover .p,
.dom a:hover .s { color: var(--bg); }
.dom a:hover .s { opacity: .66; }
.dom a:hover::before { color: var(--bg); opacity: .5; }

.meta { flex: 1 1 auto; min-width: 0; }
.ttl {
  color: var(--fg); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.desc {
  color: var(--dim); font-size: 11.5px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tags {
  flex: 0 0 auto;
  display: flex; gap: 5px; align-items: center;
  white-space: nowrap;
}
.tag {
  font-size: 10px; letter-spacing: 0.05em;
  border: 1px solid var(--line2); color: var(--dim);
  padding: 2px 7px; background: var(--bg2);
  font-variant-numeric: tabular-nums;
}
.tag.sub   { border-color: var(--green-d); color: var(--green); }
.tag.dead  { border-color: #4a2424; color: var(--red); }
.tag.alpha { border-color: var(--line2); color: var(--fg2); }
.tag.mix   { border-color: #4a3c18; color: var(--yellow); }
.tag.digit { border-color: #24404a; color: var(--cyan); }
.tag.changed { border-color: #4a3c18; color: var(--yellow); }
.tag.masked  { border-color: #3a3a52; color: #9a9ab8; background: #1a1a2a; }

/* 屏蔽条目：星号打码态（域名/标题已在服务端星号化） */
.item.masked { opacity: .6; }
.item.masked .dom a { cursor: default; }
.item.masked .dom a .p { color: #9a9ab8; letter-spacing: .08em; }
.item.masked .dom a .s { color: #55556a; }
.item.masked .ttl, .item.masked .desc { color: #8a8a9e; }

/* 免责声明排版 */
.legal {
  border: 1px solid var(--line2); background: var(--bg2);
  padding: 16px 18px; font-size: 12.5px; line-height: 1.85;
  color: var(--dim2); max-width: 780px;
}
/* 条款之间留足呼吸感，段首不缩进，长段落更易扫读 */
.legal p { margin: 0 0 11px; text-align: justify; }
.legal p:last-child { margin-bottom: 0; }
.legal b { color: var(--fg); }
.legal-foot {
  margin-top: 10px; font-size: 11px; color: var(--dim);
  max-width: 780px;
}
.legal-foot::before { content: "// "; color: var(--line3); }
.legal code {
  font-family: var(--mono, monospace); font-size: 11px;
  color: var(--green); background: rgba(51,209,122,.08); padding: 1px 5px;
}

/* 失效条目：整条降透明度 + 域名暗红（保留快照，不剔除） */
.item.dead { opacity: .72; }
.item.dead .dom a,
.item.dead .dom a .p { color: var(--red); }
.item.dead .dom a .s { color: #6b3030; }
.item.dead .dom a:hover::before { color: var(--red); }

.empty { text-align: center; color: var(--dim); padding: 46px 0; }
.empty::before { content: "// "; color: var(--line3); }
.more { text-align: center; padding: 20px 0; }
.more .chip { padding: 8px 26px; }

/* ─── 采集视图 ─── */
.vtitle { font-size: 17px; font-weight: 600; margin-bottom: 9px; }
.caret { color: var(--green); text-shadow: var(--glow); }
.vsub {
  font-size: 12.5px; color: var(--dim2); margin-bottom: 26px; line-height: 1.8;
  border-left: 2px solid var(--line2); padding-left: 12px;
}
.vsub b { color: var(--yellow); font-weight: 500; }

.panel {
  border: 1px solid var(--line2); background: var(--bg2);
  padding: 20px; margin-bottom: 18px;
  position: relative;
}
.panel::before {
  content: ""; position: absolute; left: -1px; top: -1px;
  width: 10px; height: 10px;
  border-left: 2px solid var(--green-d); border-top: 2px solid var(--green-d);
}
.panel h2 {
  font-size: 13.5px; font-weight: 600; margin-bottom: 9px; color: var(--fg);
}
.panel h2::before { content: "▸ "; color: var(--green); }
.phint { font-size: 12px; color: var(--dim2); margin-bottom: 16px; line-height: 1.8; }
.phint b { color: var(--yellow); font-weight: 500; }

.field { display: flex; align-items: stretch; flex-wrap: wrap; }
.field input {
  flex: 1; min-width: 160px;
  background: var(--bg); border: 1px solid var(--line2); border-right: 0;
  color: var(--green); font-family: var(--mono); font-size: 13px;
  padding: 10px 12px; outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--green-d); }
.field input::placeholder { color: var(--dim); }
.suffix {
  background: var(--bg3); border: 1px solid var(--line2); border-left: 0; border-right: 0;
  color: var(--dim); font-size: 12px; padding: 10px 10px;
  display: flex; align-items: center; white-space: nowrap;
}
.field button {
  background: var(--green); color: var(--bg); border: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  padding: 10px 26px; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.field button:hover { background: var(--green-x); box-shadow: var(--glow); }
.field button:disabled { background: var(--dim); cursor: wait; box-shadow: none; }

.scan-opts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 16px; }
.scan-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
button.big {
  background: var(--green); color: var(--bg); border: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  padding: 10px 28px; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
button.big:hover { background: var(--green-x); box-shadow: var(--glow); }
button.big:disabled { background: var(--dim); cursor: wait; box-shadow: none; }
button.big.ghost {
  background: transparent; border: 1px solid var(--green-d); color: var(--green);
}
button.big.ghost:hover { background: var(--green); color: var(--bg); }
button.big.ghost:disabled { border-color: var(--line2); color: var(--dim); background: transparent; }

.est { font-size: 11.5px; color: var(--dim); }
.est b { color: var(--yellow); font-weight: 500; }

/* 停止是破坏性操作，用警示红与「开始扫描」的实心绿明确区分，避免误点 */
button.big.danger {
  background: transparent; border: 1px solid var(--red); color: var(--red);
}
button.big.danger:hover {
  background: var(--red); color: var(--bg); box-shadow: none;
}
button.big.danger:disabled {
  border-color: var(--line2); color: var(--dim); background: transparent;
}
/* 从头重扫：会丢弃已跑进度，用琥珀色表示「谨慎但非破坏」 */
button.big.warn {
  background: transparent; border: 1px solid var(--amber); color: var(--amber);
}
button.big.warn:hover { background: var(--amber); color: var(--bg); box-shadow: none; }
button.big.warn:disabled {
  border-color: var(--line2); color: var(--dim); background: transparent;
}

/* 页脚版本徽章：一眼确认线上跑的是哪一版，排查问题时不用猜 */
.ver {
  display: inline-block; font-size: 10.5px; color: var(--green);
  border: 1px solid var(--green-d); padding: 0 5px; margin-left: 5px;
  line-height: 1.5; vertical-align: 1px;
}

.progress { margin-top: 18px; }
.ptop {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--fg2); margin-bottom: 8px;
}
.ptop #p-pct { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.pbar {
  height: 5px; background: var(--bg); border: 1px solid var(--line2);
  overflow: hidden;
}
.pbar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--green-d) 0 6px,
    var(--green) 6px 12px
  );
  transition: width .4s linear;
}
.pmeta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 11px; color: var(--dim); margin-top: 9px;
  font-variant-numeric: tabular-nums;
}
.pmeta .sep { color: var(--line3); }
.pmeta #p-found { color: var(--green); }

.maint { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ─── 复探覆盖可视化 ─── */
.cov { margin-bottom: 16px; }
.cov-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--dim); margin-bottom: 7px;
}
.cov-head .cov-pct { color: var(--green); font-weight: 600; font-size: 13px; }
.cov-bar {
  display: flex; height: 6px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line2);
}
.cov-bar i { display: block; height: 100%; transition: width .5s; }
.cov-bar .c24  { background: var(--green); }
.cov-bar .c7d  { background: var(--yellow); opacity: .75; }
.cov-bar .cold { background: var(--red); opacity: .6; }
.cov-legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 7px; font-size: 11px; color: var(--dim);
}
.cov-legend b { color: var(--fg2); font-weight: 500; }
.cov-legend .dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 5px;
}
.cov-legend .d24  { background: var(--green); }
.cov-legend .d7d  { background: var(--yellow); opacity: .75; }
.cov-legend .dold { background: var(--red); opacity: .6; }

.out {
  margin-top: 15px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line2);
  border-left: 2px solid var(--green);
  font-size: 12px; color: var(--dim2);
  white-space: pre-wrap; word-break: break-word; line-height: 1.85;
}
.out.err { border-left-color: var(--red); color: #d9a3a1; }
.out .k { color: var(--green); font-weight: 600; }

/* ─── 页脚 ─── */
footer {
  border-top: 1px solid var(--line2); padding: 15px 20px;
  font-size: 11.5px; color: var(--dim); text-align: center;
  background: var(--bg2);
  position: relative;
}
footer::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green-d), transparent);
  opacity: .5;
}
footer .sep { margin: 0 8px; color: var(--line3); }
footer .frow2 { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; }
footer .copy { margin-top: 7px; font-size: 11px; }
footer .copy a { color: var(--dim2); border-bottom: 1px solid transparent; }
footer .copy a:hover { color: var(--green); background: none; border-bottom-color: var(--green); }

/* ─── 骨架屏：数据未到时的占位行，避免内容闪换 ─── */
.skel-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 8px; border-bottom: 1px solid var(--line);
}
.skel {
  height: 11px; border-radius: 1px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skel.w-dom   { width: 180px; }
.skel.w-meta  { flex: 1; }
.skel.w-tags  { width: 150px; }

/* ─── Toast：轻量反馈，替代 alert（alert 会打断终端风的沉浸感） ─── */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 200;
  transform: translate(-50%, 12px);
  background: var(--bg4); color: var(--fg);
  border: 1px solid var(--line3); border-left: 2px solid var(--green);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  padding: 10px 16px; max-width: min(480px, calc(100vw - 32px));
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  white-space: pre-wrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-left-color: var(--red); }

/* ─── 全局任务条：后台扫描/复探在任何视图都可见可跳转 ─── */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--bg4); border-top: 1px solid var(--line3);
  font-family: var(--mono); font-size: 12px; color: var(--fg2);
  box-shadow: 0 -4px 18px rgba(0,0,0,.45);
}
.taskbar.on { display: flex; }
.taskbar .t-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-x); box-shadow: var(--glow);
  animation: pulse 1.3s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.taskbar #task-text {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.taskbar #task-text b { color: var(--green); font-weight: 600; }

/* 回到顶部：长列表（1100+ 条）必备 */
#totop {
  position: fixed; right: 16px; bottom: 52px; z-index: 80;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .18s, transform .18s;
  background: var(--bg4); border-color: var(--line3);
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
#totop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ─── 可折叠声明块 ─── */
details.legal-box { border: 1px solid var(--line2); background: var(--bg2); }
details.legal-box > summary {
  cursor: pointer; list-style: none;
  padding: 12px 16px;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg2);
  user-select: none;
  display: flex; align-items: center; gap: 8px;
  transition: color .13s, background .13s;
}
details.legal-box > summary:hover { color: var(--green); background: var(--bg3); }
details.legal-box > summary::-webkit-details-marker { display: none; }
details.legal-box > summary::before {
  content: "▸"; color: var(--green); transition: transform .15s;
}
details.legal-box[open] > summary::before { transform: rotate(90deg); }
details.legal-box .legal { border: 0; background: transparent; padding: 4px 16px 16px; }
details.legal-box .legal-foot { padding: 0 16px 14px; margin-top: 0; }

/* 空状态：终端风引导 */
.empty-box {
  border: 1px dashed var(--line3); background: var(--bg2);
  text-align: center; padding: 42px 18px; color: var(--dim);
  margin-top: 4px;
}
.empty-box .e-art { color: var(--line3); font-size: 11px; line-height: 1.3; margin-bottom: 14px; user-select: none; }
.empty-box .e-main { font-size: 13px; color: var(--fg2); margin-bottom: 6px; }
.empty-box .e-hint { font-size: 11.5px; margin-bottom: 14px; }

/* 动画尊重系统设置：晕动症用户不应被动效困扰 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .blink { animation: none; }
}

/* 页脚安装按钮行默认不占位（hidden 属性即可，无需额外样式） */

/* ══════════ 移动端 ══════════ */
@media (max-width: 900px) {
  .fgroup-end { margin-left: 0; }
}

@media (max-width: 680px) {
  body { font-size: 13px; }
  main { padding: 16px 14px 96px; } /* 底部留出任务条高度，避免遮挡 */
  .bar { padding: 9px 14px; flex-wrap: wrap; gap: 6px; }
  .flags { display: none; }

  /* 沿用 auto-fit；奇数张卡时最后一张跨满整行，消灭右侧空洞 */
  .stats { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); }
  .stat { padding: 13px 14px; }
  .stat .n { font-size: 22px; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .legal { padding: 13px 14px; font-size: 12px; line-height: 1.8; }
  .legal p { text-align: left; }

  .frow { gap: 12px; }
  /* chips 改为横向滑动条：像原生 App 的分段控件，纵向空间省一半以上。
     旧实现全宽换行，7 组筛选在手机上要滚三屏才看得到列表。 */
  .fgroup { width: 100%; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; text-align: center; padding: 6px 13px; }
  /* 滑动条右缘渐隐提示「还能往右滑」 */
  .fgroup { position: relative; }
  .fgroup::after {
    content: ""; position: absolute; right: 0; bottom: 2px; top: 22px; width: 22px;
    background: linear-gradient(90deg, transparent, var(--bg));
    pointer-events: none; opacity: 0; transition: opacity .2s;
  }
  .fgroup.scrollable::after { opacity: 1; }

  .item {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 8px;
  }
  .dom { max-width: 100%; font-size: 13.5px; }
  .ttl { font-size: 13px; }
  .tags { flex-wrap: wrap; }
  .panel { padding: 16px; }
  .taskbar { font-size: 11.5px; padding: 8px 12px; gap: 8px; }
  #totop { right: 12px; bottom: 58px; }
}

@media (max-width: 380px) {
  .field { flex-direction: column; }
  .field input { border-right: 1px solid var(--line2); border-bottom: 0; }
  .suffix {
    border-left: 1px solid var(--line2); border-right: 1px solid var(--line2);
    border-top: 0; border-bottom: 0;
  }
}
