/* =========================================
   天机影视模板 - 全局变量与重置
   ========================================= */
:root {
  --primary: #e50914;
  --primary-dark: #b20710;
  --bg-body: #141414;
  --bg-card: #1f1f1f;
  --bg-hover: #2a2a2a;
  --border: #333;
  --text-primary: #fff;
  --text-secondary: #ccc;
  --text-muted: #888;
  --radius: 8px;
  --transition: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: var(--bg-body); color: var(--text-primary); line-height: 1.6; min-height: 100vh; }
a { color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }

/* =========================================
   布局
   ========================================= */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.main { padding: 30px 0 50px; }

/* =========================================
   Header
   ========================================= */
.header { background: rgba(20,20,20,.97); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; flex-wrap: wrap; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo:hover { color: var(--primary); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 6px; font-size: .9rem; color: var(--text-secondary); }
.nav a:hover, .nav a.active { color: var(--text-primary); background: var(--bg-hover); }
.search-box { display: flex; flex: 1; max-width: 320px; }
.search-box input { flex: 1; padding: 8px 14px; background: var(--bg-hover); border: 1px solid var(--border); border-right: none; border-radius: var(--radius) 0 0 var(--radius); color: var(--text-primary); outline: none; }
.search-box input:focus { border-color: var(--primary); }
.search-box button { padding: 8px 16px; background: var(--primary); border: none; border-radius: 0 var(--radius) var(--radius) 0; color: #fff; cursor: pointer; }
.search-box button:hover { background: var(--primary-dark); }
.user-menu { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.user-menu a { font-size: .85rem; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; }
.user-menu a:hover { color: var(--text-primary); }

/* =========================================
   按钮
   ========================================= */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius); font-size: .9rem; cursor: pointer; border: none; transition: all var(--transition); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* =========================================
   Section
   ========================================= */
.section { margin-bottom: 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.2rem; font-weight: 700; position: relative; padding-left: 12px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }
.section-more { font-size: .85rem; color: var(--text-muted); }
.section-more:hover { color: var(--primary); }

/* =========================================
   视频卡片
   ========================================= */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.video-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.video-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.video-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition); }
