/* SudoCG home — B站风格紧凑排版 (2026-07-28 redesign) */
:root {
  --home-ink: #18191c;
  --home-muted: #9499a0;
  --home-line: #e3e5e7;
  --home-panel: #ffffff;
  --home-soft: #f1f2f3;
  --home-indigo: #00a1d6;
  --home-hover: #00b5e5;
  --home-radius: 6px;
  --home-card-bg: #fff;
}

.home-redesign {
  width: calc(100% - 16px);
  margin: 0 auto;
  padding: 8px 0 40px;
  color: var(--home-ink);
}

/* ===== B站风格顶部：左轮播 + 右推荐位 ===== */
.home-top { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; aspect-ratio:5/1; }
.home-banner { position:relative; border-radius:var(--home-radius); overflow:hidden; background:#0d1117; }
.home-banner-slide { position:absolute; inset:0; z-index:0; opacity:0; pointer-events:none; transition:opacity .6s ease; text-decoration:none; }
.home-banner-slide.active { z-index:1; opacity:1; pointer-events:auto; }
.home-banner-slide img { width:100%; height:100%; object-fit:cover; display:block; }
.home-banner-ph { width:100%; height:100%; background:linear-gradient(135deg,#1a2240,#2d1b69); }
.home-banner-overlay { position:absolute; bottom:0; left:0; right:0; padding:20px 18px 14px; background:linear-gradient(transparent,rgba(0,0,0,.82)); color:#fff; }
.home-banner-tag { display:inline-flex; padding:3px 8px; border-radius:4px; background:rgba(255,255,255,.18); font-size:10px; font-weight:700; }
.home-banner-overlay h3 { margin:8px 0 4px; font-size:17px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.home-banner-meta { color:rgba(255,255,255,.6); font-size:11px; }
.home-banner-dots { position:absolute; bottom:10px; right:14px; display:flex; gap:5px; z-index:2; }
.home-banner-dots span { width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,.35); cursor:pointer; transition:background .2s; }
.home-banner-dots span.active { background:#00a1d6; }
.home-banner-refresh { position:absolute; top:10px; right:14px; z-index:3; background:rgba(0,0,0,.5); color:#fff; border:1px solid rgba(255,255,255,.2); border-radius:4px; padding:4px 10px; font-size:11px; cursor:pointer; backdrop-filter:blur(4px); transition:all .15s; font-family:inherit; }
.home-banner-refresh:hover { background:rgba(0,0,0,.7); }
.home-banner-refresh:disabled { opacity:.6; cursor:default; }
.home-toplist { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.home-toplist-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; flex-shrink:0; }
.home-toplist-head h3 { margin:0; font-size:14px; color:var(--home-ink); }
.home-toplist-head button { background:var(--home-soft); border:1px solid var(--home-line); border-radius:4px; padding:3px 8px; font-size:11px; color:var(--home-muted); cursor:pointer; transition:all .15s; font-family:inherit; }
.home-toplist-head button:hover { color:var(--home-indigo); border-color:var(--home-indigo); }
.home-toplist-grid { display:grid; grid-template-columns:repeat(3,1fr); grid-auto-rows:1fr; gap:6px; flex:1; min-height:0; }
.home-toplist-card { display:flex; flex-direction:column; border-radius:6px; overflow:hidden; background:var(--home-card-bg); text-decoration:none; transition:transform .15s; min-height:0; }
.home-toplist-card:hover { transform:translateY(-1px); }
.home-toplist-cover { flex:1; min-height:0; background:var(--home-soft); overflow:hidden; }
.home-toplist-cover img { width:100%; height:100%; object-fit:cover; }
.home-toplist-cover.is-placeholder { background:linear-gradient(135deg,#e8f4fa,#f0f0f8); }
.home-toplist-info { padding:3px 6px 4px; flex-shrink:0; }
.home-toplist-title { display:block; font-size:11px; font-weight:600; line-height:1.3; color:var(--home-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-toplist-views { font-size:10px; color:var(--home-muted); }

/* ===== 精选区 ===== */
.home-section { margin-bottom:20px; }
.home-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.home-section-kicker { color:var(--home-indigo); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; margin:0 0 3px; }
.home-section-head h2 { margin:0; font-size:18px; color:var(--home-ink); }
.home-section-head p { margin:3px 0 0; color:var(--home-muted); font-size:12px; }
.home-text-link { color:var(--home-indigo); font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; }
.home-text-link:hover { color:var(--home-hover); }
.home-showcase { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.home-showcase-card { position:relative; aspect-ratio:16/10; overflow:hidden; border-radius:8px; background:#1a2240; color:#fff; text-decoration:none; transition:transform .15s; }
.home-showcase-card:hover { transform:translateY(-2px); }
.home-showcase-card img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.home-showcase-card::before { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 40%,rgba(0,0,0,.8)); z-index:1; }
.home-showcase-card.is-placeholder { background:linear-gradient(135deg,#2a3a6e,#5d3f7e); }
.home-showcase-card.is-placeholder::after { content:"✦"; position:absolute; top:10px; right:14px; color:rgba(255,255,255,.2); font-size:40px; }
.home-showcase-card-body { position:absolute; bottom:0; left:0; right:0; padding:10px 12px; z-index:2; }
.home-showcase-card-tag { display:inline-flex; padding:2px 7px; border-radius:4px; background:rgba(255,255,255,.2); font-size:10px; font-weight:700; }
.home-showcase-card h3 { margin:6px 0 3px; font-size:13px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.home-showcase-card-meta { color:rgba(255,255,255,.65); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== 置顶横栏 ===== */
.home-sticky-rail { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.home-sticky-rail::-webkit-scrollbar { height:4px; }
.home-sticky-rail::-webkit-scrollbar-thumb { background:#ccc; border-radius:2px; }
.home-sticky-item { flex:0 0 auto; display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid #e8eafc; border-radius:6px; background:#fff; color:var(--home-ink); text-decoration:none; font-size:12px; transition:border-color .15s; }
.home-sticky-item:hover { border-color:var(--home-indigo); }
.home-sticky-pin { width:24px; height:24px; display:grid; place-items:center; border-radius:4px; background:#e8f4fa; color:#00a1d6; flex-shrink:0; }
.home-sticky-item strong { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.home-sticky-item > span > span { display:block; color:var(--home-muted); font-size:10px; margin-top:2px; }

/* ===== 主区域：Feed + Sidebar ===== */
.home-three-col { display:grid; grid-template-columns:220px minmax(0,1fr) 250px; gap:14px; margin-top:16px; align-items:start; }
.home-left-side, .home-right-side { display:grid; gap:12px; position:sticky; top:72px; min-width:0; overflow:hidden; }
.home-side-quicknav { display:grid; gap:6px; margin-bottom:4px; }
.home-quick-btn { display:flex; align-items:center; gap:6px; padding:9px 12px; border:1px solid var(--home-line); border-radius:6px; background:var(--home-panel); color:var(--home-ink); text-decoration:none; font-size:12px; font-weight:600; transition:all .15s; }
.home-quick-btn:hover { border-color:var(--home-indigo); color:var(--home-indigo); }
.home-quick-btn--primary { background:#00a1d6; color:#fff; border-color:#00a1d6; }
.home-quick-btn--primary:hover { background:#00b5e5; color:#fff; }

/* Feed */
.home-feed-surface { border:1px solid var(--home-line); background:var(--home-panel); border-radius:8px; padding:16px; min-width:0; overflow:hidden; }
.home-feed-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-bottom:12px; border-bottom:1px solid var(--home-line); }
.home-feed-toolbar h2 { margin:0; font-size:16px; }
.home-feed-toolbar h2 small { display:block; margin-top:2px; color:var(--home-muted); font-size:11px; font-weight:400; }
.home-sort-controls { display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
.home-sort-controls a { display:inline-flex; align-items:center; height:30px; padding:0 12px; border-radius:4px; background:transparent; color:var(--home-muted); text-decoration:none; font-size:13px; font-weight:500; transition:all .15s; }
.home-sort-controls a:hover { color:var(--home-indigo); background:#e8f4fa; }
.home-sort-controls a.active { background:#00a1d6; color:#fff; }
.home-sort-controls input { height:30px; padding:0 6px; border:1px solid var(--home-line); border-radius:4px; font-size:12px; font-family:inherit; }

/* B站风格密集网格 */
.home-feed-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.home-post-card {
  display:flex; flex-direction:column; overflow:hidden; border-radius:6px; min-width:0;
  background:var(--home-card-bg); text-decoration:none; color:var(--home-ink);
  transition:transform .15s ease;
}
.home-post-card:hover { transform:translateY(-2px); }
.home-post-cover {
  position:relative; width:100%; aspect-ratio:16/9; background:var(--home-soft); overflow:hidden; border-radius:6px;
}
.home-post-cover img { width:100%; height:100%; object-fit:contain; display:block; transition:transform .3s; }
.home-post-card:hover .home-post-cover img { transform:scale(1.03); }
.home-post-cover.is-placeholder { background:linear-gradient(135deg,#e8f4fa,#f0f0f8); display:flex; align-items:center; justify-content:center; }
.home-post-cover.is-placeholder::before { content:"S"; font-size:28px; font-weight:900; color:#bcc4d6; }
.home-post-kind { position:absolute; top:6px; left:6px; padding:2px 6px; border-radius:4px; background:rgba(0,0,0,.65); color:#fff; font-size:10px; font-weight:700; backdrop-filter:blur(4px); }

/* B站风格紧凑卡片正文 */
.home-post-body { padding:8px 6px; }
.home-post-title { margin:0; font-size:13px; line-height:1.4; color:var(--home-ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:36px; }
.home-post-desc { display:none; } /* B站风格：卡片不显示摘要，更紧凑 */
.home-post-meta { display:flex; align-items:center; justify-content:space-between; margin-top:6px; color:var(--home-muted); font-size:11px; }
.home-post-author { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:60%; }

.home-empty { padding:48px 20px; text-align:center; color:var(--home-muted); }

/* ===== 侧栏 ===== */
.home-side { display:grid; gap:12px; position:sticky; top:72px; }
.home-side-panel { border:1px solid var(--home-line); background:var(--home-panel); border-radius:8px; padding:12px; overflow:hidden; min-width:0; }
.home-side-panel h3 { margin:0 0 10px; font-size:14px; color:var(--home-ink); }
.home-publish-card { background:linear-gradient(135deg,#00a1d6,#0086b5); color:#fff; border:none; }
.home-publish-card h3, .home-publish-card p { color:#fff; }
.home-publish-card p { margin:6px 0 12px; font-size:12px; line-height:1.6; color:rgba(255,255,255,.85); }
.home-publish-card a { display:flex; align-items:center; justify-content:center; height:34px; border-radius:6px; background:#fff; color:#00a1d6; text-decoration:none; font-size:13px; font-weight:700; }
.home-rank-item, .home-user-item, .home-random-item { display:flex; align-items:center; gap:8px; padding:7px 0; color:var(--home-ink); text-decoration:none; border-bottom:1px solid #f0f1f3; }
.home-rank-item:last-child, .home-user-item:last-child, .home-random-item:last-child { border-bottom:none; }
.home-rank-item:hover, .home-user-item:hover { background:var(--home-soft); }
.home-rank-number { width:20px; height:20px; flex:0 0 auto; display:grid; place-items:center; border-radius:4px; background:var(--home-soft); color:var(--home-muted); font-size:11px; font-weight:800; }
.home-rank-item:nth-child(1) .home-rank-number { background:#ff6b6b; color:#fff; }
.home-rank-item:nth-child(2) .home-rank-number { background:#ffa940; color:#fff; }
.home-rank-item:nth-child(3) .home-rank-number { background:#ffd666; color:#fff; }
.home-side-copy { min-width:0; flex:1; }
.home-side-title { overflow:hidden; font-size:12px; font-weight:600; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.home-side-meta { margin-top:2px; color:var(--home-muted); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-user-avatar { width:30px; height:30px; flex:0 0 auto; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(135deg,#00a1d6,#7b61ff); color:#fff; font-size:12px; font-weight:700; }
.home-user-avatar img { width:100%; height:100%; object-fit:cover; }
.home-ad { display:block; overflow:hidden; padding:0; color:inherit; text-decoration:none; border-radius:8px; }
.home-ad img, .home-ad video { width:100%; aspect-ratio:16/9; object-fit:cover; background:var(--home-soft); }
.home-ad-copy { padding:10px 12px; font-size:12px; font-weight:600; }

/* ===== 黑夜模式 ===== */
html.theme-dark .home-redesign { --home-ink:#e7eefb; --home-muted:#9ca3af; --home-line:#263044; --home-panel:#111827; --home-soft:#1a2333; --home-card-bg:#162032; }
html.theme-dark .home-hero { background:radial-gradient(circle at 80% 20%,rgba(0,161,214,.2),transparent 40%),radial-gradient(circle at 95% 85%,rgba(139,92,246,.2),transparent 35%),linear-gradient(125deg,#080d18,#0f1a2e 45%,#1e1438); }
html.theme-dark .home-showcase-card { background:#1a2240; }
html.theme-dark .home-sticky-item { background:#162032; border-color:#263044; color:var(--home-ink); }
html.theme-dark .home-sticky-pin { background:#1e3a5f; color:#4dd0e1; }
html.theme-dark .home-feed-surface, html.theme-dark .home-side-panel { background:var(--home-panel); border-color:var(--home-line); }
html.theme-dark .home-post-card { background:var(--home-card-bg); }
html.theme-dark .home-post-cover { background:#1a2333; }
html.theme-dark .home-post-cover.is-placeholder { background:linear-gradient(135deg,#1a2a45,#1e2335); }
html.theme-dark .home-post-cover.is-placeholder::before { color:#3a4862; }
html.theme-dark .home-sort-controls a:hover { background:#1a2a45; }
html.theme-dark .home-rank-number { background:#1a2333; }
html.theme-dark .home-rank-item:nth-child(1) .home-rank-number { background:#c0392b; }
html.theme-dark .home-rank-item:nth-child(2) .home-rank-number { background:#b9770e; }
html.theme-dark .home-rank-item:nth-child(3) .home-rank-number { background:#b7950b; }
html.theme-dark 
/* ===== 置顶横滚条 ===== */
.home-sticky-bar { margin-bottom:12px; }
.home-sticky-bar-head h3 { margin:0 0 8px; font-size:15px; color:var(--home-ink); }
.home-sticky-scroll { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.home-sticky-scroll::-webkit-scrollbar { height:4px; }
.home-sticky-scroll::-webkit-scrollbar-thumb { background:#ccc; border-radius:2px; }
.home-sticky-chip { flex:0 0 auto; display:flex; gap:8px; align-items:center; padding:6px 10px 6px 6px; border:1px solid var(--home-line); border-radius:8px; background:var(--home-card-bg); text-decoration:none; color:var(--home-ink); transition:border-color .15s; }
.home-sticky-chip:hover { border-color:var(--home-indigo); }
.home-sticky-chip-cover { width:48px; height:36px; flex:0 0 auto; border-radius:4px; overflow:hidden; background:var(--home-soft); }
.home-sticky-chip-cover img { width:100%; height:100%; object-fit:cover; }
.home-sticky-chip-cover.is-placeholder { background:linear-gradient(135deg,#e8f4fa,#f0f0f8); }
.home-sticky-chip-info { min-width:0; max-width:180px; }
.home-sticky-chip-title { display:block; font-size:12px; font-weight:600; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.home-sticky-chip-meta { display:block; margin-top:2px; font-size:10px; color:var(--home-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== 广告横幅 ===== */
.home-ad-banner { margin-bottom:12px; border-radius:var(--home-radius); overflow:hidden; }
.home-ad-banner a { display:block; text-decoration:none; position:relative; }
.home-ad-banner img, .home-ad-banner video { width:100%; aspect-ratio:8/1; object-fit:cover; display:block; background:var(--home-soft); }
.home-ad-banner-copy { position:absolute; bottom:0; left:0; right:0; padding:8px 14px; background:linear-gradient(transparent,rgba(0,0,0,.7)); color:#fff; font-size:13px; font-weight:600; }

/* ===== 响应式 ===== */
@media (max-width:1280px) { .home-feed-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } .home-top { grid-template-columns:1fr 1fr; } }
@media (max-width:1024px) {
  .home-three-col { grid-template-columns:1fr 250px; }
  .home-left-side { display:none; }
  .home-feed-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .home-top { grid-template-columns:1fr; }
  .home-toplist-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .home-main-grid { grid-template-columns:minmax(0,1fr) 260px; }
}
@media (max-width:768px) {
  .home-three-col { grid-template-columns:1fr; }
  .home-left-side, .home-right-side { position:static; }
  .home-right-side { grid-template-columns:1fr 1fr; }
  .home-publish-card { grid-column:1/-1; }
  .home-redesign { width:calc(100% - 24px); padding-top:8px; }
  .home-toplist-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-feed-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .home-main-grid { grid-template-columns:1fr; }
  .home-side { position:static; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-publish-card { grid-column:1/-1; }
  .home-feed-toolbar { flex-direction:column; align-items:flex-start; }
}
@media (max-width:480px) {
  .home-toplist-grid { grid-template-columns:1fr 1fr; }
  .home-feed-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .home-side { grid-template-columns:1fr; }
  .home-post-body { padding:6px 4px; }
  .home-post-title { font-size:12px; }
}



/* 大号快捷按钮 */
.home-quick-btn--lg { padding:14px 14px; font-size:14px; font-weight:700; border-radius:8px; }
.home-quick-btn--lg:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,161,214,.12); }

/* 翻页 — 简洁版 */
.home-pagination { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:20px; padding:10px 0; background:#fff !important; border-radius:4px; }
.home-pagination a, .home-pagination span { display:inline-block; padding:4px 10px; font-size:14px; color:#555; text-decoration:none; background:#fff; border-radius:4px; }
.home-pagination a:hover { color:#00a1d6; }
.home-pagination span.active { color:#00a1d6; font-weight:bold; }
html.theme-dark .home-pagination a, html.theme-dark .home-pagination span { color:#9ca3af; }
html.theme-dark .home-pagination a:hover, html.theme-dark .home-pagination span.active { color:#4dd0e1; }

/* 换一换按钮加载中状态 */
.home-banner-refresh:disabled { opacity:.7; }

/* ===== 首页顶部媒体 16:9 修复（2026-07-29）===== */
/* 标题改为封面内叠加，避免改变原有桌面端组件高度。 */
.home-toplist-card { position:relative; }
.home-toplist-cover {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  aspect-ratio:16/9;
  flex:none;
  min-height:0;
}
.home-toplist-info {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:2;
  padding:16px 7px 5px;
  background:linear-gradient(transparent,rgba(0,0,0,.78));
}
.home-toplist-title { color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.45); }
.home-toplist-views { color:rgba(255,255,255,.78); }

@media (min-width:1025px) {
  .home-top {
    grid-template-columns:35.555556% calc(53.333333% - 88px);
    justify-content:center;
    align-items:stretch;
  }
  .home-banner {
    width:100%;
    height:100%;
    aspect-ratio:16/9;
    justify-self:center;
  }
  .home-toplist {
    width:100%;
    height:100%;
    justify-self:center;
  }
  .home-toplist-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-auto-rows:1fr;
  }
  .home-toplist-card {
    width:100%;
    height:100%;
    aspect-ratio:16/9;
  }
}

@media (max-width:1024px) {
  .home-top {
    height:auto;
    aspect-ratio:auto;
    grid-template-columns:1fr;
    justify-items:center;
    gap:12px;
  }
  .home-banner {
    width:min(100%,640px);
    height:auto;
    aspect-ratio:16/9;
    justify-self:center;
  }
  .home-toplist {
    width:100%;
    height:auto;
    overflow:visible;
  }
  .home-toplist-grid {
    grid-template-columns:repeat(3,minmax(0,240px));
    grid-auto-rows:auto;
    justify-content:center;
  }
  .home-toplist-card {
    width:100%;
    height:auto;
    aspect-ratio:16/9;
  }
}

@media (max-width:600px) {
  .home-toplist-grid { grid-template-columns:repeat(2,minmax(0,240px)); }
  .home-toplist-info { padding:12px 5px 4px; }
}
/* ===== 首页顶部媒体 16:9 修复结束 ===== */
