/* ==========================================================================
 * joe.directory.css —— 资源站模式（分类导航 + 资源卡片）
 *
 * 作用域全部以 .joe_dir 开头，不碰主题原有 .joe_list / .joe_archive 规则。
 * 供两个页面共用：
 *   - index.php   首页：分类分区聚合
 *   - archive.php 分类 / 标签 / 搜索页：资源卡片网格
 *
 * 配色全部走 Joe 的 CSS 变量，自动跟随亮色 / 暗色（html[data-night=night]）。
 * ========================================================================== */

/* ── 首页：顶部标题区 ─────────────────────────────────────────────────── */

.joe_dir_hero {
  position: relative;
  overflow: hidden;
  padding: 30px 24px 26px;
  margin-bottom: 12px;
  border-radius: var(--radius-wrap, 8px);
  /* color-mix 不支持时的兜底（旧浏览器至少是纯色卡，不是透明） */
  background: var(--background, #fff);
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--theme, #409eff) 12%, var(--background, #fff)) 0%,
      var(--background, #fff) 62%);
  box-shadow: var(--box-shadow, none);
  text-align: center;
}

.joe_dir_hero__title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.5px;
  color: var(--main, #303133);
}

.joe_dir_hero__desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--minor, #909399);
}

.joe_dir_hero__stat {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--background, #fff) 72%, transparent);
  font-size: 12.5px;
  color: var(--routine, #606266);
}

.joe_dir_hero__stat b {
  font-weight: 700;
  color: var(--theme, #409eff);
}

/* ── 吸顶分类条 ──────────────────────────────────────────────────────── */

.joe_dir_quick {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-wrap, 8px);
  background: var(--background, #fff);
  background: color-mix(in srgb, var(--background, #fff) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: var(--box-shadow, none);
  overflow-x: auto;
  scrollbar-width: none;
}

.joe_dir_quick::-webkit-scrollbar {
  display: none;
}

.joe_dir_quick__item {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--routine, #606266);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}

.joe_dir_quick__item:hover {
  background: var(--classD, #f2f6fc);
  color: var(--theme, #409eff);
}

.joe_dir_quick__item.is-active {
  background: var(--theme, #409eff);
  color: #fff;
  font-weight: 500;
}

/* ── 分类区块 ────────────────────────────────────────────────────────── */

.joe_dir_section {
  padding: 18px 18px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-wrap, 8px);
  background: var(--background, #fff);
  box-shadow: var(--box-shadow, none);
  scroll-margin-top: 12px;
}

.joe_dir_section__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 15px;
}

.joe_dir_section__title {
  position: relative;
  margin: 0;
  padding-left: 11px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--main, #303133);
}

.joe_dir_section__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 2px;
  background: var(--theme, #409eff);
}

.joe_dir_section__count {
  font-size: 12px;
  color: var(--minor, #909399);
}

.joe_dir_section__more {
  margin-left: auto;
  font-size: 13px;
  color: var(--minor, #909399);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s;
}

.joe_dir_section__more:hover {
  color: var(--theme, #409eff);
}

/* ── 资源卡片网格 ────────────────────────────────────────────────────── */

.joe_dir_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.joe_dir_card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--classC, #ebeef5);
  border-radius: var(--radius-wrap, 8px);
  background: var(--background, #fff);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s, border-color 0.22s;
}

.joe_dir_card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--theme, #409eff) 45%, var(--classC, #ebeef5));
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--theme, #409eff) 60%, transparent);
}

/* 封面 */
.joe_dir_card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--classD, #f2f6fc);
}

.joe_dir_card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.joe_dir_card:hover .joe_dir_card__thumb img {
  transform: scale(1.04);
}

/* 无封面时的占位图标 */
.joe_dir_card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8cdd6;
  background: linear-gradient(135deg, var(--classD, #f2f6fc) 0%, var(--classC, #ebeef5) 100%);
}

.joe_dir_card__thumb--empty svg {
  width: 34px;
  height: 34px;
}

/* 付费 / 类型角标 */
.joe_dir_card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
  font-weight: 600;
  color: #fff;
  background: var(--theme, #409eff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.joe_dir_card__badge--free {
  background: #3cba54;
}

/* 卡片正文 */
.joe_dir_card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 11px 12px 12px;
}

.joe_dir_card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--main, #303133);
  text-decoration: none;
  transition: color 0.18s;
}

.joe_dir_card__title:hover {
  color: var(--theme, #409eff);
}

.joe_dir_card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--minor, #909399);
}

.joe_dir_card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  color: var(--minor, #909399);
}

.joe_dir_card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 分类页头部（复用原有 .joe_archive__head 的结构，这里只补宽度与间距） ── */

.joe_dir_archive .joe_dir_grid {
  margin-top: 2px;
}

/* ── 空状态 ──────────────────────────────────────────────────────────── */

.joe_dir_empty {
  padding: 56px 20px;
  border-radius: var(--radius-wrap, 8px);
  background: var(--background, #fff);
  box-shadow: var(--box-shadow, none);
  text-align: center;
  font-size: 14px;
  color: var(--minor, #909399);
}

/* ── 暗色 ────────────────────────────────────────────────────────────── */

html[data-night=night] .joe_dir_hero {
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--theme, #409eff) 22%, #1b1d21) 0%,
      #1b1d21 62%);
}

html[data-night=night] .joe_dir_quick {
  background: rgba(27, 29, 33, 0.86);
}

html[data-night=night] .joe_dir_section {
  background: #1b1d21;
}

html[data-night=night] .joe_dir_card {
  border-color: #2b2f36;
  background: #22252a;
}

html[data-night=night] .joe_dir_card__thumb {
  background: #2b2f36;
}

html[data-night=night] .joe_dir_card__thumb--empty {
  color: #4a5058;
  background: linear-gradient(135deg, #2b2f36 0%, #24272c 100%);
}

html[data-night=night] .joe_dir_empty {
  background: #1b1d21;
}

/* ── 移动端 ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .joe_dir_hero {
    padding: 22px 16px 20px;
  }

  .joe_dir_hero__title {
    font-size: 20px;
  }

  .joe_dir_section {
    padding: 14px 12px 16px;
    margin-bottom: 10px;
  }

  .joe_dir_section__title {
    font-size: 15px;
  }

  .joe_dir_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .joe_dir_card__body {
    padding: 9px 10px 10px;
  }

  .joe_dir_card__title {
    font-size: 13.5px;
  }

  .joe_dir_card__desc {
    display: none;
  }

  .joe_dir_card__meta {
    padding-top: 8px;
  }
}

@media (max-width: 400px) {
  .joe_dir_grid {
    grid-template-columns: 1fr;
  }

  .joe_dir_card__desc {
    display: -webkit-box;
  }
}

/* ==========================================================================
 * 资源站 v3 —— 严格对齐参考站（666 资源站）的实测尺寸
 *
 *   结构：.joe_res_container（块级）
 *           ├─ .joe_res_top      整宽：快捷入口 + hero（左轮播 / 右最新条）
 *           └─ .joe_res_cols     两栏：.joe_main（区块头 + tab + 4 列卡 + 分页）
 *                                      .joe_dir_aside（排行 / 标签 / 分类 / 公告）
 *
 *   参考站实测（容器 890 单位换算成比例）：
 *     快捷入口 4 等分，卡高 ≈ 容器宽 6%
 *     hero 左 59.2% / 右 39.2%，高 ≈ 容器宽 23.8%，右侧 3 条等高
 *     卡片 4 列，列间距 ≈ 卡宽 7.6%，卡高 ≈ 卡宽 1.27
 *     侧栏宽 ≈ 容器宽 24%
 * ========================================================================== */

:root {
  --joe-dir-border: #eef0f4;
  --joe-dir-line: #f2f4f8;
  --joe-dir-blue: #4b7bec;
  --joe-dir-blue-soft: #eff3fe;
  --joe-dir-red: #ff5252;
  --joe-dir-gold: #efa32d;
  --joe-dir-text: #1f2329;
  --joe-dir-sub: #3d4653;
  --joe-dir-muted: #8a94a6;
  --joe-dir-faint: #a3abb8;
  --joe-dir-card: #fff;
  --joe-dir-bg: #f1f2f6;
  --joe-dir-radius: 10px;
}

html[data-night=night] {
  --joe-dir-border: #2b3038;
  --joe-dir-line: #262b32;
  --joe-dir-blue-soft: rgba(75, 123, 236, 0.16);
  --joe-dir-text: #e8eaed;
  --joe-dir-sub: #c7ccd4;
  --joe-dir-muted: #8b929c;
  --joe-dir-faint: #6f7783;
  --joe-dir-card: #1c1f24;
  --joe-dir-bg: #16181c;
}

/* ---------- 外层：整宽区 + 两栏区 ---------------------------------------- */
/* Joe 默认容器 1320 太宽，资源站收窄到 1220（参考站内容宽 1200），
   头部 / 页脚同样收窄，保证上下对齐 */
.joe_dir_body .joe_container {
  max-width: 1220px;
}

.joe_res_container {
  display: block;
}

.joe_res_top {
  width: 100%;
}

.joe_res_cols {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.joe_res_cols>.joe_main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

.joe_res_cols>.joe_dir_aside {
  flex: 0 0 290px;
  width: 290px;
  margin-left: 16px;
  padding: 0;
}

/* ---------- 快捷入口（4 个白底小卡） -------------------------------------- */
.joe_res_quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 16px;
}

.joe_res_quick__item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px 18px;
  border: 1px solid var(--joe-dir-border);
  border-radius: var(--joe-dir-radius);
  background: var(--joe-dir-card);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.joe_res_quick__item:hover {
  border-color: color-mix(in srgb, var(--joe-dir-blue) 42%, var(--joe-dir-border));
  box-shadow: 0 6px 18px -12px rgba(31, 35, 41, 0.4);
}

.joe_res_quick__icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--joe-dir-blue-soft);
  color: var(--joe-dir-blue);
}

.joe_res_quick__icon svg {
  width: 21px;
  height: 21px;
}

.joe_res_quick__text {
  min-width: 0;
}

.joe_res_quick__name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--joe-dir-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.joe_res_quick__desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--joe-dir-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- hero：左轮播 + 右最新 3 条 ------------------------------------ */
.joe_res_hero {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 24px;
}

.joe_res_hero__main {
  min-width: 0;
}

.joe_res_hero .joe_index__banner {
  /* 527:212 与参考站一致；高度由宽度推出来，不写死 */
  aspect-ratio: 527 / 212;
  padding-top: 0;
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--joe-dir-border);
  border-radius: var(--joe-dir-radius);
  background: #111;
}

.joe_res_hero .joe_index__banner .swiper-container,
.joe_res_hero .joe_index__banner .swiper-wrapper,
.joe_res_hero .joe_index__banner .swiper-slide {
  height: 100%;
}

.joe_res_hero .joe_index__banner .item {
  position: relative;
  display: block;
  height: 100%;
}

.joe_res_hero .joe_index__banner .item::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 64%;
  background: linear-gradient(to top, rgba(10, 14, 22, 0.76) 0%, rgba(10, 14, 22, 0.3) 56%, transparent 100%);
  pointer-events: none;
}

.joe_res_hero .joe_index__banner .item .title {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 18px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 右侧最新 3 条：与左侧等高，flex 平分 */
.joe_res_hero__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.joe_res_hero__item {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--joe-dir-border);
  border-radius: var(--joe-dir-radius);
  background: var(--joe-dir-card);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.joe_res_hero__item:hover {
  border-color: color-mix(in srgb, var(--joe-dir-blue) 42%, var(--joe-dir-border));
  box-shadow: 0 6px 18px -12px rgba(31, 35, 41, 0.4);
}

.joe_res_hero__thumb {
  flex: 0 0 auto;
  width: 60px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: #14161a;
}

.joe_res_hero__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.joe_res_hero__title {
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--joe-dir-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 没有轮播时，侧栏改成横向 3 列 */
.joe_res_hero.is-flat {
  grid-template-columns: minmax(0, 1fr);
}

.joe_res_hero.is-flat .joe_res_hero__side {
  flex-direction: row;
}

.joe_res_hero.is-flat .joe_res_hero__item {
  flex: 1 1 0;
}

/* ---------- 区块标题（蓝竖条 + 标题 + 右侧说明） -------------------------- */
.joe_res_section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.joe_res_section__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--joe-dir-text);
}

.joe_res_section__title::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--joe-dir-blue);
}

.joe_res_section__more {
  font-size: 12.5px;
  color: var(--joe-dir-muted);
  text-decoration: none;
  white-space: nowrap;
}

.joe_res_section__more:hover {
  color: var(--joe-dir-blue);
}

/* ---------- 分类胶囊 tab -------------------------------------------------- */
.joe_res_nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.joe_res_nav__item {
  flex: 0 0 auto;
  padding: 6px 15px;
  border: 1px solid var(--joe-dir-border);
  border-radius: 15px;
  background: var(--joe-dir-card);
  font-size: 13px;
  line-height: 1.5;
  color: var(--joe-dir-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.joe_res_nav__item:hover {
  color: var(--joe-dir-blue);
  border-color: var(--joe-dir-blue);
}

.joe_res_nav__item.is-active {
  border-color: var(--joe-dir-blue);
  background: var(--joe-dir-blue);
  color: #fff;
  font-weight: 500;
}

/* ---------- 四列网格 ------------------------------------------------------ */
.joe_res_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 卡片：细边框 + 上图下文 --------------------------------------- */
.joe_res_card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--joe-dir-border);
  border-radius: var(--joe-dir-radius);
  background: var(--joe-dir-card);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.joe_res_card:hover {
  border-color: color-mix(in srgb, var(--joe-dir-blue) 40%, var(--joe-dir-border));
  box-shadow: 0 10px 24px -16px rgba(31, 35, 41, 0.45);
  transform: translateY(-2px);
}

html[data-night=night] .joe_res_card:hover {
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.85);
}

/* 封面：5:3 满宽贴边，只有上面两角跟随卡片圆角 */
.joe_res_card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  background: var(--classD, #eef1f6);
}

.joe_res_card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.joe_res_card:hover .joe_res_card__thumb img {
  transform: scale(1.04);
}

.joe_res_card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eef1f6 0%, #e2e7ef 100%);
  color: #b9c1cd;
}

html[data-night=night] .joe_res_card__thumb--empty {
  background: linear-gradient(135deg, #23272e 0%, #1b1f25 100%);
  color: #4a515b;
}

.joe_res_card__thumb--empty svg {
  width: 40px;
  height: 40px;
}

/* 左上角：分类（蓝色实心贴边） */
.joe_res_card__cat {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  max-width: 66%;
  padding: 3px 10px;
  border-radius: 0 0 6px 0;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  background: var(--joe-dir-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右上角：价格（红色实心贴边） */
.joe_res_card__price {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 0 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff;
  background: var(--joe-dir-red);
}

/* 左下角：VIP 免费（金色实心贴边） */
.joe_res_card__vip {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 0 6px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff;
  background: var(--joe-dir-gold);
}

/* 卡片正文 */
.joe_res_card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px 15px 0;
}

.joe_res_card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--joe-dir-text);
  text-decoration: none;
  transition: color 0.18s;
}

.joe_res_card__title:hover {
  color: var(--joe-dir-blue);
}

.joe_res_card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--joe-dir-muted);
}

/* 底部元信息：浅灰小字 + 线性图标 */
.joe_res_card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding: 9px 0 12px;
  font-size: 11.5px;
  color: var(--joe-dir-faint);
}

.joe_res_card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.joe_res_card__meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.9;
}