.video-card:hover { transform: translateY(-3px); }
.video-card-pic { position: relative; aspect-ratio: 2/3; overflow: hidden; }
.video-card-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.video-card:hover .video-card-pic img { transform: scale(1.05); }
.video-card-tag { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 3px; }
.video-card-tag.blue { background: #0066cc; }
.video-card-tag.green { background: #00a67d; }
.video-card-score { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.7); color: #ffa502; font-size: .75rem; padding: 2px 5px; border-radius: 3px; }
.video-card-info { padding: 10px; }
.video-card-title { font-size: .9rem; margin-bottom: 4px; }
.video-card-title a { color: var(--text-primary); }
.video-card-title a:hover { color: var(--primary); }
.video-card-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.video-card-actor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }

/* =========================================
   Banner
   ========================================= */
.banner { background: #0a0a0a; margin-bottom: 30px; overflow: hidden; }
.banner-swiper { display: flex; overflow: hidden; }
.banner-item { flex: 0 0 100%; background-size: cover; background-position: center; position: relative; min-height: 420px; display: flex; align-items: flex-end; }
.banner-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.85) 40%, transparent 100%); }
.banner-content { position: relative; z-index: 1; padding: 40px 0; max-width: 500px; }
.banner-title { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.banner-info { display: flex; gap: 12px; color: var(--text-muted); font-size: .9rem; margin-bottom: 12px; flex-wrap: wrap; }
.banner-info span { display: flex; align-items: center; gap: 4px; }
.banner-desc { color: var(--text-secondary); font-size: .9rem; line-height: 1.7; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.banner-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; background: var(--primary); color: #fff; border-radius: var(--radius); font-size: 1rem; }
.banner-btn:hover { background: var(--primary-dark); color: #fff; }
/* 简易轮播 */
.banner-dots { position: absolute; bottom: 20px; right: 20px; z-index: 2; display: flex; gap: 6px; }
.banner-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: background var(--transition); }
.banner-dot.active { background: var(--primary); }

/* =========================================
   排行榜
   ========================================= */
.rank-list { background: var(--bg-card); border-radius: var(--radius); padding: 20px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-num { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); min-width: 24px; text-align: center; }
.rank-num.top1 { color: #e50914; }
.rank-num.top2 { color: #ff6b35; }
.rank-num.top3 { color: #ffa502; }
.rank-pic { width: 44px; flex-shrink: 0; }
.rank-pic img { width: 44px; height: 60px; object-fit: cover; border-radius: 4px; }
.rank-info { flex: 1; min-width: 0; }
.rank-title { font-size: .9rem; margin-bottom: 4px; }
.rank-title a { color: var(--text-primary); }
.rank-title a:hover { color: var(--primary); }
.rank-meta { font-size: .75rem; color: var(--text-muted); }

/* =========================================
   文章
   ========================================= */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.article-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform var(--transition); }
.article-card:hover { transform: translateY(-2px); }
.article-card img { width: 100%; height: 180px; object-fit: cover; }
.article-card-content { padding: 16px; flex: 1; }
.article-card-title { font-size: 1rem; margin-bottom: 8px; }
.article-card-title a { color: var(--text-primary); }
.article-card-title a:hover { color: var(--primary); }
.article-card-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.article-content { line-height: 1.9; color: var(--text-secondary); }
.article-content img { max-width: 100%; border-radius: var(--radius); margin: 10px 0; }
.article-content p { margin-bottom: 12px; }

/* =========================================
   专题
   ========================================= */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.topic-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition); }
.topic-card:hover { transform: translateY(-2px); }
.topic-card img { width: 100%; height: 140px; object-fit: cover; }
.topic-card-info { padding: 14px; }
.topic-card-title { font-size: .95rem; color: var(--text-primary); margin-bottom: 4px; }
.topic-card-num { font-size: .8rem; color: var(--text-muted); }

/* =========================================
   详情页
   ========================================= */
.detail-header { display: grid; grid-template-columns: 220px 1fr; gap: 30px; margin-bottom: 30px; }
.detail-poster img { width: 100%; border-radius: var(--radius); }
.detail-info h1 { font-size: 1.8rem; margin-bottom: 8px; }
.detail-subtitle { color: var(--text-muted); margin-bottom: 12px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: .9rem; margin-bottom: 14px; }
.detail-meta span { display: flex; align-items: center; gap: 4px; }
.detail-desc { color: var(--text-secondary); line-height: 1.8; margin: 16px 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.detail-tag { padding: 4px 10px; background: var(--bg-hover); border-radius: 4px; font-size: .8rem; color: var(--text-muted); }
.detail-tag:hover { background: var(--primary); color: #fff; }

/* =========================================
   播放器
   ========================================= */
.player-wrap { margin-bottom: 30px; }
.player-main { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.player-content { background: #000; border-radius: var(--radius); position: relative; width: 100%; height: 0; padding-top: 56.25%; overflow: hidden; }
.player-content #player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.player-content #player iframe { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; border: none; }
/* MacPlayer 系统容器：用 position:absolute 继承 padding-box 高度 */
.player-content .MacPlayer { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; min-height: unset !important; }
.player-content .MacPlayer table { width: 100%; height: 100%; border-collapse: collapse; }
.player-content .MacPlayer #playleft { width: 100%; height: 100%; padding: 0; }
.player-content .MacPlayer #playleft iframe { width: 100% !important; height: 100% !important; border: none; display: block; }
.player-sidebar { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.player-list { height: 100%; overflow-y: auto; padding: 16px; }
.player-list h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text-secondary); }
.play-list-group { margin-bottom: 16px; }
.play-list-group h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.play-btn { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; background: var(--bg-hover); border-radius: 4px; margin-bottom: 4px; font-size: .85rem; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.play-btn:hover, .play-btn.active { background: var(--primary); color: #fff; }
.player-source-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.player-source-tab { padding: 6px 14px; background: var(--bg-hover); border-radius: var(--radius); font-size: .85rem; color: var(--text-muted); cursor: pointer; }
.player-source-tab:hover, .player-source-tab.active { background: var(--primary); color: #fff; }

/* =========================================
   筛选栏
   ========================================= */
.filter-bar { background: var(--bg-card); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.filter-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.filter-item:last-child { border-bottom: none; }
.filter-label { font-size: .85rem; color: var(--text-muted); flex-shrink: 0; min-width: 50px; padding-top: 3px; }
.filter-values { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-value { padding: 3px 10px; border-radius: 4px; font-size: .82rem; color: var(--text-secondary); transition: all var(--transition); }
.filter-value:hover, .filter-value.active { background: var(--primary); color: #fff; }

/* =========================================
   分页
   ========================================= */
.mac_pages { margin-top: 30px; }
.page_info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.page_link { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius); background: var(--bg-card); color: var(--text-secondary); font-size: .85rem; transition: all var(--transition); }
.page_link:hover, .page_link.page_current { background: var(--primary); color: #fff; }
.page_input { padding: 6px 8px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); text-align: center; }
.page_btn { padding: 6px 12px; background: var(--primary); border: none; border-radius: var(--radius); color: #fff; cursor: pointer; font-size: .85rem; }

/* =========================================
   评论
   ========================================= */
.comment-list { margin-bottom: 20px; }
.comment-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 40px; height: 40px; background: var(--bg-hover); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; color: var(--text-muted); }
.comment-content { flex: 1; }
.comment-user { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-name { font-weight: 600; font-size: .9rem; }
.comment-time { font-size: .75rem; color: var(--text-muted); }
.comment-text { color: var(--text-secondary); font-size: .9rem; line-height: 1.7; }
.mac_comment { margin-top: 10px; }
.comment-form textarea { width: 100%; padding: 12px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); resize: vertical; min-height: 100px; }
.comment-form textarea:focus { outline: none; border-color: var(--primary); }

/* =========================================
   用户中心
   ========================================= */
.user-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.user-sidebar { background: var(--bg-card); border-radius: var(--radius); padding: 20px; }
.user-sidebar-avatar { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.user-sidebar-avatar .avatar-icon { width: 70px; height: 70px; background: var(--bg-hover); border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--text-muted); }
.user-nav a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; color: var(--text-secondary); font-size: .9rem; margin-bottom: 2px; }
.user-nav a:hover, .user-nav a.active { background: var(--bg-hover); color: var(--text-primary); }
.user-card { background: var(--bg-card); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.user-card h3 { font-size: 1rem; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-item { text-align: center; padding: 16px; background: var(--bg-hover); border-radius: var(--radius); }
.stat-num { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: .9rem; color: var(--text-secondary); }
.form-control { width: 100%; padding: 10px 14px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); }
.form-control:focus { outline: none; border-color: var(--primary); }
.form-text { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.auth-box { max-width: 420px; margin: 50px auto; padding: 36px; background: var(--bg-card); border-radius: var(--radius); }
.auth-box h2 { text-align: center; margin-bottom: 28px; font-size: 1.4rem; }
.auth-captcha { display: flex; gap: 10px; align-items: center; }
.auth-captcha input { flex: 1; }
.auth-captcha img { height: 44px; border-radius: 4px; cursor: pointer; }

/* =========================================
   演员
   ========================================= */
.actor-card { text-align: center; }
.actor-card .video-card-pic { border-radius: 50% !important; aspect-ratio: 1; }
.actor-card .video-card-pic img { border-radius: 50%; }

/* =========================================
   Footer
   ========================================= */
.footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 40px 0 20px; margin-top: 20px; }
.footer-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 14px; color: var(--text-primary); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: var(--text-muted); font-size: .82rem; line-height: 1.8; }

/* =========================================
   提示信息
   ========================================= */
.msg-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.msg-box { padding: 40px; }
.msg-icon { font-size: 56px; margin-bottom: 20px; }
.msg-icon.error { color: var(--primary); }
.msg-icon.success { color: #00a67d; }
.msg-icon.info { color: #ffa502; }
.msg-title { font-size: 1.4rem; margin-bottom: 12px; }
.msg-text { color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }

/* =========================================
   Tabs
   ========================================= */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab-btn { padding: 6px 16px; border-radius: var(--radius); background: var(--bg-card); border: none; color: var(--text-secondary); cursor: pointer; font-size: .88rem; transition: all var(--transition); }
.tab-btn:hover, .tab-btn.active { background: var(--primary); color: #fff; }

/* =========================================
   工具类
   ========================================= */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }

/* =========================================
   响应式
   ========================================= */
@media (max-width: 1024px) {
  .video-grid.cols-5, .video-grid.cols-6 { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .player-main { grid-template-columns: 1fr; }
  .detail-header { grid-template-columns: 180px 1fr; }
}
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .nav { display: none; }
  .search-box { max-width: 100%; flex: 1 0 200px; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .video-grid.cols-5, .video-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
  .detail-header { grid-template-columns: 1fr; }
  .detail-poster { max-width: 200px; margin: 0 auto; }
  .user-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .banner-item { min-height: 260px; }
  .banner-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}

/* =========================================
   评论区
   ========================================= */
.mac-comment-wrap { padding: 4px 0; }
.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-avatar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.comment-author { color: var(--text-secondary); font-weight: 500; }
.comment_reply, .comment_report { cursor: pointer; }
.comment_reply:hover { color: var(--primary); }
.comment_report:hover { color: #ff4757; }
.comment-body { font-size: .9rem; line-height: 1.6; color: var(--text-primary); word-break: break-word; }
.comment-sub-item { background: var(--bg-hover); border-radius: 4px; padding: 8px 10px; margin-top: 8px; font-size: .85rem; }
.comment-pager { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 0; }
.comment-pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 4px; background: var(--bg-card); color: var(--text-secondary); font-size: .82rem; }
.comment-pager a:hover, .comment-pager a.active { background: var(--primary); color: #fff; }
