:root {
  --bg: #e8f2e4;
  --surface: #f3f9f0;
  --surface-2: #e2efdd;
  --text: #2f3a2c;
  --text-2: #5a6b55;
  --text-3: #8a9a85;
  --border: #d5e3cf;
  --accent: #2f6bff;
  --accent-soft: #dcefe0;
  --star: #f5a623;
  --new: #3b82f6;
  --new-soft: #e8f0fe;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 4px 12px rgba(20, 30, 50, 0.03);
  --shadow-h: 0 6px 16px rgba(20, 30, 50, 0.10), 0 14px 34px rgba(20, 30, 50, 0.10);
  --radius: 14px;
  --radius-lg: 18px;
}

/* 统一让 hidden 属性真正生效（避免子类 display 覆盖导致「加载中」常驻） */
[hidden] { display: none !important; }

[data-theme="dark"] {
  --bg: #0f141c;
  --surface: #161d27;
  --surface-2: #1c2530;
  --text: #e6ebf2;
  --text-2: #9aa6b6;
  --text-3: #6b7787;
  --border: #28323f;
  --accent: #5b8cff;
  --accent-soft: #1b2740;
  --star: #ffb84d;
  --new: #6ea0ff;
  --new-soft: #1e2a44;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-h: 0 6px 18px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: none;
}
.logo-img {
  height: 40px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-2);
}
.hamburger:hover { color: var(--accent); border-color: var(--accent); }

/* 搜索区：下拉选引擎 + 单输入框 + 单按钮（紧凑内嵌） */
.search-wrap {
  position: relative;
  grid-column: 3;
  justify-self: center;
  width: 100%;
  max-width: 640px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 5px 0 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-provider-wrap { position: relative; display: flex; align-items: center; flex: none; }
.search-provider-wrap::after {
  content: ""; position: absolute; right: 11px; top: 50%;
  width: 0; height: 0; margin-top: -2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-3); pointer-events: none;
}
.search-provider {
  appearance: none; -webkit-appearance: none;
  border: none; background: transparent; cursor: pointer;
  padding: 0 26px 0 14px; height: 34px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2); outline: none;
  border-right: 1px solid var(--border); margin-right: 2px;
}
.search-provider.web { color: var(--accent); }
#search {
  flex: 1; min-width: 0;
  height: 100%;
  border: none; background: transparent; color: var(--text);
  font-size: 14px; outline: none; padding: 0 6px;
}
.search-clear {
  flex: none;
  border: none; background: transparent;
  color: var(--text-3); font-size: 20px; cursor: pointer; line-height: 1;
  padding: 0 2px;
}
.search-go {
  flex: none;
  border: none; background: var(--accent); color: #fff;
  padding: 0 20px; height: 34px; border-radius: 999px;
  cursor: pointer; font-size: 13px; font-weight: 600; margin-right: 2px;
  transition: filter .12s;
}
.search-go:hover { filter: brightness(1.05); }

.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.weather {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1;
}
.weather-date { font-weight: 600; color: var(--text); }
.weather-city { color: var(--accent); font-weight: 600; cursor: pointer; }
.weather-city:hover { text-decoration: underline; }
.weather-city-input {
  width: 64px;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  outline: none;
  padding: 0 2px;
}
.weather-city-input::placeholder { color: var(--text-3); font-weight: 400; }
.weather-cond { display: inline-flex; align-items: center; gap: 3px; }
.weather-cond .w-icon { font-size: 15px; }
.weather-cond.is-fail { color: var(--text-3); font-size: 12px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: all .15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  flex: none;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 站点 logo 回退链 */
.fav {
  width: 24px; height: 24px; border-radius: 8px; overflow: hidden;
  position: relative; flex: none; display: inline-block; background: var(--surface-2);
  vertical-align: middle; margin-right: 8px;
}
.fav-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; object-fit: contain; }
.fav-letter { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-2);
}
.fav.lg { width: 44px; height: 44px; border-radius: 13px; }
.fav.lg .fav-letter { font-size: 18px; }
.fav.xl { width: 64px; height: 64px; border-radius: 18px; }
.fav.xl .fav-letter { font-size: 28px; }

/* 返佣角标 */
.aff-tag {
  font-size: 10px; line-height: 1; color: #fff; background: #e8552d;
  padding: 2px 5px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}

