/* Tools Online — 全站样式（根 / hub / FinFlow 通用）
   主题：暗色为默认；无 JS 时跟随系统（prefers-color-scheme: light），
   有 JS 时由 <head> 预置脚本把解析结果写入 html[data-theme]，切换按钮可手动覆盖
  （localStorage: site_theme）。亮色调色板在下面两个选择器中各出现一次，改动务必两处同步。 */
:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel2: #171b21;
  --border: #232830;
  --text: #e6e9ee;
  --text-2: #c3c9d3;
  --muted: #9aa3af;
  --accent: #00e589;
  --accent-dim: rgba(0, 229, 137, 0.12);
  --accent-line: rgba(0, 229, 137, 0.4);
  --accent-soft: rgba(0, 229, 137, 0.2);
  --blue: #6ea8fe;
  --red: #ff7a7a;
  --chart-grid: #232830;
  --header-bg: rgba(11, 13, 16, 0.85);
  --row-line: rgba(35, 40, 48, 0.6);
  --row-hover: rgba(0, 229, 137, 0.04);
  --radius: 14px;
}
/* 手动浅色：html[data-theme="light"] 由预置脚本/切换按钮写入 */
html[data-theme="light"] {
  --bg: #f5f7f6;
  --panel: #ffffff;
  --panel2: #eef2f0;
  --border: #e1e7e4;
  --text: #16211b;
  --text-2: #3d4a43;
  --muted: #5f6d77;
  --accent: #00814a;
  --accent-dim: rgba(0, 129, 74, 0.1);
  --accent-line: rgba(0, 129, 74, 0.45);
  --accent-soft: rgba(0, 129, 74, 0.16);
  --blue: #2563c9;
  --red: #d64550;
  --chart-grid: #e1e7e4;
  --header-bg: rgba(255, 255, 255, 0.85);
  --row-line: rgba(22, 33, 27, 0.08);
  --row-hover: rgba(0, 129, 74, 0.06);
}
/* 无 JS 回退：未写入 data-theme 时跟随系统 */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #f5f7f6;
    --panel: #ffffff;
    --panel2: #eef2f0;
    --border: #e1e7e4;
    --text: #16211b;
    --text-2: #3d4a43;
    --muted: #5f6d77;
    --accent: #00814a;
    --accent-dim: rgba(0, 129, 74, 0.1);
    --accent-line: rgba(0, 129, 74, 0.45);
    --accent-soft: rgba(0, 129, 74, 0.16);
    --blue: #2563c9;
    --red: #d64550;
    --chart-grid: #e1e7e4;
    --header-bg: rgba(255, 255, 255, 0.85);
    --row-line: rgba(22, 33, 27, 0.08);
    --row-hover: rgba(0, 129, 74, 0.06);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "PingFang TC", "Hiragino Sans", "Microsoft YaHei", "Microsoft JhengHei", "Noto Sans", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { vertical-align: middle; }

/* ---------- 侧边栏导航外壳 ---------- */
.mobile-bar { display: none; }
.nav-burger { display: none; }
.sidebar {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 234px; z-index: 100;
  background: var(--panel); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; }
.side-top .brand { font-size: 18px; }
.side-close {
  display: none; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
/* 明暗主题切换按钮：桌面在侧边栏顶部（品牌与关闭按钮之间），移动端在顶栏搜索按钮旁。
   暗色显示太阳（点击转亮），亮色显示月亮（点击转暗）。 */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: block; }
