* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --brand: #1a73e8; --brand-dark: #1557b0; --brand-light: #e8f0fe;
  --bg: #f5f6f8; --card: #ffffff;
  --text: #1f2329; --text-2: #646a73; --text-3: #8f959e;
  --border: #e5e6eb; --border-2: #f0f1f3;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10);
  --radius: 12px;
  --atype-1: #1a73e8;   /* 影集 - 蓝 */
  --atype-2: #2ba471;   /* 图集 - 绿 */
  --atype-3: #f5a623;   /* 小说集/攻略 - 橙 */
  --danger: #e5413e;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============ 顶部导航 ============ */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center; padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
}
.topbar .brand {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-right: 24px; letter-spacing: -.2px;
  display: inline-flex; align-items: baseline;
}
.topbar .brand .brand-emph {
  font-size: 24px; font-weight: 800; color: var(--brand);
  margin-right: 1px; letter-spacing: 0;
}
.topbar .nav-links { display: flex; gap: 20px; }
.topbar .nav-links a { font-size: 14px; color: var(--text-2); position: relative; padding: 4px 0; }
.topbar .nav-links a:hover { color: var(--brand); }
.topbar .nav-links a.active { color: var(--brand); font-weight: 600; }
.topbar .nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px;
  height: 2px; background: var(--brand); border-radius: 2px;
}
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box {
  width: 240px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 13px; background: var(--bg); transition: .2s;
}
.search-box:focus { outline: none; border-color: var(--brand); background: #fff; width: 300px; box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #4fc3f7);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* ============ 分类筛选条 ============ */
.chip-bar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 10px 20px; position: sticky; top: 56px; z-index: 90;
}
.chip-track {
  max-width: 680px; margin: 0 auto;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.chip-track::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 14px;
  font-size: 13px; color: var(--text-2);
  background: var(--bg); border-radius: 16px;
  border: 1px solid transparent; transition: .15s; white-space: nowrap;
}
.chip:hover { background: var(--border-2); }
.chip.active { background: var(--brand-light); color: var(--brand); border-color: var(--brand-light); font-weight: 600; }
.chip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: currentColor; opacity: .6; }
.chip.atype-1 .dot { background: var(--atype-1); opacity: 1; }
.chip.atype-2 .dot { background: var(--atype-2); opacity: 1; }
.chip.atype-3 .dot { background: var(--atype-3); opacity: 1; }

/* ============ Feed 主体 ============ */
.feed {
  max-width: 680px; margin: 0 auto; padding: 16px 16px 80px;
  display: flex; flex-direction: column; gap: 14px;
}

/* 通用卡片壳 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* 卡片头部 (作者/合集来源行) */
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 0;
}
.card-head .src-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600;
  background: var(--atype-1); flex-shrink: 0;
}
.card-head .src-meta { flex: 1; min-width: 0; }
.card-head .src-name { font-size: 13px; font-weight: 600; color: var(--text); }
.card-head .src-sub { font-size: 11px; color: var(--text-3); }
.card-head .src-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.type-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; flex-shrink: 0;
}
.type-badge.t1 { background: var(--brand-light); color: var(--atype-1); }
.type-badge.t2 { background: #e6f6ef; color: var(--atype-2); }
.type-badge.t3 { background: #fef3e0; color: var(--atype-3); }

/* ============ 影集卡 (atype=1) ============ */
.video-card .cover {
  position: relative; aspect-ratio: 16/9; background: #000;
  margin: 12px 14px 0; border-radius: 8px; overflow: hidden;
  display: block;
}
.video-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.video-card .cover .mask {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 70%);
}
.video-card .cover .play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); transition: transform .2s;
}
.video-card .cover:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.video-card .cover .play::after {
  content: ""; width: 0; height: 0;
  border-left: 16px solid var(--brand);
  border-top: 10px solid transparent; border-bottom: 10px solid transparent;
  margin-left: 4px;
}
.video-card .cover .ep-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  backdrop-filter: blur(4px); font-weight: 500;
}
.video-card .cover .heat {
  position: absolute; top: 10px; right: 10px;
  background: rgba(229,65,62,.92); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 600;
}
.video-card .cover .info {
  position: absolute; left: 12px; right: 12px; bottom: 10px; color: #fff;
}
.video-card .cover .info .title {
  font-size: 16px; font-weight: 700; line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.video-card .cover .info .sub {
  font-size: 12px; opacity: .9; margin-top: 2px;
}
.video-card .body { padding: 10px 14px 12px; }
.video-card .meta-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3); margin-bottom: 8px;
}
.video-card .meta-line .cate { color: var(--brand); font-weight: 600; }
.video-card .meta-line .sep { color: var(--border); }
.video-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.video-card .tag {
  font-size: 11px; color: var(--text-2); background: var(--bg);
  padding: 2px 8px; border-radius: 4px;
}