/* ---------- 分页 ---------------------------------------------------------- */
.joe_res .joe_pagination,
.joe_dir_archive .joe_pagination {
  margin-top: 24px;
  justify-content: center;
}

/* ==========================================================================
 * 侧栏：热门排行 / 热门标签 / 资源分类 / 站点公告
 * ========================================================================== */
.joe_dir_aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}

.joe_dir_box {
  padding: 16px 18px;
  border: 1px solid var(--joe-dir-border);
  border-radius: var(--joe-dir-radius);
  background: var(--joe-dir-card);
}

.joe_dir_box__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--joe-dir-text);
}

.joe_dir_box__title svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--joe-dir-blue);
}

/* 排行榜 */
.joe_dir_rank {
  margin: 0;
  padding: 0;
  list-style: none;
}

.joe_dir_rank__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
}

.joe_dir_rank li+li .joe_dir_rank__link {
  border-top: 1px solid var(--joe-dir-line);
}

.joe_dir_rank__no {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--joe-dir-line);
  font-size: 11px;
  font-weight: 700;
  color: var(--joe-dir-faint);
}

.joe_dir_rank li:nth-child(-n+2) .joe_dir_rank__no {
  background: var(--joe-dir-blue);
  color: #fff;
}

.joe_dir_rank__title {
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--joe-dir-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.joe_dir_rank__link:hover .joe_dir_rank__title {
  color: var(--joe-dir-blue);
}

/* 标签 / 分类胶囊 */
.joe_dir_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.joe_dir_tag {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--joe-dir-line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--joe-dir-sub);
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.joe_dir_tag:hover {
  background: var(--joe-dir-blue-soft);
  color: var(--joe-dir-blue);
}

.joe_dir_tag sup {
  top: 0;
  font-size: 10px;
  color: var(--joe-dir-faint);
}

/* 公告 */
.joe_dir_notice {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--joe-dir-muted);
}