/* ============ 布局：边栏 + 主区 ============ */
.layout {
  display: flex;
  gap: 24px;
  max-width: min(1760px, 96vw);
  margin: 0 auto;
  padding: 20px 24px 40px;
  align-items: flex-start;
}
.sidebar {
  position: sticky;
  /* 59px 顶栏 + 20px .layout 上内边距 = 79px，正好和右侧「站长笔记」块同顶（Q先生 要求：分类栏顶头显示）。
     写成 calc 是为了以后改顶栏高度或 .layout 内边距时能一眼看出这两个数是怎么来的。 */
  top: calc(59px + 20px);
  flex: 0 0 220px;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  overflow: visible;   /* 收缩按钮要外挂到侧栏右缘，此处不能裁切 */
}
/* 滚动下移到导航本身：侧栏保持 overflow:visible，按钮才能探出右缘 */
#sideNav {
  max-height: calc(100vh - 126px);
  overflow: auto;
}
.side-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  position: relative;
  transition: background .12s, color .12s;
}
.side-cat:hover { background: var(--surface-2); color: var(--text); }
.side-cat.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-cat.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: var(--accent);
}
.side-cat .sc-icon { font-size: 16px; flex: none; }
.side-cat .sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-cat .sc-count { font-size: 12px; color: var(--text-3); flex: none; }
.side-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.side-fav { margin-top: 6px; }

/* 桌面端：左侧分类树收缩开关
   —— 绝对定位脱离文档流：不再占用侧栏顶部一行，底部"科技"分类得以完整显示
   —— 垂直居中吸附在侧栏右缘（半探出），常见的面板把手形态 */
.side-toggle {
  position: absolute;
  top: 50%;
  right: -13px;
  transform: translateY(-50%);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: 0; padding: 0;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-3); cursor: pointer;
  font-size: 13px; border-radius: 50%; line-height: 1;
  box-shadow: var(--shadow);
  transition: background .12s, color .12s, border-color .12s;
}
.side-toggle:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }

/* 折叠态：极简图标栏，去掉明显"方块感"，避免突兀 */
@media (min-width: 1081px) {
  .layout.collapsed .sidebar {
    flex: 0 0 32px; padding: 8px 0;
    background: transparent; border: none;
    border-radius: 0;
    overflow: visible;   /* 关键：允许 hover 气泡溢出 32px 盒子，否则被 overflow:auto 裁掉 */
    z-index: 40;          /* 高于右侧内容(auto)，确保气泡浮在内容之上 */
  }
  /* 折叠态必须让导航也溢出可见：否则 #sideNav 的 overflow:auto 会裁掉 hover 气泡 */
  .layout.collapsed #sideNav { overflow: visible; max-height: none; }
  .layout.collapsed .side-toggle {
    width: 26px; height: 26px; margin: 0; padding: 0;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2);
    border-radius: 50%;
    font-size: 14px; line-height: 1;
  }
  .layout.collapsed .side-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
  .layout.collapsed .side-cat { justify-content: center; padding: 10px 0; gap: 0; position: relative; }
  .layout.collapsed .side-cat .sc-name,
  .layout.collapsed .side-cat .sc-count { display: none; }
  /* 折叠态：hover 分类图标时在右侧浮出名称气泡 */
  .layout.collapsed .side-cat .sc-name {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #2f3a2c;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    pointer-events: none;
    z-index: 70;
  }
  .layout.collapsed .side-cat:hover .sc-name { display: block; }
  .layout.collapsed .side-cat.active { background: transparent; }
  .layout.collapsed .side-cat.active::before { left: 0; top: 6px; bottom: 6px; }
  .layout.collapsed .side-foot { border-top: none; margin-top: 2px; }
}

.main { flex: 1; min-width: 0; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 40px;
  margin-bottom: 24px;
  text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; }
.hero p { margin: 0; color: var(--text-2); font-size: 15px; }

