:root {
  --bg: #f6f7f9; --panel: #ffffff; --border: #e3e6ea;
  --text: #1c2128; --muted: #6b7280; --accent: #2563eb;
  --accent-soft: #eff4ff; --ok: #16a34a; --err: #dc2626; --warn: #b45309;
  --radius: 12px; --mono: ui-monospace, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }

/* 键盘焦点可见（鼠标点击不触发，避免视觉噪音） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .icon-btn:focus-visible { outline-offset: 3px; }
/* 跳过导航：仅键盘聚焦时出现 */
.skip-link {
  position: absolute; left: -9999px; top: 6px; z-index: 60;
  background: var(--accent); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
}
.skip-link:focus { left: 16px; }
/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 12px 24px;
}
.logo { font-weight: 700; font-size: 18px; color: var(--accent); cursor: pointer; }
.logo small { color: var(--muted); font-weight: 400; margin-left: 6px; }
#search {
  flex: 1; max-width: 480px; padding: 9px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 999px; outline: none; background: var(--bg);
}
#search:focus { border-color: var(--accent); background: #fff; }
/* v3.4：首页首屏已经有 hero 大搜索框，头部再放一个一模一样的输入框纯属重复。
   首页把输入框收起来，换成一个打开命令面板的按钮——命令面板搜的是全站
   （工具 / 资源 / 专题 / 评测 / 页面），和 hero 框的「就地筛选当前列表」职责不同。
   滚到下面想搜东西也有入口，而且入口是全站搜索，不是又一份同样的筛选。 */
#search-open { display: none; }
body[data-view='home'] #search { display: none; }
body[data-view='home'] #search-open { display: inline-flex; }

/* v3.4：1000 → 1160。正文页有自己的 .page{max-width:720px} 兜底，
   加宽只作用在目录类界面（首页工具网格、资源、对比），不会把长文行宽拉到读不动 */
.container { max-width: 1160px; margin: 0 auto; padding: 28px 20px 60px; }
.hero { text-align: center; padding: 26px 0 30px; position: relative; }
.hero-kicker {
  display: inline-block; font-size: 11px; letter-spacing: 4px; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 16px; margin-bottom: 14px; font-weight: 600;
}
.hero h1 { font-size: 30px; margin: 0 0 10px; line-height: 1.35; }
.hero .grad {
  background: linear-gradient(90deg, #2563eb, #7c3aed 55%, #db2777);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin: 0 0 8px; }
.hero::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: -6px;
  width: 72px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; justify-content: center; }
.chip {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); cursor: pointer; font-size: 13px; color: var(--muted);
  transition: border-color .12s, color .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 运行时筛选 + 排序：与分类 chip 区分开，弱化为工具栏 */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: -8px 0 18px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel);
}
.filterbar .fb-label { font-size: 12px; color: var(--muted); }
.filterbar .fb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.filterbar .chip { padding: 4px 11px; font-size: 12.5px; }
.filterbar .fb-count { margin-left: auto; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) {
  .filterbar { justify-content: center; }
  .filterbar .fb-count { margin-left: 0; width: 100%; text-align: center; }
}

/* ===== 推荐区（与普通列表明显区分：渐变边框 + 排名）===== */
.featured-section {
  background: linear-gradient(135deg, #f5f8ff 0%, #fdf5ff 100%);
  border: 1px solid #dfe6fb; border-radius: 16px; padding: 20px 20px 24px; margin-bottom: 26px;
}
.section-title {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 700;
}
.section-title em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; }
/* ===== 高频推荐：8 条紧凑列表 =====
   v3.4：原来是 13 张卡片，和下方工具网格长得太像，读者会以为是同一份列表。
   改成两列行式列表：无卡片边框、行分隔、单行描述，一眼就能看出「这是精选摘要，下面才是全集」 */
