/* ============================================================
   AI Compass · 暗色编辑部风索引
   主题令牌：暗色为默认，亮色为镜像；accent 全站唯一（荧光绿）
   形状系统：按钮/胶囊 999px，卡片 14px，浮层 20px
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
    "Noto Sans Mono CJK SC", monospace;

  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --radius-card: 14px;
  --radius-float: 20px;

  --header-h: 52px;
  --topbar-top: 12px;
  --z-topbar: 40;
  --z-toolbar: 30;
  --z-side: 25;
  --z-palette: 90;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d0f;
  --bg-2: #101114;
  --surface: #141519;
  --surface-2: #1a1b21;
  --border: rgba(236, 235, 230, 0.08);
  --border-2: rgba(236, 235, 230, 0.16);
  --text: #ecebe6;
  --text-2: #a3a29a;
  --text-3: #82817a;
  --accent: #c9f24d;
  --accent-text: #d3f56a;
  --accent-ink: #131a02;
  --accent-soft: rgba(201, 242, 77, 0.13);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --float-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --fav-bg-l: 16%;
  --grid-dot: rgba(236, 235, 230, 0.05);
  --scrim: rgba(5, 6, 7, 0.62);
  --mark-bg: rgba(201, 242, 77, 0.22);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f0;
  --bg-2: #edede8;
  --surface: #fbfbf8;
  --surface-2: #f1f1ec;
  --border: rgba(25, 26, 23, 0.09);
  --border-2: rgba(25, 26, 23, 0.18);
  --text: #1a1b18;
  --text-2: #5f5f58;
  --text-3: #75756d;
  --accent: #c9f24d;
  --accent-text: #567a00;
  --accent-ink: #131a02;
  --accent-soft: rgba(120, 165, 10, 0.14);
  --card-shadow: 0 10px 28px rgba(30, 32, 20, 0.08);
  --float-shadow: 0 16px 44px rgba(30, 32, 20, 0.12);
  --fav-bg-l: 91%;
  --grid-dot: rgba(25, 26, 23, 0.06);
  --scrim: rgba(240, 240, 235, 0.55);
  --mark-bg: rgba(120, 165, 10, 0.25);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: calc(var(--header-h) + var(--topbar-top) * 2 + 8px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

.mono { font-family: var(--font-mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -48px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* 颗粒噪点，固定层不参与滚动 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ---------- 顶部导航（悬浮胶囊） ---------- */
.topbar {
  position: fixed;
  top: var(--topbar-top);
  left: 0;
  right: 0;
  z-index: var(--z-topbar);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.topbar-inner {
  pointer-events: auto;
  width: min(1280px, calc(100% - 24px));
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand svg { display: block; }

.brand .zh {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.14em;
  margin-left: 2px;
  transform: translateY(1px);
}

.top-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-2);
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out),
    transform 0.15s var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
}
.search-btn:hover { border-color: var(--border-2); color: var(--text); background: var(--surface-2); }
.search-btn .label { display: none; }
@media (min-width: 720px) { .search-btn .label { display: inline; } }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-3);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 84px) 24px 34px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    560px circle at var(--mx, 30%) var(--my, 20%),
    var(--accent-soft),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}
.hero.pointer-live::after { opacity: 1; }

.hero-inner { position: relative; z-index: 1; max-width: 860px; }

.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  animation: rise 0.7s var(--ease-out) both;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent-text);
}

.hero p {
  margin-top: 16px;
  max-width: 56ch;
  font-size: 15.5px;
  color: var(--text-2);
  animation: rise 0.7s var(--ease-out) 0.08s both;
}

.hero-cta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  animation: rise 0.7s var(--ease-out) 0.16s both;
}

