/* ==========================================================================
   AI速览 · AI工具导航 —— 设计系统 v2
   版式参照：深色侧边栏 + 深色 Hero + 浅色内容区 + 图标横排卡片
   暗色铬件 #1d1f27 / 纸面内容 #f3f4f6 / 强调红 #f1404b
   ========================================================================== */

:root {
  /* 暗色铬件（顶栏/侧栏/hero） */
  --chrome: #17181d;
  --chrome-2: #1d1f27;
  --chrome-3: #262932;
  --chrome-line: #2e323d;
  --chrome-ink: #e8eaf0;
  --chrome-ink-2: #9aa0ad;
  --chrome-ink-3: #6b7180;
  /* 纸面内容区 */
  --paper: #f3f4f6;
  --card: #ffffff;
  --ink: #1c1e24;
  --ink-2: #565b66;
  --ink-3: #969ba6;
  --line: #e6e8ec;
  --line-strong: #d8dbe1;
  /* 强调色 */
  --accent: #f1404b;
  --accent-hover: #e02d39;
  --accent-soft: rgba(241, 64, 75, 0.08);
  --accent-mark: rgba(241, 64, 75, 0.18);
  --green: #2fbf71;
  /* 其他 */
  --mark: rgba(241, 64, 75, 0.14);
  --shadow-sm: 0 1px 2px rgba(20, 22, 30, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(20, 22, 30, 0.18);
  --shadow-lg: 0 28px 70px -28px rgba(0, 0, 0, 0.55);
  --radius: 12px;
  --radius-sm: 8px;
  --sidenav-w: 218px;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* 关闭 CSS 长距离平滑滚动（大页面锚点跳转会严重掉帧），平滑效果由 JS 按需触发 */
html { scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { width: 20px; height: 20px; flex: none; }
img { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: 56px;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
}
.topbar__inner {
  height: 100%; display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__name {
  font-family: var(--font-serif); font-weight: 900; font-size: 20px;
  letter-spacing: 0.02em; color: var(--chrome-ink); white-space: nowrap;
}
.brand__sub {
  font-size: 11.5px; color: var(--chrome-ink-3); letter-spacing: 0.12em;
  border-left: 1px solid var(--chrome-line); padding-left: 10px; white-space: nowrap;
}
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.submit-entry {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; margin-right: 6px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--chrome-ink);
  border: 1px solid var(--chrome-line); background: rgba(255, 255, 255, 0.04);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.submit-entry svg { width: 15px; height: 15px; }
.submit-entry:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--chrome-ink-2);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-spring);
}
.icon-btn:hover { background: var(--chrome-3); color: var(--chrome-ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-btn { display: none; }

/* 侧栏收起开关 */
.nav-toggle .icon-expand { display: none; }
body.nav-collapsed .nav-toggle .icon-collapse { display: none; }
body.nav-collapsed .nav-toggle .icon-expand { display: block; }

/* ---------- 侧边栏 ---------- */
.sidenav {
  position: fixed; top: 56px; left: 0; bottom: 0; z-index: 80;
  width: var(--sidenav-w);
  background: var(--chrome-2);
  border-right: 1px solid var(--chrome-line);
  display: flex; flex-direction: column;
  transition: width 0.28s var(--ease-out);
}
.sidenav__list {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 10px 16px;
  scrollbar-width: thin; scrollbar-color: var(--chrome-3) transparent;
}
.sidenav__list::-webkit-scrollbar { width: 5px; }
.sidenav__list::-webkit-scrollbar-thumb { background: var(--chrome-3); border-radius: 4px; }

/* 收起状态：slim 图标栏 */
body.nav-collapsed .sidenav { width: 62px; }
body.nav-collapsed .sidenav__list { padding: 10px 8px 16px; }
body.nav-collapsed .snav-item__row { flex-direction: column; gap: 4px; padding: 9px 4px; }
body.nav-collapsed .snav-item__icon { width: 30px; height: 30px; }
body.nav-collapsed .snav-item__label,
body.nav-collapsed .snav-item__count,
body.nav-collapsed .snav-item__chev,
body.nav-collapsed .snav-subs { display: none; }
body.nav-collapsed .snav-item__label {
  display: block; font-size: 10px; max-width: 100%;
  transform: scale(0.92);
}

.sidenav__foot {
  flex: none; padding: 12px 16px;
  border-top: 1px solid var(--chrome-line);
  font-size: 11.5px; color: var(--chrome-ink-3);
}

/* 分组标题 */
.sidenav__group {
  margin: 14px 8px 6px; font-size: 11px; letter-spacing: 0.16em;
  color: var(--chrome-ink-3); font-weight: 600;
}
.sidenav__group:first-child { margin-top: 4px; }

/* 顶级分类项 */
.snav-item { border-radius: 9px; }
.snav-item + .snav-item { margin-top: 2px; }
.snav-item__row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--chrome-ink-2); cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.snav-item__row:hover { background: var(--chrome-3); color: var(--chrome-ink); }
.snav-item__icon {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--chrome-3); color: var(--chrome-ink-2);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.snav-item__icon svg { width: 15px; height: 15px; }
.snav-item__label {
  flex: 1; min-width: 0; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snav-item__count { font-size: 10.5px; color: var(--chrome-ink-3); font-variant-numeric: tabular-nums; }
.snav-item__chev {
  width: 14px; height: 14px; color: var(--chrome-ink-3);
  transition: transform 0.26s var(--ease-out);
}
.snav-item.is-open .snav-item__chev { transform: rotate(90deg); }
.snav-item.is-active > .snav-item__row { background: var(--accent-soft); color: #fff; }
.snav-item.is-active > .snav-item__row .snav-item__icon { background: var(--accent); color: #fff; }
.snav-item.is-active > .snav-item__row .snav-item__count { color: rgba(255,255,255,0.6); }

/* 子分类 */
.snav-subs {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
}
.snav-item.is-open .snav-subs { max-height: 1200px; }
.snav-subs a {
  display: flex; align-items: center; gap: 8px;
  margin: 1px 0 1px 22px; padding: 7px 10px;
  border-radius: 8px; font-size: 12.5px; color: var(--chrome-ink-3);
  border-left: 2px solid transparent;
  transition: background-color 0.16s ease, color 0.16s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snav-subs a::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--chrome-line); flex: none;
  transition: background-color 0.16s ease;
}
.snav-subs a:hover { background: var(--chrome-3); color: var(--chrome-ink); }
.snav-subs a.is-active {
  color: #fff; background: var(--accent-soft);
  border-left-color: var(--accent);
}
.snav-subs a.is-active::before { background: var(--accent); }
.snav-subs .snav-subs__count { margin-left: auto; font-size: 10.5px; color: var(--chrome-ink-3); }

/* ---------- 主区域 ---------- */
.main {
  margin-left: var(--sidenav-w); min-width: 0;
  transition: margin-left 0.28s var(--ease-out);
}
body.nav-collapsed .main { margin-left: 62px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--chrome); }
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 500px at 78% -10%, rgba(241, 64, 75, 0.16), transparent 60%),
    radial-gradient(900px 480px at 12% 110%, rgba(64, 120, 255, 0.12), transparent 60%),
    url("https://images.pexels.com/photos/8386440/pexels-photo-8386440.jpeg?auto=compress&cs=tinysrgb&w=1920") center / cover no-repeat;
  opacity: 0.5;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23,24,29,0.6), rgba(23,24,29,0.86));
}
.hero__inner {
  position: relative; max-width: 780px; margin: 0 auto;
  padding: 88px 24px 72px; text-align: center; color: var(--chrome-ink);
}
.hero__title {
  margin: 0; font-family: var(--font-serif); font-weight: 900;
  font-size: clamp(34px, 5.4vw, 54px); line-height: 1.2; letter-spacing: 0.02em;
  color: #fff;
}
.hero__desc {
  margin: 16px auto 0; max-width: 560px;
  font-size: 15px; line-height: 1.9; color: var(--chrome-ink-2);
}
/* Hero 内的提交入口：红色渐变胶囊，悬停箭头前移 */
.hero__submit {
  margin: 22px auto 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; text-decoration: none;
  background: linear-gradient(120deg, #f1404b, #ff6a4d); color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(241, 64, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease, filter 0.22s ease;
}
.hero__submit svg { width: 16px; height: 16px; }
.hero__submit .hero__submit-go { width: 14px; height: 14px; opacity: 0.75; transition: transform 0.22s var(--ease-out), opacity 0.2s ease; }
.hero__submit:hover {
  transform: translateY(-2px); filter: brightness(1.06);
  box-shadow: 0 12px 30px rgba(241, 64, 75, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.hero__submit:hover .hero__submit-go { transform: translateX(4px); opacity: 1; }
.hero__search {
  margin: 32px auto 0; max-width: 560px; height: 52px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px;
  background: var(--chrome-2); color: var(--chrome-ink-3);
  border: 1px solid var(--chrome-line); border-radius: 999px;
  font-size: 14px; width: 100%;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.hero__search:hover, .hero__search:focus-visible {
  border-color: var(--accent); color: var(--chrome-ink-2);
  box-shadow: 0 0 0 3px rgba(241, 64, 75, 0.18);
}
.hero__search svg { width: 18px; height: 18px; }
.hero__search span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero__search kbd {
  font-family: inherit; font-size: 11px; color: var(--chrome-ink-3);
  border: 1px solid var(--chrome-line); border-radius: 6px; padding: 2px 8px;
  background: var(--chrome); white-space: nowrap;
}

/* 公告轮播（已移除） */
/* 热门词 */
.hero__chips {
  margin: 24px auto 0; max-width: 640px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px;
}
.hero__chips-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--chrome-ink-3);
}
.hero__chips-label svg { width: 14px; height: 14px; }
.chip {
  padding: 6px 15px; border-radius: 999px; font-size: 12.5px;
  color: var(--chrome-ink-2);
  border: 1px solid var(--chrome-line); background: rgba(255, 255, 255, 0.04);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-spring);
}
.chip:hover { border-color: var(--accent); color: #fff; background: var(--accent-soft); transform: translateY(-1px); }
.chip:active { transform: scale(0.96); }

/* 统计 */
.hero__stats {
  margin: 44px auto 0; padding: 0; max-width: 520px;
  display: flex; justify-content: center; gap: clamp(30px, 7vw, 68px);
}
.hero__stat { text-align: center; }
.hero__stat dd {
  margin: 0; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(24px, 3vw, 32px); color: #fff; font-variant-numeric: tabular-nums;
}
.hero__stat dt { margin-top: 4px; font-size: 12px; color: var(--chrome-ink-3); letter-spacing: 0.06em; }

/* ---------- 内容通用 ---------- */
.content { padding: 26px clamp(14px, 2.6vw, 32px) 0; max-width: 1560px; margin: 0 auto; }

.section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
}
.section-head__title {
  margin: 0; font-family: var(--font-serif); font-weight: 700;
  font-size: 20px; display: flex; align-items: center; gap: 10px;
}
.section-head__badge {
  font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: #fff; background: var(--accent); border-radius: 5px; padding: 3px 7px;
  transform: translateY(-1px);
}
.section-head__hint { font-size: 12px; color: var(--ink-3); }

/* ---------- 工具卡片（图标横排） ---------- */
.tcard-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px;
}

