/* ==========================================================================
   AI 导航站 · 全站样式表（纯原生 CSS，无任何外部依赖 / 无外链字体）
   --------------------------------------------------------------------------
   设计思路：
   1. 深空暗色 + 紫青双色光晕，营造「AI / 未来感」，这是导航站的第一印象；
   2. 全部尺寸用 rem / clamp 描述，移动端只做少量覆盖，保证一份 CSS 通吃；
   3. 卡片用「玻璃拟态 + 1px 细描边」，hover 时抬升并发彩色光晕，强化点击欲；
   4. 站点图标不请求任何第三方 favicon 接口，改用「首字母 + 渐变徽章」，
      零请求、永不裂图、首屏更快（性能也是 SEO 的一部分）；
   5. 支持深/浅色两套主题，通过 <html data-theme="light"> 切换。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量（Design Tokens）
   -------------------------------------------------------------------------- */
:root {
  /* 背景层次：基底 → 稍亮面板 → 悬浮面板 */
  --bg: #07080d;
  --bg-soft: #0b0d15;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.055);
  --panel-hover: rgba(255, 255, 255, 0.075);

  /* 描边 */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* 文字三级灰阶，保证正文对比度 ≥ 4.5:1 */
  --text: #eef1f8;
  --text-2: #a8b0c6;
  --text-3: #737d96;

  /* 品牌色：主紫 + 辅青 + 点缀粉 */
  --brand: #7c6cff;
  --brand-2: #22d3ee;
  --brand-3: #ff6bcb;
  --brand-soft: rgba(124, 108, 255, 0.14);

  /* 圆角与阴影 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);

  /* 布局 */
  --maxw: 1240px;
  --nav-h: 62px;

  color-scheme: dark;
}

/* 浅色主题：只覆盖颜色类变量，布局与组件样式完全复用 */
[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-hover: #ffffff;
  --line: rgba(14, 18, 34, 0.09);
  --line-strong: rgba(14, 18, 34, 0.18);
  --text: #0e1222;
  --text-2: #4a5366;
  --text-3: #7b8398;
  --brand-soft: rgba(124, 108, 255, 0.1);
  --shadow-sm: 0 1px 3px rgba(16, 22, 40, 0.08);
  --shadow-lg: 0 20px 50px -24px rgba(20, 26, 50, 0.28);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* 锚点跳转时留出固定导航栏的高度，避免标题被遮住 */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 页面顶部两团氛围光晕：固定定位，不随滚动重绘，滚动性能更好 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(720px 380px at 12% -8%, rgba(124, 108, 255, 0.28), transparent 65%),
    radial-gradient(760px 420px at 88% -12%, rgba(34, 211, 238, 0.18), transparent 62%),
    radial-gradient(600px 600px at 50% 100%, rgba(255, 107, 203, 0.1), transparent 70%);
  pointer-events: none;
}

/* 极淡的网格纹理，增加科技质感（不拦截鼠标事件） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(to right, rgba(14, 18, 34, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 18, 34, 0.04) 1px, transparent 1px);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* 关键：搜索过滤靠 hidden 属性隐藏卡片，而 .card 自身设置了 display:flex，
   会覆盖浏览器对 [hidden] 的默认 display:none，必须显式强制一次 */
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 键盘焦点可见：无障碍要求，也让 Mac/Win 用户操作顺畅 */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(124, 108, 255, 0.4);
  color: #fff;
}

/* 自定义滚动条（桌面端） */
@media (min-width: 900px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.26);
    background-clip: padding-box;
  }
}

/* 跳转到主内容（仅键盘聚焦时出现） */
.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -160%);
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translate(-50%, 0);
}

/* 通用容器 */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   3. 顶部导航栏
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Logo：渐变方块 + 文字，呼应浏览器标签页图标 */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.logo__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 16px rgba(124, 108, 255, 0.45);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo__text b {
  background: linear-gradient(92deg, var(--text) 20%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 导航内的快捷分类（桌面才显示） */
.nav__links {
  display: none;
  gap: 4px;
  margin-left: 6px;
}

.nav__links a {
  padding: 7px 12px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  color: var(--text-2);
  transition: background 0.18s, color 0.18s;
}

.nav__links a:hover {
  background: var(--panel);
  color: var(--text);
}

.nav__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 导航右侧的迷你搜索按钮，点击后把焦点交给主搜索框 */
.nav__search {
  display: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-3);
  font-size: 13px;
  transition: border-color 0.18s, color 0.18s;
}

.nav__search:hover {
  border-color: var(--line-strong);
  color: var(--text-2);
}

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-3);
  line-height: 1.5;
}