.joe_dir_notice__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  border: 1px solid var(--joe-dir-border);
  border-radius: 6px;
  background: var(--joe-dir-blue-soft);
  font-size: 12px;
  color: var(--joe-dir-blue);
  text-decoration: none;
}

.joe_dir_notice__btn svg {
  width: 14px;
  height: 14px;
}

/* ---------- 自适应 -------------------------------------------------------- */
@media (max-width: 1180px) {
  .joe_res_cols>.joe_dir_aside {
    flex-basis: 270px;
    width: 270px;
  }

  .joe_res_grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .joe_res_hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .joe_res_quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .joe_res_hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .joe_res_hero__side {
    display: none;
  }

  .joe_res_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .joe_res_cols>.joe_dir_aside {
    display: none;
  }
}

@media (max-width: 640px) {
  .joe_res_quick__item {
    padding: 12px 13px;
  }

  .joe_res_quick__icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .joe_res_quick__icon svg {
    width: 18px;
    height: 18px;
  }

  .joe_res_quick__name {
    font-size: 13.5px;
  }

  /* 手机端保持每行两列，靠缩小内边距 / 字号来适配，不再退化成单列 */
  .joe_res_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .joe_res_card__body {
    padding: 9px 10px 0;
  }

  .joe_res_card__title {
    font-size: 13px;
    line-height: 1.45;
  }

  /* 两列时描述挤成豆腐块，只留一行做点缀 */
  .joe_res_card__desc {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.55;
    -webkit-line-clamp: 1;
  }

  .joe_res_card__meta {
    gap: 9px;
    padding: 7px 0 9px;
    font-size: 10.5px;
  }

  .joe_res_card__meta svg {
    width: 11px;
    height: 11px;
  }

  /* 角标缩小，避免左右两个角标在窄卡片上打架 */
  .joe_res_card__cat,
  .joe_res_card__price,
  .joe_res_card__vip {
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.6;
  }

  .joe_res_card__cat {
    max-width: 52%;
    border-radius: 0 0 5px 0;
  }

  .joe_res_card__price {
    border-radius: 0 0 0 5px;
  }

  .joe_res_card__vip {
    border-radius: 0 5px 0 0;
  }

  .joe_res_hero .joe_index__banner .item .title {
    left: 14px;
    right: 14px;
    bottom: 12px;
    font-size: 15px;
  }

  .joe_res_section {
    margin-bottom: 12px;
  }

  .joe_res_section__title {
    font-size: 16px;
  }
}