/* ============ 图集卡 (atype=2) ============ */
.gallery-card .gh-title {
  padding: 12px 14px 8px; font-size: 15px; font-weight: 600; line-height: 1.4;
}
.gallery-card .cover { display: block; color: inherit; }
.gallery-card .mosaic {
  margin: 0 14px; border-radius: 10px; overflow: hidden;
  display: grid; gap: 2px;
  aspect-ratio: 16/9; background: var(--border-2);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
/* 一主二副: 左大图占 2/3 全高, 右侧上下两张副图 (≥3 张) */
.gallery-card .mosaic.lead {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.gallery-card .mosaic.lead .lead-main { grid-row: 1 / span 2; grid-column: 1; }
/* 2 主图: 2 列等分 */
.gallery-card .mosaic.pair { grid-template-columns: repeat(2, 1fr); grid-template-rows: 1fr; }
/* 单主图: 1 列, 强阴影突出图片本身 */
.gallery-card .mosaic.single {
  grid-template-columns: 1fr; grid-template-rows: 1fr; gap: 0;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.gallery-card .mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-card .mosaic .cell { position: relative; overflow: hidden; }
.gallery-card .mosaic .cell:hover img { transform: scale(1.05); }
.gallery-card .mosaic .more {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.gallery-card .mosaic .more small { font-size: 11px; font-weight: 400; opacity: .85; margin-top: 2px; }
/* 单图: 右下角常驻张数角标 */
.gallery-card .mosaic.single .count-tag {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
  backdrop-filter: blur(6px); font-weight: 500;
  transition: opacity .25s;
}
/* 单图: 悬浮时切换为查看大图按钮 */
.gallery-card .mosaic.single .zoom-hint {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(255,255,255,.92); color: var(--atype-2);
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s;
}
.gallery-card .mosaic.single:hover .count-tag { opacity: 0; }
.gallery-card .mosaic.single:hover .zoom-hint { opacity: 1; transform: scale(1); }
.gallery-card .gmeta {
  padding: 10px 14px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
.gallery-card .gmeta .cate { color: var(--atype-2); font-weight: 600; }
.gallery-card .gmeta .count {
  background: #e6f6ef; color: var(--atype-2);
  padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 11px;
}
.gallery-card .tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 12px; }
.gallery-card .tag {
  font-size: 11px; color: var(--text-2); background: var(--bg);
  padding: 2px 8px; border-radius: 4px;
}
.gallery-card .actions {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 14px 12px; border-top: 1px solid var(--border-2); margin-top: 0;
}
.gallery-card .act { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.gallery-card .act:hover { color: var(--atype-2); }

/* ============ 小说集/攻略卡 (atype=3) ============ */
.article-card .a-wrap {
  display: flex; gap: 12px; padding: 12px 14px;
}
.article-card .a-cover {
  flex-shrink: 0; width: 110px; height: 82px; border-radius: 8px;
  overflow: hidden; background: var(--bg); position: relative;
}
.article-card .a-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-card .a-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-card .a-title {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .a-excerpt {
  font-size: 12px; color: var(--text-2); line-height: 1.55; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .a-meta {
  margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-3);
}
.article-card .a-meta .author { color: var(--text-2); font-weight: 500; }
.article-card .a-meta .read-time { display: flex; align-items: center; gap: 3px; }
.article-card .a-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid var(--border-2);
}
.article-card .a-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.article-card .a-tag {
  font-size: 11px; color: var(--atype-3); background: #fef3e0;
  padding: 2px 8px; border-radius: 4px;
}
.article-card .read-more { font-size: 12px; color: var(--atype-3); font-weight: 600; }
.article-card .read-more:hover { color: var(--brand-dark); }

/* ============ 加载更多 / 骨架 ============ */
.loader {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; color: var(--text-3); font-size: 13px;
}
.loader .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3); font-size: 14px;
}

/* ============ 浮动刷新按钮 (移动端) ============ */
.fab {
  display: none; position: fixed; right: 16px; bottom: 76px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 20px;
  box-shadow: 0 4px 16px rgba(26,115,232,.4);
  align-items: center; justify-content: center; z-index: 80;
}

/* ============ H5 适配 ============ */
body.h5 .topbar { padding: 0 14px; height: 50px; }
body.h5 .topbar .brand { font-size: 18px; margin-right: 14px; }
body.h5 .topbar .brand .brand-emph { font-size: 21px; }
body.h5 .topbar .nav-links { gap: 14px; }
body.h5 .topbar .nav-links a { font-size: 13px; }
body.h5 .topbar .search-box { width: 0; flex: 1; max-width: 180px; padding: 6px 12px; font-size: 12px; }
body.h5 .topbar .search-box:focus { width: 0; flex: 1; max-width: 180px; }
body.h5 .chip-bar { padding: 8px 14px; }
body.h5 .chip { padding: 5px 12px; font-size: 12px; }
body.h5 .feed { padding: 12px 12px 72px; }
body.h5 .video-card .cover { margin: 10px 12px 0; }
body.h5 .video-card .cover .info .title { font-size: 15px; }
body.h5 .video-card .cover .play { width: 46px; height: 46px; }
body.h5 .gallery-card .gh-title { padding: 10px 12px 6px; font-size: 14px; }
body.h5 .gallery-card .mosaic { margin: 0 12px; }
body.h5 .article-card .a-cover { width: 96px; height: 72px; }
body.h5 .article-card .a-title { font-size: 14px; }
body.h5 .fab { display: flex; }
