/* ===== StarFlix Dark Theme Reset ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-tap-highlight-color:transparent}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei","Helvetica Neue",sans-serif;color:#fff;background:#0a0a0a;line-height:1.6;min-height:100vh;-webkit-font-smoothing:antialiased}
a{color:#ccc;text-decoration:none;transition:color .2s}
a:hover{color:#fff}
img{max-width:100%;height:auto;display:block}
ul,ol{list-style:none}
button{cursor:pointer;border:none;outline:none;font-family:inherit}
input,select,textarea{font-family:inherit;outline:none}

/* ===== Scrollbar ===== */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:#0a0a0a}
::-webkit-scrollbar-thumb{background:#333;border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:#555}

/* ===== Layout ===== */
.wrap{max-width:1400px;margin:0 auto;padding:0 40px}

/* ===== Header ===== */
.header{position:fixed;top:0;left:0;right:0;z-index:1000;background:linear-gradient(180deg,rgba(0,0,0,.95) 0%,rgba(0,0,0,.85) 60%,transparent 100%);transition:background .3s}
.header.scrolled{background:rgba(10,10,10,.97);backdrop-filter:blur(12px)}
.header-inner{
    display:flex;
    align-items:center;
    height:64px;
    gap:24px;
    max-width:1400px;
    margin:0 auto;
    padding:0 40px;
    /* 核心：两端固定，中间区域自动占位 */
    justify-content: space-between;
}

/* Logo 左侧固定，禁止压缩 */
.header-logo{
    display:flex;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}
.header-logo .logo-text{font-size:22px;font-weight:700;color:#e50914;letter-spacing:3px;text-transform:uppercase;line-height:1}
.header-logo .logo-icon{width:32px;height:32px;background:#e50914;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.header-logo .logo-icon svg{width:18px;height:18px;fill:#fff}

/* 新增导航外层nav容器，用来居中导航 */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
}
/* Nav 导航栏自身不拉伸 */
.header-nav{
    display:flex;
    gap:4px;
    flex-shrink:0;
}
.header-nav a{display:block;padding:6px 14px;font-size:13px;color:#ccc;border-radius:4px;transition:all .2s;white-space:nowrap}
.header-nav a:hover{color:#fff;background:rgba(255,255,255,.08)}
.header-nav a.active{color:#fff;font-weight:600}

/* Search 右侧固定，取消flex:1，限制最大宽度不拉伸 */
.header-search-wrap{
    flex-shrink: 0;
    width: 400px;
}
.header-search{display:flex;width:100%}
.header-search input{flex:1;height:36px;border:1px solid rgba(255,255,255,.15);border-right:none;border-radius:6px 0 0 6px;padding:0 14px;font-size:13px;color:#fff;background:rgba(255,255,255,.06);transition:all .2s}
.header-search input::placeholder{color:#666}
.header-search input:focus{border-color:rgba(229,9,20,.5);background:rgba(255,255,255,.1)}
.header-search button{height:36px;padding:0 18px;background:#e50914;color:#fff;border:none;border-radius:0 6px 6px 0;font-size:13px;white-space:nowrap;transition:background .2s}
.header-search button:hover{background:#f40612}

/* 移动端补充（可选，小屏隐藏搜索，显示汉堡菜单） */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
@media (max-width: 992px) {
  nav{
    flex: 0;
  }
    .header-search-wrap {
        display: none;
    }
    .menu-toggle {
        display: block;
    }
    .header-nav {
        display: none;
    }
}

/* Right nav */
.header-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}

/* Mobile toggle */
.menu-toggle{display:none;background:none;border:none;font-size:24px;color:#ccc;padding:4px 8px}

@media(max-width:1024px){
  .header-nav{display:none;position:absolute;top:64px;left:0;right:0;background:rgba(10,10,10,.98);backdrop-filter:blur(12px);flex-direction:column;padding:12px 40px;gap:0;border-top:1px solid #222}
  .header-nav.show{display:flex}
  .menu-toggle{display:block}
  .header-nav a{padding:12px 0;border-bottom:1px solid #1a1a1a;font-size:14px}
  .header-nav a:last-child{border-bottom:none}
  .header-search-wrap{max-width:100%}
}
@media(max-width:640px){
  .wrap,.header-inner{padding:0 16px}
  .header-inner{height:56px;gap:12px}
  .header-logo .logo-text{font-size:18px;letter-spacing:2px}
  .header-nav{top:56px;padding:8px 16px}
  .header-nav.show{display:flex}
}

/* ===== Hero Banner ===== */
.hero-banner{position:relative;width:100%;height:75vh;min-height:500px;max-height:800px;overflow:hidden;margin-bottom:0}
.hero-banner .banner-bg{position:absolute;inset:0;background-size:cover;background-position:center top;background-repeat:no-repeat;transition:opacity .6s}
.hero-banner .banner-bg::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,10,10,.4) 0%,rgba(10,10,10,.2) 30%,rgba(10,10,10,.9) 100%),linear-gradient(90deg,rgba(10,10,10,.85) 0%,rgba(10,10,10,.3) 50%,rgba(10,10,10,.1) 100%)}
.hero-banner .banner-content{position:absolute;bottom:15%;left:60px;max-width:520px;z-index:2}
.hero-banner .banner-content h1{font-size:42px;font-weight:700;color:#fff;margin-bottom:12px;line-height:1.2;text-shadow:0 2px 8px rgba(0,0,0,.5)}
.hero-banner .banner-content .banner-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:13px;color:#ccc;margin-bottom:16px}
.hero-banner .banner-content .banner-meta span{color:#666;font-weight:600}
.hero-banner .banner-content .banner-desc{font-size:14px;color:#ccc;line-height:1.7;margin-bottom:20px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.hero-banner .banner-content .banner-btns{display:flex;gap:12px;flex-wrap:wrap}
.hero-banner .banner-content .btn-play{display:inline-flex;align-items:center;gap:6px;padding:10px 28px;background:#e50914;color:#fff;font-size:15px;font-weight:600;border-radius:6px;transition:all .2s}
.hero-banner .banner-content .btn-play:hover{background:#f40612;transform:scale(1.03)}
.hero-banner .banner-content .btn-play svg{width:18px;height:18px;fill:#fff}
.hero-banner .banner-content .btn-secondary{display:inline-flex;align-items:center;gap:6px;padding:10px 24px;background:rgba(255,255,255,.15);color:#fff;font-size:14px;font-weight:500;border-radius:6px;transition:all .2s;border:1px solid rgba(255,255,255,.2)}
.hero-banner .banner-content .btn-secondary:hover{background:rgba(255,255,255,.25);border-color:rgba(255,255,255,.4)}
.hero-banner .banner-content .btn-info{display:inline-flex;align-items:center;gap:6px;padding:10px 24px;background:rgba(109,109,110,.7);color:#fff;font-size:14px;font-weight:500;border-radius:6px;transition:all .2s}
.hero-banner .banner-content .btn-info:hover{background:rgba(109,109,110,.9)}
.banner-dots{position:absolute;bottom:8%;right:60px;z-index:2;display:flex;gap:8px}
.banner-dots .dot{width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,.4);cursor:pointer;transition:all .3s}
.banner-dots .dot.active{background:#e50914;width:24px;border-radius:5px}

@media(max-width:768px){
  .hero-banner{height:60vh;min-height:400px}
  .hero-banner .banner-content{left:24px;bottom:12%;right:24px;max-width:100%}
  .hero-banner .banner-content h1{font-size:28px}
  .hero-banner .banner-content .banner-desc{font-size:13px;-webkit-line-clamp:2}
  .hero-banner .banner-content .banner-btns{gap:8px}
  .hero-banner .banner-content .btn-play,.hero-banner .banner-content .btn-secondary,.hero-banner .banner-content .btn-info{padding:8px 18px;font-size:13px}
  .banner-dots{right:24px;bottom:10%}
}

/* ===== Section ===== */
.main-content{padding:0 40px;max-width:1400px;margin:0 auto;margin-top: 65px;}
.hero-banner+.main-content{margin-top:0}
.section-row{margin-bottom:44px}
.section-row:last-child{margin-bottom:0}
.section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.section-header h2{font-size:20px;font-weight:700;color:#fff}
.section-header .more-link{font-size:13px;color:#aaa;display:flex;align-items:center;gap:4px;transition:color .2s}
.section-header .more-link:hover{color:#e50914}
.section-header .more-link svg{width:12px;height:12px;fill:#aaa;transition:fill .2s}
.section-header .more-link:hover svg{fill:#e50914}

/* ===== Horizontal Scroll Row ===== */
.scroll-row{display:flex;gap:10px;overflow-x:auto;scroll-behavior:smooth;padding-bottom:8px;-ms-overflow-style:none;scrollbar-width:none}
.scroll-row::-webkit-scrollbar{display:none}
.scroll-row .poster-card{flex:0 0 calc(16.666% - 8.5px);min-width:150px;text-align:center}
.scroll-row .poster-card .poster-wrap{position:relative;width:100%;aspect-ratio:2/3;background:#1a1a1a;border-radius:6px;overflow:hidden;transition:transform .3s,box-shadow .3s}
.scroll-row .poster-card:hover .poster-wrap{transform:scale(1.05);box-shadow:0 8px 24px rgba(0,0,0,.5);z-index:2}
.scroll-row .poster-card .poster-wrap img{width:100%;height:100%;object-fit:cover}
.scroll-row .poster-card .poster-wrap .placeholder-poster{width:100%;height:100%;background:linear-gradient(135deg,#1a1a1a,#2a2a2a);display:flex;align-items:center;justify-content:center;color:#444;font-size:12px}
.scroll-row .poster-card .rating-badge{position:absolute;top:6px;left:6px;background:#e50914;color:#fff;font-size:11px;font-weight:700;padding:2px 6px;border-radius:3px;z-index:1}
.scroll-row .poster-card .poster-title{display:block;margin-top:8px;font-size:13px;color:#ccc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:color .2s}
.scroll-row .poster-card:hover .poster-title{color:#fff}
.scroll-row .poster-card .poster-year{font-size:11px;color:#666;margin-top:2px}

@media(max-width:1024px){
  .scroll-row .poster-card{flex:0 0 calc(20% - 8px);min-width:130px}
}
@media(max-width:768px){
  .main-content{padding:0 16px}
  .scroll-row .poster-card{flex:0 0 calc(33.33% - 7px);min-width:100px}
}
@media(max-width:480px){
  .scroll-row .poster-card{flex:0 0 calc(50% - 5px);min-width:90px}
}

/* ===== Grid Layout (List Pages) ===== */
.mt{margin-top: 40px;}
.poster-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}
.poster-grid .poster-card{text-align:center}
.poster-grid .poster-card .poster-wrap{position:relative;width:100%;aspect-ratio:2/3;background:#1a1a1a;border-radius:6px;overflow:hidden;transition:transform .3s,box-shadow .3s}
.poster-grid .poster-card:hover .poster-wrap{transform:translateY(-3px);box-shadow:0 6px 20px rgba(0,0,0,.5)}
.poster-grid .poster-card .poster-wrap img{width:100%;height:100%;object-fit:cover}
.poster-grid .poster-card .poster-wrap .placeholder-poster{width:100%;height:100%;background:linear-gradient(135deg,#1a1a1a,#2a2a2a);display:flex;align-items:center;justify-content:center;color:#444;font-size:12px}
.poster-grid .poster-card .rating-badge{position:absolute;top:6px;left:6px;background:#e50914;color:#fff;font-size:10px;font-weight:700;padding:2px 6px;border-radius:3px;z-index:1}
.poster-grid .poster-card .poster-title{display:block;margin-top:8px;font-size:12px;color:#ccc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:color .2s}
.poster-grid .poster-card:hover .poster-title{color:#fff}
.poster-grid .poster-card .poster-year{font-size:11px;color:#666;margin-top:2px}

@media(max-width:1200px){
  .poster-grid{grid-template-columns:repeat(6,1fr)}
}
@media(max-width:768px){
  .poster-grid{grid-template-columns:repeat(4,1fr);gap:10px}
}
@media(max-width:480px){
  .poster-grid{grid-template-columns:repeat(3,1fr);gap:8px}
}

/* ===== Page Header (List pages) ===== */
.page-header{padding:24px 0 16px}
.page-header h1{font-size:24px;font-weight:700;color:#fff}
.page-header .page-subtitle{font-size:13px;color:#999;margin-top:4px}

/* ===== Filter Bars ===== */
.filter-section{margin-bottom:20px}
.filter-row{display:flex;align-items:flex-start;margin-bottom:10px;gap:10px}
.filter-row:last-child{margin-bottom:0}
.filter-label{flex-shrink:0;font-size:12px;color:#888;padding:5px 0;min-width:48px;font-weight:500}
.filter-tags{display:flex;flex-wrap:wrap;gap:6px}
.filter-tags a{display:inline-block;padding:4px 12px;font-size:12px;color:#999;border:1px solid rgba(255,255,255,.1);border-radius:20px;transition:all .2s;white-space:nowrap}
.filter-tags a:hover{color:#fff;border-color:rgba(255,255,255,.3)}
.filter-tags a.active{background:#e50914;color:#fff;border-color:#e50914;font-weight:600}

/* Sort bar */
.sort-bar{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid #1a1a1a;margin-bottom:16px}
.sort-bar .sort-tabs{display:flex;gap:4px}
.sort-bar .sort-tabs a{font-size:13px;color:#999;padding:4px 14px;border-radius:4px;transition:all .2s}
.sort-bar .sort-tabs a:hover{color:#fff}
.sort-bar .sort-tabs a.active{color:#fff;background:rgba(255,255,255,.1);font-weight:600}
.sort-bar .result-count{font-size:13px;color:#666}

/* ===== Detail Page (hero) ===== */
.detail-hero{position:relative;padding:100px 40px 60px;min-height:450px;overflow:hidden}
.detail-hero .hero-bg{position:absolute;inset:0;background-size:cover;background-position:center 20%;background-repeat:no-repeat;filter:blur(40px) brightness(.4);transform:scale(1.1)}
.detail-hero .hero-overlay{position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,10,10,.6) 0%,rgba(10,10,10,.95) 100%)}
.detail-hero .hero-inner{position:relative;z-index:1;display:flex;gap:32px;max-width:1400px;margin:0 auto}
.detail-hero .hero-poster{width:220px;flex-shrink:0}
.detail-hero .hero-poster img{width:100%;border-radius:8px;box-shadow:0 8px 30px rgba(0,0,0,.6)}
.detail-hero .hero-poster .placeholder-poster{width:100%;aspect-ratio:2/3;background:linear-gradient(135deg,#1a1a1a,#2a2a2a);border-radius:8px;display:flex;align-items:center;justify-content:center;color:#444}
.detail-hero .hero-info{flex:1;min-width:0}
.detail-hero .hero-info h1{font-size:32px;font-weight:700;color:#fff;margin-bottom:10px}
.detail-hero .hero-info .hero-meta{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:13px;color:#aaa;margin-bottom:10px}
.detail-hero .hero-info .hero-meta .score{color:#46d369;font-weight:700;font-size:15px}
.detail-hero .hero-info .hero-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.detail-hero .hero-info .hero-tags a{font-size:12px;color:#aaa;border:1px solid #333;padding:2px 10px;border-radius:4px;transition:all .2s}
.detail-hero .hero-info .hero-tags a:hover{color:#fff;border-color:#555}
.detail-hero .hero-info .hero-crew{font-size:13px;color:#999;line-height:1.8;margin-bottom:14px}
.detail-hero .hero-info .hero-crew strong{color:#ccc;font-weight:500}
.detail-hero .hero-info .hero-btns{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.detail-hero .hero-info .hero-btns .btn-play{display:inline-flex;align-items:center;gap:6px;padding:10px 28px;background:#e50914;color:#fff;font-size:15px;font-weight:600;border-radius:6px;transition:all .2s;border:none}
.detail-hero .hero-info .hero-btns .btn-play:hover{background:#f40612}
.detail-hero .hero-info .hero-btns .btn-play svg{width:16px;height:16px;fill:#fff}
.detail-hero .hero-info .hero-btns .btn-icon{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.2);border-radius:50%;color:#fff;font-size:16px;background:rgba(255,255,255,.05);transition:all .2s}
.detail-hero .hero-info .hero-btns .btn-icon:hover{border-color:rgba(255,255,255,.5);background:rgba(255,255,255,.1)}
.detail-hero .hero-info .hero-desc{font-size:14px;color:#aaa;line-height:1.8;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.detail-hero .hero-info .hero-desc.expanded{-webkit-line-clamp:unset}

@media(max-width:768px){
  .detail-hero{padding:80px 16px 40px}
  .detail-hero .hero-inner{flex-direction:column;align-items:center;text-align:center}
  .detail-hero .hero-poster{width:160px}
  .detail-hero .hero-info h1{font-size:24px}
  .detail-hero .hero-info .hero-meta{justify-content:center}
  .detail-hero .hero-info .hero-tags{justify-content:center}
  .detail-hero .hero-info .hero-btns{justify-content:center}
}

/* ===== Player Section ===== */
.player-section{max-width:1400px;margin:0 auto;padding:0 40px 32px}
.player-container{width:100%;aspect-ratio:16/9;background:#000;border-radius:8px;overflow:hidden;position:relative}
.player-container iframe{width:100%;height:100%;border:none}
.player-container .play-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:rgba(255,255,255,.3)}
.play-placeholder .play-triangle{width:0;height:0;border-style:solid;border-width:24px 0 24px 42px;border-color:transparent transparent transparent rgba(255,255,255,.6);margin-bottom:20px;cursor:pointer;transition:border-color .2s}
.play-placeholder .play-triangle:hover{border-color:transparent transparent transparent #e50914}

/* ===== Episode List ===== */
.episode-section{max-width:1400px;margin:0 auto;padding:0 40px 32px}
.episode-section .ep-heading{font-size:16px;font-weight:600;color:#fff;margin-bottom:12px}
.source-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.source-tabs .tab-btn{padding:6px 16px;font-size:13px;color:#999;border:1px solid #333;border-radius:20px;background:transparent;cursor:pointer;transition:all .2s}
.source-tabs .tab-btn:hover{color:#fff;border-color:#555}
.source-tabs .tab-btn.active{background:#e50914;color:#fff;border-color:#e50914}
.episode-list{display:none;flex-wrap:wrap;gap:8px}
.episode-list.active{display:flex}
.episode-list a{display:inline-block;padding:6px 14px;font-size:13px;color:#ccc;border:1px solid #2a2a2a;border-radius:4px;transition:all .2s}
.episode-list a:hover{color:#fff;border-color:#555}
.episode-list a.active{background:#e50914;color:#fff;border-color:#e50914}

/* ===== Related Section ===== */
.related-section{max-width:1400px;margin:0 auto;padding:0 40px 40px}
.related-section h2{font-size:18px;font-weight:700;color:#fff;margin-bottom:16px}

/* ===== Comments Section ===== */
.comments-section{max-width:1400px;margin:0 auto;padding:0 40px 48px}
.comments-section h2{font-size:18px;font-weight:700;color:#fff;margin-bottom:16px}

/* ===== Pagination ===== */
.pagination{display:flex;justify-content:center;align-items:center;gap:4px;padding:32px 0}
.pagination a,.pagination span{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;font-size:13px;color:#999;border:1px solid #2a2a2a;border-radius:4px;transition:all .2s}
.pagination a:hover{color:#fff;border-color:#555;background:rgba(255,255,255,.05)}
.pagination a.active,.pagination span.active{background:#e50914;color:#fff;border-color:#e50914;font-weight:600}
.pagination span.dots{border-color:transparent;color:#666}
.pagination .prev-next{font-size:12px}
.pagination .page-info{font-size:12px;color:#666;margin:0 8px}

/* ===== Footer ===== */
.footer{background:#0a0a0a;border-top:1px solid #1a1a1a;padding:32px 40px 24px}
.footer-inner{max-width:1400px;margin:0 auto}
.footer-links{display:flex;justify-content:center;gap:24px;margin-bottom:12px;flex-wrap:wrap}
.footer-links a{font-size:12px;color:#666;transition:color .2s}
.footer-links a:hover{color:#ccc}
.footer-copy{text-align:center;font-size:12px;color:#555}

@media(max-width:768px){
  .footer{padding:24px 16px}
}

/* ===== Back to Top ===== */
.back-to-top{position:fixed;bottom:30px;right:30px;width:42px;height:42px;background:rgba(229,9,20,.85);color:#fff;border:none;border-radius:50%;font-size:18px;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:99;transition:all .2s}
.back-to-top:hover{background:#e50914;transform:translateY(-2px)}
.back-to-top.show{display:flex}

/* ===== Utility ===== */
.d-none{display:none}
.text-center{text-align:center}
.mb-16{margin-bottom:16px}

/* ===== Friend Links ===== */
.friend-links{display:flex;flex-wrap:wrap;gap:10px;padding:16px 0;border-top:1px solid #1a1a1a;margin-top:16px}
.friend-links a{font-size:12px;color:#555;transition:color .2s}
.friend-links a:hover{color:#ccc}

/* ===== Sub-category menu ===== */
.sub-menu{display:flex;flex-wrap:wrap;gap:6px;padding:12px 0}
.sub-menu a{display:inline-block;padding:4px 14px;font-size:12px;color:#999;border:1px solid #2a2a2a;border-radius:20px;transition:all .2s}
.sub-menu a:hover{color:#fff;border-color:#444}
.sub-menu a.active{background:#e50914;color:#fff;border-color:#e50914}

/* ===== Active filter tags display ===== */
.active-tags{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0}
.active-tags .tag-item{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;background:#1a1a1a;border:1px solid #2a2a2a;border-radius:20px;font-size:12px;color:#ccc}
.active-tags .tag-item .close{color:#666;font-size:14px;cursor:pointer;line-height:1}
.active-tags .tag-item .close:hover{color:#e50914}