.tcard { min-width: 0; }
.tcard__link {
  position: relative; height: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.26s var(--ease-out), border-color 0.26s ease, box-shadow 0.26s ease;
}
.tcard__link:hover {
  transform: translateY(-3px);
  border-color: rgba(241, 64, 75, 0.5);
  box-shadow: var(--shadow-md);
}
.tcard__icon {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f6f7f9; border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden;
  transition: border-color 0.26s ease;
}
.tcard__link:hover .tcard__icon { border-color: rgba(241, 64, 75, 0.35); }
.tcard__icon img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.tcard__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tcard__name {
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.22s ease;
}
.tcard__link:hover .tcard__name { color: var(--accent-hover); }
.tcard__desc {
  font-size: 12.5px; line-height: 1.55; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tcard__go {
  width: 15px; height: 15px; flex: none; align-self: center;
  color: var(--ink-3);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity 0.24s ease, transform 0.24s var(--ease-out), color 0.24s ease;
}
.tcard__link:hover .tcard__go { opacity: 1; transform: translate(0, 0); color: var(--accent); }

/* ---------- 悬停浮层：展示被省略的完整信息 ---------- */
.tcard-tip {
  position: fixed; z-index: 130; max-width: 300px;
  background: #17181d; color: #e8eaf0;
  border: 1px solid #2e3038; border-radius: 11px;
  padding: 11px 14px; pointer-events: none;
  box-shadow: 0 14px 40px rgba(10, 11, 15, 0.4);
  animation: tip-in 0.16s var(--ease-out);
}
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } }
.tcard-tip__name { font-size: 14px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.tcard-tip__desc { font-size: 12.5px; color: #a6abb8; line-height: 1.7; margin-top: 5px; word-break: break-all; }
.tcard-tip__host {
  font-size: 11.5px; color: #6b7080; margin-top: 7px;
  display: flex; align-items: center; gap: 5px;
}
.tcard-tip__host::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none;
}

/* ---------- 分类区块（白色分组面板，分类边界更清晰） ---------- */
.cat-section {
  margin-bottom: 20px; scroll-margin-top: 72px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px clamp(14px, 2vw, 24px) 8px;
  box-shadow: var(--shadow-sm);
}
.cat-section__head { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.cat-section__icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.cat-section__icon svg { width: 18px; height: 18px; }
.cat-section__title {
  margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: 21px;
}
.cat-section__count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cat-section__subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.sub-jump {
  font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px;
  background: var(--paper);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.sub-jump:hover { color: var(--accent-hover); border-color: var(--accent); background: var(--accent-soft); }

.sub-section { margin-bottom: 24px; scroll-margin-top: 72px; }
.sub-section__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.sub-section__title {
  margin: 0; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.sub-section__title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--accent); flex: none; transform: translateY(1px);
}
.sub-section__count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sub-section__line { flex: 1; height: 1px; background: var(--line); transform: translateY(-3px); }

/* ---------- 页脚 ---------- */
.footer { margin-top: 56px; background: var(--chrome); color: var(--chrome-ink-2); }
.footer__inner {
  max-width: 1560px; margin: 0 auto; padding: 44px clamp(16px, 3vw, 36px) 32px;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 180px; gap: 44px;
}
.footer .brand__name { font-size: 24px; color: #fff; }
.footer__desc { margin: 14px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--chrome-ink-3); max-width: 540px; }
.footer__title { margin: 0 0 13px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--chrome-ink); }
.footer__cats { display: flex; flex-wrap: wrap; gap: 8px 16px; align-content: flex-start; }
.footer__cats a, .footer__links a { font-size: 12.5px; color: var(--chrome-ink-3); transition: color 0.18s ease; }
.footer__cats a:hover, .footer__links a:hover { color: #fff; }
.footer__links { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.footer__bottom {
  border-top: 1px solid var(--chrome-line);
  padding: 16px 24px; text-align: center;
  font-size: 12px; color: var(--chrome-ink-3);
}
.footer__bottom p { margin: 0; }

/* ---------- 移动端抽屉 ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer__mask {
  position: absolute; inset: 0; background: rgba(8, 9, 13, 0.6);
  opacity: 0; transition: opacity 0.3s ease;
}
.drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 84vw);
  background: var(--chrome-2); box-shadow: var(--shadow-lg);
  transform: translateX(-102%); transition: transform 0.34s var(--ease-out);
  display: flex; flex-direction: column;
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__mask { opacity: 1; }
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--chrome-line); flex: none;
}
.drawer__title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-serif); font-weight: 700; font-size: 15px; color: var(--chrome-ink);
}
.drawer__title .brand__mark { width: 24px; height: 24px; }
.drawer__list { padding: 10px; }
.drawer .icon-btn { color: var(--chrome-ink-2); }
.drawer .icon-btn:hover { background: var(--chrome-3); color: #fff; }

/* ---------- 搜索遮罩层 ---------- */
.search-modal { position: fixed; inset: 0; z-index: 110; pointer-events: none; }
.search-modal__mask {
  position: absolute; inset: 0; background: rgba(8, 9, 13, 0.62);
  opacity: 0; transition: opacity 0.28s ease;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.search-modal__panel {
  position: absolute; left: 50%; top: 11vh; transform: translate(-50%, -12px);
  width: min(660px, calc(100vw - 32px)); max-height: 74vh;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity 0.24s ease, transform 0.24s var(--ease-out);
  overflow: hidden;
}
.search-modal.is-open { pointer-events: auto; }
.search-modal.is-open .search-modal__mask { opacity: 1; }
.search-modal.is-open .search-modal__panel { opacity: 1; transform: translate(-50%, 0); }
.search-modal__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 60px; flex: none;
  border-bottom: 1px solid var(--line);
}
.search-modal__bar > svg { width: 19px; height: 19px; color: var(--ink-3); }
.search-modal__bar input {
  flex: 1; height: 100%; border: none; outline: none; background: transparent;
  font-size: 15.5px; color: var(--ink); min-width: 0;
}
.search-modal__bar input::placeholder { color: var(--ink-3); }
.search-modal__esc {
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em;
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 8px;
}
.search-modal__hint {
  display: flex; gap: 18px; padding: 9px 18px; flex: none;
  font-size: 11.5px; color: var(--ink-3);
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.search-modal__hint kbd {
  font-family: inherit; font-size: 10.5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; margin-right: 3px; background: #fff;
}
.search-modal__results { overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
}
.search-result.is-active { background: var(--accent-soft); }
.search-result__icon {
  width: 32px; height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.search-result__icon img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }
.search-result__main { flex: 1; min-width: 0; }
.search-result__name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result.is-active .search-result__name { color: var(--accent-hover); }
.search-result__name mark, .search-result__meta mark { background: var(--accent-mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-result__meta {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result__cat {
  flex: none; font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px;
}
.search-result__go { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.search-result.is-active .search-result__go { color: var(--accent); }
.search-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.search-empty strong { color: var(--ink-2); }

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 85;
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s var(--ease-out),
    color 0.2s ease, border-color 0.2s ease;
}
.back-top.is-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { color: var(--accent); border-color: var(--accent); }
.back-top svg { width: 17px; height: 17px; }

/* ---------- 滚动显现动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- 性能：跳过屏外渲染（海量卡片关键优化） ---------- */
/* content-visibility 让浏览器跳过屏外区块的布局与绘制，
   contain-intrinsic-size 提供占位尺寸避免滚动条跳动。
   注意：不要加在 .tcard 上——子级 transform 与父级布局约束
   组合会导致悬停边框渲染异常，且区块级跳过已足够。 */
.sub-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}
.cat-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .sidenav { display: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar__inner { padding: 0 12px; }
}
@media (min-width: 1081px) {
  .menu-btn { display: none !important; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .brand__sub { display: none; }
  .hero__inner { padding: 64px 18px 52px; }
  .hero__search { height: 48px; }
  .hero__search kbd { display: none; }
  .ticker { font-size: 12px; }
  .content, .latest { padding-left: 14px; padding-right: 14px; }
  .tcard-grid { grid-template-columns: 1fr; gap: 10px; }
  .tcard-row .tcard { flex-basis: 272px; }
  .cat-section { margin-bottom: 36px; }
  .footer__inner { grid-template-columns: 1fr; gap: 26px; padding: 36px 18px 24px; }
  .search-modal__panel { top: 7vh; max-height: 82vh; }
  .back-top { right: 14px; bottom: 14px; }
}
