/* ============================================================
   /tools 频道深色主题（v=1）
   ------------------------------------------------------------------
   为什么用 `html[data-theme="dark"]` 前缀而不是改写 tools.css：
     1) 只覆盖、不分支：浅色仍是原来那一份，出问题一行删除就能退回；
     2) 前缀自带特异性（0,2,0 > 0,1,0），所以本文件放在 <head> 里、比
        body 中引入的 tools.css 更早加载也不会被盖掉；
     3) data-theme 由服务端按 cookie 直接写在 <html> 上，首屏不会闪白。
   调色板：底 #0b1120 / 面 #121c2e / 面2 #0f1828 / 线 #223049
          正文 #e5ecf7 / 次要 #a9b8cc / 弱化 #7c8ca4 / 强调 #60a5fa
   ============================================================ */

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0b1120; color: #cbd8e8; }
html[data-theme="dark"] body { scrollbar-color: #2b3a55 transparent; }

/* ---------------- 站头 / 站脚（浅色皮肤的深色对应版） ---------------- */
html[data-theme="dark"] .top-nav {
  background: linear-gradient(180deg, rgba(13, 21, 36, .97), rgba(11, 17, 32, .9));
  border-bottom-color: rgba(35, 48, 73, .9);
  box-shadow: 0 1px 0 rgba(35, 48, 73, .8);
  color: #e5ecf7;
}
html[data-theme="dark"] .brand-short-name,
html[data-theme="dark"] .brand-mark { color: #eef3fb; }
html[data-theme="dark"] .brand-suffix { color: #7f93ae; }
html[data-theme="dark"] .nav-menu > a,
html[data-theme="dark"] .nav-menu .nav-link { color: #c3d0e2; }
html[data-theme="dark"] .nav-menu a:hover { color: #93c5fd; background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .nav-menu a.active,
html[data-theme="dark"] .nav-menu .nav-item.has-children.active > .nav-link { color: #93c5fd; }
html[data-theme="dark"] .nav-menu a.active::after,
html[data-theme="dark"] .nav-menu .nav-item.has-children.active > .nav-link::after { background: #60a5fa; }
html[data-theme="dark"] .nav-sub { background: #111c2e; border-color: #223049; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .9); }
html[data-theme="dark"] .nav-sub-link { color: #b9c7da; }
html[data-theme="dark"] .nav-sub-link:hover { color: #93c5fd; background: rgba(96, 165, 250, .12); }

html[data-theme="dark"] .search-form .search-input {
  background: rgba(255, 255, 255, .06); color: #e5ecf7;
  box-shadow: inset 0 0 0 1px rgba(35, 48, 73, .95);
}
html[data-theme="dark"] .search-form .search-input::placeholder { color: #6f7f96; }
html[data-theme="dark"] .search-form .search-input:focus { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .search-form .search-btn { background: rgba(96, 165, 250, .16); color: #93c5fd; }
html[data-theme="dark"] .search-form .search-close { background: rgba(96, 165, 250, .16); color: #93c5fd; }
html[data-theme="dark"] .auth-btn-login,
html[data-theme="dark"] .auth-btn-cart { border-color: #26344e; background: rgba(255, 255, 255, .07); color: #dbe5f3; }
html[data-theme="dark"] .auth-btn-avatar { background: #16233a; border-color: #26344e; }

html[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, #0d1524 0%, #0b1120 100%);
  color: #9fb0c6;
  border-top-color: #1e2b42;
}
html[data-theme="dark"] .footer-top,
html[data-theme="dark"] .footer-friend-links { border-bottom-color: #1e2b42; }
html[data-theme="dark"] .footer-brand,
html[data-theme="dark"] .footer-brand .brand-word,
html[data-theme="dark"] .footer-col-title { color: #e5ecf7; }
html[data-theme="dark"] .footer-brand .suffix,
html[data-theme="dark"] .footer-sub,
html[data-theme="dark"] .footer-copy { color: #7c8ca4; }
html[data-theme="dark"] .footer-col-list a,
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .footer-friend-links a { color: #9fb0c6; }
html[data-theme="dark"] .footer-col-list a:hover,
html[data-theme="dark"] .footer-links a:hover,
html[data-theme="dark"] .footer-friend-links a:hover { color: #93c5fd; }
html[data-theme="dark"] .footer-friend-links .fl-label { color: #6f7f96; }

/* ---------------- 主视觉 ---------------- */
/* 浅色那张 webp 是浅蓝底，套深色页面会刺眼：换成同色系的两团暗光斑 */
html[data-theme="dark"] .tl-hero {
  background-color: #0b1120;
  background-image:
    radial-gradient(900px 420px at 18% -12%, rgba(37, 99, 235, .34), transparent 70%),
    radial-gradient(760px 380px at 88% 6%, rgba(14, 165, 233, .18), transparent 72%);
}
html[data-theme="dark"] .tl-badge { background: rgba(96, 165, 250, .16); color: #93c5fd; }
html[data-theme="dark"] .tl-title { color: #f1f5f9; }
html[data-theme="dark"] .tl-title em { color: #60a5fa; }
html[data-theme="dark"] .tl-sub { color: #a9b8cc; }

html[data-theme="dark"] .tl-search {
  background: #111c2e; border-color: #233149;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .9);
}
html[data-theme="dark"] .tl-search:focus-within { border-color: #3b5b8c; }
html[data-theme="dark"] .tl-search > svg { color: #6f7f96; }
html[data-theme="dark"] .tl-search input { color: #e5ecf7; }
html[data-theme="dark"] .tl-search input::placeholder { color: #6f7f96; }

html[data-theme="dark"] .tl-pill { background: #111c2e; border-color: #233149; color: #b9c7da; }
html[data-theme="dark"] .tl-pill i { color: #7c8ca4; }
html[data-theme="dark"] .tl-pill:hover { border-color: #3b5b8c; color: #93c5fd; }
html[data-theme="dark"] .tl-pill.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme="dark"] .tl-pill-ext svg { color: #60a5fa; }

html[data-theme="dark"] .tl-trust { color: #8b9bb2; }
html[data-theme="dark"] .tl-trust b { color: #cbd5e1; }
html[data-theme="dark"] .tl-trust::before {
  background: linear-gradient(90deg, transparent, #233149 18%, #233149 82%, transparent);
}

/* ---------------- 区块与卡片 ---------------- */
html[data-theme="dark"] .tl-sec-h h2 { color: #e5ecf7; }
html[data-theme="dark"] .tl-sec-more { color: #60a5fa; }
html[data-theme="dark"] .tl-sec-more:hover { color: #93c5fd; }
html[data-theme="dark"] .tl-sec-n { color: #7c8ca4; }
html[data-theme="dark"] .tl-sec-lead { color: #8b9bb2; }
html[data-theme="dark"] .tl-grp-h h3 { color: #b9c7da; }
html[data-theme="dark"] .tl-grp-h span { color: #6f7f96; }

html[data-theme="dark"] .tl-card { background: #121c2e; border-color: #223049; }
html[data-theme="dark"] .tl-card:hover { border-color: #33507f; box-shadow: 0 18px 32px -26px rgba(0, 0, 0, .9); }
html[data-theme="dark"] .tl-card-ic {
  background: #f1f5ff;
  background: color-mix(in srgb, var(--c) 22%, #0f1828);
}
html[data-theme="dark"] .tl-card-bd h3 { color: #e9eef8; }
html[data-theme="dark"] .tl-card-bd p { color: #9aa9be; }
html[data-theme="dark"] .tl-card-tag { color: #93c5fd; background: rgba(37, 99, 235, .18); }
html[data-theme="dark"] .tl-card-meta .tl-card-tag { color: #7c8ca4; background: none; }
/* 滑杆的轨道在深色下仍是浏览器默认的亮灰，压暗一档；填充色交给 accent-color */
html[data-theme="dark"] input[type="range"]::-webkit-slider-runnable-track {
  background: #243450; border-radius: 999px; height: 5px;
}
html[data-theme="dark"] input[type="range"]::-moz-range-track {
  background: #243450; border-radius: 999px; height: 5px;
}
html[data-theme="dark"] .tl-card-go { background: #1a2437; color: #7f92ad; }
html[data-theme="dark"] .tl-card:hover .tl-card-go { background: #2563eb; color: #fff; }
html[data-theme="dark"] .tl-soon {
  color: #fbbf24; background: rgba(180, 83, 9, .2); border-color: rgba(180, 83, 9, .5);
}
html[data-theme="dark"] .tl-card.is-soon { background: #0f1828; }
html[data-theme="dark"] .tl-ext {
  color: #fca5a5; background: rgba(185, 28, 28, .18); border-color: rgba(185, 28, 28, .45);
}

/* 能力标签（tools-extra.css 的深色版） */
html[data-theme="dark"] .tl-flag-chip.is-blue { color: #93c5fd; background: rgba(37, 99, 235, .2); border-color: rgba(37, 99, 235, .38); }
html[data-theme="dark"] .tl-flag-chip.is-amber { color: #fcd34d; background: rgba(180, 83, 9, .2); border-color: rgba(180, 83, 9, .45); }
html[data-theme="dark"] .tl-flag-chip.is-gray { color: #9fb0c6; background: rgba(148, 163, 184, .12); border-color: rgba(148, 163, 184, .22); }

/* ---------------- 提示 / 隐私横幅 / 关于 ---------------- */
html[data-theme="dark"] .tl-hint { background: #111c2e; border-color: #223049; color: #a9b8cc; }
html[data-theme="dark"] .tl-hint a { color: #60a5fa; }
html[data-theme="dark"] .tl-empty { background: #0f1828; border-color: #223049; color: #7c8ca4; }
html[data-theme="dark"] .tl-safe {
  background: linear-gradient(100deg, #111f33 0%, #0f1a2b 55%, #111f33 100%);
  border-color: #1f2f49;
}
html[data-theme="dark"] .tl-safe-ic { background: rgba(37, 99, 235, .24); color: #93c5fd; }
html[data-theme="dark"] .tl-safe-bd b { color: #dbe7f6; }
html[data-theme="dark"] .tl-safe-bd p { color: #8fa3bd; }
html[data-theme="dark"] .tl-safe-ghost { color: #60a5fa; opacity: .14; }
html[data-theme="dark"] .tl-about { background: #0f1828; border-color: #1e2b42; }
html[data-theme="dark"] .tl-about h2 { color: #e5ecf7; }
html[data-theme="dark"] .tl-about p { color: #a9b8cc; }
html[data-theme="dark"] .tl-about-grid > div { background: #121c2e; border-color: #223049; }
html[data-theme="dark"] .tl-about-grid b { color: #e9eef8; }
html[data-theme="dark"] .tl-about-grid p { color: #8b9bb2; }

/* ---------------- 工具详情页 ---------------- */
html[data-theme="dark"] .tl-crumb { color: #6f7f96; }
html[data-theme="dark"] .tl-crumb a { color: #8b9bb2; }
html[data-theme="dark"] .tl-crumb a:hover { color: #93c5fd; }
html[data-theme="dark"] .tl-crumb-cur { color: #cbd5e1; }
html[data-theme="dark"] .tl-tool-hd-bd h1 { color: #f1f5f9; }
html[data-theme="dark"] .tl-tool-hd-bd > p { color: #a9b8cc; }
html[data-theme="dark"] .tl-tool-ic { background: color-mix(in srgb, var(--c) 22%, #0f1828); }
html[data-theme="dark"] .tl-badges span { background: rgba(148, 163, 184, .12); color: #9fb0c6; }
html[data-theme="dark"] .tl-badges .tl-badge-free {
  color: #fbbf24; background: rgba(180, 83, 9, .18); border-color: rgba(180, 83, 9, .45);
}
html[data-theme="dark"] .tl-badges .tl-badge-flag.is-blue { color: #93c5fd; background: rgba(37, 99, 235, .2); }
html[data-theme="dark"] .tl-badges .tl-badge-flag.is-amber { color: #fcd34d; background: rgba(180, 83, 9, .2); }
html[data-theme="dark"] .tl-badges .tl-badge-flag.is-gray { color: #9fb0c6; background: rgba(148, 163, 184, .12); }

/* 工作区 */
html[data-theme="dark"] .tl-work {
  background: #111a2b; border-color: #223049;
  box-shadow: 0 14px 40px -34px rgba(0, 0, 0, .95);
}
html[data-theme="dark"] .tl-bar { background: #0f1828; border-bottom-color: #1e2b42; }
html[data-theme="dark"] .tl-btn { background: #141f33; border-color: #26344e; color: #c3d0e2; }
html[data-theme="dark"] .tl-btn:hover { background: #182741; border-color: #3b5b8c; color: #93c5fd; }
html[data-theme="dark"] .tl-btn-main { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme="dark"] .tl-btn-main:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
html[data-theme="dark"] .tl-indent { color: #8b9bb2; }
html[data-theme="dark"] .tl-indent select { background: #141f33; border-color: #26344e; color: #c3d0e2; }
html[data-theme="dark"] .tl-pane + .tl-pane { border-left-color: #1e2b42; }
html[data-theme="dark"] .tl-pane-h { color: #8b9bb2; border-bottom-color: #1e2b42; }
html[data-theme="dark"] .tl-pane-h em { color: #6f7f96; }
html[data-theme="dark"] .tl-pane textarea { background: #111a2b; color: #dfe8f5; }
html[data-theme="dark"] .tl-pane textarea::placeholder { color: #5e6d84; }
html[data-theme="dark"] .tl-msg:not(:empty) { border-top-color: #1e2b42; }
html[data-theme="dark"] .tl-msg.is-ok { color: #6ee7b7; background: rgba(4, 120, 87, .16); }
html[data-theme="dark"] .tl-msg.is-err { color: #fca5a5; background: rgba(185, 28, 28, .16); }
html[data-theme="dark"] .tl-msg.is-warn { color: #fcd34d; background: rgba(180, 83, 9, .16); }

/* 表单 */
html[data-theme="dark"] .tl-frow > label,
html[data-theme="dark"] .tl-frow-wide > label { color: #a9b8cc; }
html[data-theme="dark"] .tl-inp,
html[data-theme="dark"] .tl-sel { background: #0f1828; border-color: #26344e; color: #e5ecf7; }
html[data-theme="dark"] .tl-inp:focus,
html[data-theme="dark"] .tl-sel:focus { border-color: #3b5b8c; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
html[data-theme="dark"] .tl-inp-text { background: #0f1828; border-color: #26344e; color: #e5ecf7; }
html[data-theme="dark"] .tl-inp-text:focus { border-color: #3b5b8c; box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
html[data-theme="dark"] .tl-chip { background: #141f33; border-color: #26344e; color: #b9c7da; }
html[data-theme="dark"] .tl-chip:hover { background: #182741; border-color: #3b5b8c; color: #93c5fd; }
html[data-theme="dark"] .tl-chip.is-on { background: rgba(37, 99, 235, .22); border-color: #2563eb; color: #bfdbfe; }
html[data-theme="dark"] .tl-tabs { background: #0f1828; }
html[data-theme="dark"] .tl-tab { color: #8b9bb2; }
html[data-theme="dark"] .tl-tab.is-on { background: #1b2942; color: #bfdbfe; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .tl-check { background: #141f33; border-color: #26344e; color: #b9c7da; }
html[data-theme="dark"] .tl-check:has(input:checked) { background: rgba(37, 99, 235, .2); border-color: #2563eb; color: #bfdbfe; }
html[data-theme="dark"] .tl-drop { background: #0f1828; border-color: #2b3a55; }
html[data-theme="dark"] .tl-drop:hover,
html[data-theme="dark"] .tl-drop.is-over { background: #131f33; border-color: #3b5b8c; }
html[data-theme="dark"] .tl-drop b { color: #cbd5e1; }
html[data-theme="dark"] .tl-drop span { color: #7c8ca4; }

/* 输出区 / 指标 / 预览 */
html[data-theme="dark"] .tl-outbox { background: #0f1828; border-color: #223049; color: #e5ecf7; }
html[data-theme="dark"] .tl-outbox.is-big { color: #93c5fd; }
html[data-theme="dark"] .tl-outbox.is-empty { color: #5e6d84; }
html[data-theme="dark"] .tl-kv em { color: #7c8ca4; }
html[data-theme="dark"] .tl-kv code { background: #0f1828; border-color: #223049; color: #e5ecf7; }
html[data-theme="dark"] .tl-mini { background: #141f33; border-color: #26344e; color: #a9b8cc; }
html[data-theme="dark"] .tl-mini:hover { border-color: #3b5b8c; color: #93c5fd; }
html[data-theme="dark"] .tl-metric { background: #0f1828; border-color: #223049; }
html[data-theme="dark"] .tl-metric b { color: #e9eef8; }
html[data-theme="dark"] .tl-metric span { color: #7c8ca4; }
html[data-theme="dark"] .tl-preview {
  background: repeating-conic-gradient(#131c2d 0% 25%, #0f1828 0% 50%) 50% / 18px 18px;
  border-color: #223049;
}
html[data-theme="dark"] .tl-preview-solid { background: #0f1828; }
html[data-theme="dark"] .tl-swatch-t b { color: #e9eef8; }
html[data-theme="dark"] .tl-swatch-t span { color: #8b9bb2; }

/* 对比 / 表格 / 文件列表 / 高亮 / Markdown */
html[data-theme="dark"] .tl-diff { background: #111a2b; border-color: #223049; }
html[data-theme="dark"] .tl-dl { border-top-color: #1a2437; }
html[data-theme="dark"] .tl-dl-n { background: #0e1626; color: #5e6d84; }
html[data-theme="dark"] .tl-dl-n + .tl-dl-n { border-left-color: #1a2437; }
html[data-theme="dark"] .tl-dl-c { border-left-color: #1a2437; color: #c3d0e2; }
html[data-theme="dark"] .tl-dl.is-add { background: rgba(4, 120, 87, .16); }
html[data-theme="dark"] .tl-dl.is-add .tl-dl-c { color: #6ee7b7; }
html[data-theme="dark"] .tl-dl.is-del { background: rgba(185, 28, 28, .16); }
html[data-theme="dark"] .tl-dl.is-del .tl-dl-c { color: #fca5a5; }
html[data-theme="dark"] .tl-dl.is-mod { background: rgba(180, 83, 9, .16); }
html[data-theme="dark"] .tl-dl.is-mod .tl-dl-c { color: #fcd34d; }
html[data-theme="dark"] .tl-dl.is-mod .tl-dl-n { background: rgba(180, 83, 9, .16); }
html[data-theme="dark"] .tl-dl-sig { color: #5e6d84; }

html[data-theme="dark"] .tl-file { background: #121c2e; border-color: #223049; }
html[data-theme="dark"] .tl-file-th {
  background: repeating-conic-gradient(#131c2d 0% 25%, #0f1828 0% 50%) 50% / 12px 12px; color: #7c8ca4;
}
html[data-theme="dark"] .tl-file-bd b { color: #e5ecf7; }
html[data-theme="dark"] .tl-file-bd span { color: #7c8ca4; }

html[data-theme="dark"] .tl-table-wrap { border-color: #223049; }
html[data-theme="dark"] .tl-table th { background: #0f1828; color: #8b9bb2; }
html[data-theme="dark"] .tl-table th,
html[data-theme="dark"] .tl-table td { border-bottom-color: #1e2b42; }
html[data-theme="dark"] .tl-table code { color: #e5ecf7; }
html[data-theme="dark"] .tl-table .tl-td-n { color: #7c8ca4; }
html[data-theme="dark"] .tl-table .tl-td-k { color: #93c5fd; }
html[data-theme="dark"] .tl-table .tl-td-group { background: #0f1828; color: #b9c7da; }

html[data-theme="dark"] .tl-hl { background: #0f1828; border-color: #223049; color: #cbd5e1; }
html[data-theme="dark"] .tl-hl mark { background: #a16207; color: #fef3c7; }
html[data-theme="dark"] .tl-hl mark.m2 { background: #1d4ed8; color: #dbeafe; }

html[data-theme="dark"] .tl-mdl { background: #121c2e; border-color: #223049; color: #c3d0e2; }
html[data-theme="dark"] .tl-mdl h1,
html[data-theme="dark"] .tl-mdl h2,
html[data-theme="dark"] .tl-mdl h3,
html[data-theme="dark"] .tl-mdl h4,
html[data-theme="dark"] .tl-mdl h5,
html[data-theme="dark"] .tl-mdl h6 { color: #e9eef8; }
html[data-theme="dark"] .tl-mdl h2 { border-bottom-color: #223049; }
html[data-theme="dark"] .tl-mdl code { background: #0f1828; color: #fda4af; }
html[data-theme="dark"] .tl-mdl blockquote { background: #0f1828; border-left-color: #3b5b8c; color: #a9b8cc; }
html[data-theme="dark"] .tl-mdl a { color: #60a5fa; }
html[data-theme="dark"] .tl-mdl th,
html[data-theme="dark"] .tl-mdl td { border-color: #223049; }
html[data-theme="dark"] .tl-mdl th { background: #0f1828; }
html[data-theme="dark"] .tl-mdl hr { border-top-color: #223049; }

/* 正文说明 / 同类工具 / 即将上线 */
html[data-theme="dark"] .tl-doc h2 { color: #e9eef8; }
html[data-theme="dark"] .tl-doc p,
html[data-theme="dark"] .tl-doc li { color: #a9b8cc; }
html[data-theme="dark"] .tl-doc b { color: #e5ecf7; }
html[data-theme="dark"] .tl-doc code { background: #0f1828; color: #fda4af; }
html[data-theme="dark"] .tl-soonbox { background: #0f1828; border-color: #223049; }
html[data-theme="dark"] .tl-soonbox b { color: #e9eef8; }
html[data-theme="dark"] .tl-soonbox p { color: #8b9bb2; }
html[data-theme="dark"] .tl-note { color: #7c8ca4; }
html[data-theme="dark"] .tl-flag { background: rgba(148, 163, 184, .12); color: #9fb0c6; }
html[data-theme="dark"] .tl-flag.is-warn { background: rgba(180, 83, 9, .2); color: #fcd34d; border-color: rgba(180, 83, 9, .45); }
html[data-theme="dark"] .tl-flag.is-ok { background: rgba(4, 120, 87, .2); color: #6ee7b7; border-color: rgba(4, 120, 87, .45); }
html[data-theme="dark"] .tl-line { color: #a9b8cc; }
html[data-theme="dark"] .tl-line b,
html[data-theme="dark"] .tl-strong { color: #e9eef8; }

/* 深色模式开关与「最近使用」的深色皮 */
html[data-theme="dark"] .tl-theme {
  background: #16233a; border-color: #26344e; color: #b9c7da;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .85);
}
html[data-theme="dark"] .tl-theme:hover { color: #93c5fd; border-color: #3b5b8c; }
html[data-theme="dark"] .tl-recent-x { color: #9fb0c6; }
html[data-theme="dark"] .tl-recent-x:hover { color: #93c5fd; }
html[data-theme="dark"] .tl-sec-h h2 .tl-sec-n { color: #6f7f96; }