.hero-search {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: min(440px, 100%);
  height: 52px;
  padding: 0 10px 0 18px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-3);
  font-size: 14.5px;
  text-align: left;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    transform 0.15s var(--ease-out);
}
.hero-search:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero-search:active { transform: scale(0.99); }
.hero-search .ph { flex: 1; color: var(--text-3); }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Hero 罗盘装饰：随指针转动的表针 */
.hero-compass {
  position: absolute;
  right: -36px;
  top: 50%;
  margin-top: -210px;
  z-index: 0;
  pointer-events: none;
  animation: rise 0.9s var(--ease-out) 0.2s both;
}
.hero-compass .ring {
  fill: none;
  stroke: var(--border-2);
  stroke-width: 1;
}
.hero-compass .tick { stroke: var(--border-2); stroke-width: 1.5; }
.hero-compass .needle {
  transform-origin: 100px 100px;
  transition: transform 0.35s var(--ease-out);
}
.hero-compass .n-up { fill: var(--accent); opacity: 0.55; }
.hero-compass .n-down { fill: var(--text-3); opacity: 0.28; }
.hero-compass .hub { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; opacity: 0.9; }
@media (max-width: 1080px) { .hero-compass { display: none; } }

/* ---------- 工具条 ---------- */
.toolbar-wrap {
  position: sticky;
  top: calc(var(--topbar-top) + var(--header-h) + 6px);
  z-index: var(--z-toolbar);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.toolbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.chips { display: flex; gap: 6px; }

.chip {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.22s var(--ease-out);
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.count-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.seg {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.seg button {
  width: 30px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-3);
  transition: all 0.2s var(--ease-out);
}
.seg button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}
.seg button:active { transform: scale(0.92); }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 0;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* 侧栏 */
.side {
  position: sticky;
  top: calc(var(--topbar-top) + var(--header-h) + 66px);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }

.side-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-2);
  border-left: 2px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.side-nav a:hover { color: var(--text); background: var(--surface); }
.side-nav a.active {
  color: var(--text);
  background: var(--surface);
  border-left-color: var(--accent);
}
.side-nav a .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.side-nav a.dim { opacity: 0.35; pointer-events: none; }

.side-keys {
  margin-top: 18px;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.side-keys div { display: flex; align-items: center; gap: 8px; }
.side-keys kbd { margin-left: auto; }

/* ---------- 分类区块 ---------- */
.cat-section { padding: 26px 0 6px; scroll-margin-top: 150px; }

.cat-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.cat-head h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.cat-head .en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cat-head .n {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.cat-head::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: hsl(var(--h) 68% 58%);
  transform: rotate(45deg);
  align-self: center;
  flex: none;
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 10px;
}

.site {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.site:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--h) 62% 58% / 0.55);
  box-shadow: var(--card-shadow);
}
.site:active { transform: translateY(0) scale(0.985); }

.site .row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fav {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: hsl(var(--h) 38% var(--fav-bg-l));
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  border-radius: 4px;
}
.fav .mono-letter {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--h) 55% 62%);
}
html[data-theme="light"] .fav .mono-letter { color: hsl(var(--h) 60% 34%); }
.fav.hide-img img { display: none; }

.site .name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site .arrow {
  margin-left: auto;
  flex: none;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: all 0.22s var(--ease-out);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 13px;
}
.site:hover .arrow { opacity: 1; transform: none; }

.site .desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.site .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
}
.site .host {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  flex: none;
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.tag.oss { color: var(--accent-text); border-color: transparent; background: var(--accent-soft); }

/* 紧凑列表视图 */
.layout[data-view="list"] .grid { grid-template-columns: 1fr; gap: 4px; }
.layout[data-view="list"] .site {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  background: transparent;
  border-color: transparent;
  border-bottom: 1px solid var(--border);
}
.layout[data-view="list"] .site:hover {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--border);
  transform: none;
  box-shadow: none;
}
.layout[data-view="list"] .site .row1 { flex: none; }
.layout[data-view="list"] .site .name { flex: none; max-width: 200px; }
.layout[data-view="list"] .site .desc {
  -webkit-line-clamp: 1;
  min-height: 0;
  flex: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-left: 4px;
}
.layout[data-view="list"] .site .meta { margin-left: auto; margin-top: 0; flex: none; }
.layout[data-view="list"] .site .arrow { position: static; margin-left: 0; }

/* 空态 */
.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  display: none;
}
.empty.show { display: block; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1280px;
  margin: 56px auto 0;
  padding: 22px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-size: 12.5px;
  color: var(--text-3);
}
.footer .grow { flex: 1; }
.footer a { color: var(--text-2); transition: color 0.2s; }
.footer a:hover { color: var(--accent-text); }

