/* KVideo 前端样式 - 响应式深色主题 */

:root {
    --bg: #0f1115;
    --bg-2: #161a22;
    --bg-3: #1d2330;
    --card: #1b212c;
    --border: #2a3140;
    --text: #e7ecf3;
    --text-2: #9aa6b8;
    --text-3: #6c7686;
    --brand: #ff5c38;
    --brand-2: #ff8a3d;
    --accent: #3b82f6;
    --radius: 10px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand); }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 21, .96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); white-space: nowrap; }
.brand-text { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search-form { display: flex; flex: 1; max-width: 560px; margin: 0 auto; }
.search-input {
    flex: 1; height: 38px; padding: 0 14px; border: 1px solid var(--border);
    background: var(--bg-2); color: var(--text); border-radius: 8px 0 0 8px; font-size: 14px; outline: none;
}
.search-input:focus { border-color: var(--brand); }
.search-btn {
    height: 38px; padding: 0 18px; border: none; border-radius: 0 8px 8px 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; cursor: pointer;
}
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; display: block; }

.category-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0; }
.cat-link { color: var(--text-2); font-size: 14px; padding: 4px 0; white-space: nowrap; }
.cat-link:hover, .cat-link.active { color: var(--brand); }

/* ===== Hero ===== */
.home-hero {
    background: radial-gradient(1200px 400px at 50% -10%, rgba(255, 92, 56, .15), transparent 60%), var(--bg);
    padding: 56px 0 40px;
    text-align: center;
}
.hero-title { font-size: 32px; margin: 0 0 8px; letter-spacing: 1px; }
.hero-sub { color: var(--text-2); margin: 0 0 24px; }
.hero-search { display: flex; max-width: 620px; margin: 0 auto 18px; }
.hero-search-input { flex: 1; height: 46px; padding: 0 16px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); border-radius: 8px 0 0 8px; font-size: 15px; }
.hero-search-input:focus { border-color: var(--brand); }
.hero-search-btn { height: 46px; padding: 0 26px; border: none; border-radius: 0 8px 8px 0; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.hero-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.hero-cats a { color: var(--text-2); font-size: 14px; }
.hero-cats a:hover { color: var(--brand); }

/* ===== Sections ===== */
.main-content { padding: 28px 16px 60px; min-height: 60vh; }
.home-section { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { font-size: 20px; margin: 0; position: relative; padding-left: 12px; }
.section-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: linear-gradient(var(--brand), var(--brand-2)); border-radius: 4px; }
.section-cats { display: flex; gap: 16px; flex-wrap: wrap; }
.section-cats a { font-size: 13px; color: var(--text-3); }

.block-title { font-size: 18px; margin: 28px 0 14px; }

/* ===== Category two-column block ===== */
.cat-block { margin-bottom: 40px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.cat-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cat-block-title { font-size: 20px; margin: 0; position: relative; padding-left: 12px; }
.cat-block-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: linear-gradient(var(--brand), var(--brand-2)); border-radius: 4px; }
.cat-block-more { font-size: 13px; color: var(--text-3); }
.cat-block-more:hover { color: var(--brand); }
.cat-block-body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.cat-col-label { font-size: 14px; color: var(--text-3); margin-bottom: 12px; font-weight: 600; }
.cat-col-empty { color: var(--text-3); font-size: 13px; padding: 20px 0; text-align: center; }

/* ===== Ranking list ===== */
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-num { flex: 0 0 22px; width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 4px; background: var(--bg-3); color: var(--text-3); }
.rank-item:nth-child(1) .rank-num { background: linear-gradient(135deg, #ff5c38, #ff8a3d); color: #fff; }
.rank-item:nth-child(2) .rank-num { background: linear-gradient(135deg, #ff8a3d, #ffb24d); color: #fff; }
.rank-item:nth-child(3) .rank-num { background: linear-gradient(135deg, #ffb24d, #ffd24d); color: #fff; }
.rank-info { flex: 1; min-width: 0; }
.rank-title { display: block; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title:hover { color: var(--brand); }
.rank-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.rank-sep { margin: 0 4px; color: var(--border); }
.rank-remarks { color: var(--brand-2); }

/* ===== Video grid & card ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.vcard { display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s; border: 1px solid var(--border); }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); }
.vcard-cover { position: relative; aspect-ratio: 2 / 3; background: var(--bg-3); overflow: hidden; }
.vcard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-cover.no-cover { display: flex; align-items: center; justify-content: center; }
.vcard-noimg { color: var(--text-3); font-size: 13px; padding: 8px; text-align: center; }
.vcard-remarks { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.vcard-title { font-size: 14px; padding: 8px 10px 2px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-meta { font-size: 12px; color: var(--text-3); padding: 0 10px 10px; }

/* ===== List page ===== */
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--text-2); }
.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.list-title { font-size: 22px; margin: 0; }
.list-count { color: var(--text-3); font-size: 13px; }
.list-intro { font-size: 13px; color: var(--text-3); line-height: 1.6; margin: 0 0 16px; }
.filter-bar { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.filter-row:last-child { border-bottom: none; }
.filter-label { color: var(--text-3); font-size: 13px; width: 40px; flex-shrink: 0; }
.filter-pill { font-size: 13px; color: var(--text-2); padding: 3px 12px; border-radius: 14px; background: var(--bg-3); }
.filter-pill:hover { color: var(--text); }
.filter-pill.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

/* ===== Pagination ===== */
.pagination-wrap { display: flex; justify-content: center; margin-top: 28px; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination li { list-style: none; }
.pagination a, .pagination span { display: inline-block; min-width: 36px; height: 36px; line-height: 34px; padding: 0 10px; text-align: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-size: 14px; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .active a, .pagination .active span { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }

/* ===== Related links (SEO内链) ===== */
.related-links { margin-top: 28px; padding: 16px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.related-section { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 4px 0; }
.related-label { color: var(--text-3); font-size: 13px; flex-shrink: 0; }
.related-section a { font-size: 13px; color: var(--text-2); padding: 2px 8px; }
.related-section a:hover { color: var(--brand); }
.pagination .disabled a, .pagination .disabled span { opacity: .4; cursor: not-allowed; }

/* ===== Detail ===== */
.detail-wrap { display: flex; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.detail-poster { flex: 0 0 200px; }
.detail-cover-img { width: 200px; height: 280px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-3); }
.detail-info { flex: 1; min-width: 260px; }
.detail-title { font-size: 26px; margin: 0 0 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.detail-remarks { color: var(--brand); }
.detail-line { margin: 6px 0; color: var(--text-2); font-size: 14px; }
.detail-line b { color: var(--text-3); font-weight: 600; }
.actor-link { color: var(--text-2); margin-right: 6px; }
.actor-link:hover { color: var(--brand); }
.detail-content p { color: var(--text-2); font-size: 14px; line-height: 1.8; margin: 6px 0; }
.detail-actions { margin-top: 18px; }
.btn-play { display: inline-block; padding: 10px 28px; border-radius: 24px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.btn-play:hover { color: #fff; opacity: .92; }

/* ===== Play sources & episodes ===== */
.play-sources { margin-top: 8px; }
.play-line { margin-bottom: 18px; }
.play-line-name { color: var(--text-3); font-size: 14px; margin-bottom: 10px; }
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-link { display: inline-block; min-width: 56px; text-align: center; padding: 6px 12px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-size: 13px; }
.ep-link:hover { border-color: var(--brand); color: var(--brand); }
.ep-link.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.ep-empty { color: var(--text-3); font-size: 13px; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-3); margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.breadcrumb a { color: var(--text-2); }

/* ===== Play page ===== */
.play-wrap { max-width: 100%; }
.play-main { width: 100%; }
.player-box { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player { width: 100%; height: 100%; display: block; background: #000; }
.play-info { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.play-title { font-size: 20px; margin: 0; }
.play-ep { color: var(--brand); font-size: 16px; margin-left: 8px; }
.play-actions { margin-top: 0; }

/* 播放源 Tab 切换 */
.source-tabs { display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px; border-bottom: 2px solid var(--border); }
.source-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; cursor: pointer;
    color: var(--text-3); font-size: 14px; font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    background: none; border-top: none; border-left: none; border-right: none;
    text-decoration: none;
}
.source-tab:hover { color: var(--text); }
.source-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.single-source .source-tab { cursor: default; }
.source-tab-name { white-space: nowrap; }
.source-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg-3); color: var(--text-3); font-size: 11px; }
.source-tab.active .source-tab-count { background: var(--brand); color: #fff; }
.hidden { display: none !important; }
.play-sources { margin-top: 8px; }
.play-line { margin-bottom: 0; padding-top: 16px; }
.play-line-name { color: var(--text-3); font-size: 14px; margin-bottom: 10px; }

/* 选集列表 */
.ep-list-title { color: var(--text-3); font-size: 14px; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.current-source { color: var(--text-2); font-size: 13px; }
.current-source::before { content: '·'; margin-right: 6px; }
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-link { display: inline-block; min-width: 56px; text-align: center; padding: 6px 12px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ep-link:hover { border-color: var(--brand); color: var(--brand); }
.ep-link.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.ep-empty { color: var(--text-3); font-size: 13px; }
.ep-list-scroll { max-height: 320px; overflow-y: auto; }

/* ===== Recommend sections ===== */
.recommend-section { margin-top: 36px; }
.play-wrap + .recommend-section { margin-top: 28px; }
.recommend-section .block-title { margin-bottom: 16px; }

/* ===== Empty / Footer ===== */
.empty-state { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 15px; }
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 24px 0; color: var(--text-3); font-size: 13px; text-align: center; }
.site-footer p { margin: 4px 0; }
.site-footer .footer-link { color: var(--text-3); text-decoration: none; }
.site-footer .footer-link:hover { color: var(--primary); }
.site-footer .footer-sep { margin: 0 6px; color: var(--border); }
.site-footer .footer-links { margin-bottom: 8px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .search-form { order: 3; flex-basis: 100%; margin: 8px 0 0; max-width: none; }
    .category-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
    .category-nav::-webkit-scrollbar { height: 4px; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .hero-title { font-size: 24px; }
    .hero-sub { font-size: 13px; }
    .detail-wrap { flex-direction: column; }
    .detail-poster { flex: none; }
    .detail-cover-img { width: 130px; height: 182px; }
    .play-wrap { flex-direction: column; }
    .source-tab { padding: 8px 14px; font-size: 13px; }
    .ep-list-scroll { max-height: 280px; }
    .nav-toggle { display: flex; }
    .cat-block { padding: 14px; }
    .cat-block-body { grid-template-columns: 1fr; gap: 16px; }
    .cat-block-rank { border-top: 1px solid var(--border); padding-top: 16px; }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .vcard-title { font-size: 12px; padding: 6px 6px 2px; }
    .vcard-meta { font-size: 11px; padding: 0 6px 8px; }
    .filter-bar { padding: 10px; }
    .filter-label { width: 36px; }
    .home-hero { padding: 36px 0 28px; }
}