/* ============ 为你精选 ============ */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.feat-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.feat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: var(--accent); }
.feat-card::before {
  content: "";
  position: absolute; left: 0; top: 0; right: 0;
  height: 3px;
  background: var(--fc, var(--accent));
  opacity: .85;
}
.feat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.feat-top .fav { margin: 0; }
.feat-name { font-weight: 600; font-size: 16px; }
.feat-tag {
  display: inline-block;
  font-size: 11px; color: var(--text-2);
  background: var(--surface-2);
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
}
.feat-desc {
  color: var(--text-2); font-size: 13px; line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feat-foot { display: flex; align-items: center; justify-content: space-between; }
.feat-heat { font-size: 12px; color: var(--text-3); }
.feat-go { font-size: 13px; font-weight: 600; color: var(--accent); }

/* ============ 工具栏：标签 + 排序 ============ */
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.tags { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding-bottom: 2px; scrollbar-width: thin; }
.tags::-webkit-scrollbar { height: 6px; }
.tags::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
.tag {
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: all .12s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(47, 107, 255, .28); }
.sort { display: flex; align-items: center; gap: 6px; flex: none; }
.sort label { font-size: 12px; color: var(--text-3); }
.sort select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.sort select:focus { border-color: var(--accent); }

/* ============ 站点网格 + 富卡片 ============ */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.site-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: var(--accent); }
.sc-top { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 22px; }
.sc-top .fav { margin: 0; }
.sc-name { font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-new {
  flex: none; font-size: 10px; font-weight: 700;
  color: var(--new); background: var(--new-soft);
  padding: 1px 7px; border-radius: 999px;
}
.sc-desc {
  color: var(--text-2); font-size: 12.5px; line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.site-card:hover .sc-desc { -webkit-line-clamp: 6; color: var(--text); }
.sc-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.sc-tag { font-size: 11px; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; flex: none; }
.sc-heat { font-size: 11px; color: var(--text-3); }
.sc-visit { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); }
.sc-star {
  position: absolute; top: 10px; right: 12px;
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--text-3); line-height: 1;
}
.sc-star.on { color: var(--star); }

.empty-tip { text-align: center; color: var(--text-3); padding: 40px 0; }

/* ============ Toast / 回到顶部 ============ */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 10px 20px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60; box-shadow: var(--shadow-h);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.back-top {
  position: fixed; right: 24px; bottom: 28px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--accent); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s;
  z-index: 40;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { border-color: var(--accent); }

/* 移动端边栏遮罩 */
.scrim { display: none; position: fixed; inset: 0; background: rgba(10, 16, 24, .45); z-index: 44; }
.scrim.show { display: block; }