/* ---------- 命令面板 ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: var(--z-palette);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease-out);
}
.palette.open { opacity: 1; pointer-events: auto; }

.palette-panel {
  width: min(620px, 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-float);
  background: var(--bg-2);
  box-shadow: var(--float-shadow);
  overflow: hidden;
  transform: scale(0.98) translateY(-6px);
  transition: transform 0.22s var(--ease-out);
}
.palette.open .palette-panel { transform: none; }

.palette-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.palette-input-row svg { flex: none; color: var(--text-3); }
.palette-input-row input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.palette-input-row input::placeholder { color: var(--text-3); }

.palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 11px;
  transition: background 0.12s linear;
}
.palette-item .fav { width: 24px; height: 24px; border-radius: 7px; }
.palette-item .fav img { width: 15px; height: 15px; }
.palette-item .p-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.palette-item .p-desc {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.palette-item .p-cat {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
}
.palette-item.active { background: var(--surface-2); }
.palette-item.active .p-name { color: var(--accent-text); }

mark {
  background: var(--mark-bg);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.palette-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

.palette-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .layout {
    display: block;
    padding: 0 16px;
  }
  .side {
    position: sticky;
    top: calc(var(--topbar-top) + var(--header-h) + 62px);
    z-index: var(--z-side);
    max-height: none;
    overflow-x: auto;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    margin: 0 -16px;
    padding: 10px 16px;
  }
  .side-title, .side-keys { display: none; }
  .side-nav {
    display: flex;
    gap: 6px;
    width: max-content;
  }
  .side-nav a {
    border-left: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    white-space: nowrap;
    font-size: 12.5px;
  }
  .side-nav a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
  }
  .side-nav a.active .n { color: var(--accent-ink); }
  .toolbar { padding: 12px 16px; }
  .hero { padding-inline: 16px; }
  .footer { padding-inline: 16px; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .count-label { display: none; }
  .brand .zh { display: none; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-right { width: 100%; justify-content: flex-end; }
  .side { top: calc(var(--topbar-top) + var(--header-h) + 108px); }
}

@media (max-width: 460px) {
  .grid { grid-template-columns: 1fr; }
  .site .desc { -webkit-line-clamp: 1; min-height: 0; }
}

/* ---------- 动效降级 ---------- */
@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;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   v2 扩展层：导航 / 今日速览 / 资讯时间线 / 墓园 / 日志 / 表单
   沿用既有 token：单一 accent、色相编码、999/14/20 形状系统
   ============================================================ */

/* ---------- 顶部导航链接 ---------- */
.topnav {
  display: none;
  align-items: center;
  gap: 2px;
  margin-right: auto;
  padding-left: 6px;
}
@media (min-width: 860px) {
  .brand { margin-right: 0; }
  .topnav { display: flex; }
}
.topnav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.topnav a.dim-link { color: var(--text-3); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  width: 100%;
}
.brand-mini { font-weight: 650; color: var(--text-2); }

/* ---------- Hero 次链接 ---------- */
.hero-link {
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.hero-link:hover { color: var(--accent-text); border-color: var(--accent); }

/* ---------- 今日速览 ---------- */
.today {
  max-width: 1280px;
  margin: 4px auto 0;
  padding: 0 24px;
}
.today-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 0 10px;
}
.today-head h2 { font-size: 17px; font-weight: 650; }
.today-head h2 a { transition: color 0.2s; }
.today-head h2 a:hover { color: var(--accent-text); }
.today-date { font-size: 11.5px; color: var(--text-3); }
.today-more { margin-left: auto; font-size: 13px; color: var(--text-2); }
.today-more:hover { color: var(--accent-text); }