html[data-theme="light"] .theme-toggle .i-sun { display: none; }
.side-top .theme-toggle { margin-inline-start: auto; }
.side-nav { flex: 1; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.side-link svg { flex: none; }
.side-link:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.side-link.on { color: var(--accent); background: var(--accent-dim); }
.side-link.sm { padding: 6px 10px; font-size: 13px; font-weight: 500; }
.side-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); }
.side-foot .lang-switch { flex-wrap: wrap; gap: 2px 4px; }
.side-foot .lang-switch a { font-size: 12px; padding: 4px 9px; }
.side-backdrop { display: none; }
/* 侧边栏工具搜索（/js/search.js + /js/search-index.js） */
.side-search { position: relative; margin: 12px 12px 2px; }
.side-search .ss-ico {
  position: absolute; inset-inline-start: 10px; top: 20px; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.side-search input {
  width: 100%; padding: 8px 12px; padding-inline-start: 33px; font: inherit; font-size: 13.5px; appearance: none;
  color: var(--text); background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; outline: none;
}
.side-search input::placeholder { color: var(--muted); }
.side-search input:focus { border-color: var(--accent-line); }
.side-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.side-search input::-webkit-search-decoration { -webkit-appearance: none; }
.ss-list {
  margin: 6px 0 4px; max-height: min(55vh, 480px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.45);
}
.ss-item { display: block; padding: 7px 9px; border-radius: 8px; color: var(--text); }
.ss-item:hover, .ss-item.on { background: var(--accent-dim); text-decoration: none; }
.ss-item .ss-name { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-item .ss-sub { display: block; font-size: 11.5px; color: var(--muted); }
.ss-item mark { background: none; color: var(--accent); font-weight: 700; padding: 0; }
.ss-empty { padding: 10px 9px; font-size: 13px; color: var(--muted); }
.nav-search-btn { display: none; }
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.page > main { flex: 1; width: 100%; }
html.nav-lock { overflow: hidden; }

@media (min-width: 1024px) {
  .page { margin-inline-start: 234px; }
}
@media (max-width: 1023.98px) {
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 90;
    padding: 10px 14px; background: var(--header-bg); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: none;
    background: var(--panel2); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer;
  }
  .nav-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: none; margin-inline-start: auto;
    background: var(--panel2); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer;
  }
  /* 顶栏：主题切换按钮推右，搜索按钮紧随其后 */
  .mobile-bar .theme-toggle { width: 38px; height: 38px; border-radius: 10px; color: var(--text); margin-inline-start: auto; }
  .mobile-bar .nav-search-btn { margin-inline-start: 0; }
  .sidebar { width: min(300px, 85vw); transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); }
  /* :not(.open) 抬高关闭态规则的适用门槛，避免覆盖 .sidebar.open 的 transform:none */
  html[dir="rtl"] .sidebar:not(.open) { transform: translateX(100%); }
  .sidebar.open { transform: none; }
  .side-close { display: inline-flex; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 99; background: rgba(0, 0, 0, 0.45); }
  .side-backdrop[hidden] { display: none; }
}

/* 品牌 */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; }
.brand em { font-style: normal; color: var(--accent); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px;
}
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a.on { color: var(--accent); background: var(--accent-dim); }