.featured-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; }
@media (max-width: 820px) { .featured-list { grid-template-columns: 1fr; } }
.fl-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 0 10px;
  padding: 10px 8px; border-bottom: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.fl-row:hover { background: var(--accent-soft); }
.fl-row .rank {
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); opacity: .7;
}
.fl-row .f-body { min-width: 0; }
.fl-row .f-name { font-weight: 650; font-size: 14px; }
.fl-row .f-desc {
  font-size: 12px; color: var(--muted); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fl-row .f-meta { font-size: 11px; color: var(--accent); white-space: nowrap; }

/* ===== 工具列表：宽屏 5 列 ===== */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1250px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid { grid-template-columns: 1fr; } }

/* ===== 分页条（v3.4） ===== */
.pager {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; margin: 26px 0 4px;
}
.pager:empty { display: none; }
.pg-btn {
  min-width: 34px; min-height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel);
  color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-gap { min-width: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.pg-info { flex-basis: 100%; text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  opacity: 0; transition: opacity .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.07); border-color: #c7d4f5; }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; gap: 8px; }
.cat-icon { font-size: 17px; }
.card-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.card .desc { color: var(--muted); font-size: 12.5px; flex: 1; line-height: 1.55; }
.card .meta { display: flex; gap: 8px; font-size: 11px; flex-wrap: wrap; }
.badge { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 6px; }
.badge.local { background: #ecfdf3; color: var(--ok); }
.badge.link { background: #fff7ed; color: #c2570a; }
.badge.hot { background: transparent; padding: 2px 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* 工具页专用样式（堆叠提示、结果导出、结果表格、个税大数字、二维码布局、
   教程/常见错误、diff 与 Markdown 预览、口令弹层…）已拆到 assets/style.tool.css（v3.5）。
   这里的 .panel / .field / .btn / .result 是工具页与内容页共用的基础件，不要搬走。 */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.tool-head .desc { color: var(--muted); margin: 0 0 4px; font-size: 14px; }
.tool-head .src { font-size: 12px; color: var(--muted); }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-top: 18px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.field textarea { font-family: var(--mono); min-height: 160px; resize: vertical; }
.field textarea:focus, .field input:focus, .field select:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  padding: 10px 22px; border: none; border-radius: 8px; background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.result { margin-top: 16px; }
.result pre {
  background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 8px;
  overflow: auto; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all;
  max-height: 420px;
}
.result pre.ok { outline: 2px solid var(--ok); }
.result pre.err { outline: 2px solid var(--err); }
.msg-ok { color: var(--ok); font-size: 13px; }
/* v3.7：提醒类提示（「已收缩到边缘」「校验值不一致」）。之前只有 .msg-ok，
   .msg-warn 在 exif-strip、file-hash、csv-columns 和提交页的工具构建器里都是裸文本。 */
.msg-warn { color: var(--warn); font-size: 13px; }
.msg-err { color: var(--err); font-size: 13px; }
/* 统一结果出口：复制 / 下载 / 分享 */
.result-actions .btn { padding: 8px 14px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
canvas.qr { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; border-top: 1px solid var(--border); margin-top: 40px; }
footer .foot-note { margin-top: 8px; font-size: 11px; opacity: .8; max-width: 720px; margin-left: auto; margin-right: auto; }

/* 使用说明 / 小贴士区块 */
.usage { background: var(--accent-soft); border-color: #c7d4f5; font-size: 13.5px; color: #33415c; }
.usage b { color: var(--accent); }
.tips { background: #fffbeb; border-color: #fde68a; font-size: 13.5px; }
.tips b { color: #b45309; }
.tips ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }
.tips li { margin-left: 4px; }
/* 长尾教程：使用步骤 / 常见错误 */
.related-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.related-chip {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; transition: border-color .12s, color .12s;
}
.related-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 头部操作区 ===== */
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color .12s;
}
.icon-btn:hover { border-color: var(--accent); }
/* 语言按钮带文字，不能按 34px 方块处理，否则图标与 EN 会折行 */
#lang-btn { width: auto; min-width: 34px; padding: 0 8px; gap: 4px; font-size: 12px; white-space: nowrap; }
.icon-btn { white-space: nowrap; }
/* 标题按行均衡断行，避免手机上出现「工具」单字孤行 */
.hero h1 { text-wrap: balance; }

/* ===== 卡片等高 + 星标 ===== */
.card .desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
}
.star {
  position: absolute; top: 10px; right: 10px; border: none; background: transparent;
  font-size: 16px; color: #cbd2dc; cursor: pointer; line-height: 1; padding: 2px 4px;
  transition: color .12s, transform .12s;
  /* 24×20 太窄点不准，撑到 24×24（WCAG 2.5.8 硬线） */
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; min-height: 24px;
}
.star:hover { color: #f59e0b; transform: scale(1.15); }
.star.on { color: #f59e0b; }

/* ===== 回到顶部 ===== */
.to-top {
  position: fixed; right: 22px; bottom: 26px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--accent);
  font-size: 17px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s; box-shadow: 0 4px 14px rgba(0,0,0,.12); z-index: 30;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }

/* ===== 静态内容页 ===== */
.page { max-width: 720px; margin: 0 auto; }
.page h1 { font-size: 24px; margin: 6px 0 12px; }
.page .lead { color: var(--muted); font-size: 15px; line-height: 1.8; }
.page h2 { font-size: 16px; margin: 26px 0 10px; }
.page ul { line-height: 1.9; padding-left: 20px; color: var(--text); }
.page p { line-height: 1.8; }
.page pre {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; font-family: var(--mono); font-size: 13px; line-height: 1.7; overflow: auto;
}
.foot-links { margin-top: 8px; font-size: 12px; }
.foot-links a { color: var(--accent); }

/* ===== 深色主题 ===== */
[data-theme='dark'] {
  --bg: #0e1116; --panel: #161a22; --border: #262b36;
  --text: #e6e9ef; --muted: #98a1b0; --accent: #6b97ff;
  --accent-soft: #1a2233; --ok: #4ade80; --err: #f87171; --warn: #fbbf24;
}
[data-theme='dark'] body { background: var(--bg); color: var(--text); }
[data-theme='dark'] .site-header { background: rgba(22, 26, 34, .92); backdrop-filter: blur(8px); }
[data-theme='dark'] #search { background: #10141b; color: var(--text); }
[data-theme='dark'] #search:focus { background: #10141b; }
[data-theme='dark'] .chip { background: var(--panel); }
[data-theme='dark'] .featured-section { background: linear-gradient(135deg, #141a28 0%, #1b1526 100%); border-color: #2a3140; }
[data-theme='dark'] .fl-row:hover { background: #171d29; }
[data-theme='dark'] .badge { background: var(--accent-soft); color: var(--accent); }
[data-theme='dark'] .badge.local { background: #10251a; color: var(--ok); }
[data-theme='dark'] .badge.link { background: #2a1c10; color: #f0a866; }
[data-theme='dark'] .usage { background: #151d2e; border-color: #2a3448; color: #b9c6dd; }
[data-theme='dark'] .tips { background: #221c10; border-color: #4a3a15; }
[data-theme='dark'] .tips b { color: #f0b429; }
[data-theme='dark'] .field input[type=text], [data-theme='dark'] .field input[type=number],
[data-theme='dark'] .field select, [data-theme='dark'] .field textarea { background: #10141b; color: var(--text); }
[data-theme='dark'] .btn.ghost { background: var(--panel); color: var(--text); }
/* 深色 --accent 偏亮：白字压上去只有 2.8:1，按钮改用更深的蓝 */
[data-theme='dark'] .btn:not(.ghost),
[data-theme='dark'] .skip-link { background: #3f6fe0; }
[data-theme='dark'] .related-chip { background: var(--panel); }
[data-theme='dark'] .page pre { background: #10141b; }
[data-theme='dark'] .card:hover { border-color: #3a4a68; }

/* ===== 最近使用 ===== */
.recent-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.recent-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; }

/* ===== 随机发现（v3.9：从统计条搬进搜索框下方那行提示里） ===== */
.random-btn {
  border: 1px dashed var(--accent); background: transparent; color: var(--accent);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; line-height: 1.5;
  white-space: nowrap; cursor: pointer; transition: background .15s;
}
.random-btn:hover { background: var(--accent-soft); }

/* ===== 使用场景 ===== */
.scenarios summary { cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 600; outline: none; }
.scenarios { background: var(--panel); }

/* ===== 卡片使用角标 ===== */
.used-tag { font-size: 10.5px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 2px 6px; }
[data-theme='dark'] .used-tag { background: #10141b; }

/* ===== 任务导向入口 ===== */
.task-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.task-label { font-size: 12.5px; color: var(--muted); align-self: center; margin-right: 2px; }
.task-chip {
  border: 1px solid #dbe4ff; background: #f7f9ff; color: #3b56a8;
  border-radius: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: all .12s;
}
.task-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme='dark'] .task-chip { background: #141a26; border-color: #2a3448; color: #a9bce6; }
[data-theme='dark'] .task-chip:hover { background: var(--accent); color: #fff; }

/* ===== 信任区（品牌差异化） ===== */
.trust-section { margin: 0 0 22px; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 780px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-item {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--ok);
  border-radius: 10px; padding: 14px 16px;
}
.trust-item b { display: block; font-size: 14px; margin-bottom: 4px; }
.trust-item span { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* ===== 对比表 ===== */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0 6px; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.cmp-table th { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cmp-table td.yes { color: var(--ok); }
.cmp-table td.no { color: var(--err); }

/* ===== 卡片外链按钮（目录工具） ===== */
.go-btn {
  position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--accent); background: var(--accent-soft); text-decoration: none;
  transition: background .12s, color .12s;
}
.go-btn:hover { background: var(--accent); color: #fff; }

/* ===== 目录工具详情页 CTA ===== */
.dir-cta .btn { white-space: nowrap; }

/* ===== 工具对比：底部对比栏 ===== */
.cmp-bar {
  position: fixed; left: 0; right: 0; bottom: -120px; z-index: 40;
  transition: bottom .22s ease;
}
.cmp-bar.show { bottom: 0; }
.cmp-bar-inner {
  max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
}
.cmp-bar-label { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.cmp-bar-names { flex: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-bar .btn { padding: 7px 16px; font-size: 13px; }

/* ===== 对比页 ===== */
.cmp-pickers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 20px; }
@media (max-width: 780px) { .cmp-pickers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cmp-pickers { grid-template-columns: 1fr; } }
.cmp-pick {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text); font-size: 13px; outline: none;
  /* select 内在宽度由最长 option 决定，不压窄会撑破页面 */
  width: 100%; min-width: 0;
}
/* 窄屏让表格在容器内横滑，别把整页顶宽 */
#cmp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.cmp-page-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 460px; }
.cmp-page-table th, .cmp-page-table td {
  border: 1px solid var(--border); padding: 9px 10px; text-align: left; vertical-align: top;
}
.cmp-page-table thead th { background: var(--accent-soft); }
.cmp-page-table tbody th { background: var(--bg); color: var(--muted); font-weight: 500; width: 148px; white-space: nowrap; }
.cmp-page-table td.yes { color: var(--ok); }
.cmp-page-table td.no { color: #c2570a; }
.cmp-head { font-size: 13.5px; font-weight: 600; }
.cmp-link { color: var(--accent); }
.cmp-tip { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.share-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
[data-theme='dark'] .cmp-pick { background: #10141b; color: var(--text); }
[data-theme='dark'] .cmp-bar-inner { box-shadow: 0 -6px 24px rgba(0, 0, 0, .5); }

/* ===== 资源库 ===== */
.res-policy {
  font-size: 12.5px; color: #7a5b12; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: 10px 14px; margin: 16px 0 24px; line-height: 1.7;
}
[data-theme='dark'] .res-policy { background: #221c10; color: #e5c07b; border-color: #4a3a15; }
.res-group-title { font-size: 16px; margin: 26px 0 12px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .res-grid { grid-template-columns: 1fr; } }
.res-card {
  display: flex; gap: 12px; align-items: flex-start; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.res-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.07); border-color: #c7d4f5; }
.res-card-icon { font-size: 22px; line-height: 1; margin-top: 2px; }
.res-card-body { display: flex; flex-direction: column; gap: 4px; }
.res-card-body b { font-size: 15px; color: var(--text); }
.res-card-body span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.res-card-body em { font-style: normal; font-size: 11.5px; color: var(--accent); }
.res-intro { font-size: 14.5px; line-height: 1.9; color: var(--text); margin: 10px 0 18px; }
.res-list { display: grid; gap: 10px; }
.res-item { background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.res-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-item-name { font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.res-item-name:hover { text-decoration: underline; }
.res-license {
  font-size: 11px; color: #0f6b3f; background: #ecfdf3; border-radius: 6px; padding: 2px 8px;
}
[data-theme='dark'] .res-license { background: #10251a; color: #6ee7a8; }
.res-item-note { font-size: 13px; color: var(--muted); line-height: 1.75; margin: 6px 0 8px; }
.res-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; }
.res-src { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.res-choices { line-height: 1.95; font-size: 13.5px; padding-left: 20px; }

/* ===== 头部主导航 ===== */
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; transition: background .12s, color .12s;
}
.main-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.main-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 900px) {
  /* 小屏：导航换行到第二行，仍保留所有入口 */
  .site-header { flex-wrap: wrap; row-gap: 8px; }
  .main-nav { order: 3; width: 100%; justify-content: center; gap: 4px; }
  /* 只撑高不撑宽：7 个入口在 375px 上横向空间不够 */
  .main-nav a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; font-size: 12.5px; }
  #search { order: 2; flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 25px; }
  .site-header { column-gap: 6px; }
  .header-actions { margin-left: auto; gap: 4px; }
  /* 30px 点不准，与桌面统一到 34px；375 宽度下仍放得下 */
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  #lang-btn { width: auto; padding: 0 7px; }
}

/* ===== 首页资源精选 ===== */
.res-preview { margin: 0 0 22px; }
.section-title .sec-more { margin-left: auto; font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 400; }
.res-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .res-preview-grid { grid-template-columns: 1fr; } }
.res-preview-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.res-preview-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.07); border-color: #c7d4f5; }
.rp-icon { font-size: 20px; }
.rp-title { font-size: 15px; font-weight: 600; color: var(--text); }
.rp-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; flex: 1; }
.rp-count { font-size: 11.5px; color: var(--accent); }

/* ===== 首页 hero 搜索 + 内容路由卡 ===== */
/* v3.9：搜索框从 560 加宽到 700——它现在是首屏唯一的主输入，窄了显得局促 */
.hero-search-wrap { position: relative; max-width: 700px; margin: 20px auto 14px; }
#hero-search {
  width: 100%; padding: 14px 18px 14px 44px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text);
  outline: none; box-shadow: 0 4px 18px rgba(37, 99, 235, .08);
}
#hero-search:focus { border-color: var(--accent); box-shadow: 0 6px 22px rgba(37, 99, 235, .16); }
/* 搜索图标挂在 .hs-field（只包输入框）上，而不是整个 wrap：
   v3.9 把「随便看看」挪进提示行后 wrap 变高了，50% 会把图标顶到提示行上去 */
.hs-field { position: relative; }
.hs-field::before {
  content: '⌕'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--muted); pointer-events: none;
}
/* 提示文案与「随便看看」并排：一行里左说明右动作，窄屏自动折行 */
.hero-search-hint {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px 10px; margin-top: 8px; font-size: 11.5px; color: var(--muted);
}
/* ===== 四个入口（v3.4：改成一整行，每个板块一个徽章 + 一个标签） =====
   原来是 3 列网格，4 张卡永远剩一张孤零零占第二行；这里按板块数直接给 4 列 */
.route-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 8px; }
@media (max-width: 1040px) { .route-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .route-cards { grid-template-columns: 1fr; } }
.route-card {
  --rc: #1d4ed8; --rc-soft: #e8efff;
  position: relative; display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 15px 15px 13px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.route-card.rc--res { --rc: #0f766e; --rc-soft: #e0f5f2; }
.route-card.rc--compare { --rc: #6d28d9; --rc-soft: #f0eaff; }
.route-card.rc--eval { --rc: #92400e; --rc-soft: #fbeedd; }
[data-theme='dark'] .route-card { --rc: #93b8ff; --rc-soft: rgba(255, 255, 255, .07); }
[data-theme='dark'] .route-card.rc--res { --rc: #5eead4; }
[data-theme='dark'] .route-card.rc--compare { --rc: #c4b5fd; }
[data-theme='dark'] .route-card.rc--eval { --rc: #fcd34d; }
.route-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .08); border-color: var(--rc); }
.rc-badge {
  width: 32px; height: 32px; border-radius: 10px; margin-bottom: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; background: var(--rc-soft);
}
.rc-tag {
  position: absolute; top: 15px; right: 13px;
  font-size: 10.5px; letter-spacing: .04em; padding: 2px 7px;
  border: 1px solid currentColor; border-radius: 99px; color: var(--rc); opacity: .85;
}
.route-card b { display: flex; align-items: baseline; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
/* 卡片主数字：原来 hero 统计条里那四个大数字（22px 强调色），现在住进卡片头部 */
.route-card b .rc-num { font-size: 21px; line-height: 1.15; font-weight: 700; color: var(--rc); letter-spacing: -.02em; }
.route-card span.rc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.route-card em { font-style: normal; font-size: 12px; color: var(--rc); margin-top: auto; padding-top: 4px; }

/* ===== 命令面板 ===== */
#palette {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(10, 14, 22, .45); backdrop-filter: blur(2px);
  padding-top: 12vh;
}
#palette.show { display: block; }
.pal-box {
  max-width: 620px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden;
}
#palette-input {
  width: 100%; border: none; outline: none; background: transparent; color: var(--text);
  padding: 16px 18px; font-size: 15px; border-bottom: 1px solid var(--border);
}
#palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.pal-item.active { background: var(--accent-soft); }
.pal-type { font-size: 10.5px; color: var(--muted); background: var(--bg); border-radius: 5px; padding: 2px 6px; flex: none; }
.pal-name { font-size: 14px; font-weight: 600; color: var(--text); flex: none; }
.pal-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* ===== 键盘快捷键帮助面板 ===== */
.foot-link-btn {
  border: none; background: transparent; color: var(--accent); font: inherit;
  font-size: 12px; cursor: pointer; padding: 0;
  /* 16px 高在手机上几乎点不到，撑到 24px */
  display: inline-flex; align-items: center; min-height: 24px;
}
.foot-link-btn:hover { text-decoration: underline; }
#kbd-help {
  position: fixed; inset: 0; z-index: 62; display: none;
  background: rgba(10, 14, 22, .45); backdrop-filter: blur(2px);
  padding-top: 10vh;
}
#kbd-help.show { display: block; }
.kbd-box {
  max-width: 520px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden;
}
.kbd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text);
}
.kbd-close {
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 12px; line-height: 1;
}
.kbd-close:hover { color: var(--text); }
.kbd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kbd-table td { padding: 9px 18px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.kbd-table td:first-child { width: 42%; white-space: nowrap; }
.kbd-table tr:last-child td { border-bottom: none; }
.kbd-table kbd {
  font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text);
}
.kbd-note { padding: 12px 18px; margin: 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

/* 键盘选卡焦点环：比 :focus-visible 更明显，避免用户找不到当前位置 */
.card.kb-focus, .fl-row.kb-focus {
  outline: 2px solid var(--accent); outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
/* 结果出现时闪一下，提示「结果在这里」 */
@keyframes resultFlash {
  from { box-shadow: 0 0 0 3px var(--accent); }
  to { box-shadow: 0 0 0 3px transparent; }
}

/* ===== 专题 / 更新日志 ===== */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 860px) { .topic-grid { grid-template-columns: 1fr; } }
.topic-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 18px;
  transition: transform .12s, box-shadow .12s;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.topic-card .tp-icon { font-size: 22px; }
.topic-card b { font-size: 15.5px; color: var(--text); }
.topic-card span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.topic-card em { font-style: normal; font-size: 11.5px; color: var(--accent); }
.topic-steps { display: grid; gap: 8px; }
.topic-step {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px;
}
.topic-step:hover { border-color: var(--accent); }
.ts-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none;
}
.ts-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ts-body b { font-size: 14px; color: var(--text); }
.ts-body em { font-style: normal; font-size: 12px; color: var(--muted); }
.ts-badge { font-size: 10.5px; color: var(--ok); background: #ecfdf3; border-radius: 5px; padding: 2px 7px; }
[data-theme='dark'] .ts-badge { background: #10251a; color: #6ee7a8; }

/* ===== 工具评测 ===== */
.eval-verdict {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; margin: 14px 0 20px;
}
.eval-verdict b { font-size: 13px; color: var(--accent); }
.eval-verdict p { font-size: 14px; line-height: 1.8; color: var(--text); margin: 6px 0 0; }
.eval-grid { display: grid; gap: 12px; }
.eval-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px;
}
.eval-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.eval-card-head b { font-size: 15px; color: var(--text); }
.eval-card-head a { text-decoration: none; }
.eval-card-head a:hover b { color: var(--accent); }
.eval-type { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 5px; padding: 2px 8px; flex: none; }
.eval-meta { margin: 8px 0 10px; }
.pv-badge { font-size: 11.5px; border-radius: 6px; padding: 3px 9px; font-weight: 600; }
.pv-ok { color: #0a7c42; background: #e7f8ef; }
.pv-mid { color: #9a6700; background: #fdf3d7; }
.pv-warn { color: #b42318; background: #fdecea; }
[data-theme='dark'] .pv-ok { color: #6ee7a8; background: #10251a; }
[data-theme='dark'] .pv-mid { color: #fbbf24; background: #2b2205; }
[data-theme='dark'] .pv-warn { color: #fca5a5; background: #3b1412; }
.eval-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .eval-pc { grid-template-columns: 1fr; } }
.eval-pc b { font-size: 12px; }
.eval-pros b { color: #0a7c42; }
.eval-cons b { color: #b42318; }
[data-theme='dark'] .eval-pros b { color: #6ee7a8; }
[data-theme='dark'] .eval-cons b { color: #fca5a5; }
.eval-pc ul { margin: 6px 0 0; padding-left: 18px; }
.eval-pc li { font-size: 12.5px; color: var(--text); line-height: 1.75; }
.log-entry { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin-bottom: 22px; }
.log-head { display: flex; align-items: baseline; gap: 10px; }
.log-head b { font-size: 15px; color: var(--accent); }
.log-head span { font-size: 12px; color: var(--muted); }
.log-title { font-size: 14px; font-weight: 600; margin: 4px 0 6px; }
.log-entry ul { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 13.5px; color: var(--text); }

/* ===== 嵌入模式 ===== */
body.embed-mode .site-header,
body.embed-mode footer,
body.embed-mode .crumb,
body.embed-mode #related-panel,
body.embed-mode .to-top,
body.embed-mode .cmp-bar,
body.embed-mode .hero,
body.embed-mode #route-cards { display: none !important; }
body.embed-mode .container { padding-top: 12px; }
body.embed-mode .share-btn { display: none; }

/* 拖放路由（v3.1） */
.drop-mask {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  /* 先给一个不透明底色做兜底：color-mix 在旧内核里不支持，会让遮罩变成全透明 */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
}
.drop-mask.show { display: flex; }
.drop-zone {
  width: min(520px, 86vw); padding: 34px 26px; text-align: center;
  border: 2px dashed var(--accent); border-radius: 18px; background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}
.dz-icon { font-size: 40px; line-height: 1; }
.dz-title { margin: 12px 0 6px; font-size: 17px; font-weight: 700; color: var(--text); }
.dz-sub { font-size: 13px; color: var(--muted); }

.drop-panel-mask {
  position: fixed; inset: 0; z-index: 210; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}
.drop-panel-mask[data-open] { display: flex; }
.drop-panel {
  width: min(460px, 94vw); border-radius: 16px; background: var(--panel);
  border: 1px solid var(--border); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.dp-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.dp-head b { display: block; font-size: 15px; color: var(--text); }
.dp-head span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.dp-list { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.dp-item {
  display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dp-item:hover, .dp-item:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dp-item b { font-size: 14px; color: var(--text); }
.dp-item span { font-size: 12px; color: var(--muted); }
.dp-empty { padding: 6px 2px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.dp-empty a { color: var(--accent); }
.dp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 18px 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.dp-foot a { color: var(--accent); text-decoration: none; }
body.dp-lock { overflow: hidden; }

/* 粘贴识别提示条 */
.paste-hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--accent-soft);
  font-size: 12.5px; color: var(--text);
}
.paste-hint span { color: var(--muted); }
.paste-hint .ph-go {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-size: 12.5px; cursor: pointer;
}
.paste-hint .ph-x {
  margin-left: auto; padding: 2px 6px; border: none; background: none;
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}

/* ===== 统一状态：空 / 加载 / 错误（v3.3）=====
   以前工具各自写 div.empty / msg-err，留白与文案都不一致。
   统一成一套 .state：视觉一致、语义带 role（loading/empty=status，error=alert）。
   颜色全部走 CSS 变量，深色模式自动跟随，无需再写一份覆盖。 */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 34px 18px;
  color: var(--muted); font-size: 13.5px; line-height: 1.7;
}
.state > .state-icon { font-size: 28px; line-height: 1; }
.state > .state-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.state > .state-detail { max-width: 46ch; word-break: break-word; }
.state--error > .state-title,
.state--error > .state-detail { color: var(--err); }
/* 行内变体：贴在表单/结果区里，不占整屏高度 */
.state--inline {
  flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 10px; text-align: left; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft);
}
.state--inline.state--error { background: transparent; }
.state-spinner {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: stateSpin .8s linear infinite;
}
@keyframes stateSpin { to { transform: rotate(360deg); } }
/* 减少动效：转圈改为静止的强调环，别让它变成高速闪烁 */
@media (prefers-reduced-motion: reduce) {
  .state-spinner { animation: none; border-top-color: var(--accent); }
}

/* ===== 窄屏（≤560px）触摸目标 =====
   体检只把 <24px 判成硬伤，但 24～27px 在 375px 上仍然经常点空。
   这里把刚好卡在 24px 的两个元素撑到 28px 舒适线（33 个工具页共用同一份
   排行/卡片星标与页脚「快捷键」入口，改一处全站生效）。 */
@media (max-width: 560px) {
  .star { min-width: 28px; min-height: 28px; top: 8px; right: 8px; }
  .foot-link-btn { min-height: 28px; padding: 0 2px; }
}