.today-list { list-style: none; display: grid; gap: 2px; }
.today-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  min-width: 0;
}
.today-list li:last-child { border-bottom: 0; }
.today-list a {
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
  transition: color 0.2s;
}
.today-list a:hover { color: var(--accent-text); }
.today-comment {
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.today-src {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
@media (max-width: 860px) {
  .today { padding-inline: 16px; }
  .today-comment { display: none; }
}

/* ---------- 主题标签（资讯）---------- */
.topic-chip {
  flex: none;
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid hsl(var(--th, 210) 40% 55% / 0.45);
  color: hsl(var(--th, 210) 55% 68%);
  white-space: nowrap;
}
html[data-theme="light"] .topic-chip { color: hsl(var(--th, 210) 60% 32%); border-color: hsl(var(--th, 210) 45% 45% / 0.4); }
.t-模型 { --th: 210; } .t-产品 { --th: 293; } .t-开源 { --th: 100; }
.t-研究 { --th: 155; } .t-政策 { --th: 30; } .t-产业 { --th: 238; }

/* ---------- 卡片徽标与收藏 ---------- */
.badge-new {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
.badge-price {
  flex: none;
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--text-3);
}
.badge-price.p-free { color: var(--accent-text); border-color: transparent; background: var(--accent-soft); }

.docs-link {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  padding: 3px 8px;
  border: 1px dashed var(--border-2);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.docs-link:hover { color: var(--accent-text); border-color: var(--accent); }

.star {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-3);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}
.site:hover .star, .star.on, .star:focus-visible { opacity: 1; }
.star:hover { color: var(--accent-text); background: var(--surface-2); }
.star.on { color: var(--accent-text); }
.star svg { pointer-events: none; }
.layout[data-view="list"] .star { top: 50%; transform: translateY(-50%); right: 4px; }

.site.dim-star { opacity: 0.28; }
body.fav-mode .site:not(.is-fav) { display: none; }

/* ---------- 首页尾栏 ---------- */
.home-tail {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 30px 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}
.home-tail h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.home-tail p { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.tail-cta {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s;
}
.tail-cta:hover { box-shadow: 0 4px 18px var(--accent-soft); }
.tail-cta:active { transform: scale(0.97); }
.tail-cta.ghost { background: none; border: 1px solid var(--border-2); color: var(--text); }
.tail-cta.ghost:hover { border-color: var(--accent); box-shadow: none; }
.tail-link { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.tail-link:hover { color: var(--accent-text); }
.tail-log { list-style: none; display: grid; gap: 7px; font-size: 13px; }
.tail-log li { display: flex; align-items: baseline; gap: 8px; }
.tail-log .mono { font-size: 11px; color: var(--text-3); }
.log-add, .cl-add { color: var(--accent-text); font-size: 11px; flex: none; }
.log-remove, .cl-remove { color: #e2695f; font-size: 11px; flex: none; }
.log-fix, .cl-fix, .log-news, .cl-news { color: var(--text-3); font-size: 11px; flex: none; }
.log-news, .cl-news { color: hsl(210 60% 65%); }

/* ---------- 通用页头（资讯/墓园/日志/提交）---------- */
.page-head {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--topbar-top) + var(--header-h) + 44px) 24px 10px;
}
.page-head h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; letter-spacing: -0.015em; }
.page-head p { margin-top: 10px; font-size: 14.5px; color: var(--text-2); max-width: 62ch; line-height: 1.7; }
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--accent-text); }
.single-issue .issue-sub { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.issue-nav { margin-top: 18px; display: flex; gap: 20px; font-size: 13.5px; }
.issue-nav a, .issue-nav .dim { color: var(--text-2); }
.issue-nav .dim { opacity: 0.4; }
.issue-nav a:hover { color: var(--accent-text); }

/* ---------- 资讯筛选 ---------- */
.news-filters {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
#newsSearch {
  margin-left: auto;
  height: 34px;
  width: 220px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#newsSearch:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
#newsSearch::placeholder { color: var(--text-3); }
@media (max-width: 720px) { #newsSearch { margin-left: 0; width: 100%; } }

/* ---------- 资讯时间线 ---------- */
.news-layout {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 24px 30px;
}
.news-empty { padding: 60px 0; text-align: center; color: var(--text-3); font-size: 14px; }

.issue { padding: 18px 0 8px; }
.issue + .issue { border-top: 1px solid var(--border); }
.issue-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.issue-head h2 { font-size: 19px; font-weight: 650; }
.issue-head h2 a { transition: color 0.2s; }
.issue-head h2 a:hover { color: var(--accent-text); }
.issue-meta { font-size: 11px; color: var(--text-3); }

.issue-items { list-style: none; display: grid; gap: 2px; counter-reset: item; }
.news-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: 0; }
.news-item[hidden] { display: none; }
.news-body { flex: 1; min-width: 0; }
.news-title {
  font-size: 15px;
  font-weight: 550;
  color: var(--text);
  line-height: 1.55;
  transition: color 0.2s;
  word-break: break-word;
}
.news-title:hover { color: var(--accent-text); }
.news-comment { margin-top: 4px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.news-why { color: var(--accent-text); opacity: 0.85; }
.news-meta { margin-top: 5px; display: flex; gap: 10px; font-size: 11px; color: var(--text-3); }
.news-meta .mono { font-size: 10.5px; }
.engine-note { margin-top: 14px; font-size: 12px; color: var(--text-3); }

.archive { padding: 26px 0; border-top: 1px solid var(--border); }
.archive h2 { font-size: 16px; font-weight: 650; margin-bottom: 10px; }
.archive ul { list-style: none; columns: 2; column-gap: 28px; }
.archive li { padding: 4px 0; font-size: 13px; break-inside: avoid; }
.archive a { color: var(--text-2); }
.archive a:hover { color: var(--accent-text); }

/* ---------- 墓园 ---------- */
.graveyard-layout {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 24px 30px;
}
.gy-section { padding: 24px 0 10px; }
.gy-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.gy-head h2 { font-size: 19px; font-weight: 650; }
.gy-hint { font-size: 12px; color: var(--text-3); }
.gy-list { list-style: none; display: grid; gap: 4px; }
.gy-item {
  display: grid;
  grid-template-columns: 200px 150px 1fr;
  gap: 8px 18px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.gy-item:last-child { border-bottom: 0; }
.gy-shutdown .gy-title { text-decoration: line-through; text-decoration-color: hsl(6 60% 55% / 0.6); text-decoration-thickness: 1.5px; }
.gy-title { font-size: 14.5px; font-weight: 600; }
.gy-vendor { margin-left: 8px; font-size: 11.5px; color: var(--text-3); }
.gy-life { font-size: 11.5px; color: var(--text-3); }
.gy-note { font-size: 13px; color: var(--text-2); line-height: 1.65; }
.gy-succ { display: inline-block; margin-left: 8px; font-size: 11.5px; color: var(--accent-text); }
.gy-outro { padding: 28px 0 8px; border-top: 1px solid var(--border); }
.gy-outro p { font-size: 13.5px; color: var(--text-3); line-height: 1.8; }
@media (max-width: 760px) {
  .gy-item { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- 更新日志 ---------- */
.changelog-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 24px 30px;
}
.cl-day { padding: 18px 0 6px; }
.cl-day h2 { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.cl-list { list-style: none; display: grid; gap: 6px; }
.cl-list li { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.cl-type { flex: none; font-size: 11px; width: 40px; }
.cl-target { color: var(--text); }
.cl-note { color: var(--text-3); font-size: 12.5px; }

/* ---------- 提交页 ---------- */
.submit-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 24px 30px;
  display: grid;
  gap: 30px;
}
.submit-rules h2, .submit-how h2 { font-size: 18px; font-weight: 650; margin-bottom: 12px; }
.submit-rules ol { padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); line-height: 1.7; }
.submit-rules strong { color: var(--text); }
.submit-note { margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.submit-option { padding: 16px 0; border-bottom: 1px solid var(--border); }
.submit-option:last-child { border-bottom: 0; }
.submit-option h3 { font-size: 14.5px; font-weight: 650; margin-bottom: 6px; }
.submit-option p { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.submit-form { display: grid; gap: 10px; max-width: 420px; }
.submit-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.submit-form input {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.submit-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.submit-form .tail-cta { margin-top: 4px; justify-self: start; }

/* ---------- 404 ---------- */
.nf { max-width: 760px; margin: 0 auto; padding: calc(var(--topbar-top) + var(--header-h) + 90px) 24px 60px; text-align: left; }
.nf-code { font-size: 15px; color: var(--text-3); margin-bottom: 14px; }
.nf h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 700; margin-bottom: 14px; }
.nf p { font-size: 14.5px; color: var(--text-2); }
.nf a { color: var(--accent-text); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