/* 圆形图标按钮（主题切换等） */
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* 浅色模式显示太阳、深色模式显示月亮 */
[data-theme="light"] .icon-moon,
[data-theme="dark"] .icon-sun {
  display: none;
}

/* --------------------------------------------------------------------------
   4. Hero 首屏
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  /* 只设置上下内边距：若用 padding 简写，会覆盖 .wrap 的左右 20px 安全边距 */
  padding-top: clamp(44px, 8vw, 86px);
  padding-bottom: clamp(26px, 4vw, 40px);
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 22px;
}

.hero__badge span.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.hero h1 {
  font-size: clamp(30px, 5.4vw, 54px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

/* 标题后半句用渐变色，视觉重心落在「AI 工具」上 */
.hero h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--brand) 8%, var(--brand-2) 58%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: clamp(13.5px, 1.6vw, 16px);
  line-height: 1.7;
}

/* 搜索框：全站最重要的交互元素，做得足够大、足够显眼 */
.search {
  position: relative;
  max-width: 620px;
  margin: 30px auto 0;
}

.search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 8px 0 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search__field:focus-within {
  border-color: color-mix(in srgb, var(--brand) 70%, transparent);
  box-shadow: 0 0 0 4px var(--brand-soft), 0 18px 40px -22px rgba(124, 108, 255, 0.9);
}

.search__field > svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search__input::placeholder {
  color: var(--text-3);
}

/* 搜索框右侧的清除按钮，仅在有内容时出现 */
.search__clear {
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  background: var(--panel-2);
}

.search__clear:hover {
  color: var(--text);
}

.search.has-value .search__clear {
  display: grid;
}

.search__submit {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand), #5b8cff);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.18s, transform 0.18s;
}

.search__submit:hover {
  filter: brightness(1.12);
}

.search__submit:active {
  transform: scale(0.97);
}

/* 热门关键词胶囊 */
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.hero__tags button {
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 12.5px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.hero__tags button:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--brand-soft);
}

/* 首页数据统计条，增强「这是个有积累的站点」的可信度 */
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 30px;
  color: var(--text-3);
  font-size: 12.5px;
}

.hero__stats b {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   5. 主体布局：左侧分类导航 + 右侧内容
   -------------------------------------------------------------------------- */
.layout {
  display: block;
  padding-bottom: 40px;
}

/* 移动端分类条：横向滚动，吸顶在导航栏下方 */
.cats {
  position: sticky;
  top: var(--nav-h);
  z-index: 60;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  margin: 0 -20px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.cats::-webkit-scrollbar {
  display: none;
}

.cats a {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.cats a.is-active,
.cats a:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), #5b8cff);
  box-shadow: 0 6px 18px -8px rgba(124, 108, 255, 0.9);
}

[data-theme="light"] .cats a.is-active,
[data-theme="light"] .cats a:hover {
  color: #fff;
}

/* 搜索结果提示条 */
.result-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13.5px;
  color: var(--text-2);
}

.result-bar.is-on {
  display: flex;
}

.result-bar b {
  color: var(--text);
}

.result-bar button {
  margin-left: auto;
  color: var(--brand-2);
  font-size: 13px;
}

/* 分类区块 */
.section {
  padding: 22px 0 6px;
  scroll-margin-top: calc(var(--nav-h) + 72px);
}

.section[hidden] {
  display: none;
}

.section__head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  /* 圆角方块（13px），椭圆的是里面的图标本身，不是这个底 */
  border-radius: 13px;
  /* 深色主题：底色压暗 + 品牌色描边，让渐变线条图标有足够对比度 */
  border: 1px solid rgba(124, 108, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  font-size: 16px;
  line-height: 1;
}

/* 图标本身带一点点辉光，和页面光晕呼应，避免线条显得干瘪 */
.section__icon .ico {
  filter: drop-shadow(0 0 5px rgba(124, 108, 255, 0.45));
}

/* 浅色主题：白底上深色线条已足够，改用淡品牌渐变底增加精致感 */
[data-theme="light"] .section__icon {
  background: linear-gradient(140deg, rgba(124, 108, 255, 0.12), rgba(34, 211, 238, 0.08));
}