/* ============ 底栏（多列） ============ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 24px 28px;
  margin-top: 30px;
}
.footer-cols {
  max-width: min(1760px, 96vw); margin: 0 auto 20px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 24px;
}
.footer-brand .f-logo { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.footer-brand p { color: var(--text-3); font-size: 12.5px; line-height: 1.7; margin: 0; }
.footer-col h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.footer-col a { display: block; color: var(--text-2); font-size: 12.5px; padding: 4px 0; text-decoration: none; }
.footer-col a:hover { color: var(--accent); }

/* 全站导航带：全部分类 + 精选专栏，静态直出，给蜘蛛一张全站地图 */
.footer-sitenav {
  max-width: min(1760px, 96vw); margin: 0 auto 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.footer-sitenav h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.footer-sitenav .fsn-line { font-size: 12.5px; line-height: 2; margin-bottom: 8px; }
.footer-sitenav a { color: var(--text-2); text-decoration: none; display: inline-block; margin: 0 12px 2px 0; }
.footer-sitenav a:hover { color: var(--accent); }
.footer-bottom {
  max-width: min(1760px, 96vw); margin: 0 auto; padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.footer-bottom .copyright { color: var(--text-3); font-size: 12px; margin: 0; }
.footer-bottom .copyright a.beian-link { color: var(--accent); text-decoration: none; }
.footer-bottom .copyright a.beian-link:hover { text-decoration: underline; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-2); font-size: 12.5px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ============ 常驻备案底栏（固定视口最低端，不随加载消失） ============ */
body { padding-bottom: 40px; }
.beian-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 12px; line-height: 1.5;
}
.beian-bar .bb-copy { color: var(--text-3); }
.beian-bar .bb-link { color: var(--accent); text-decoration: none; }
.beian-bar .bb-link:hover { text-decoration: underline; }
.beian-bar .bb-sep { color: var(--border); }
.bb-icon, .beian-icon { height: 14px; width: auto; vertical-align: -2px; margin-right: 3px; border-radius: 2px; }
@media (max-width: 640px) {
  body { padding-bottom: 52px; }
  .beian-bar { font-size: 11px; padding: 7px 10px; gap: 6px; }
}

/* ============ 模态（提交收录） ============ */
.modal { position: fixed; inset: 0; background: rgba(10,16,24,.5); display: grid; place-items: center; z-index: 50; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); width: min(420px, 92vw); border-radius: var(--radius); padding: 22px; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 12px; top: 8px; border: none; background: transparent; font-size: 22px; color: var(--text-3); cursor: pointer; line-height: 1; }
.modal-title { margin: 0 0 16px; font-size: 16px; }
.submit-form { display: flex; flex-direction: column; gap: 10px; }
.submit-form input, .submit-form select, .submit-form textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2); color: var(--text); font-size: 14px; font-family: inherit; outline: none;
}
.submit-form input:focus, .submit-form select:focus, .submit-form textarea:focus { border-color: var(--accent); }
.submit-btn { border: none; background: var(--accent); color: #fff; padding: 11px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.submit-tip { margin: 12px 0 0; font-size: 13px; color: var(--accent); min-height: 18px; }

/* ============ 中转 / 详情页 ============ */
.detail { max-width: 760px; margin: 8px auto; }
.detail-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 30px 30px;
  text-align: center;
  overflow: hidden;
}
.detail-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #7aa6ff);
}
.detail-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 18px; padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.detail-top { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 18px; }
.detail-top .fav { margin: 0; }
.detail-meta { text-align: left; }
.detail-name { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-domain { font-size: 12px; font-weight: 400; color: var(--text-3); }
.detail-tags { display: flex; gap: 6px; margin: 6px 0 2px; flex-wrap: wrap; }
.detail-tags .d-tag { font-size: 11px; color: var(--text-2); background: var(--surface-2); padding: 2px 9px; border-radius: 999px; }
.detail-sub { color: var(--text-3); font-size: 12px; }
.detail-desc { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 0 0 18px; text-align: left; }
.launch {
  display: inline-block;
  margin: 4px auto;
  padding: 13px 46px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #6f9bff);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.28);
  transition: transform .15s, box-shadow .15s, filter .15s;
  cursor: pointer;
}
.launch:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(47, 107, 255, 0.36); filter: brightness(1.04); }
.detail-note { color: var(--text-3); font-size: 12px; margin: 8px 0 0; }
.rel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rel-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px; background: var(--surface-2);
  transition: background .12s;
}
.rel-item:hover { background: var(--accent-soft); }
.rel-name { font-weight: 600; }
.rel-desc { font-size: 12px; color: var(--text-3); text-align: center; }
.ad-slot { margin: 22px auto; max-width: 760px; min-height: 1px; }

/* ============ 分类独立页依赖（保留） ============ */
.container { max-width: 1180px; margin: 0 auto; padding: 12px 24px 40px; }
.back-link { display: inline-block; margin: 16px 0 6px; color: var(--accent); font-size: 14px; font-weight: 600; }
.cat-head-page { font-size: 18px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; max-width: 760px; margin-top: 6px; }
#search.cat-search { padding-left: 18px; padding-right: 40px; }
.cat-clear { right: 10px; }
.tagline {
  text-align: center; margin: 18px auto 2px;
  font-size: 18px; font-weight: 600; letter-spacing: 2px; color: var(--text-2);
}
.tagline::before, .tagline::after {
  content: ""; display: inline-block; width: 22px; height: 1px;
  background: var(--border); vertical-align: middle; margin: 0 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px 4px; max-width: 1180px; margin: 0 auto; }
.chips .chip { padding: 6px 13px; font-size: 13px; }
.chips .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.section-title { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--text); }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; max-height: none; border-radius: 0;
    transform: translateX(-100%); transition: transform .25s;
    z-index: 45; box-shadow: var(--shadow-h);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .side-toggle { display: none; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .weather { display: none; }
  .layout { padding: 14px; }
  .feat-grid { grid-template-columns: 1fr; }
  .site-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ============ 分屏懒加载提示 ============ */
.sentinel { height: 1px; }
.load-tip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 0; color: var(--text-3); font-size: 13px;
}
.load-tip .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  display: inline-block; animation: jdh-spin .7s linear infinite;
}
@keyframes jdh-spin { to { transform: rotate(360deg); } }
.list-end {
  text-align: center; padding: 16px 0 4px;
  color: var(--text-3); font-size: 13px;
}

/* ============ 首页顶栏（双行：信息行 + VA 搜索行） ============ */
.home-topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px;
  padding: 8px 20px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { justify-self: start; }