/* 超窄屏（iPhone SE 一代、320px 一类）继续维持两列，只再压一点间距 */
@media (max-width: 380px) {
  .joe_res_grid {
    gap: 8px;
  }

  .joe_res_card__body {
    padding: 8px 8px 0;
  }

  .joe_res_card__title {
    font-size: 12.5px;
  }

  .joe_res_card__desc {
    font-size: 11px;
  }

  .joe_res_card__meta {
    gap: 7px;
    font-size: 10px;
  }
}

/* ==========================================================================
 * 首页 / 分类页皮肤：浅灰底 + 白底细边框头部
 * 只作用于 body.joe_dir_body，不影响文章页
 * ========================================================================== */
.joe_dir_body {
  background: var(--joe-dir-bg);
}

html[data-night=night] .joe_dir_body {
  background: var(--joe-dir-bg);
}

.joe_dir_body .joe_header {
  background: var(--joe-dir-card);
  box-shadow: none;
  border-bottom: 1px solid var(--joe-dir-border);
}

.joe_dir_body .joe_header__above,
.joe_dir_body .joe_header__below {
  background: transparent;
  box-shadow: none;
}

.joe_dir_body .joe_header__below {
  border-top: 1px solid var(--joe-dir-border);
}

/* 导航当前项做成浅蓝胶囊（对齐参考站） */
.joe_dir_body .joe_header__above-nav .item.active {
  border-radius: 6px;
  background: var(--joe-dir-blue-soft);
  color: var(--joe-dir-blue);
  font-weight: 500;
}

/* 顶部公告条 */
.joe_notice {
  border-bottom: 1px solid var(--joe-dir-border);
  background: var(--joe-dir-card);
}

.joe_notice__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 32px;
  font-size: 12px;
  color: var(--joe-dir-muted);
}

.joe_notice__left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.joe_notice__left svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--joe-dir-muted);
}

.joe_notice__right {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .joe_notice__right {
    display: none;
  }
}