/* --------------------------------------------------------------------------
   分类图标：全站统一使用渐变线条 SVG（替代 emoji）
   为什么不用 emoji？同一字符在 Windows / macOS / Android 上是三套完全不同的
   画风，尺寸与颜色也不受控；换成引用 #ico-grad 渐变的线条图标后，
   跨设备呈现一致，且能和品牌紫青色系呼应。
   下面按三个使用位置分别微调尺寸与基线对齐。
   -------------------------------------------------------------------------- */
.ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

/* 分类标题下的 34px 圆角方块：图标略大一点才撑得住 */
.section__icon .ico {
  width: 19px;
  height: 19px;
  vertical-align: 0;
}

/* 桌面端左侧栏：图标比文字略小，视觉更稳 */
.sidebar .ico {
  width: 16px;
  height: 16px;
  vertical-align: 0;
}

/* 移动端横向分类条：胶囊里空间有限，用最小尺寸 */
.cats .ico {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 1px;
}

/* 侧栏未选中时图标压暗一档，hover / 选中时回到全亮，强化当前位置感 */
.sidebar a .ico {
  opacity: 0.85;
  transition: opacity 0.18s;
}

.sidebar a:hover .ico,
.sidebar a.is-active .ico {
  opacity: 1;
}

.section__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section__title small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.section__desc {
  color: var(--text-3);
  font-size: 12.5px;
  margin-left: auto;
  text-align: right;
  /* 单行省略：分类说明长短不一，允许截断才能保证每个分类标题区高度一致 */
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 站点卡片网格：自适应列数，手机 1 列、平板 2 列、桌面 3~4 列 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
}

/* --------------------------------------------------------------------------
   6. 站点卡片
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.22s,
    background 0.22s, box-shadow 0.22s;
  will-change: transform;
  overflow: hidden;
}

/* hover 时顶部透出一条渐变高光线 */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), var(--brand-2), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--panel-hover);
  box-shadow: 0 16px 34px -20px rgba(124, 108, 255, 0.85), var(--shadow-sm);
}

.card:hover::before {
  opacity: 1;
}

/* 浅色主题：白卡放在浅灰底上需要更清晰的层级，补一层极淡投影 */
[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(16, 22, 40, 0.04);
}

[data-theme="light"] .card:hover {
  box-shadow: 0 14px 30px -20px rgba(70, 60, 190, 0.4), 0 1px 2px rgba(16, 22, 40, 0.06);
}

/* 站点徽章：首字母 + 品牌渐变，颜色由 HTML 上的 --c1/--c2 逐个指定 */
.card__logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--c1, #7c6cff), var(--c2, #22d3ee));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px -8px var(--c1, #7c6cff);
  user-select: none;
}

.card__body {
  min-width: 0;
  flex: 1;
}

.card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  /* 给右上角的外链箭头预留位置，防止长站名被压住 */
  padding-right: 14px;
}

.card__title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 「荐」角标：人工精选，提升点击优先级 */
.card__pick {
  flex-shrink: 0;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
  color: #ffd479;
  background: rgba(255, 180, 60, 0.14);
  border: 1px solid rgba(255, 180, 60, 0.28);
}

.card__desc {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  /* 描述统一截断为两行：长描述不至于撑高单张卡片，网格行高才能对齐 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.card__tags span {
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 17px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  white-space: nowrap;
}

[data-theme="light"] .card__tags span {
  background: rgba(14, 18, 34, 0.04);
}

/* 右上角外链箭头：用伪元素生成，省掉 140 个卡片重复的 SVG（体积减少约 30KB） */
.card::after {
  content: "↗";
  position: absolute;
  top: 9px;
  right: 11px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-3);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.22s, transform 0.22s, color 0.22s;
}

.card:hover::after,
.card:focus-visible::after {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--brand-2);
}

/* 搜索无结果时的空状态 */
.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 70px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty.is-on {
  display: flex;
}

.empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.empty p {
  font-size: 14px;
}

