/* ========================================
   影视天堂模板 - 主样式
   橙色主题 PC + 移动端自适应
   ======================================== */
:root {
    --primary: #f60;
    --primary-dark: #e55a00;
    --bg-dark: #1a1a1a;
    --bg-header: #333;
    --bg-body: #f5f5f5;
    --bg-white: #fff;
    --text-main: #333;
    --text-light: #999;
    --text-white: #fff;
    --border-color: #eee;
    --radius: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --container-width: 1200px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 14px; color: var(--text-main); background: var(--bg-body); line-height: 1.5; }
a { color: var(--text-main); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; vertical-align: middle; }
ul, ol { list-style: none; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 15px; }
.clearfix::after { content:''; display:block; clear:both; }
.show-pc { display: block; }
.show-mobile { display: none; }

/* ===== Header ===== */
.site-header { background: var(--bg-dark); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; height: 56px; }
.logo a { display: flex; align-items: center; }
.logo img { height: 36px; }
.logo-text { color: var(--primary); font-size: 20px; font-weight: bold; }
.main-nav { margin-left: 40px; display: flex; gap: 24px; }
.main-nav .nav-item { color: var(--text-white); font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav .nav-item:hover, .main-nav .nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.header-right { margin-left: auto; }
.header-icons { display: flex; gap: 16px; }
.header-icons a { color: var(--text-white); font-size: 18px; }
.header-icons a:hover { color: var(--primary); }
.mobile-header { display: none; margin-left: auto; }

/* Sub Header */
.sub-header { background: var(--bg-dark); border-top: 1px solid rgba(255,255,255,.1); }
.sub-header .container { display: flex; align-items: center; height: 44px; gap: 15px; }
.category-btn { color: var(--text-white); background: var(--primary); padding: 6px 14px; border-radius: var(--radius); cursor: pointer; font-size: 13px; white-space: nowrap; }
.search-bar { flex: 1; max-width: 360px; }
.search-bar form { display: flex; }
.search-bar input { flex: 1; height: 32px; border: none; border-radius: var(--radius) 0 0 var(--radius); padding: 0 12px; font-size: 13px; outline: none; }
.search-btn { background: var(--primary); color: #fff; border: none; padding: 0 16px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-size: 13px; }
.hot-tags { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: nowrap; overflow: hidden; }
.hot-tags i { color: var(--primary); }
.hot-tags a { color: var(--text-white); font-size: 12px; white-space: nowrap; }
.hot-tags a:hover { color: var(--primary); }

/* Category Panel */
.category-panel { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 2000; }
.category-panel-inner { background: #fff; max-width: 500px; margin: 60px auto; border-radius: 8px; padding: 30px; position: relative; }
.category-close { position: absolute; top: 15px; right: 15px; cursor: pointer; font-size: 20px; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.category-grid a { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 8px; background: #f8f8f8; font-size: 14px; }
.category-grid a:hover { background: #fff3e6; color: var(--primary); }

/* ===== Section / Module ===== */
.section { margin-top: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; padding: 0 5px; }
.section-title { font-size: 18px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); font-size: 20px; }
.section-more { color: var(--text-light); font-size: 13px; }
.section-more:hover { color: var(--primary); }
.section-tabs { display: flex; gap: 12px; }
.section-tabs a { color: var(--text-light); font-size: 13px; padding: 2px 8px; border-radius: 3px; }
.section-tabs a:hover, .section-tabs a.active { color: var(--primary); background: #fff3e6; }

/* ===== Video Grid ===== */
.vod-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.vod-item { position: relative; width: 100%; min-width: 0; }
.vod-thumb { position: relative; display: block; border-radius: var(--radius); overflow: hidden; width: 100%; }
.vod-thumb::before { content: ''; display: block; padding-top: 140%; }
.vod-thumb img { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; object-fit: cover; transition: transform .3s; }
.vod-thumb:hover img { transform: scale(1.05); }
.vod-score { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 5px; border-radius: 3px; }
.vod-remarks { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; font-size: 11px; padding: 15px 6px 4px; text-align: right; }
.vod-title { margin-top: 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vod-title a { color: var(--text-main); }
.vod-title a:hover { color: var(--primary); }
.vod-info { font-size: 11px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

/* 7 columns for type page */
.vod-grid-7 { grid-template-columns: repeat(7, 1fr); }

/* ===== Hot Recommend (Tab area) ===== */
.hot-section { background: var(--bg-white); border-radius: var(--radius); padding: 20px; margin-top: 20px; box-shadow: var(--shadow); }
.hot-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-color); margin-bottom: 15px; }
.hot-tabs .tab-item { padding: 8px 20px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.hot-tabs .tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.hot-sub-tabs { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.hot-sub-tabs a { font-size: 12px; padding: 3px 10px; background: #f5f5f5; border-radius: 3px; color: var(--text-light); }
.hot-sub-tabs a:hover, .hot-sub-tabs a.active { background: var(--primary); color: #fff; }

/* ===== Latest Update List ===== */
.update-list { background: var(--bg-white); border-radius: var(--radius); padding: 15px 20px; box-shadow: var(--shadow); }
.update-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.update-item:last-child { border-bottom: none; }
.update-item .u-thumb { width: 60px; height: 80px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; margin-right: 12px; }
.update-item .u-thumb img { width: 100%; height: 100%; object-fit: cover; }
.update-item .u-info { flex: 1; overflow: hidden; }
.update-item .u-name { font-size: 14px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-item .u-meta { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.update-item .u-type { float: right; font-size: 12px; color: var(--primary); }

/* ===== Rank Section ===== */
.rank-section { background: var(--bg-white); border-radius: var(--radius); padding: 20px; margin-top: 20px; box-shadow: var(--shadow); }
.rank-tabs { display: flex; justify-content: center; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border-color); }
.rank-tabs .rank-tab { padding: 10px 40px; font-size: 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--text-light); }
.rank-tabs .rank-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.rank-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.rank-col-title { font-size: 15px; font-weight: bold; margin-bottom: 12px; display: flex; justify-content: space-between; }
.rank-col-more { font-size: 12px; color: var(--text-light); }
.rank-list-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.rank-list-item:last-child { border-bottom: none; }
.rank-num { width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 4px; font-size: 12px; font-weight: bold; margin-right: 10px; background: #f0f0f0; color: var(--text-light); flex-shrink: 0; }
.rank-num.top1 { background: var(--primary); color: #fff; }
.rank-num.top2 { background: #ff8533; color: #fff; }
.rank-num.top3 { background: #ffad33; color: #fff; }
.rank-list-item .rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank-list-item .rank-hits { color: var(--text-light); font-size: 12px; margin-left: 8px; }
.rank-top-item { display: flex; margin-bottom: 12px; }
.rank-top-thumb { width: 70px; height: 95px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; margin-right: 10px; position: relative; }
.rank-top-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-top-info { flex: 1; }
.rank-top-info .r-name { font-size: 14px; font-weight: bold; }
.rank-top-info .r-meta { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== Detail Page ===== */
.detail-header { background: var(--bg-white); padding: 25px 0; box-shadow: var(--shadow); }
.detail-inner { display: flex; gap: 25px; }
.detail-poster { width: 200px; flex-shrink: 0; }
.detail-poster img { width: 100%; border-radius: var(--radius); }
.detail-info { flex: 1; }
.detail-title { font-size: 22px; font-weight: bold; margin-bottom: 10px; }
.detail-score { color: var(--primary); font-size: 14px; margin-bottom: 8px; }
.detail-meta { font-size: 13px; color: var(--text-light); line-height: 2; }
.detail-meta span { margin-right: 15px; }
.detail-btns { margin-top: 15px; display: flex; gap: 12px; }
.btn-play { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; background: var(--primary); color: #fff; border-radius: 20px; border: 1px solid var(--primary); font-size: 14px; cursor: pointer; }
.btn-play:hover { background: var(--primary-dark); color: #fff; }
.btn-share { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; background: #fff; color: var(--text-main); border: 1px solid var(--border-color); border-radius: 20px; font-size: 14px; cursor: pointer; }

/* Detail Content */
.detail-body { margin-top: 20px; }
.detail-layout { display: flex; gap: 20px; }
.detail-main { flex: 1; }
.detail-sidebar { width: 300px; flex-shrink: 0; }
.panel { background: var(--bg-white); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-title { font-size: 16px; font-weight: bold; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.panel-title span { color: var(--primary); }
.desc-text { font-size: 13px; line-height: 1.8; color: #666; }

/* Playlist */
.playlist-tabs { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.playlist-tabs a { padding: 5px 12px; border-radius: 15px; font-size: 13px; background: #f5f5f5; }
.playlist-tabs a.active { background: var(--primary); color: #fff; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.playlist-grid a { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 12px; transition: all .2s; }
.playlist-grid a:hover, .playlist-grid a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Sidebar Rank */
.side-rank-title { font-size: 15px; font-weight: bold; color: var(--primary); margin-bottom: 12px; }
.side-rank-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.side-rank-item:last-child { border-bottom: none; }
.side-rank-item .rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 8px; font-size: 13px; }
.side-rank-item .rank-hits { flex-shrink: 0; font-size: 12px; color: var(--text-light); margin-left: auto; padding-left: 10px; }

/* ===== Play Page ===== */
.play-page { background: var(--bg-dark); }
.player-box { width: 100%; padding-top: 56.25%; position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.play-controls { display: flex; align-items: center; gap: 20px; padding: 12px 0; color: var(--text-white); font-size: 13px; }
.play-controls a { color: var(--text-white); }
.play-controls a:hover { color: var(--primary); }
.play-info { padding: 15px 0; }
.play-info h1 { font-size: 16px; color: var(--text-white); font-weight: normal; }
.play-meta { font-size: 12px; color: #999; margin-top: 6px; }
.play-sidebar { background: var(--bg-header); border-radius: var(--radius); padding: 15px; }
.play-sidebar-title { font-size: 14px; color: var(--text-white); margin-bottom: 10px; }
.play-rec-item { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.play-rec-thumb { width: 80px; height: 50px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.play-rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-rec-info { flex: 1; }
.play-rec-info .pr-name { font-size: 12px; color: var(--text-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-rec-info .pr-meta { font-size: 11px; color: #999; margin-top: 3px; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 30px 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 13px; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Footer ===== */
.site-footer { background: var(--bg-white); border-top: 1px solid var(--border-color); padding: 25px 0; margin-top: 40px; text-align: center; }
.site-footer .footer-links { margin-bottom: 10px; }
.site-footer .footer-links a { margin: 0 10px; color: var(--text-main); }
.site-footer .footer-links a:hover { color: var(--primary); }
.site-footer .footer-text { font-size: 12px; color: var(--text-light); line-height: 1.8; margin-bottom: 10px; }
.site-footer .footer-nav { font-size: 12px; }
.site-footer .footer-nav a { margin: 0 6px; color: var(--text-light); }

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee; z-index: 999; padding: 6px 0 env(safe-area-inset-bottom); }
.mobile-bottom-nav .bnav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--text-light); padding: 4px 0; text-align: center; }
.mobile-bottom-nav .bnav-item.active { color: var(--primary); }
.mobile-bottom-nav .bnav-item i { font-size: 20px; margin-bottom: 2px; }

/* Mobile Category Icons */
.mobile-category-icons { display: none; }
.mci-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mci-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.mci-name { font-size: 12px; color: var(--text-main); }
.mci-color-1 { background: #6c9ff8; }
.mci-color-2 { background: #f06b6b; }
.mci-color-3 { background: #5ecba1; }
.mci-color-4 { background: #f6a23c; }
.mci-color-5 { background: #a78bfa; }

/* History Modal */
.history-modal { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; z-index: 3000; border-radius: 12px 12px 0 0; max-height: 70vh; overflow-y: auto; }
.history-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.history-clear { color: var(--text-light); font-size: 13px; cursor: pointer; }
.history-title { font-size: 15px; font-weight: bold; }
.history-close { cursor: pointer; font-size: 20px; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 15px; }
.history-list .h-item { text-align: center; }
.history-list .h-thumb { border-radius: var(--radius); overflow: hidden; padding-top: 140%; position: relative; }
.history-list .h-thumb img { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; }
.history-list .h-name { font-size: 12px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-overlay { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,.5); z-index: 2999; }

/* ===== Filter (Type/Show page) ===== */
.filter-bar { background: var(--bg-white); border-radius: var(--radius); padding: 15px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.filter-row { display: flex; align-items: flex-start; margin-bottom: 8px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-label { width: 60px; flex-shrink: 0; font-size: 13px; color: var(--text-light); line-height: 28px; }
.filter-items { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-items a { padding: 4px 12px; font-size: 12px; border-radius: 3px; color: var(--text-main); }
.filter-items a:hover, .filter-items a.active { background: var(--primary); color: #fff; }

/* ===== Search Page ===== */
.search-result { margin-top: 20px; }
.search-title { font-size: 14px; margin-bottom: 15px; color: var(--text-light); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .show-pc { display: none !important; }
    .show-mobile { display: block !important; }
    .mobile-header { display: flex; }
    .mobile-bottom-nav { display: flex !important; justify-content: space-around; }
    .mobile-category-icons { display: flex !important; justify-content: space-around; padding: 15px 0; }
    body { padding-bottom: 56px; }
    .container { padding: 0 10px; }
    .vod-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .vod-grid .vod-item:nth-child(n+7) { display: none; }
    .vod-grid-7 { grid-template-columns: repeat(3, 1fr); }
    .detail-inner { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 140px; }
    .detail-btns { justify-content: center; }
    .detail-layout { flex-direction: column; }
    .detail-sidebar { width: 100%; }
    .rank-columns { grid-template-columns: 1fr; }
    .hot-section { padding: 12px; }
    .sub-header .container { gap: 8px; }
    .search-bar { max-width: none; }
    .site-footer { margin-top: 20px; padding-bottom: 70px; }
    .header-inner { height: 48px; }
    .site-header .logo img { height: 28px; }
    .playlist-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
    /* Mobile index: list mode */
    .mobile-update-list .update-item .u-thumb { width: 80px; height: 106px; }
    .update-item .u-name { font-size: 15px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .vod-grid { grid-template-columns: repeat(5, 1fr); }
    .rank-columns { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Icon (Bootstrap Icons) ===== */
.header-icons a i { font-size: 18px; }
.section-title i { color: var(--primary); font-size: 18px; }
.mobile-bottom-nav .bnav-item i { font-size: 22px; }
