/*
Theme Name: Hanfan Vodi Child
Theme URI: https://hanfan.net/
Description: Child theme for Vodi, tailored for Hanfan.net video portal.
Author: Hanfan
Template: vodi
Version: 1.0.6
Text Domain: hanfan-vodi
*/

/* Hanfan visual system (33dy-like blocks, clean cards) */
:root{--hanfan-border:rgba(0,0,0,.08);--hanfan-muted:#6c757d;--hanfan-bg:#f6f7fb;--hanfan-radius:12px}

body{background:var(--hanfan-bg)}

/* 站点整体宽度：大屏更接近 33dy 的宽布局 */
@media (min-width: 1200px){
  .container, .container-lg, .container-md, .container-sm, .container-xl{
    max-width: 1320px;
  }
}

.hanfan-wrap{padding:22px 0}

/* Home page 2-column layout (do not depend on Bootstrap grid) */
.hanfan-wrap .hanfan-home-layout{display:flex!important;align-items:flex-start!important;gap:18px!important}
.hanfan-wrap .hanfan-home-main{flex:1 1 auto;min-width:0}
.hanfan-wrap .hanfan-home-aside{flex:0 0 320px;width:320px}
@media (max-width: 1200px){
  .hanfan-wrap .hanfan-home-aside{flex-basis:300px;width:300px}
}
@media (max-width: 992px){
  .hanfan-wrap .hanfan-home-layout{display:block!important}
  .hanfan-wrap .hanfan-home-aside{width:auto}
}
.hanfan-block{background:#fff;border:1px solid var(--hanfan-border);border-radius:var(--hanfan-radius);box-shadow:0 6px 18px rgba(0,0,0,.03);padding:16px}
.hanfan-block + .hanfan-block{margin-top:16px}

.hanfan-block-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.hanfan-block-head .title{font-size:18px;font-weight:700;display:flex;align-items:center;gap:8px}
.hanfan-block-head .more{font-size:13px;color:var(--hanfan-muted)}
.hanfan-block-head .more:hover{color:#111}


/* 方片统一：缩略图严格 200×300（33dy 风格）
   关键点：列宽固定 200px，避免被拉伸导致“尺寸不一致” */
.hanfan-grid{display:grid;grid-template-columns:repeat(auto-fill,200px);gap:14px;justify-content:flex-start}
@media (max-width: 1200px){.hanfan-grid{grid-template-columns:repeat(auto-fill,190px)}}
@media (max-width: 992px){.hanfan-grid{grid-template-columns:repeat(auto-fill,180px)}}
@media (max-width: 768px){.hanfan-grid{grid-template-columns:repeat(auto-fill,160px)}}
@media (max-width: 520px){.hanfan-grid{grid-template-columns:repeat(2,1fr)}}

/* 分类区块内（带右侧榜单）也保持固定列宽，避免最后一列挤到榜单旁边 */
.hanfan-section-body .hanfan-grid{grid-template-columns:repeat(auto-fill,200px)}
@media (max-width: 1200px){.hanfan-section-body .hanfan-grid{grid-template-columns:repeat(auto-fill,190px)}}
@media (max-width: 992px){.hanfan-section-body .hanfan-grid{grid-template-columns:repeat(auto-fill,180px)}}
@media (max-width: 768px){.hanfan-section-body .hanfan-grid{grid-template-columns:repeat(auto-fill,160px)}}
@media (max-width: 520px){.hanfan-section-body .hanfan-grid{grid-template-columns:repeat(2,1fr)}}

.hanfan-card-item{width:200px}
@media (max-width: 1200px){.hanfan-card-item{width:190px}}
@media (max-width: 992px){.hanfan-card-item{width:180px}}
@media (max-width: 768px){.hanfan-card-item{width:160px}}

.hanfan-poster{position:relative;overflow:hidden;border-radius:10px;background:rgba(0,0,0,.04);width:100%}
.hanfan-poster img{width:100%;height:300px;object-fit:cover;display:block}
@media (max-width: 1200px){.hanfan-poster img{height:285px}}
@media (max-width: 992px){.hanfan-poster img{height:270px}}
@media (max-width: 768px){.hanfan-poster img{height:240px}}

.hanfan-poster .badge-remarks{position:absolute;right:8px;top:8px;background:rgba(0,0,0,.75);color:#fff;padding:2px 6px;border-radius:6px;font-size:12px}
.hanfan-card-title{font-size:14px;font-weight:600;margin-top:8px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hanfan-card-meta{font-size:12px;color:var(--hanfan-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.hanfan-side{background:#fff;border:1px solid var(--hanfan-border);border-radius:var(--hanfan-radius);box-shadow:0 6px 18px rgba(0,0,0,.03);padding:14px}
.hanfan-side + .hanfan-side{margin-top:16px}
.hanfan-side h3{font-size:16px;font-weight:700;margin:0 0 10px 0}

/* Home: section layout like 33dy (cards + right ranking)
   目标：榜单始终贴右对齐，并与缩略图区留出明显空隙（不“贴着海报”） */
.hanfan-wrap .hanfan-section-body{display:flex!important;gap:34px!important;align-items:flex-start!important}
.hanfan-section-main{flex:1;min-width:0;padding-right:6px}
.hanfan-wrap .hanfan-section-rank{width:280px;min-width:280px;border-left:1px solid var(--hanfan-border);padding-left:18px}
@media (max-width: 992px){
  .hanfan-wrap .hanfan-section-body{flex-direction:column!important}
  .hanfan-wrap .hanfan-section-rank{width:auto;min-width:0}
}

/* Home: right global sidebar */
.hanfan-sticky{position:sticky;top:90px}

/* News cards (2 per row, thumb + title + date) */
.hanfan-news-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media (max-width: 768px){.hanfan-news-grid{grid-template-columns:1fr}}
.hanfan-news-item{display:flex;gap:12px;align-items:flex-start}
.hanfan-news-thumb{width:110px;min-width:110px;height:72px;border-radius:10px;overflow:hidden;background:rgba(0,0,0,.04)}
.hanfan-news-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.hanfan-news-title{font-weight:800;font-size:14px;line-height:1.25;max-height:2.5em;overflow:hidden}
.hanfan-news-meta{font-size:12px;color:var(--hanfan-muted);margin-top:4px}

/* --- Strong overrides to match 33dy layout (prevent parent theme overrides) --- */
.hanfan-wrap .hanfan-section-body{display:flex!important;gap:34px!important;align-items:flex-start!important}
.hanfan-wrap .hanfan-section-rank{flex:0 0 280px!important;width:280px!important;min-width:280px!important;border-left:1px solid var(--hanfan-border);padding-left:18px}
@media (max-width: 992px){
  .hanfan-wrap .hanfan-home-layout{display:block!important}
  .hanfan-wrap .hanfan-home-aside{width:auto!important}
  .hanfan-wrap .hanfan-section-body{display:block!important}
  .hanfan-wrap .hanfan-section-rank{width:auto!important;min-width:0!important;margin-top:12px}
}

/* News精选：固定 4 行（8 条），卡片统一高度 */
.hanfan-news-grid{grid-auto-rows:1fr}
.hanfan-news-item{height:96px;overflow:hidden}
.hanfan-news-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

.hanfan-side-list{list-style:none;margin:0;padding:0}
.hanfan-side-list li{display:flex;gap:8px;align-items:flex-start;margin:0 0 8px 0}
.hanfan-side-list .idx{min-width:18px;height:18px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;background:rgba(0,0,0,.06);color:#333}
.hanfan-side-list a{display:block;line-height:1.25;max-height:2.5em;overflow:hidden}
.hanfan-side-list .muted{font-size:12px;color:var(--hanfan-muted)}
.hanfan-section-title{display:flex;align-items:center;justify-content:space-between;margin:1.25rem 0 .75rem}
.hanfan-card{margin-bottom:1rem}
.hanfan-card .poster{position:relative;overflow:hidden;border-radius:.5rem}
.hanfan-card .badge-remarks{position:absolute;right:.5rem;top:.5rem}
.hanfan-episode-list a{display:inline-block;margin:.25rem .25rem 0 0;padding:.35rem .55rem;border:1px solid rgba(0,0,0,.1);border-radius:.35rem}
.hanfan-episode-list a.active{font-weight:700}
.hanfan-player{position:relative;padding-top:56.25%;background:#000;border-radius:.5rem;overflow:hidden}
.hanfan-player iframe{position:absolute;left:0;top:0;width:100%;height:100%;border:0}

/* News content safety: prevent vertical/column layout issues */
.entry-content, .hanfan-news-content{writing-mode:horizontal-tb!important;column-count:1!important;column-gap:0!important;word-break:break-word;overflow-wrap:anywhere}
.hanfan-news-content p{margin-bottom:12px}
.hanfan-news-content img{max-width:100%;height:auto}

/* Filters (horizontal) */
.hanfan-filters .filter-row{display:flex;flex-wrap:wrap;align-items:flex-start;margin-bottom:.5rem}
.hanfan-filters .filter-row .label{min-width:3.2rem;color:#666;padding-top:.1rem}
.hanfan-filters .filter-row .items{flex:1}
.hanfan-filters .filter-row .items a{display:inline-block;margin:0 .35rem .35rem 0;padding:.25rem .55rem;border:1px solid rgba(0,0,0,.1);border-radius:.35rem}
.hanfan-filters .filter-row .items a.active{font-weight:700;border-color:rgba(0,0,0,.35)}

/* Sidebar lists */
.hanfan-side-list{list-style:none;margin:0;padding:0}
.hanfan-side-list li{margin:0 0 .4rem 0;line-height:1.3}
.hanfan-side-list a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Detail / Play UI */
.hanfan-detail-title{font-size:26px;font-weight:800;letter-spacing:.2px}
@media (max-width:768px){.hanfan-detail-title{font-size:20px}}
.hanfan-poster-placeholder{height:360px;background:rgba(0,0,0,.05)}
.hanfan-detail-tags{display:flex;flex-wrap:wrap;gap:8px}
.hanfan-chip{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.1);font-size:12px;color:#333;background:#fff}
.hanfan-chip:hover{color:#111;border-color:rgba(0,0,0,.25)}
.hanfan-chip-dark{background:#111;color:#fff;border-color:#111}
.hanfan-chip-soft{background:rgba(0,0,0,.04)}
.hanfan-detail-kv div{margin-bottom:6px}
.hanfan-detail-kv span{color:var(--hanfan-muted)}

.hanfan-tabs .nav-link{font-weight:700}
.hanfan-desc{font-size:14px;line-height:1.8}

.hanfan-playlist-tabs{display:flex;flex-wrap:wrap;gap:10px}
.hanfan-line-pill{display:inline-flex;align-items:center;justify-content:center;padding:8px 14px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:#fff;font-size:13px;font-weight:700;color:#333}
.hanfan-line-pill.active{background:#111;color:#fff;border-color:#111}

.hanfan-episode-grid{display:flex;flex-wrap:wrap;gap:10px}
.hanfan-episode-pill{display:inline-flex;align-items:center;justify-content:center;min-width:78px;padding:8px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:#fff;font-size:13px;color:#333}
.hanfan-episode-pill:hover{border-color:rgba(0,0,0,.3)}

/* Filter panel */
.hanfan-filter-panel .card-body{padding:14px 16px}
.hanfan-filter-panel .filter-row{margin-bottom:10px}

/* Play page */
.hanfan-play-title{font-size:18px;font-weight:800;margin-bottom:10px}

/* Home layout helpers */
.hanfan-sticky{position:sticky;top:90px}

.hanfan-section-body{display:flex;gap:18px;align-items:flex-start}
.hanfan-section-main{flex:1;min-width:0}
.hanfan-section-rank{width:260px;min-width:260px}
@media (max-width: 992px){
  .hanfan-section-body{display:block}
  .hanfan-section-rank{width:auto;min-width:0;margin-top:12px}
}

/* News精选：2列小缩略图，4行 */
.hanfan-news-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media (max-width: 768px){.hanfan-news-grid{grid-template-columns:1fr}}
.hanfan-news-item{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid var(--hanfan-border);border-radius:12px;background:#fff}
.hanfan-news-item{height:96px;overflow:hidden}
.hanfan-news-meta{min-width:0}
.hanfan-news-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Rank card look (right side of each category block) */
.hanfan-rank-card{border:1px solid var(--hanfan-border);border-radius:12px;background:#fff;padding:12px}
.hanfan-rank-title{font-size:13px;font-weight:800;margin:0 0 10px 0;color:#222}
.hanfan-news-thumb{width:96px;min-width:96px;height:64px;border-radius:10px;overflow:hidden;background:rgba(0,0,0,.04)}
.hanfan-news-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.hanfan-news-title{font-weight:800;line-height:1.25;margin:0 0 6px 0}
.hanfan-news-meta{font-size:12px;color:var(--hanfan-muted);margin-top:4px}


/* ========================================
   Hanfan minor beautify (safe overrides)
   - 不改动任何采集/参数，仅做 UI 细节优化
   ======================================== */
:root{
  --hanfan-primary:#0b78d1;
  --hanfan-accent:#ff6a00;
}

/* Links */
a{transition:color .15s ease, background-color .15s ease, border-color .15s ease}
a:hover{color:var(--hanfan-primary)}

/* Buttons (兼容 Bootstrap) */
.btn, button, input[type="submit"], .button{border-radius:10px}
.btn-primary, .btn.btn-primary{
  background:var(--hanfan-primary);
  border-color:var(--hanfan-primary);
}
.btn-primary:hover, .btn.btn-primary:hover{filter:brightness(.95)}

/* Cards */
.card, .hanfan-block, .hanfan-side{backdrop-filter:saturate(1.1)}

/* Pagination */
.pagination .page-numbers, .page-links a{
  border-radius:10px !important;
}

/* Search input */
input[type="search"], input[type="text"], input[type="email"], input[type="url"], textarea{
  border-radius:10px;
}

/* Sticky header overlap fix (best-effort) */
.hanfan-sticky{top:86px}

@media (max-width:768px){
  .hanfan-wrap{padding:14px 0}
  .hanfan-block{padding:14px}
}


/* ========================================
   Hanfan "更大气" 视觉升级（2026-02）
   参考：更通透的浅色背景 + 大留白 + 柔和阴影 + 蓝色主色
   注意：仅 CSS 层覆盖，不动采集/参数/数据结构
   ======================================== */

:root{
  --hanfan-bg:#f5f7fb;
  --hanfan-card:#ffffff;
  --hanfan-text:#111827;
  --hanfan-muted:#6b7280;
  --hanfan-border:rgba(17,24,39,.08);
  --hanfan-shadow:0 10px 30px rgba(17,24,39,.08);
  --hanfan-shadow-sm:0 6px 16px rgba(17,24,39,.08);
  --hanfan-radius:16px;
  --hanfan-radius-sm:12px;
  --hanfan-primary:#0b78d1;
  --hanfan-primary-2:#2563eb;
  --hanfan-accent:#ff6a00;
}

body{
  background:radial-gradient(1200px 400px at 70% 0%, rgba(37,99,235,.10), transparent 55%),
             radial-gradient(900px 380px at 0% 20%, rgba(255,106,0,.08), transparent 50%),
             var(--hanfan-bg);
  color:var(--hanfan-text);
}

/* 更舒服的字号/行高（兼容不同设备） */
body, p{font-size:clamp(14px, 0.95vw, 15px);line-height:1.8}

/* 更大气的容器宽度 */
@media (min-width: 1200px){
  .container, .container-lg, .container-md, .container-sm, .container-xl{max-width: 1400px;}
}

/* 通用卡片观感 */
.hanfan-block, .hanfan-side, .card{
  background:var(--hanfan-card);
  border:1px solid var(--hanfan-border);
  border-radius:var(--hanfan-radius);
  box-shadow:var(--hanfan-shadow);
}

.hanfan-block{padding:18px}
.hanfan-side{padding:16px}

.hanfan-block-head .title{font-size:18px}
.hanfan-block-head .more{color:var(--hanfan-muted)}

/* 海报 hover 更高级 */
.hanfan-poster{border-radius:var(--hanfan-radius-sm)}
.hanfan-poster:after{content:'';position:absolute;inset:0;background:linear-gradient(to top, rgba(17,24,39,.20), transparent 55%);opacity:0;transition:opacity .18s ease}
.hanfan-poster:hover:after{opacity:1}
.hanfan-poster img{transition:transform .25s ease, filter .25s ease}
.hanfan-poster:hover img{transform:scale(1.03);filter:saturate(1.05) contrast(1.02)}

/* Tag/Chip 更统一 */
.hanfan-chip{border-radius:999px;border-color:rgba(17,24,39,.10);background:rgba(255,255,255,.85)}
.hanfan-chip:hover{border-color:rgba(11,120,209,.35)}
.hanfan-chip-dark{background:var(--hanfan-primary);border-color:var(--hanfan-primary)}

/* 分页按钮更现代 */
.page-numbers, .pagination .page-numbers{
  border-radius:12px !important;
  border-color:rgba(17,24,39,.10) !important;
  background:rgba(255,255,255,.95) !important;
}
.page-numbers.current, .pagination .page-numbers.current{
  background:var(--hanfan-primary) !important;
  border-color:var(--hanfan-primary) !important;
  color:#fff !important;
}

/* 移动端：留白收敛 */
@media (max-width: 768px){
  .hanfan-wrap{padding:14px 0}
  .hanfan-block{padding:14px;border-radius:14px}
  .hanfan-side{padding:14px;border-radius:14px}
  .hanfan-wrap .hanfan-section-body{gap:18px!important}
}