.empty b {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   7. FAQ / 收录说明 / 页脚
   -------------------------------------------------------------------------- */
.faq {
  padding: 46px 0 10px;
  max-width: 820px;
  margin: 0 auto;
}

.faq h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.faq > p {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 22px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 0 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.faq details:hover {
  border-color: var(--line-strong);
}

.faq details[open] {
  background: var(--panel-2);
}

.faq summary {
  padding: 14px 0;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* 用加号/减号表示展开状态 */
.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--text-3);
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  content: "−";
}

.faq .answer {
  padding: 0 0 14px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.75;
}

/* 底部提交收录引导 */
.cta {
  margin: 34px auto 0;
  max-width: 820px;
  padding: 26px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 180px at 15% 0%, rgba(124, 108, 255, 0.22), transparent 70%),
    var(--panel);
  text-align: center;
}

.cta h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.cta p {
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand), #5b8cff);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  transition: filter 0.18s, transform 0.18s;
}

.btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding: 34px 0 30px;
}

/* 页脚分类内链：既方便用户，也是站内权重传递的入口 */
.footer__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 22px;
  font-size: 13px;
}

.footer__cats a {
  color: var(--text-2);
  transition: color 0.18s;
}

.footer__cats a:hover {
  color: var(--brand-2);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.footer__bottom a:hover {
  color: var(--text-2);
}

.footer__note {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.7;
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 90;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.to-top.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--text);
}

.to-top svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   8. 关于页等内页的排版
   -------------------------------------------------------------------------- */
.doc {
  max-width: 780px;
  margin: 0 auto;
  padding: 44px 0 20px;
}

.doc h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 12px;
}

.doc h2 {
  font-size: 18px;
  margin: 30px 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--brand);
  line-height: 1.3;
}

.doc h3 {
  font-size: 15px;
  margin: 20px 0 6px;
}

.doc p,
.doc li {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.85;
}

.doc p {
  margin: 8px 0;
}

.doc ul {
  padding-left: 20px;
  list-style: disc;
}

.doc ul li {
  margin: 5px 0;
}

.doc a {
  color: var(--brand-2);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
}

.doc a:hover {
  border-bottom-color: currentColor;
}

.doc .meta {
  color: var(--text-3);
  font-size: 12.5px;
  margin-bottom: 26px;
}

/* --------------------------------------------------------------------------
   9. 响应式：≥ 900px 时侧栏固定在左侧
   -------------------------------------------------------------------------- */
@media (min-width: 980px) {
  .nav__links,
  .nav__search {
    display: flex;
  }

  .layout {
    display: grid;
    grid-template-columns: 208px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
  }

  /* 移动端横向分类条在桌面隐藏，改用侧栏 */
  .cats {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 22px);
    display: block;
    padding-top: 22px;
  }

  .sidebar__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-3);
    margin-bottom: 10px;
    padding-left: 12px;
  }

  .sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13.5px;
    transition: background 0.18s, color 0.18s;
  }

  /* 图标改为 SVG 后，这里的 span 只作为对齐容器，不再需要字号与透明度 */
  .sidebar a span {
    display: inline-flex;
    align-items: center;
    line-height: 0;
  }

  .sidebar a::after {
    content: attr(data-count);
    margin-left: auto;
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
  }

  .sidebar a:hover {
    background: var(--panel);
    color: var(--text);
  }

  .sidebar a.is-active {
    background: var(--brand-soft);
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--brand);
  }

  /* 桌面端侧栏底部的小提示 */
  .sidebar__tip {
    margin-top: 18px;
    padding: 12px;
    border-radius: var(--r-md);
    border: 1px dashed var(--line-strong);
    color: var(--text-3);
    font-size: 11.5px;
    line-height: 1.7;
  }
}

/* 移动端隐藏侧栏（分类条已替代它） */
@media (max-width: 979px) {
  .sidebar {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }

  .hero {
    text-align: left;
    padding-top: 32px;
  }

  .hero__badge,
  .hero__tags,
  .hero__stats {
    justify-content: flex-start;
  }

  .hero__sub {
    margin: 0;
  }

  .search {
    margin: 22px 0 0;
  }

  .search__submit {
    display: none; /* 移动端回车即可搜索，省出输入宽度 */
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    padding: 12px;
  }

  .section__desc {
    display: none;
  }

  .footer__cats {
    gap: 8px 14px;
  }
}

/* 尊重系统「减少动效」设置：关掉所有过渡与位移动画 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 打印时去掉装饰，保留可读的链接清单 */
@media print {
  body::before,
  body::after,
  .nav,
  .to-top,
  .search,
  .hero__tags {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    break-inside: avoid;
  }
}
