/* ==========================================================================
   搜匠工具箱 · main.css
   原创设计：移动优先 500px 版心 / 深色主题 / 青绿强调色
   结构语汇：公告条 → 轮播 → 宫格 → 横卡 → 瀑布流 → 榜单 → 底部Tab
   ========================================================================== */

/* ---------- 1. Reset & Tokens ---------- */
*,
*::before,
*::after { padding: 0; margin: 0; box-sizing: border-box; }

:root {
  --bg: #0f1418;
  --bg-soft: #131a1f;
  --surface: #171e24;
  --surface-2: #1d262e;
  --surface-3: #232e37;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #e9eef3;
  --text-2: #9aa7b2;
  --text-3: #64717c;
  --accent: #14d3b2;
  --accent-soft: rgba(20, 211, 178, 0.12);
  --accent-ink: #05261f;
  --hot: #ffb02e;
  --hot-soft: rgba(255, 176, 46, 0.14);
  --danger: #ff7a7a;
  --success: #3ddc84;
  --radius-card: 14px;
  --radius-inner: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;
  --shell: 500px;
  --tabbar-h: 60px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(560px 300px at 85% -60px, rgba(20, 211, 178, 0.13), transparent 70%),
    radial-gradient(480px 280px at -10% 22%, rgba(46, 111, 229, 0.10), transparent 72%),
    radial-gradient(520px 320px at 110% 68%, rgba(20, 211, 178, 0.06), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100dvh;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(20, 211, 178, 0.3); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 2. App Shell ---------- */
.shell {
  max-width: var(--shell);
  width: 100%;
  margin: 0 auto;
  padding: 0 14px calc(var(--tabbar-h) + 28px);
}

.hidden { display: none !important; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }

/* ---------- 3. Top Bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  max-width: var(--shell);
  margin: 0 auto;
  background: rgba(15, 20, 24, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; letter-spacing: 0.01em;
}
.topbar .brand .logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, #14d3b2, #0e9c88);
  display: grid; place-items: center; color: #05261f; flex: 0 0 auto;
}
.topbar .brand .logo svg { width: 32px; height: 32px; }
.topbar .brand small {
  display: block; font-size: 11px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.08em; line-height: 1.2;
}
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  font-size: 13px; color: var(--text-2); padding: 8px 10px;
  border-radius: 8px; min-height: 36px; display: inline-flex; align-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.topbar nav a:hover, .topbar nav a[aria-current="page"] {
  color: var(--text); background: rgba(255, 255, 255, 0.06);
}

/* ---------- 4. Notice Marquee ---------- */
.notice {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.notice .notice-icon { flex: 0 0 auto; color: var(--accent); }
.notice .notice-icon svg { width: 15px; height: 15px; }
.notice .marquee { flex: 1; overflow: hidden; }
.notice .marquee p {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text-2);
  animation: vmarquee 22s linear infinite;
}
.notice:hover .marquee p, .notice:focus-within .marquee p { animation-play-state: paused; }
@keyframes vmarquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* ---------- 5. Banner Carousel ---------- */
.banner {
  position: relative; margin-top: 12px;
  border-radius: var(--radius-card); overflow: hidden;
}
.banner-track {
  display: flex; gap: 0;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: 64 / 35; position: relative; overflow: hidden;
}
.banner-slide .bs-inner {
  position: absolute; inset: 0;
  padding: 18px 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.banner-slide h2 {
  font-size: 19px; line-height: 1.32; font-weight: 700; letter-spacing: 0.01em;
  max-width: 82%;
}
.banner-slide p {
  font-size: 12px; color: rgba(255, 255, 255, 0.72); max-width: 86%;
}
.banner-slide .bs-cta {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 12px; font-weight: 600;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 7px 12px; border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}
.bs-a { background: linear-gradient(135deg, #0c3b34 0%, #11695a 58%, #14d3b2 130%); }
.bs-b { background: linear-gradient(135deg, #14263f 0%, #1d3f63 62%, #3f7fd4 130%); }
.bs-c { background: linear-gradient(135deg, #33250a 0%, #6b4a0e 60%, #ffb02e 135%); }
.banner-slide .bs-grid {
  position: absolute; right: -30px; bottom: -46px; width: 170px; height: 170px;
  opacity: 0.5; pointer-events: none;
}
.banner-dots {
  position: absolute; bottom: 10px; right: 12px; z-index: 3;
  display: flex; gap: 5px; align-items: center;
}
.banner-dots button {
  width: 6px; height: 6px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.38); transition: all 0.25s ease;
  min-width: 6px; min-height: 6px; padding: 0;
}
.banner-dots button[aria-current="true"] { width: 16px; background: #fff; }

/* ---------- 6. Section Head ---------- */
.sec { margin-top: 22px; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.sec-title {
  font-size: 16.5px; font-weight: 700; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 8px;
}
.sec-title .bar {
  width: 4px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(20, 211, 178, 0.25));
}
.sec-title small { font-size: 11px; color: var(--text-3); font-weight: 500; letter-spacing: 0.04em; }
.sec-more {
  font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center;
  gap: 3px; min-height: 32px; padding: 0 4px;
}
.sec-more:hover { color: var(--accent); }
.sec-more svg { width: 13px; height: 13px; }

/* ---------- 7. Quick Grid (2×5) ---------- */
.quick-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 6px; padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; min-height: 44px;
}
.quick-item .qi-icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  transition: transform 0.18s ease, background 0.18s ease;
}
.quick-item:hover .qi-icon, .quick-item:focus-visible .qi-icon {
  transform: translateY(-2px); background: var(--surface-3);
}
.quick-item .qi-icon svg { width: 38px; height: 38px; }
.quick-item span { font-size: 11.5px; color: var(--text-2); line-height: 1.3; }
.quick-item:hover span { color: var(--text); }

/* ---------- 8. H-Cards (editor picks, 2-col) ---------- */
.hcard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hcard {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 12px;
  min-height: 80px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.18s ease;
}
.hcard:hover, .hcard:focus-visible { border-color: var(--border-strong); transform: translateY(-1px); }
.hcard .hc-icon {
  width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.hcard .hc-icon svg { width: 34px; height: 34px; }
.hcard .hc-meta { min-width: 0; flex: 1; }
.hcard .hc-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hcard .hc-desc {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hcard .hc-go { color: var(--text-3); flex: 0 0 auto; }
.hcard .hc-go svg { width: 14px; height: 14px; }
.hcard:hover .hc-go { color: var(--accent); }

/* ---------- 9. Waterfall (2-col masonry) ---------- */
.waterfall { columns: 2; column-gap: 10px; }
.wf-card {
  display: block; break-inside: avoid;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.18s ease;
}
.wf-card:hover, .wf-card:focus-visible { border-color: var(--border-strong); transform: translateY(-1px); }
.wf-cover {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  border-bottom: 1px solid var(--border);
}
.wf-cover.c1 { background: linear-gradient(150deg, #123b33, #0e2a26); }
.wf-cover.c2 { background: linear-gradient(150deg, #1b2a44, #131e30); }
.wf-cover.c3 { background: linear-gradient(150deg, #3a2c10, #241c0c); }
.wf-cover.c4 { background: linear-gradient(150deg, #2c2140, #1d1630); }
.wf-cover .wf-glyph { width: 64px; height: 64px; color: rgba(255, 255, 255, 0.85); }
.wf-cover .wf-glyph svg { width: 100%; height: 100%; }
.wf-body { padding: 10px 11px 12px; }
.wf-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.wf-desc {
  font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wf-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag {
  font-size: 10px; color: var(--accent); background: var(--accent-soft);
  border-radius: var(--radius-pill); padding: 2px 7px; line-height: 1.5;
}
.tag.gray { color: var(--text-3); background: rgba(255, 255, 255, 0.05); }
.tag.hot { color: var(--hot); background: var(--hot-soft); }

/* ---------- 10. Rank Cards ---------- */
.rank-list { display: grid; gap: 10px; }
.rank-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.18s ease;
}
.rank-card:hover, .rank-card:focus-visible { border-color: var(--border-strong); transform: translateY(-1px); }
.rank-card .rk {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.06); color: var(--text-2);
}
.rank-card:nth-child(1) .rk { background: linear-gradient(145deg, #ffcf6b, #f59e0b); color: #3a2402; }
.rank-card:nth-child(2) .rk { background: linear-gradient(145deg, #d9e2ea, #93a5b4); color: #22303c; }
.rank-card:nth-child(3) .rk { background: linear-gradient(145deg, #e8b48c, #b97a45); color: #331d08; }
.rank-card .rc-icon {
  width: 60px; height: 60px; border-radius: 15px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent);
}
.rank-card .rc-icon svg { width: 32px; height: 32px; }
.rank-card .rc-meta { flex: 1; min-width: 0; }
.rank-card .rc-name { font-size: 13.5px; font-weight: 600; }
.rank-card .rc-why {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-card .rc-badge {
  flex: 0 0 auto; font-size: 10px; padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--hot-soft); color: var(--hot); font-weight: 600;
}

/* ---------- 11. Topic Big Cards ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topic-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  min-height: 148px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px 12px;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.topic-card:hover, .topic-card:focus-visible { transform: translateY(-2px); border-color: var(--border-strong); }
.topic-card.t-a { background: linear-gradient(165deg, #0e332c 0%, #0d201d 78%); }
.topic-card.t-b { background: linear-gradient(165deg, #1a2b47 0%, #101a29 78%); }
.topic-card .tc-glyph {
  position: absolute; right: -18px; top: -18px; width: 120px; height: 120px;
  color: rgba(255, 255, 255, 0.07); pointer-events: none;
}
.topic-card .tc-glyph svg { width: 100%; height: 100%; }
.topic-card h3 { font-size: 15px; font-weight: 700; }
.topic-card p { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); margin-top: 4px; line-height: 1.5; }
.topic-card .tc-count {
  font-size: 10.5px; color: rgba(255, 255, 255, 0.55); margin-top: 9px;
  display: inline-flex; align-items: center; gap: 4px;
}
.topic-card .tc-count svg { width: 12px; height: 12px; }

/* ---------- 12. Tabbar (fixed bottom) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--shell);
  z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(15, 20, 24, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 0 8px; color: var(--text-3); font-size: 10.5px;
  min-height: var(--tabbar-h);
}
.tabbar a svg { width: 32px; height: 32px; }
.tabbar a.active, .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar a:active { transform: scale(0.97); }

/* ---------- 13. Detail / Tool Pages ---------- */
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3); margin-top: 14px;
}
.crumbs a { color: var(--text-2); min-height: 24px; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--accent); }
.crumbs svg { width: 12px; height: 12px; }

.detail-head { margin-top: 14px; display: flex; align-items: flex-start; gap: 14px; }
.detail-head .dh-icon {
  width: 80px; height: 80px; border-radius: 20px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(20, 211, 178, 0.22);
}
.detail-head .dh-icon svg { width: 44px; height: 44px; }
.detail-head h1 { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.3; }
.detail-head .dh-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.detail-head .dh-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

/* Tool panel */
.tool-panel {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px 14px 16px;
}
.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px;
}
.field-label .hint { font-size: 11px; color: var(--text-3); font-weight: 400; }
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-inner);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.textarea { min-height: 132px; resize: vertical; line-height: 1.6; font-size: 13.5px; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 211, 178, 0.14);
}
.select { appearance: none; background-image: none; cursor: pointer; }
.input[type="number"] { font-family: var(--font-mono); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }

.check-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check-row label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2); min-height: 44px; cursor: pointer;
}
.check-row input[type="checkbox"], .check-row input[type="radio"] {
  width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer;
}

.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); flex: 1; }
.btn-primary:hover { background: #1ae3c1; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05); color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 12.5px; }

/* Results */
.result-box {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}
.result-box:focus { outline: none; }
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.result-head h2 { font-size: 14px; font-weight: 700; }
.result-pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow: auto;
}
.alert {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.6;
  background: rgba(255, 122, 122, 0.1);
  border: 1px solid rgba(255, 122, 122, 0.3);
  color: #ffb4b4;
  border-radius: var(--radius-inner);
  padding: 10px 12px;
}
.alert.ok { background: var(--accent-soft); border-color: rgba(20, 211, 178, 0.3); color: #7ef0da; }
.alert svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 10px 11px;
}
.stat .st-label { font-size: 11px; color: var(--text-3); }
.stat .st-value {
  font-family: var(--font-mono);
  font-size: 19px; font-weight: 700; color: var(--text);
  margin-top: 2px; line-height: 1.25;
  word-break: break-all;
}
.stat .st-value.accent { color: var(--accent); }
.stat .st-value.hot { color: var(--hot); }

/* Data list */
.data-list { display: grid; gap: 6px; }
.data-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 9px 11px;
  font-size: 12.5px;
}
.data-row .dr-key { color: var(--text-2); flex: 1; min-width: 0; }
.data-row .dr-val {
  font-family: var(--font-mono); color: var(--text); font-weight: 600;
  text-align: right; word-break: break-all;
}
.data-row .dr-val.ok { color: var(--success); }
.data-row .dr-val.warn { color: var(--hot); }
.data-row .dr-val.bad { color: var(--danger); }

/* keyword density bar */
.density-bar {
  height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07);
  overflow: hidden; margin-top: 6px;
}
.density-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: var(--accent);
}
.density-bar i.hot { background: var(--hot); }
.density-bar i.bad { background: var(--danger); }

/* Pills / chips for keywords */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text-2);
}
.chip b { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }

/* tables inside tool output */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-inner); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 320px; }
.data-table th, .data-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { color: var(--text-2); font-weight: 600; background: var(--bg-soft); white-space: nowrap; }
.data-table td { color: var(--text); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .mono { font-family: var(--font-mono); }

/* ---------- 14. Editorial content (detail pages) ---------- */
.article { margin-top: 22px; }
.article h2 {
  font-size: 15.5px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.article h2 .bar {
  width: 4px; height: 14px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(20, 211, 178, 0.25));
}
.article p { font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.article p + p { margin-top: 8px; }
.article .steps { display: grid; gap: 9px; counter-reset: step; }
.article .steps li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text-2); line-height: 1.65;
}
.article .steps li::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 auto; width: 21px; height: 21px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; margin-top: 2px;
}
.faq { display: grid; gap: 8px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 13px; font-size: 13px; font-weight: 600; color: var(--text);
  min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .faq-chev { flex: 0 0 auto; color: var(--text-3); transition: transform 0.2s ease; }
.faq summary .faq-chev svg { width: 15px; height: 15px; }
.faq details[open] summary .faq-chev { transform: rotate(180deg); }
.faq .faq-body { padding: 0 13px 13px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* Related tools */
.rel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- 15. Category page ---------- */
.filter-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  scrollbar-width: none; margin-top: 4px;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; font-size: 12.5px; padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); min-height: 36px;
  transition: all 0.2s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); font-weight: 600;
}
.cat-group { margin-top: 18px; }
.cat-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-group-head h2 { font-size: 15px; font-weight: 700; }
.cat-group-head .cnt { font-size: 11px; color: var(--text-3); }
.cat-group-head .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- 16. About page ---------- */
.about-block {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px 14px;
}
.about-block h2 { font-size: 15px; font-weight: 700; margin-bottom: 9px; }
.about-block p, .about-block li { font-size: 13px; color: var(--text-2); line-height: 1.75; }
.about-block ul { display: grid; gap: 6px; }
.about-block ul li { display: flex; gap: 8px; align-items: flex-start; }
.about-block ul li svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 4px; color: var(--accent); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-inner); padding: 10px 11px;
}
.kv .k { font-size: 11px; color: var(--text-3); }
.kv .v { font-family: var(--font-mono); font-size: 14px; font-weight: 600; margin-top: 2px; color: var(--accent); }

/* ---------- 17. Footer ---------- */
.site-footer {
  margin-top: 28px; padding: 18px 4px 8px;
  border-top: 1px solid var(--border);
}
.site-footer p { font-size: 11.5px; color: var(--text-3); line-height: 1.8; }
.site-footer .foot-links {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px;
}
.site-footer .foot-links a { font-size: 12px; color: var(--text-2); min-height: 28px; display: inline-flex; align-items: center; }
.site-footer .foot-links a:hover { color: var(--accent); }

/* ---------- 18. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 22px);
  transform: translateX(-50%) translateY(8px);
  background: #e9eef3; color: #10161b;
  font-size: 12.5px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-pill);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 90;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 19. Misc ---------- */
.empty-tip {
  text-align: center; padding: 26px 10px;
  font-size: 12.5px; color: var(--text-3);
}
.link-inline { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link-inline:hover { color: #1ae3c1; }

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 20. Responsive ---------- */
@media (min-width: 520px) {
  .shell { padding: 0 18px calc(var(--tabbar-h) + 32px); }
  body { font-size: 15.5px; }
}
@media (max-width: 359px) {
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hcard-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .notice .marquee p { animation: none; padding-left: 0; white-space: normal; }
}
