/* ============================================================
   前台公共样式 · 现代内容聚合站观感（自托管，无外部依赖）
   复用 theme.css 的设计变量：--accent / --ink / --line / --radius 等
   ============================================================ */

/* ============================================================
   深色主题变量（AIHOT 风格）
   默认浅色（继承 theme.css 的浅色变量）；
   当 body 加 data-theme="dark" 时切换到深色。
   切换由顶栏 JS 控制，存 localStorage('theme')。
   ============================================================ */
body.bg-light[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --line: #21262d;
  --ink: #e6edf3;
  --ink-2: #c9d1d9;
  --muted: #8b949e;
  --accent: #7c8bff;
  --accent-600: #818cf8;
  --accent-700: #6366f1;
  --accent-soft: rgba(99, 102, 241, .14);
  background-color: var(--bg) !important;
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 深色下的覆盖样式（顶栏、徽章、hero 等） */
body.bg-light[data-theme="dark"] .site-nav {
  background: rgba(13, 17, 23, .85);
}
body.bg-light[data-theme="dark"] .nav-search input {
  background: var(--bg);
}
body.bg-light[data-theme="dark"] .nav-search input:focus {
  background: var(--surface);
}
body.bg-light[data-theme="dark"] .btn-admin {
  background: var(--accent);
}
body.bg-light[data-theme="dark"] .btn-admin:hover {
  background: var(--accent-600);
}
body.bg-light[data-theme="dark"] .lang-badge--en { background: rgba(59, 130, 246, .15); color: #93c5fd; border-color: rgba(59, 130, 246, .35); }
body.bg-light[data-theme="dark"] .lang-badge--ja { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
body.bg-light[data-theme="dark"] .lang-badge--ko { background: rgba(34, 197, 94, .15); color: #86efac; border-color: rgba(34, 197, 94, .35); }
body.bg-light[data-theme="dark"] .lang-badge--de,
body.bg-light[data-theme="dark"] .lang-badge--fr { background: rgba(245, 158, 11, .15); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
body.bg-light[data-theme="dark"] .lang-badge--ru { background: rgba(168, 85, 247, .15); color: #d8b4fe; border-color: rgba(168, 85, 247, .35); }
body.bg-light[data-theme="dark"] .article-page .alert.alert-light {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink-2) !important;
}
body.bg-light[data-theme="dark"] .article-page .alert.alert-light strong { color: var(--ink); }
body.bg-light[data-theme="dark"] .article-page .bg-light { background: var(--surface) !important; }
body.bg-light[data-theme="dark"] .article-page .border-top { border-color: var(--line) !important; }
body.bg-light[data-theme="dark"] .article-page .text-muted { color: var(--muted) !important; }
body.bg-light[data-theme="dark"] .article-page .text-danger { color: #f87171 !important; }

/* ============================================================
   浅色主题下的原有样式覆写（之前已删除硬编码，需要补回）
   ============================================================ */
/* 浅色顶栏 */
body.bg-light:not([data-theme="dark"]) .site-nav {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
}

/* 推荐理由（规则生成，零 token） */
.tl-reason {
  margin: 6px 0 0;
  padding: 6px 10px;
  background: rgba(124, 92, 255, .06);
  border-left: 3px solid rgba(124, 92, 255, .35);
  border-radius: 0 6px 6px 0;
  font-size: .82rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.tl-reason__label {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--accent-700);
  background: rgba(124, 92, 255, .12);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  letter-spacing: .02em;
  vertical-align: 1px;
}
body.bg-light[data-theme="dark"] .tl-reason {
  background: rgba(124, 139, 255, .08);
  border-left-color: rgba(124, 139, 255, .4);
  color: var(--ink-2);
}
body.bg-light[data-theme="dark"] .tl-reason__label {
  color: var(--accent);
  background: rgba(124, 139, 255, .15);
}

/* 详情页推荐理由 */
.tl-reason-detail {
  background: rgba(124, 92, 255, .06) !important;
  border-left-color: rgba(124, 92, 255, .5) !important;
}
.tl-reason-detail strong {
  color: var(--accent-700);
}
body.bg-light[data-theme="dark"] .tl-reason-detail {
  background: rgba(124, 139, 255, .1) !important;
  border-left-color: rgba(124, 139, 255, .5) !important;
}
body.bg-light[data-theme="dark"] .tl-reason-detail strong {
  color: var(--accent);
}
body.bg-light:not([data-theme="dark"]) .nav-search input {
  background: var(--bg);
}
body.bg-light:not([data-theme="dark"]) .nav-search input:focus {
  background: #fff;
}
body.bg-light:not([data-theme="dark"]) .btn-admin {
  background: var(--ink);
}
body.bg-light:not([data-theme="dark"]) .btn-admin:hover {
  background: #1e293b;
}
body.bg-light:not([data-theme="dark"]) .lang-badge--en { background: #eef4ff; color: #1d4ed8; border-color: #c7d7fa; }
body.bg-light:not([data-theme="dark"]) .lang-badge--ja { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
body.bg-light:not([data-theme="dark"]) .lang-badge--ko { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
body.bg-light:not([data-theme="dark"]) .lang-badge--de,
body.bg-light:not([data-theme="dark"]) .lang-badge--fr { background: #fffbeb; color: #b45309; border-color: #fde68a; }
body.bg-light:not([data-theme="dark"]) .lang-badge--ru { background: #faf5ff; color: #6b21a8; border-color: #e9d5ff; }

/* ---------------- 顶栏 ---------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.site-nav .container {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
  max-width: 1140px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.12rem;
  white-space: nowrap;
}
.site-brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.site-brand .brand-text { letter-spacing: .3px; }

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
}
.site-nav .nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0 13px;
  height: 36px;
  line-height: 36px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 1rem;
  transition: background .15s, color .15s;
}
.site-nav .nav-links a:hover {
  background: var(--bg);
  color: var(--accent-600);
}

.site-nav .nav-search {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 260px;
  height: 36px;
}
.site-nav .nav-search__icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.site-nav .nav-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0 16px 0 36px;
  font-size: .9rem;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.site-nav .nav-search input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .14);
}

.site-nav .btn-admin {
  flex: 0 0 auto;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.site-nav .btn-admin:hover { background: var(--accent-600); color: #fff; }

/* 主题切换按钮：太阳/月亮图标 */
.theme-toggle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background .15s, color .15s, border-color .15s, transform .2s;
  position: relative;
}
.theme-toggle:hover {
  background: var(--bg);
  color: var(--accent-600);
  border-color: var(--accent);
}
.theme-toggle:active { transform: scale(0.92); }
.theme-icon {
  width: 16px;
  height: 16px;
  position: absolute;
  transition: opacity .2s, transform .2s;
}
/* 浅色：显示月亮（点击变深色） */
body:not([data-theme="dark"]) .theme-icon--sun {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}
body:not([data-theme="dark"]) .theme-icon--moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}
/* 深色：显示太阳（点击变浅色） */
body[data-theme="dark"] .theme-icon--sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}
body[data-theme="dark"] .theme-icon--moon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

/* ---------------- 布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
.layout--no-side { grid-template-columns: 1fr; }
.layout--article { grid-template-columns: 1fr 300px; }   /* 桌面双栏：正文 + 右侧标签/相关文章 */
.layout-main { min-width: 0; }
.layout-side { min-width: 0; }

/* 文章页右侧延伸区：标签 + 相关文章（侧栏内纵向堆叠） */
.article-extras {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
/* 平板/手机：单栏，标签与相关文章落到正文下方，并加分隔线 */
@media (max-width: 980px) {
  .layout--article > .layout-side { order: 2; }   /* 覆盖全局 .layout-side{order:-1}，落正文下 */
  .article-extras { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
}

/* ---------------- 分类 tab 栏（首页主区顶部） ---------------- */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  /* 吸顶：随文章列表滚动时固定在顶栏下方，始终可见 */
  position: sticky;
  top: 64px;              /* 顶栏高度 64px */
  z-index: 1020;          /* 低于顶栏 1030，避免盖住顶栏下拉 */
  background: var(--bg);  /* 遮住底下滚过的内容 */
  padding: 8px 0;         /* 上下留白，视觉不贴边 */
  /* 吸顶时的底部细阴影：用 box-shadow 在 sticky 生效时自然浮现，
     下方内容滚过时阴影显影，静止时几乎不可见，层次柔和 */
  box-shadow: 0 1px 0 var(--line), 0 6px 12px -8px rgba(15, 23, 42, .08);
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-2);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s, background .15s;
  min-height: 36px;
}
.cat-tab:hover {
  color: var(--accent-600);
  border-color: var(--accent);
}
.cat-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.cat-tab .cat-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.cat-tab.active .cat-cnt {
  color: #fff;
  background: rgba(255, 255, 255, .28);
}

/* ============================================================
   顶部条：标题 + 副标题 + 搜索 + 排序（一行）
   ============================================================ */
.index-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 18px;
}
.index-bar__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
.index-bar__title h1 {
  font-weight: 800;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: -.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.index-bar__count {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
}
.index-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 360px;
  justify-content: flex-end;
}
.index-search__field {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 36px;
  height: 38px;
  flex: 1 1 240px;
  max-width: 360px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.index-search__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.index-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  min-width: 14px; min-height: 14px;
  max-width: 14px; max-height: 14px;
  flex-shrink: 0;
  color: var(--muted);
  pointer-events: none;
  stroke-width: 2.25;
}
.index-search__field input[name="q"] {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font-size: .9rem; color: var(--ink);
  outline: none; height: 100%;
}
.index-search__field input[name="q"]::placeholder { color: var(--muted); }
.index-search__clear {
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: .9rem; padding: 0 4px;
  line-height: 1;
}
.index-search__clear:hover { color: var(--ink); }
.sort-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.sort-tabs a {
  text-decoration: none;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all .15s;
}
.sort-tabs a:hover { color: var(--ink); }
.sort-tabs a.active {
  background: var(--accent);
  color: #fff;
}

/* ---------------- 精选大卡 ---------------- */
.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  margin-bottom: 24px;
  transition: transform .18s, box-shadow .18s;
}
.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
}
.hero-card__cover {
  min-height: 180px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  background-size: cover;
  background-position: center;
}
.hero-card__body {
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-card__body .chip {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-600);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-card__body h2 {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 10px;
}
.hero-card__body p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-card__body .meta {
  color: var(--muted);
  font-size: .82rem;
}

/* ---------------- 文章卡片网格 ---------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.post-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}
.post-card__cover {
  position: relative;
  flex: 0 0 150px;
  min-height: 106px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  background-size: cover;
  background-position: center;
}
.post-card__cover.is-empty::after {
  /* 无图时叠加柔光纹理，避免纯色呆板 */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(100% 80% at 0% 100%, rgba(255, 255, 255, .14), transparent 55%);
}
.post-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.post-card__badge.wechat { background: rgba(229, 56, 53, .92); }
.post-card__badge.web { background: rgba(15, 23, 42, .72); }
.post-card__body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
}
.post-card__title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.42;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta {
  color: var(--muted);
  font-size: .76rem;
  margin: 0;
}
.post-card__meta .dot { margin: 0 4px; }
.post-card__excerpt {
  color: var(--ink-2);
  font-size: .84rem;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-height: 0;
}
.post-card__tags span {
  font-size: .72rem;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.post-card__tags .tag-more {
  color: var(--accent-600);
  font-weight: 600;
  background: transparent;
  padding: 1px 2px;
}
.lang-text {
  font-size: .72rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------------- 侧栏组件 ---------------- */
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.widget__head {
  padding: 14px 16px;
  font-weight: 700;
  color: var(--ink);
  font-size: .95rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget__head svg { width: 17px; height: 17px; color: var(--accent); }
.widget__body { padding: 14px 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 999px;
  transition: all .15s;
}
.chip-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip-btn.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip-btn .cnt {
  font-size: .74rem;
  opacity: .8;
  margin-left: 4px;
}
.src-list { list-style: none; margin: 0; padding: 0; }
.src-list li + li { border-top: 1px solid var(--line); }
.src-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: .88rem;
  transition: color .15s;
}
.src-list a:hover { color: var(--accent-600); }
.src-list .src-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-list .src-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}
.src-list .src-dot.wechat { background: #e53835; }
.src-list .src-dot.web { background: var(--accent); }
.mini-tag {
  display: inline-block;
  text-decoration: none;
  font-size: .8rem;
  color: var(--accent-600);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0 6px 6px 0;
}
.mini-tag:hover { background: var(--accent); color: #fff; }

/* ---------------- 空状态提示 ---------------- */
.empty-tip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-tip p { margin: 0; }
.empty-tip a { color: var(--accent-600); text-decoration: none; }
.empty-tip a:hover { text-decoration: underline; }

/* ---------------- 分页 ---------------- */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  font-size: .88rem;
}
.page-nav a, .page-nav span {
  text-decoration: none;
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
}
.page-nav a:hover { border-color: var(--accent); color: var(--accent-600); }
.page-nav .cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-nav .disabled, .page-nav .disabled:hover { color: #cbd5e1; border-color: var(--line); cursor: default; }
.page-nav .info { border: none; background: transparent; color: var(--muted); font-weight: 500; }

/* ---------------- 检索结果条 ---------------- */
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.result-bar h6 { margin: 0; font-weight: 700; color: var(--ink); font-size: 1rem; }
.result-bar .total { color: var(--muted); font-weight: 500; }

/* ---------------- 详情页 ---------------- */
.article-page { max-width: 1200px; margin: 0 auto; }
.article-page .doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
}
@media (min-width: 1400px) {
  .article-page .doc { padding: 28px 32px; }
}
/* 正文块填满 .doc；标题 / 元信息 / 提示块稍窄作视觉层级 */
.article-page .article-content { max-width: 100%; }

/* 防御：正文是原始抓取 HTML（content_html|safe），可能残留 position:fixed / 超高 z-index /
   超宽表格图片，会盖住左侧固定导航（栏目菜单）或撑破布局。统一降权定位 + 限宽 + 裁剪溢出。 */
.article-page .article-content {
  position: relative;
  overflow: hidden;            /* 裁剪水平溢出，避免撑出横向滚动/盖住右栏 */
}
.article-page .article-content *,
.article-page .article-content *::before,
.article-page .article-content *::after {
  position: static !important;   /* 取消 fixed/absolute/sticky，杜绝盖住固定导航 */
  max-width: 100% !important;    /* 超宽表格/图片限宽，不溢出正文容器 */
}
/* 标题 / 摘要 / 转载保留 920px 居中（中文 35–45 字行长，视觉呼吸） */
.article-page h1, .article-page .doc-meta, .article-page .alert, .article-page .reprint-notice {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.article-page h1 { font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1.4; margin: 0 0 14px; }
.article-page .doc-meta {
  color: var(--muted);
  font-size: .84rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.article-page .doc-meta .badge {
  font-size: .72rem;
  align-self: center;
}
/* 兜底：微信正文根节点 #js_content 可能残留 visibility:hidden;opacity:0 的初始隐藏样式
   （微信靠自身 JS 加载后解除，聚合站无该 JS），强制可见避免正文整块空白 */
.article-page .rich_media_content {
  visibility: visible !important;
  opacity: 1 !important;
}
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.side-card__head {
  padding: 13px 16px;
  font-weight: 700;
  color: var(--ink);
  font-size: .92rem;
  border-bottom: 1px solid var(--line);
}
.side-card__body { padding: 14px 16px; font-size: .88rem; }

/* ---------------- 页脚 ---------------- */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 0;
  margin-top: 40px;
}
.site-foot__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
}
.site-foot a { color: var(--accent-600); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .layout-side { order: -1; }
  /* 平板：栏目胶囊稍微紧凑，仍可换行但不至于太散 */
  .cat-tab { padding: 8px 14px; }
}
@media (max-width: 720px) {
  .site-nav .nav-links { display: none; }
  .site-nav .container { gap: 12px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card__cover { min-height: 150px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card__cover { flex: 0 0 120px; }
  .article-page .doc { padding: 22px 18px; }

  /* ===== 栏目导航：单行横向滑动（swipe），不换行堆叠 ===== */
  .category-tabs {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;               /* Firefox 隐藏滚动条 */
    margin: 0 -4px 12px;                 /* 抵消左右内边距，让滑动贴满屏幕 */
    padding: 8px 4px;                    /* 覆盖基类 padding，吸顶时不贴边 */
    scroll-snap-type: x proximity;
    /* 左缘渐隐遮罩：提示左侧还有更多栏目 */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px);
    mask-image: linear-gradient(to right, transparent 0, #000 12px);
  }
  .category-tabs::-webkit-scrollbar { display: none; }  /* Chrome/Safari 隐藏 */
  .cat-tab {
    flex: 0 0 auto;                       /* 不被压缩 */
    scroll-snap-align: start;
    padding: 7px 13px;
    font-size: .84rem;
    min-height: 32px;
    white-space: nowrap;                  /* 名字不折行 */
  }
  .cat-tab .cat-cnt {
    font-size: .68rem;
    padding: 1px 6px;
    min-width: 16px;
  }
}

/* ============================================================
   首页封面优化（V2）：改回 cover 填满，避免 contain 大留白
   之前 contain 模式下，竖图/方图在封面区里只占中央一小块，
   周围大块浅色留白视觉很差。
   改用 cover + 顶部对齐：图片填满，公众号头图主要内容在顶部时不被裁掉。
   ============================================================ */
.post-card__cover {
  background-color: var(--accent-soft);
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

/* ====== 增强字段渲染：语言徽章 / 分数圆点 / 双语标题 ====== */
.post-card__topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  margin-bottom: 2px;
}
.lang-badge {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  text-transform: uppercase;
}
.lang-badge--en { background: rgba(59, 130, 246, .15); color: #93c5fd; border-color: rgba(59, 130, 246, .35); }
.lang-badge--ja { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.lang-badge--ko { background: rgba(34, 197, 94, .15); color: #86efac; border-color: rgba(34, 197, 94, .35); }
.lang-badge--de,
.lang-badge--fr { background: rgba(245, 158, 11, .15); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
.lang-badge--ru { background: rgba(168, 85, 247, .15); color: #d8b4fe; border-color: rgba(168, 85, 247, .35); }
.score-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 2px var(--bg);
}
.score-dot--high { background: #16a34a; }
.score-dot--mid  { background: #2563eb; }
.score-dot--low  { background: #9ca3af; }
.post-card__title .title-zh {
  display: block;
  color: var(--ink);
}
.post-card__title .title-original {
  display: block;
  font-size: .76rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.hero-card__body h2 .title-zh { display: block; }
.hero-card__body h2 .title-original {
  display: block;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
/* 详情页：双行标题 + 增强徽章 */
.article-page h1 .title-original {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
/* 无封面占位：恢复品牌渐变铺满 */
.post-card__cover.is-empty {
  background-color: transparent;
  background-size: cover;
}

/* ============================================================
   时间线卡片（AIHOT 风格）
   单列垂直流：左侧时间戳 + 节点连线，右侧内容卡
   ============================================================ */
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 18px 1fr;
  gap: 0;
  padding: 14px 0 14px 0;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
  box-shadow: none;
  transition: none;
}
.tl-item:hover { transform: none; box-shadow: none; }

/* 时间戳列 */
.tl-time {
  text-align: right;
  padding-right: 12px;
  padding-top: 4px;
  flex: 0 0 auto;
}
.tl-time__date {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.2;
}
.tl-time__clock {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* 节点圆点 + 纵向连线（AIHOT 风格：细圆点 + 半透连线） */
.tl-node {
  position: relative;
  width: 16px;
  display: flex;
  justify-content: center;
  padding-top: 16px;
}
.tl-node::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  z-index: 2;
  position: relative;
  transition: background .15s, box-shadow .15s, transform .15s;
  opacity: .55;
}
.tl-node::after {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -14px;
  left: 50%;
  width: 1px;
  background: var(--line);
  transform: translateX(-.5px);
  opacity: .7;
}
.tl-item:last-child .tl-node::after { display: none; }
.tl-item:first-child .tl-node::before {
  /* 第一项节点用品牌色 */
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tl-item:hover .tl-node::before {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* 卡片主体 */
.tl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px 14px;
  margin-left: 8px;
  transition: border-color .15s, background .15s;
}
.tl-item:hover .tl-card {
  border-color: var(--accent);
}

/* meta 行 */
.tl-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.tl-source {
  color: var(--accent);
  font-weight: 600;
  font-size: .78rem;
}
.tl-author { color: var(--ink-2); font-weight: 500; }
.tl-wc { color: var(--muted); }

/* 标题 */
.tl-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin: 0 0 8px;
}
.tl-title .title-zh { display: block; }
.tl-title .title-original {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* 摘要 */
.tl-excerpt {
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 标签 */
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tl-tag {
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
}
.tl-tag:hover { color: var(--accent); border-color: var(--accent); }
.tl-tag--more {
  color: var(--accent-600);
  font-weight: 600;
  background: transparent;
  border-color: transparent;
}

/* 容器：列表 */
/* 首页动态区：列表与内联文章共用容器 */
.list-region { min-height: 240px; }
.article-view__bar { margin: 2px 0 16px; }
.article-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.article-back:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.article-back:active { transform: scale(.96); }

.tl-list { padding: 0; margin: 0; }

/* ============================================================
   日期分组头（AIHOT 风格）
   ## 9月8日今天9月8日 周二
   星期二 · 4 条
   ============================================================ */
.day-group {
  padding: 22px 0 14px;
  position: relative;
}
.day-group:first-child { padding-top: 8px; }

.day-group__h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.day-group__date { color: var(--ink); }
.day-group__today {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
  vertical-align: middle;
  margin-left: 2px;
}
.day-group__weekday {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
}
.day-group__cnt {
  margin-left: auto;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 12px;
}

/* ============================================================
   深色模式：覆盖 Bootstrap 的浅色提示框 / 转载声明
   ============================================================ */
/* 摘要 alert-light → 深色化 */
.article-page .alert.alert-light {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink-2) !important;
}
.article-page .alert.alert-light strong { color: var(--ink); }
.article-page .alert.alert-light .border-secondary { border-color: var(--line) !important; }

/* 转载声明 bg-light → 深色化 */
.article-page .bg-light {
  background: var(--surface) !important;
}
.article-page .border-top { border-color: var(--line) !important; }

/* Bootstrap 文本色覆写（深色模式下一些 .text-muted 颜色变浅） */
.article-page .text-muted { color: var(--muted) !important; }
.article-page .text-decoration-none { color: inherit; }
.article-page .text-decoration-none:hover { color: var(--accent); }
.article-page .text-danger { color: #f87171 !important; }

/* ============================================================
   正文排版 .article-content
   正文是抓取来的原始 HTML，带大量内联样式（微信常见 color:#3d3d3d
   深灰字 + background:#fff 白底）。内联样式优先级高于普通选择器，
   因此深色主题下必须用 !important 强制反转，否则黑底深灰字看不见。
   ============================================================ */

/* —— 通用排版（浅色 / 深色共用，颜色一律走 CSS 变量）—— */
.article-content {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-2);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  margin: 1.6em 0 .7em;
}
.article-content h1 { font-size: 1.55rem; }
.article-content h2 { font-size: 1.32rem; }
.article-content h3 { font-size: 1.14rem; }
.article-content h4,
.article-content h5,
.article-content h6 { font-size: 1.02rem; }
.article-content p { margin: 0 0 1.15em; }
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content a:hover { color: var(--accent-600); }
.article-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 1em auto;
  border-radius: 8px;
}
.article-content ul,
.article-content ol { margin: 0 0 1.15em; padding-left: 1.6em; }
.article-content li { margin-bottom: .45em; }
.article-content blockquote {
  margin: 1.3em 0;
  padding: .7em 1em;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  color: var(--muted);
  border-radius: 0 8px 8px 0;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.article-content table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 1.2em 0;
  display: block;
  overflow-x: auto;
}
.article-content th,
.article-content td {
  border: 1px solid var(--line) !important;
  padding: 8px 10px;
}
.article-content th {
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
}
.article-content pre {
  background: var(--bg) !important;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.article-content code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: .9em;
}
.article-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
}
.article-content iframe,
.article-content video { max-width: 100%; }

/* —— 深色主题：强制反转抓取内容的内联深色文字与白底 —— */
body.bg-light[data-theme="dark"] .article-content {
  color: #e6edf3 !important;
  background-color: transparent !important;
}
/* 清掉内联的深灰字与白底色块；!important 才能压过内联样式 */
body.bg-light[data-theme="dark"] .article-content * {
  color: #e6edf3 !important;
  background-color: transparent !important;
  border-color: #21262d !important;
  box-shadow: none !important;
  -webkit-text-fill-color: #e6edf3 !important;
}
/* 标题与加粗：再亮一档 */
body.bg-light[data-theme="dark"] .article-content h1,
body.bg-light[data-theme="dark"] .article-content h2,
body.bg-light[data-theme="dark"] .article-content h3,
body.bg-light[data-theme="dark"] .article-content h4,
body.bg-light[data-theme="dark"] .article-content h5,
body.bg-light[data-theme="dark"] .article-content h6,
body.bg-light[data-theme="dark"] .article-content strong,
body.bg-light[data-theme="dark"] .article-content b {
  color: #f0f6fc !important;
  -webkit-text-fill-color: #f0f6fc !important;
}
/* 链接 */
body.bg-light[data-theme="dark"] .article-content a,
body.bg-light[data-theme="dark"] .article-content a * {
  color: #a5b4fc !important;
  -webkit-text-fill-color: #a5b4fc !important;
}
/* 署名 / 图注等次要文字 */
body.bg-light[data-theme="dark"] .article-content small,
body.bg-light[data-theme="dark"] .article-content figcaption {
  color: #8b949e !important;
  -webkit-text-fill-color: #8b949e !important;
}
/* 引用块：保留可辨识的底色 */
body.bg-light[data-theme="dark"] .article-content blockquote {
  background: #161b22 !important;
  border-left-color: var(--accent) !important;
}
/* 表头 */
body.bg-light[data-theme="dark"] .article-content th {
  background: #161b22 !important;
  color: #f0f6fc !important;
  -webkit-text-fill-color: #f0f6fc !important;
}
/* 代码块：深色底 + 亮字（必须放在 * 通配规则之后才能生效） */
body.bg-light[data-theme="dark"] .article-content pre,
body.bg-light[data-theme="dark"] .article-content pre *,
body.bg-light[data-theme="dark"] .article-content code {
  background: #0b0f14 !important;
  color: #d1d9e0 !important;
  -webkit-text-fill-color: #d1d9e0 !important;
}
body.bg-light[data-theme="dark"] .article-content pre {
  border-color: #21262d !important;
}
body.bg-light[data-theme="dark"] .article-content pre code {
  background: transparent !important;
}

/* ============================================================
   流式宽度：顶栏 / 主区 / 页脚统一铺满浏览器，随窗口变化
   （覆盖 Bootstrap .container 的 max-width 断点，消除两侧留白）
   ============================================================ */
.site-fluid {
  width: 100%;
  max-width: 2240px !important;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 2.4vw, 44px);
  padding-right: clamp(16px, 2.4vw, 44px);
}

/* 超宽屏：侧栏适当加宽，主区卡片列数随宽度自适应 */
@media (min-width: 1600px) {
  .layout--list { grid-template-columns: 272px 1fr; gap: 28px; }
}
@media (min-width: 2000px) {
  .layout--list { grid-template-columns: 300px 1fr; gap: 32px; }
}

/* 结果网格：按可用宽度自动排布列数（1~4 列） */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
@media (max-width: 700px) {
  .post-grid { grid-template-columns: 1fr; }
}

/* 首页时间线：宽屏时给时间戳列更多空间 */
@media (min-width: 1400px) {
  .tl-item { gap: 18px; }
}

/* ============================================================
   左右栏布局（首页 / 检索）：左侧 Filters 侧栏 + 右侧主区
   参考 AMD Radeon Cloud 的"侧栏筛选 + 主区分组卡片"模式，
   但用 radio 单选语义保留旧 URL 兼容性（?category=X 仍可用）。
   ============================================================ */
.layout--list {
  display: grid;
  /* 主区在前，侧栏在右侧；移动端叠加时 order: -1 让侧栏置顶 */
  grid-template-columns: 1fr 248px;
  gap: 24px;
  align-items: start;
}
.layout--list > .layout-side { position: sticky; top: 72px; }
@media (max-width: 900px) {
  .layout--list { grid-template-columns: 1fr; }
  .layout--list > .layout-side {
    position: static;
    order: -1;
  }
}

/* ----- 筛选卡 ----- */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.filter-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.filter-card__head h3 {
  margin: 0;
  font-size: .98rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: .02em;
}
.filter-card__head .reset {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.filter-card__head .reset:hover { color: var(--accent-600); }

/* ----- 分组 ----- */
.filter-group {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.filter-group:last-child { border-bottom: 0; }
.filter-group__title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* 筛选行（label + radio + 名称 + 计数） */
.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: .92rem;
  transition: background .12s ease;
}
.filter-row:hover { background: var(--bg); color: var(--ink); }
.filter-row input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.filter-row__name { flex: 1; line-height: 1.3; }
.filter-row__cnt {
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.filter-row.is-active {
  background: var(--accent-soft);
  color: var(--accent-600);
  font-weight: 700;
}
.filter-row.is-empty {
  color: var(--muted);
  opacity: .6;
  cursor: not-allowed;
}
.filter-row.is-empty:hover { background: transparent; color: var(--muted); }

/* 文本筛选（搜索页 tag/date 输入） */
.filter-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .88rem;
  outline: none;
}
.filter-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

/* ----- 右侧主区 ----- */
.layout-main .list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.layout-main .page-h {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}
.layout-main .result-bar {
  color: var(--ink-2);
  font-size: .92rem;
  margin-bottom: 10px;
}
.layout-main .result-bar .total {
  margin-left: 6px;
  color: var(--muted);
  font-size: .85rem;
}

/* 排序 tabs（最新 / 最热 / 最早） */
.sort-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.sort-tabs a {
  padding: 5px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
  transition: all .15s ease;
}
.sort-tabs a:hover { color: var(--ink); }
.sort-tabs a.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

/* 搜索页：右侧主搜索框（AMD 风格：占满宽度 + 后置搜索图标） */
.search-main {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 8px 6px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.search-main input[name="q"] {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  padding: 8px 0;
}
.search-main input[name="q"]::placeholder { color: var(--muted); }
.search-main .sort-tabs { border: 0; background: transparent; }
.search-main .sort-tabs a { padding: 6px 12px; }
.search-main button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}
.search-main button:hover { background: var(--accent-600); }

/* 检索页：日期 + tag 横排 */
.search-extras {
  display: grid;
  grid-template-columns: 130px 130px 1fr;
  gap: 10px;
  margin-top: 10px;
}
.search-extras .filter-input { padding: 7px 10px; }
@media (max-width: 700px) {
  .search-extras { grid-template-columns: 1fr 1fr; }
  .search-extras .filter-input:nth-child(3) { grid-column: 1 / -1; }
}

/* ============================================================
   App Shell：左侧分组导航 + 主区
   视频里的左侧分组导航（内容 / 收录 / AI 三组）
   默认浅色；深色模式下走 var(--*)
   ============================================================ */
.app-shell {
  display: block;
  max-width: 2400px;
  margin-left: 220px;        /* 给固定侧栏让位 */
  padding: 0 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .app-shell {
    display: block;
    margin-left: 0;
    padding: 0 16px;
  }
  .site-foot--inside { margin-left: 0; padding: 16px 16px 24px; }
  .app-side {
    position: relative !important;
    top: 0 !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }
}

.app-side {
  position: fixed;             /* 固定定位铺满屏幕高度 */
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  height: 100vh;
  z-index: 50;
  align-self: start;
  padding: 0;                  /* 由 ::before / ::after / 子元素 padding 控制 */
  border-radius: 0;            /* 贴齐屏幕边缘，圆角无意义 */
  border: 0;                   /* 去掉全边框，只留右侧描边分隔主区 */
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;            /* 让顶部 / 底部彩条贴齐圆角（虽然没圆角了，避免彩条溢出） */
}
/* 顶部封顶：紫→蓝渐变细条（4px），与品牌区交界 */
.app-side::before {
  content: "";
  display: block;
  height: 4px;
  flex: 0 0 4px;
  background: linear-gradient(90deg, #7c5cff 0%, #4dabf7 100%);
  order: -1;
}
/* 底部底边界：蓝→紫渐变细条，与底部操作区交界 */
.app-side::after {
  content: "";
  display: block;
  height: 4px;
  flex: 0 0 4px;
  background: linear-gradient(90deg, #4dabf7 0%, #7c5cff 100%);
  order: 99;
}
/* 浅色下给侧栏一点淡紫氛围（视频里的视觉） */
body.bg-light:not([data-theme="dark"]) .app-side {
  background: linear-gradient(180deg, #faf8ff 0%, #f6f4ff 100%);
  border-color: #ece7ff;
}

.app-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 11px;       /* 原品牌行呼吸，下边线移到容器 */
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border-bottom: 0;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  flex: 1 1 auto;
}
.side-toggle {
  display: none;                 /* 桌面隐藏，仅移动端出现 */
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.side-toggle svg { width: 18px; height: 18px; display: block; transition: transform .2s ease; }
.side-toggle:active { transform: scale(.94); }
.app-brand__logo {
  width: 32px;
  height: 32px;
  display: inline-flex;
}
.app-brand__logo svg { width: 100%; height: 100%; display: block; }
.app-brand__text {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;          /* 占满剩余高度 */
  min-height: 0;           /* 关键：flex 子项允许收缩到比内容小 */
  overflow-y: auto;        /* 中段可滚动，不影响顶部 / 底部 */
  padding: 10px 4px 8px;
}
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group__title {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 6px 10px 4px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.side-link:hover { background: rgba(124, 92, 255, .08); color: var(--ink); text-decoration: none; }
.side-link.is-active {
  background: rgba(124, 92, 255, .12);
  color: var(--accent-700);
  font-weight: 600;
}
.side-link__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: currentColor;
  opacity: .8;
}

.side-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 12px 14px;       /* 底部留出彩条前的呼吸 */
  border-top: 1px solid var(--line);
  background: rgba(124, 92, 255, .04);   /* 半透明紫调底，让下半段成为整体 */
  flex: 0 0 auto;
}
body.bg-light[data-theme="dark"] .side-foot {
  background: rgba(124, 92, 255, .10);
}

.app-main {
  min-width: 0;
  padding-bottom: 24px;
}

.site-foot--inside {
  max-width: 2400px;
  margin: 0 auto 0 220px;       /* 给固定侧栏让位 */
  padding: 16px 24px 24px;
  color: var(--muted);
  font-size: .8rem;
}
.site-foot--inside .site-foot__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ===== 主题切换：并列两个图标按钮（太阳/月亮都常驻显示） ===== */
.side-foot .theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.side-foot .theme-switch__btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color .18s, color .18s, border-color .18s, transform .12s;
}
.side-foot .theme-switch__btn:hover {
  color: var(--ink);
  background: var(--surface);
}
.side-foot .theme-switch__btn:active { transform: scale(.92); }
.side-foot .theme-switch__btn .theme-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  stroke-width: 2.25;
}
/* 当前激活态：根据 body 的 data-theme 高亮对应按钮 */
body.bg-light:not([data-theme="dark"]) .side-foot .theme-switch__btn[data-theme-target="light"] {
  background: var(--surface);
  color: #b45309;                    /* 浅色下太阳用琥珀色 */
  border-color: #fcd34d;
  box-shadow: 0 1px 3px rgba(245, 158, 11, .25);
}
body.bg-light[data-theme="dark"] .side-foot .theme-switch__btn[data-theme-target="dark"] {
  background: var(--surface);
  color: #c4b5fd;                    /* 深色下月亮用淡紫色 */
  border-color: #7c5cff;
  box-shadow: 0 1px 3px rgba(124, 92, 255, .35);
}

/* ===== 主区顶部搜索框（视频里在右上） ===== */
.app-main__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.app-main__search {
  position: relative;
  width: 360px;
  max-width: 100%;
}
.app-main__search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.app-main__search input:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.app-main__search__icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}
@media (max-width: 700px) {
  .app-main__top { justify-content: stretch; }
  .app-main__search { width: 100%; }
}

/* 主区头部：标题 + meta */
.app-main__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.app-main__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.app-main__sub {
  font-size: .82rem;
  color: var(--muted);
}

/* 状态颜色：浅色模式下的紫色主题已被全局采纳 */
body.bg-light[data-theme="dark"] .app-side {
  background: var(--surface);
  border-color: var(--line);
}
body.bg-light[data-theme="dark"] .side-link.is-active {
  background: rgba(124, 139, 255, .18);
  color: var(--accent);
}

/* ============================================================
   顶置筛选条（首页 / 检索）：栏目胶囊 + 标签
   位于文章列表正上方，卡片边界 + 与列表留出呼吸间距
   ============================================================ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.filter-bar__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px 16px;
}
.filter-bar__group + .filter-bar__group {
  border-top: 1px solid var(--line);
}
.filter-bar__label {
  flex: 0 0 auto;
  min-width: 30px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-bar__group .chip-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.filter-bar__group--tag {
  justify-content: flex-start;
}
.filter-bar__taginput {
  flex: 1 1 220px;
  max-width: 420px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: .88rem;
  padding: 0 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.filter-bar__taginput:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-bar__taginput::placeholder { color: var(--muted); }
.filter-bar__reset {
  margin-left: auto;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .15s;
}
.filter-bar__reset:hover {
  background: var(--accent-soft);
  color: var(--accent-600);
}

/* ===== 移动端顶部收放：折叠搜索 / 排序 / 栏目，只留标题行 ===== */
.top-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.top-toggle svg { width: 18px; height: 18px; display: block; transition: transform .2s ease; }
.top-toggle:active { transform: scale(.94); }
.top-region.is-collapsed .top-toggle svg { transform: rotate(180deg); }

@media (max-width: 720px) {
  .top-toggle { display: inline-flex; }
  .index-bar__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .index-bar__title h1 { white-space: normal; }
  .top-region.is-collapsed .index-search { display: none; }
  .top-region.is-collapsed .filter-bar { display: none; }
  .top-region.is-collapsed .index-bar { margin-bottom: 8px; }

  /* 左侧导航：手机端默认收起，仅留品牌行；点按钮展开 */
  .side-toggle { display: inline-flex; }
  .app-side .side-nav,
  .app-side .side-foot { display: none; }      /* 默认收起 */
  .app-side.is-expanded .side-nav { display: flex; }
  .app-side.is-expanded .side-foot { display: flex; }
  .app-side.is-expanded .side-toggle svg { transform: rotate(180deg); }
  .app-side.is-expanded { border-bottom: 1px solid var(--line); }
}

/* 栏目胶囊（radio 语义，label 包裹） */
.chip-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: .86rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color .15s, border-color .15s, background .15s, transform .12s;
}
.chip-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.chip-tab em {
  font-style: normal;
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chip-tab:hover {
  color: var(--accent-600);
  border-color: var(--accent);
}
.chip-tab:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chip-tab.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.chip-tab.is-active em {
  color: rgba(255, 255, 255, .85);
}
.chip-tab.is-empty {
  opacity: .45;
  cursor: not-allowed;
}
.chip-tab.is-empty:hover {
  color: var(--ink-2);
  border-color: var(--line);
  background: var(--bg);
}


/* ===== 手机端页脚：纵向居中堆叠 =====
   覆盖 .site-foot--inside 全局的 margin:0 auto 0 220px（1898 行）与
   .site-foot__row 全局的 justify-content:space-between（1905 行）。
   这两条全局规则源顺序靠后，需用 !important 在手机断点强制覆盖。 */
@media (max-width: 720px) {
  .site-foot--inside {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px 16px 28px !important;
  }
  .site-foot--inside .site-foot__row {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
  }
  .site-foot--inside .site-foot__row > div {
    line-height: 1.7 !important;
  }
}
