/* 分类 / 标签存档页（Modules/Common/CategoryPage/CategoryPage.php）。颜色用额外CSS里的变量，黑夜模式自动适配 */

/* ---------- 顶部横幅 ---------- */
.ytea-term-hero {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  margin-top: 16px !important;
  padding: 34px 40px 26px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 18%, rgba(255, 255, 255, .14) 0 80px, transparent 81px),
    radial-gradient(circle at 76% 130%, rgba(255, 255, 255, .1) 0 130px, transparent 131px),
    linear-gradient(135deg, #143a68 0%, #1d4e89 55%, #5fa8dc 100%);
}
.ytea-term-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: rgba(255, 255, 255, .7); }
.ytea-term-hero h1.ytea-term-title { margin: 6px 0 0 !important; font-size: 30px; line-height: 1.3; letter-spacing: 2px; color: #fff !important; }
.ytea-term-sub { margin: 8px 0 0 !important; font-size: 15px; color: rgba(255, 255, 255, .85); }
.ytea-term-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ytea-term-stats span {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
}
.ytea-term-stats b { color: #fff; font-variant-numeric: tabular-nums; }

/* 分类切换 */
.ytea-term-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .18); }
.ytea-term-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: rgba(255, 255, 255, .9) !important;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .25);
  text-decoration: none !important;
  transition: background .2s, color .2s;
}
.ytea-term-nav a i { font-style: normal; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.ytea-term-nav a:hover { background: rgba(255, 255, 255, .22); }
.ytea-term-nav a.is-current { color: #1d4e89 !important; background: #fff; border-color: #fff; font-weight: 700; }

/* ---------- A2 原来的顶部（搜索 + 全部标签 + 灰色分类名）改成横幅下的工具条 ---------- */
body.archive .tax-header { margin: 12px 0 0 !important; padding: 0 !important; }
body.archive .tax-header .b2-light-dark-outside-box,
body.archive .tax-header .b2-light-dark-outside,
body.archive .tax-header .b2-light-dark-bg { display: none !important; }
body.archive .tax-header .tax-title { display: none !important; } /* 和横幅里的标题重复 */
body.archive .tax-header .wrapper { background: none !important; box-shadow: none !important; padding: 0 !important; }
body.archive .tax-header .tax-info { display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 0 !important; }
body.archive .tax-header .tax-info-item { margin: 0 !important; }
body.archive .tax-header { margin-bottom: 16px !important; }
/* 标签页：没有筛选项时 A2 仍输出一个空的筛选框，显示成一条白边 */
body.archive .tax-fliter-cat:has(.filters-box > ul:empty) { display: none !important; }
body.archive .tax-header .tax-search { flex: 1; max-width: 420px; }
body.archive .tax-header .tax-search form { position: relative; display: flex; align-items: center; }
body.archive .tax-header .tax-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px !important;
  border: 1px solid var(--line, #dce7f2) !important;
  border-radius: 999px !important;
  background: var(--card, #fff) !important;
  color: var(--ink, #1c2b3a);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
body.archive .tax-header .tax-search input:focus { outline: none; border-color: var(--sky, #5fa8dc) !important; box-shadow: 0 0 0 3px rgba(95, 168, 220, .18); }
body.archive .tax-header .tax-search button { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); padding: 0 !important; color: var(--ink-muted, #6b7c8f) !important; background: none !important; }
body.archive .tax-header a.fliter-button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px !important;
  border: 1px solid var(--line, #dce7f2) !important;
  border-radius: 999px !important;
  font-size: 14px;
  color: var(--deep, #1d4e89) !important;
  background: var(--card, #fff) !important; /* 黑夜模式下原来是刺眼的白底 */
  box-shadow: none !important;
}
body.archive .tax-header a.fliter-button:hover { border-color: var(--sky, #5fa8dc) !important; }

/* ---------- 文章卡片 ---------- */
body.archive .post-1 .item-in {
  overflow: hidden;
  border: 1px solid var(--line, #dce7f2);
  border-radius: 16px !important;
  box-shadow: none !important;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
body.archive .post-1 .item-in:hover {
  transform: translateY(-4px);
  border-color: var(--sky, #5fa8dc);
  box-shadow: 0 10px 26px rgba(29, 78, 137, .12) !important;
}
/* 同一行卡片等高：卡片铺满格子，底部「x 年前」贴底 */
/* 卡片原来靠 margin-bottom:16px 隔开上下排；高度设成 100% 后这段间距会被挤掉，改成格子自己留底部间距 */
body.archive .post-1 .post-list-item { padding-bottom: 16px !important; box-sizing: border-box; }
body.archive .post-1 .post-list-item > .item-in { display: flex; flex-direction: column; height: 100%; margin-bottom: 0 !important; box-sizing: border-box; }
body.archive .post-1 .post-info { display: flex; flex-direction: column; flex: 1; }
body.archive .post-1 .post-info .list-footer { margin-top: auto !important; border-top: 1px solid var(--line, #dce7f2) !important; }
body.archive .post-1 .post-list-meta-box { margin: 8px 0 10px !important; }
body.archive .post-1 .post-module-thumb { overflow: hidden; }
body.archive .post-1 .post-module-thumb img { transition: transform .5s ease; }
body.archive .post-1 .item-in:hover .post-module-thumb img { transform: scale(1.05); }
body.archive .post-1 .post-info { padding: 14px 16px 16px !important; }
body.archive .post-1 .post-info h2 { font-size: 16px !important; line-height: 1.5 !important; }
body.archive .post-1 .post-info h2 a { color: var(--ink, #1c2b3a) !important; }
body.archive .post-1 .item-in:hover .post-info h2 a { color: var(--deep, #1d4e89) !important; }
body.archive .post-1 .post-excerpt,
body.archive .post-1 .post-info .post-excerpt { font-size: 13px; line-height: 1.7; color: var(--ink-muted, #6b7c8f) !important; }
body.archive .post-1 .post-list-meta,
body.archive .post-1 .post-item-meta { font-size: 12px; color: var(--ink-muted, #6b7c8f) !important; }

@media (prefers-reduced-motion: reduce) {
  body.archive .post-1 .item-in, body.archive .post-1 .post-module-thumb img { transition: none; }
  body.archive .post-1 .item-in:hover { transform: none; }
  body.archive .post-1 .item-in:hover .post-module-thumb img { transform: none; }
}

/* ---------- 手机 ---------- */
@media (max-width: 768px) {
  .ytea-term-hero { margin: 12px 12px 0 !important; padding: 24px 18px 18px; width: auto; }
  .ytea-term-hero h1.ytea-term-title { font-size: 24px; }
  .ytea-term-sub { font-size: 13px; }
  .ytea-term-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -18px; padding-right: 18px; }
  .ytea-term-nav::-webkit-scrollbar { display: none; }
  .ytea-term-nav a { flex: none; }
  body.archive .tax-header { padding: 0 12px !important; }
  body.archive .tax-header .tax-info { flex-direction: row-reverse; }
  /* 主题在手机上把搜索框绝对定位到下一行，会盖住第一排卡片 */
  body.archive .tax-header .tax-search { position: static !important; max-width: none; }
  body.archive .tax-header { margin-bottom: 12px !important; }
  body.archive .post-1 .post-info { padding: 10px 12px 12px !important; }
  body.archive .post-1 .post-info h2 { font-size: 14px !important; }
}