.setwrap { justify-self: center; }
.top-info { justify-self: end; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.brand-en { font-size: 10px; color: var(--text-3); letter-spacing: 1px; }
.top-info { display: flex; align-items: center; gap: 10px; flex: none; justify-self: end; }
.setwrap { position: relative; justify-self: center; }
.set-bubble {
  position: absolute; top: calc(100% + 10px); right: 0; width: 300px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-h); padding: 14px; z-index: 50;
  font-size: 12px; color: var(--text); text-align: left;
}
.set-bubble[hidden] { display: none; }
.set-bubble h4 { margin: 0 0 8px; font-size: 13px; color: var(--accent); }
.set-bubble ol { margin: 0 0 10px 18px; padding: 0; color: var(--text-2); line-height: 1.7; }
.set-copy { display: flex; gap: 6px; }
.set-copy input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.set-copy button { border: none; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 12px; font-size: 12px; cursor: pointer; flex: none; }

/* VA 标签置顶搜索（已改为紧凑内嵌搜索，样式保留 .search-wrap） */

/* 首页顶栏响应式 */
@media (max-width: 980px) {
  .home-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 14px; }
  .brand { justify-self: start; }
  .setwrap { justify-self: start; }
  .top-info { justify-self: end; margin-left: auto; flex-wrap: wrap; gap: 8px; }
  .search-wrap { grid-column: auto; justify-self: stretch; order: 4; flex-basis: 100%; max-width: none; margin: 0; }
}
@media (max-width: 640px) {
  .brand-en { display: none; }
  .weather { display: none; }
}

/* ===== 站长笔记（首页区块 · 带封面轮播）=====
   卡片是 node build_all.js 在 NOTES_LATEST_START/END 标记之间静态写入的，
   不依赖 JS 渲染，蜘蛛能直接抓到链接与标题。JS 只负责翻页滚动，不参与内容生成。
   轮播用「原生横向滚动 + scroll-snap」实现：手机可直接手指滑，箭头只做 scrollBy。 */
/* 2026-09-16：本块已从 .layout 外面移进 <main> 内部（见 index.html）。
   移进来的原因是：放在外面时它会把整条 .layout（含左侧分类栏）往下压 476px，
   导致左上角一大片空白、分类栏不顶头。进 main 之后侧栏与笔记块同顶对齐。
   因此这里不能再写 max-width / auto margin / 水平 padding —— 宽度由 <main> 决定。 */
.notes-strip { margin: 0 0 18px; padding: 0; }
.notes-head { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.notes-head h2 { font-size: 16px; margin: 0; color: var(--text); }
.notes-more { margin-left: auto; font-size: 13px; color: var(--accent); text-decoration: none; }
.notes-more:hover { text-decoration: underline; }
.notes-lead { margin: 0 0 12px; color: var(--text-3); font-size: 13px; line-height: 1.7; }

/* 视口：横向滚动 + 吸附；滚条隐藏，翻页交给箭头/手指 */
.nc-viewport {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px;
}
.nc-viewport::-webkit-scrollbar { display: none; }

.note-card {
  flex: 0 0 calc((100% - 28px) / 3); scroll-snap-align: start;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none;
  transition: border-color .12s, box-shadow .12s;
}
.note-card:hover { border-color: var(--accent); box-shadow: var(--shadow-h); }
/* 封面：有图用图，没图时由构建脚本塞一张内联 SVG 兜底（按分类配色），不会留白块 */
.nc-cover { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.nc-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nc-cover svg { display: block; width: 100%; height: 100%; }
/* flex:1 让正文撑满卡片剩余高度 —— 否则摘要短的卡片底部会留一截空白，
   三张卡边框下沿参差不齐（2026-09-16 实测：1、2 号卡 body 140px、3 号 161px）。 */
.nc-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 12px 14px 15px; }
.note-card .nc-d { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }
.note-card .nc-t {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; margin-bottom: 6px;
}
.note-card:hover .nc-t { color: var(--accent); }
.note-card .nc-s {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 12.5px; color: var(--text-2); line-height: 1.65;
}

.nc-nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.nc-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .12s, color .12s, opacity .12s;
}
.nc-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nc-btn:disabled { opacity: .3; cursor: default; }
.nc-pgs { margin-left: auto; font-size: 12px; color: var(--text-3); }

@media (max-width: 860px) {
  .note-card { flex: 0 0 calc((100% - 14px) / 2); }
}
@media (max-width: 560px) {
  .note-card { flex: 0 0 100%; }
}
