* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; color: #333; background: #f5f7fa; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

:root {
    --primary: #ff4757;
    --primary-dark: #e83a48;
    --primary-light: #ffe1e4;
    --text: #333;
    --text-2: #666;
    --text-3: #999;
    --bg: #f5f7fa;
    --card: #fff;
    --border: #eee;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ========== Header ========== */
.header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--primary); white-space: nowrap; }
.logo .icon { width: 36px; height: 36px; background: linear-gradient(135deg, #ff4757, #ff6b81); border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 8px 14px; border-radius: 6px; font-size: 14px; color: var(--text-2); transition: all .2s; white-space: nowrap; }
.nav a:hover { color: var(--primary); }
.nav a.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.search-bar { display: flex; align-items: center; background: var(--bg); border-radius: 20px; padding: 0 6px 0 16px; height: 38px; min-width: 240px; }
.search-bar input { border: none; background: none; flex: 1; height: 100%; font-size: 14px; min-width: 0; }
.search-bar button { background: var(--primary); color: #fff; height: 30px; padding: 0 14px; border-radius: 16px; font-size: 13px; }
.search-bar button:hover { background: var(--primary-dark); }

/* ========== Container ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

/* ========== Banner ========== */
.banner { border-radius: 12px; overflow: hidden; margin-bottom: 28px; height: 300px; position: relative; background: linear-gradient(135deg, #667eea, #764ba2); }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.banner-slide.active { opacity: 1; }
.banner-slide .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.banner-slide .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 60%, transparent 100%); }
.banner-slide .info { position: relative; z-index: 1; padding: 60px 50px; max-width: 60%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.banner-slide .info h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.banner-slide .info p { font-size: 15px; opacity: 0.85; margin-bottom: 20px; line-height: 1.7; text-shadow: 0 1px 4px rgba(0,0,0,0.5); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.banner-slide .info .meta { display: flex; gap: 14px; align-items: center; font-size: 14px; opacity: 0.9; margin-bottom: 22px; }
.banner-slide .info .btn-play { display: inline-flex; align-items: center; gap: 8px; background: var(--primary); color: #fff; padding: 10px 28px; border-radius: 24px; font-size: 15px; font-weight: 600; transition: transform .2s, box-shadow .2s; width: fit-content; }
.banner-slide .info .btn-play:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,71,87,0.5); }
.banner-dots { position: absolute; bottom: 16px; right: 30px; display: flex; gap: 8px; z-index: 2; }
.banner-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all .3s; }
.banner-dots span.active { background: #fff; width: 28px; border-radius: 5px; }

/* ========== Section ========== */
.section { margin-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-head h3 { font-size: 20px; font-weight: 700; position: relative; padding-left: 14px; }
.section-head h3::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }
.section-head .more { color: var(--text-3); font-size: 13px; }
.section-head .more:hover { color: var(--primary); }

/* ========== Movie Card Grid ========== */
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.movie-card { background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; cursor: pointer; }
.movie-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.movie-card .cover { aspect-ratio: 2 / 3; background: var(--bg); background-size: cover; background-position: center; position: relative; }
.movie-card .cover .badge { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.movie-card .cover .badge.hot { background: #ff6b81; }
.movie-card .cover .badge.rating { background: linear-gradient(135deg, #ffa502, #ff7f50); top: auto; bottom: 8px; left: auto; right: 8px; }
.movie-card .cover .type-badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.movie-card .info { padding: 12px; }
.movie-card .title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movie-card .meta { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; justify-content: space-between; }

/* ========== Rank List ========== */
.rank-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .rank-list { grid-template-columns: 1fr; } }
.rank-card { background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.rank-card .head { padding: 14px 18px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.rank-card.hot .head { color: var(--primary); }
.rank-card.new .head { color: #ffa502; }
.rank-card.rating .head { color: #2ed573; }
.rank-card .head .tag { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.rank-card.hot .tag { background: var(--primary-light); color: var(--primary); }
.rank-card.new .tag { background: #fff3e0; color: #ffa502; }
.rank-card.rating .tag { background: #e8f8ef; color: #2ed573; }
.rank-card ul { padding: 8px 0; }
.rank-card li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; transition: background .2s; }
.rank-card li:hover { background: var(--bg); }
.rank-card li .num { width: 22px; height: 22px; border-radius: 4px; background: var(--bg); color: var(--text-3); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-card li:nth-child(1) .num { background: var(--primary); color: #fff; }
.rank-card li:nth-child(2) .num { background: #ffa502; color: #fff; }
.rank-card li:nth-child(3) .num { background: #ff7f50; color: #fff; }
.rank-card li .thumb { width: 40px; height: 56px; border-radius: 4px; background: var(--bg); background-size: cover; background-position: center; flex-shrink: 0; }
.rank-card li .t-info { flex: 1; min-width: 0; }
.rank-card li .t-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rank-card li .t-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rank-card li .t-rating { font-size: 13px; color: #ffa502; font-weight: 600; flex-shrink: 0; }

/* ========== Filters (list page) ========== */
.filter-bar { background: #fff; border-radius: 10px; padding: 18px 22px; margin-bottom: 22px; box-shadow: var(--shadow); }
.filter-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row .label { width: 60px; color: var(--text-3); font-size: 13px; flex-shrink: 0; padding-top: 5px; }
.filter-row .options { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.filter-row .options a { padding: 4px 12px; border-radius: 14px; background: var(--bg); color: var(--text-2); font-size: 13px; transition: all .2s; }
.filter-row .options a:hover { color: var(--primary); }
.filter-row .options a.active { background: var(--primary); color: #fff; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 30px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 6px; background: #fff; color: var(--text-2); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; }
.pagination a:hover { color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; }
.pagination .disabled { color: var(--text-3); cursor: not-allowed; }

/* ========== Detail Page ========== */
.detail { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 24px; }
.detail-head { padding: 30px; display: flex; gap: 30px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: #fff; }
.detail-head .cover { width: 220px; height: 310px; border-radius: 10px; overflow: hidden; background: var(--bg); flex-shrink: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.detail-head .info { flex: 1; min-width: 0; }
.detail-head .info h1 { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.detail-head .info .original { font-size: 15px; opacity: 0.7; margin-bottom: 16px; }
.detail-head .info .tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head .info .tags a { padding: 4px 12px; background: rgba(255,255,255,0.15); border-radius: 14px; font-size: 13px; }
.detail-head .info .tags a:hover { background: var(--primary); }
.detail-head .info .stat-row { display: flex; gap: 28px; margin-bottom: 20px; }
.detail-head .info .stat { font-size: 14px; opacity: 0.85; }
.detail-head .info .stat b { display: block; font-size: 20px; color: var(--primary); font-weight: 700; margin-bottom: 2px; }
.detail-head .info .buttons { display: flex; gap: 14px; }
.detail-head .info .btn { padding: 10px 28px; border-radius: 24px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: all .2s; }
.detail-head .info .btn-primary { background: var(--primary); color: #fff; }
.detail-head .info .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,71,87,0.5); }
.detail-head .info .btn-default { background: rgba(255,255,255,0.15); color: #fff; }
.detail-head .info .btn-default:hover { background: rgba(255,255,255,0.25); }

.detail-body { padding: 28px 30px; }
.detail-body h4 { font-size: 16px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.detail-body p.summary { font-size: 14px; color: var(--text-2); line-height: 1.8; margin-bottom: 24px; text-indent: 2em; }
.person-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.person-tag { padding: 6px 16px; background: var(--bg); border-radius: 16px; font-size: 13px; color: var(--text-2); }
.person-tag .role { color: var(--primary); margin-right: 6px; }

.source-block { margin-bottom: 24px; }
.source-block h5 { font-size: 14px; color: var(--text); margin-bottom: 10px; font-weight: 600; }
.episodes { display: flex; flex-wrap: wrap; gap: 8px; }
.episodes a { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text-2); transition: all .2s; }
.episodes a:hover { border-color: var(--primary); color: var(--primary); }
.episodes a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.download-list { display: grid; gap: 10px; }
.download-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border-radius: 8px; }
.download-item .dl-type { padding: 2px 10px; background: var(--primary-light); color: var(--primary); border-radius: 4px; font-size: 12px; font-weight: 600; }
.download-item .dl-url { flex: 1; font-size: 13px; color: var(--text-2); word-break: break-all; }
.download-item .dl-quality { font-size: 12px; color: var(--text-3); }
.download-item .dl-btn { background: var(--primary); color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px; }

/* ========== Player Page ========== */
.player-wrap { background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; margin-bottom: 24px; }
.player-wrap video, .player-wrap iframe { width: 100%; height: 100%; border: none; }
.player-info { background: #fff; border-radius: 10px; padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.player-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.source-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.source-tabs a { padding: 8px 18px; background: var(--bg); border-radius: 20px; font-size: 14px; color: var(--text-2); transition: all .2s; }
.source-tabs a:hover { color: var(--primary); }
.source-tabs a.active { background: var(--primary); color: #fff; }

/* ========== Comments ========== */
.comment-form { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.comment-form textarea { width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; resize: vertical; font-size: 14px; }
.comment-form .row { display: flex; gap: 12px; margin-top: 12px; align-items: center; }
.comment-form input.name { border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; }
.comment-form .submit { background: var(--primary); color: #fff; padding: 8px 24px; border-radius: 20px; font-size: 14px; margin-left: auto; }
.comment-list .item { padding: 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.comment-list .item:last-child { border-bottom: none; }
.comment-list .item .avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.comment-list .item .c-body { flex: 1; }
.comment-list .item .c-head { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.comment-list .item .c-head b { color: var(--text); margin-right: 8px; }
.comment-list .item .c-content { font-size: 14px; color: var(--text); line-height: 1.7; }

/* ========== Breadcrumb ========== */
.breadcrumb { padding: 14px 0; font-size: 13px; color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--text); }

/* ========== Footer ========== */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 40px 20px 20px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { font-size: 15px; margin-bottom: 14px; color: var(--text); }
.footer-col a { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a { padding: 4px 12px; background: var(--bg); border-radius: 14px; font-size: 12px; margin-bottom: 0; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* ========== Empty / Loading ========== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.loading { text-align: center; padding: 40px; color: var(--text-3); }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .header-inner { gap: 12px; padding: 0 14px; height: 56px; }
    .search-bar { min-width: 0; height: 34px; flex: 1; }
    .search-bar input { display: none; }
    .search-bar:focus-within input, .search-bar:active input { display: block; }
    .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; gap: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
    .nav.open { display: flex; }
    .banner { height: 200px; }
    .banner-slide .info { padding: 30px 20px; max-width: 100%; }
    .banner-slide .info h2 { font-size: 22px; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
    .detail-head { flex-direction: column; padding: 20px; }
    .detail-head .cover { width: 140px; height: 200px; margin: 0 auto; }
    .detail-head .info h1 { font-size: 22px; text-align: center; }
    .detail-head .info .stat-row { justify-content: center; }
    .detail-head .info .buttons { justify-content: center; }
    .portal-tabs { margin-right: 0 !important; }
    .portal-tabs a { padding: 5px 12px !important; font-size: 12px !important; }
}