/* ---------- 布局 ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.hero { padding: 34px 0 10px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 38px); font-weight: 800; line-height: 1.25; letter-spacing: 0.2px; }
.hero .sub { color: var(--muted); margin-top: 10px; max-width: 760px; font-size: 15px; }
.page-sub { color: var(--muted); font-size: 16px; margin-top: 12px; max-width: 820px; }

/* ---------- 首页工具卡片 ---------- */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px; margin-top: 26px;
}
.tool-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; color: var(--text); display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.tool-card .icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.tool-card h3 { font-size: 16px; font-weight: 700; }
.tool-card p { font-size: 13px; color: var(--muted); line-height: 1.55; flex: 1; }
.tool-card .go { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------- 计算器面板 ---------- */
.calc {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 22px;
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-weight: 400; opacity: 0.8; }
.field input, .field select {
  width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; font-size: 15px; outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input::placeholder, .field select::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.65; }
.field .affix { position: relative; }
.field .affix span.sym {
  position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
.field-note { font-size: 12px; color: var(--muted); margin-top: 5px; }
.error-msg {
  display: none; margin-top: 14px; padding: 10px 14px;
  background: rgba(255, 122, 122, 0.1); border: 1px solid rgba(255, 122, 122, 0.35);
  border-radius: 10px; color: var(--red); font-size: 14px;
}
.error-msg.show { display: block; }

/* 触屏：输入字号 ≥16px，避免 iOS Safari 聚焦时自动放大页面 */
@media (pointer: coarse) {
  .field input, .field select, .field textarea { font-size: 16px; }
}

/* 分段选择器 */
.segmented { display: inline-flex; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 18px; }
.segmented button {
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit;
}
.segmented button.active { background: var(--accent-dim); color: var(--accent); }

/* ---------- 结果 ---------- */
.results { margin-top: 22px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px;
}
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: clamp(19px, 2.6vw, 26px); font-weight: 800; margin-top: 4px; letter-spacing: 0.2px; }
.stat.primary { background: var(--accent-dim); border-color: var(--accent-line); }
.stat.primary .v { color: var(--accent); }
.stat .note { font-size: 12px; color: var(--muted); margin-top: 3px; }

.chart-wrap { margin-top: 20px; background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.chart-wrap .chart-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
canvas.chart { width: 100%; height: 260px; display: block; }

/* ---------- 表格 ---------- */
.table-wrap {
  margin-top: 20px; border: 1px solid var(--border); border-radius: 12px;
  overflow: auto; max-height: 420px; background: var(--panel2);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 9px 14px; text-align: right; white-space: nowrap; }
table.data th {
  position: sticky; top: 0; background: var(--panel);
  color: var(--muted); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border); z-index: 2;
}
table.data th:first-child, table.data td:first-child { text-align: start; }
table.data tbody tr { border-bottom: 1px solid var(--row-line); }
table.data tbody tr:hover { background: var(--row-hover); }
table.data td.num { font-variant-numeric: tabular-nums; }
.table-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 广告位 ---------- */
.ad-slot { display: none; margin: 26px auto; text-align: center; max-width: 970px; }

/* ---------- 内容区 ---------- */
.content { margin-top: 34px; max-width: 820px; }
.content h2 { font-size: 22px; font-weight: 800; margin: 30px 0 12px; }
.content h2:first-child { margin-top: 0; }
.content p, .content li { color: var(--text-2); font-size: 15px; }
.content ol, .content ul { padding-inline-start: 22px; margin: 10px 0; }
.content li { margin: 7px 0; }
.content .formula {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin: 12px 0; overflow-x: auto;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px; color: var(--accent); white-space: nowrap;
}
.content .formula-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* FAQ */
.faq details {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px;
  list-style: none; position: relative; padding-inline-end: 40px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; inset-inline-end: 18px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 20px; font-weight: 400; transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq .faq-a { padding: 0 18px 16px; color: var(--text-2); font-size: 14px; }

/* 免责声明 */
.disclaimer {
  margin-top: 34px; padding: 14px 18px; border-radius: 12px;
  background: rgba(110, 168, 254, 0.08); border: 1px solid rgba(110, 168, 254, 0.3);
  font-size: 13px; color: var(--muted);
}
.disclaimer strong { color: var(--blue); }

/* 相关工具 */
.related { margin-top: 34px; }
.related h2 { font-size: 18px; margin-bottom: 14px; }
.related .tool-grid { margin-top: 0; }
.related .tool-card { padding: 16px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px;
  color: var(--muted); font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-brand { font-weight: 700; color: var(--text); }

/* 404 */
.notfound { text-align: center; padding: 90px 0; }
.notfound h1 { font-size: 64px; color: var(--accent); }
.notfound p { color: var(--muted); margin: 12px 0 24px; }

@media (max-width: 640px) {
  .calc { padding: 18px; }
  .hero { padding-top: 26px; }
  canvas.chart { height: 210px; }
}

/* ---------- 枢纽首页 ---------- */
.section-title { font-size: 22px; font-weight: 800; margin: 34px 0 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; color: var(--text); display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cat-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cat-head h2 { font-size: 20px; font-weight: 800; }
.cat-count { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-dim); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.cat-card p { color: var(--muted); font-size: 14px; flex: 1; }
.cat-card .go { color: var(--accent); font-weight: 600; font-size: 14px; }
.privacy-strip {
  margin-top: 30px; padding: 16px 20px; border-radius: 12px;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  color: var(--text-2); font-size: 14px;
}
.nf-links a { margin: 0 8px; }

/* ---------- 通用工具板块（dev / text / calc / health …） ---------- */
.field textarea {
  width: 100%; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; line-height: 1.55; outline: none;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  resize: vertical; min-height: 150px;
  transition: border-color 0.15s ease;
}
.field textarea:focus { border-color: var(--accent); }
.code-out {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 460px; min-height: 44px;
}
.code-out.err { color: var(--red); border-color: rgba(255, 122, 122, 0.4); }
.code-out .ins { color: var(--accent); background: var(--accent-dim); border-radius: 3px; }
.code-out .del { color: var(--red); background: rgba(255, 122, 122, 0.12); border-radius: 3px; text-decoration: line-through; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.toolbar .spacer { flex: 1; }
.btn {
  background: var(--accent-dim); border: 1px solid var(--accent-line); color: var(--accent);
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--accent-soft); }
.checks { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.checks label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.checks input { accent-color: var(--accent); width: 15px; height: 15px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hash-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.hash-row:last-child { border-bottom: 0; }
.hash-row .algo { font-size: 12px; font-weight: 700; color: var(--muted); width: 78px; flex: none; }
.hash-row code { flex: 1; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-dim); color: var(--accent); }
.badge.gray { background: rgba(154, 163, 175, 0.14); color: var(--muted); }
.badge.warn { background: rgba(255, 122, 122, 0.12); color: var(--red); }
.badge.blue { background: rgba(110, 168, 254, 0.12); color: var(--blue); }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }

/* ---------- 趣味测试板块（fun）：猫咪性格测试 ---------- */
.cq-hero { font-size: 44px; line-height: 1; }
.cq-title { font-size: 20px; font-weight: 800; margin-top: 10px; }
.cq-sub { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 640px; }
.cq-start-btn { font-size: 16px; padding: 12px 34px; }
.cq-hint { margin-top: 10px; }
.cq-progress { height: 6px; background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cq-bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.2s ease; }
#cq-count { margin-top: 8px; }
.cq-q { font-size: clamp(18px, 2.6vw, 22px); font-weight: 700; margin-top: 14px; line-height: 1.45; }
.cq-opts { display: grid; gap: 10px; margin-top: 16px; }
.cq-opt {
  text-align: start; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; line-height: 1.5; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cq-opt:hover { border-color: var(--accent); }
.cq-opt.picked { border-color: var(--accent-line); background: var(--accent-dim); }
.cq-opt:disabled { opacity: 0.5; cursor: default; }
.cq-res-head { text-align: center; }
.cq-lead { font-size: 13px; color: var(--muted); font-weight: 600; }
.cq-code { font-size: clamp(34px, 6vw, 52px); font-weight: 800; letter-spacing: 4px; color: var(--accent); line-height: 1.2; }
.cq-name { font-size: clamp(20px, 3.4vw, 28px); font-weight: 800; margin-top: 2px; }
#cq-breed-badge { margin-top: 8px; }
.cq-desc { color: var(--text-2); font-size: 15px; margin-top: 14px; max-width: 640px; margin-inline: auto; }
.cq-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.cq-tag { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent-dim); color: var(--accent); }
.cq-axis-title { font-size: 12px; font-weight: 700; color: var(--muted); margin: 26px 0 12px; text-align: center; letter-spacing: 1.5px; text-transform: uppercase; }
.cq-axis { margin-bottom: 14px; }
.cq-axis-names { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.cq-axis-names .on { color: var(--text); }
.cq-axis-track { height: 8px; background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cq-axis-fill { height: 100%; background: var(--accent); border-radius: 999px; margin-inline-end: auto; transition: width 0.3s ease; }
/* 结果页「全球猫格占比」：仅在云统计可用时由 JS 取消隐藏 */
.cq-share-track { height: 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cq-share-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-line)); border-radius: 999px; margin-inline-end: auto; transition: width 0.5s ease; }
.cq-share-text { text-align: center; margin-top: 8px; }


/* ===== AI 导航目录（/ai/directory.html） ===== */
.dir-search { display: flex; align-items: center; gap: 12px; }
.dir-search .dir-input { flex: 1; width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font-size: 15px; outline: none; }
.dir-search .dir-input:focus { border-color: var(--accent); }
.dir-search .dir-input::placeholder { color: var(--muted); opacity: 0.65; }
.dir-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.dir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.dir-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 1; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; }
.dir-chip:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.dir-chip span { font-weight: 600; opacity: 0.7; }
.dir-sec { margin-top: 26px; }
.dir-sec.hide { display: none; }
.dir-sec-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 12px; scroll-margin-top: 72px; }
.dir-sec-n { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.dir-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); text-decoration: none; transition: border-color 0.15s ease; }
.dir-item:hover { border-color: var(--accent); text-decoration: none; }
.dir-item.hide { display: none; }
.dir-name { font-weight: 600; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-empty { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
@media (max-width: 620px) {
  .dir-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
  .dir-item { padding: 9px 10px; }
}
