/* ============================================================
   影视站前端样式  ——  含白天 / 黑夜两套主题
   通过 <html data-theme="night|day"> 切换，变量集中在此处。
   ============================================================ */

:root {
    --radius: 14px;
    --transition: .3s ease;
    --shadow: 0 8px 30px rgba(0,0,0,.35);
}

/* ---------- 黑夜主题（默认） ---------- */
html[data-theme="night"] {
    --bg: #0a0f1c;
    --bg2: #111827;
    --card: rgba(17, 24, 39, .72);
    --card-solid: #16213a;
    --text: #eef2ff;
    --muted: #9aa7c7;
    --border: rgba(255,255,255,.10);
    --accent: #f5b301;          /* 金色 */
    --accent2: #22d3ee;         /* 青色 */
    --overlay: rgba(5, 8, 20, .55);
    --glass: rgba(255,255,255,.06);
    --input-bg: rgba(255,255,255,.06);
}

/* ---------- 白天主题 ---------- */
html[data-theme="day"] {
    --bg: #eef1f7;
    --bg2: #e3e8f2;
    --card: rgba(255,255,255,.80);
    --card-solid: #ffffff;
    --text: #1b2340;
    --muted: #5b6585;
    --border: rgba(20,30,70,.12);
    --accent: #d99a00;
    --accent2: #0e9db8;
    --overlay: rgba(255,255,255,.35);
    --glass: rgba(255,255,255,.55);
    --input-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

/* ---------- 背景轮播层 ---------- */
.bg-slider {
    position: fixed; inset: 0; z-index: -2;
    background: var(--bg);
}
.bg-slider .slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.6s ease;
}
.bg-slider .slide.active { opacity: 1; }
.bg-slider::after {
    content: ""; position: absolute; inset: 0;
    background: var(--overlay);
}

/* ---------- 顶部导航 ---------- */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 22px;
    backdrop-filter: blur(12px);
    background: var(--glass);
    border-bottom: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--text); white-space: nowrap; }
.brand em { font-style: normal; color: var(--accent); }

.nav { display: flex; gap: 6px; margin-left: 12px; flex: 1; overflow-x: auto; }
.nav a {
    color: var(--muted); text-decoration: none; font-size: 14px;
    padding: 7px 12px; border-radius: 9px; white-space: nowrap; transition: var(--transition);
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--glass); }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
    background: var(--glass); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; transition: var(--transition);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 主容器 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 96px 22px 60px; }

/* ---------- 卡片 / 按钮 ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: 11px; cursor: pointer;
    padding: 11px 20px; font-size: 15px; font-weight: 600; transition: var(--transition);
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ffb800);
    color: #1a1200;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--glass); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent2); color: var(--accent2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.input {
    width: 100%; padding: 12px 14px; font-size: 15px;
    color: var(--text); background: var(--input-bg);
    border: 1px solid var(--border); border-radius: 11px; outline: none; transition: var(--transition);
}
.input:focus { border-color: var(--accent2); }
label.field { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
label.field .input { margin-top: 6px; }

/* ---------- 页面标题 ---------- */
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-bottom: 26px; font-size: 14px; }
.hero {
    text-align: center; padding: 40px 0 34px;
}
.hero h1 { font-size: 34px; font-weight: 900; }
.hero p { color: var(--muted); margin-top: 12px; font-size: 15px; max-width: 620px; margin-inline: auto; }

/* ---------- 影片网格 ---------- */
.section-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; margin: 34px 0 16px; }
.section-title::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: var(--accent); }
.movie-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.movie-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; cursor: pointer; transition: var(--transition); position: relative;
    box-shadow: var(--shadow);
}
.movie-card:hover { transform: translateY(-4px); border-color: var(--accent2); }
.movie-poster {
    width: 100%; aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1f2937, #111827);
    background-size: cover; background-position: center; position: relative;
}
.movie-badge {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: var(--accent); color: #1a1200; font-size: 12px; font-weight: 700;
    padding: 3px 9px; border-radius: 20px;
}
.movie-badge.vip { background: var(--accent2); color: #062026; }
.movie-body { padding: 12px 14px 14px; }
.movie-body h3 { font-size: 15px; margin-bottom: 5px; }
.movie-body .cat { font-size: 12px; color: var(--muted); }
.play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition); background: rgba(0,0,0,.35);
}
.movie-card:hover .play-overlay { opacity: 1; }
.play-circle {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent); color: #1a1200; display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

/* ---------- 会员套餐 ---------- */
.plan-grid {
    display: grid; gap: 18px; margin-top: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.plan-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 18px; text-align: center; cursor: pointer; transition: var(--transition);
    position: relative; box-shadow: var(--shadow);
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.plan-name { font-size: 17px; font-weight: 800; }
.plan-days { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.plan-price { font-size: 26px; font-weight: 900; color: var(--accent); }
.plan-price small { font-size: 14px; font-weight: 600; }

/* ---------- 会员状态条 ---------- */
.vip-status {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 18px 20px; margin: 10px 0 8px;
}
.vip-status .crown { font-size: 26px; }
.vip-status .txt { flex: 1; }
.vip-status .txt b { font-size: 16px; }
.vip-status .txt span { color: var(--muted); font-size: 13px; display: block; margin-top: 4px; }

/* ---------- 开关 ---------- */
.switch-row {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; margin-top: 14px;
}
.switch { position: relative; width: 50px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; border-radius: 20px; background: var(--border); transition: var(--transition); cursor: pointer;
}
.switch .slider::before {
    content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px;
    border-radius: 50%; background: #fff; transition: var(--transition);
}
.switch input:checked + .slider { background: var(--accent2); }
.switch input:checked + .slider::before { transform: translateX(23px); }
.switch-label b { font-size: 15px; }
.switch-label span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- 订单表 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #f59e0b22; color: #f59e0b; }
.badge.paid { background: #22c55e22; color: #22c55e; }
.badge.canceled { background: #ef444422; color: #ef4444; }

/* ---------- 播放页 ---------- */
.player-box { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box video { width: 100%; height: 100%; }
.lock-tip {
    text-align: center; padding: 60px 20px; color: var(--muted);
}
.lock-tip .big { font-size: 46px; margin-bottom: 16px; }

/* ---------- 提示条 / 消息 ---------- */
.toast {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: var(--card-solid); color: var(--text); border: 1px solid var(--border);
    padding: 12px 22px; border-radius: 11px; box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transition: var(--transition); z-index: 99; max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #ef4444; color: #ef4444; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 20px 34px; }

/* ---------- 响应式 ---------- */
@media (max-width: 700px) {
    .topbar { padding: 10px 14px; gap: 8px; }
    .brand { font-size: 16px; }
    .nav { margin-left: 4px; }
    .icon-btn { padding: 6px 9px; font-size: 13px; }
    .hero h1 { font-size: 26px; }
    .wrap { padding: 88px 14px 40px; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .plan-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .table-wrap { overflow-x: auto; }
}
