/* ========================================
   CJplayer 主样式表
   - 暗色模式变量在最前面定义，优先级最高
   - 所有组件使用CSS变量，零硬编码颜色
   - 统一圆角/间距/阴影系统
   ======================================== */

/* ===== 暗色模式变量（最高优先级，放在最前） ===== */
html[data-theme="dark"] {
    --bg-body:        #0f1115;
    --bg-header:      #161922;
    --bg-card:        #1c2030;
    --bg-hover:       #252a3d;
    --bg-input:       #252a3d;
    --bg-overlay:      rgba(0,0,0,0.75);

    --text-main:       #e8ecf4;
    --text-second:     #aab2c5;
    --text-muted:      #6b7488;

    --primary:         #6b8aff;
    --primary-hover:    #8ba8ff;
    --primary-soft:    rgba(107,138,255,0.15);

    --success:         #4ade80;
    --success-soft:    rgba(74,222,128,0.12);
    --danger:          #f87171;
    --danger-soft:    rgba(248,113,113,0.12);
    --warning:         #fbbf24;
    --warning-soft:    rgba(251,191,36,0.12);
    --info:            #60a5fa;
    --info-soft:      rgba(96,165,250,0.12);

    --border:          #2a3045;
    --shadow-xs:       0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm:       0 2px 8px rgba(0,0,0,0.35);
    --shadow-md:       0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:       0 8px 30px rgba(0,0,0,0.5);
}

/* ===== 亮色模式变量（默认） ===== */
:root {
    --bg-body:        #f5f7fa;
    --bg-header:      #ffffff;
    --bg-card:        #ffffff;
    --bg-hover:       #f0f2f7;
    --bg-input:       #f8f9fc;
    --bg-overlay:      rgba(0,0,0,0.5);

    --text-main:       #1a1d28;
    --text-second:     #4a5068;
    --text-muted:      #8a90a2;

    --primary:         #4a7dff;
    --primary-hover:    #3366ee;
    --primary-soft:    rgba(74,125,255,0.08);

    --success:         #22c55e;
    --success-soft:    rgba(34,197,94,0.1);
    --danger:          #ef4444;
    --danger-soft:    rgba(239,68,68,0.1);
    --warning:         #f59e0b;
    --warning-soft:    rgba(245,158,11,0.1);
    --info:            #3b82f6;
    --info-soft:      rgba(59,130,246,0.1);

    --border:          #e2e6ef;
    --shadow-xs:       0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:       0 2px 8px rgba(0,0,0,0.06);
    --shadow-md:       0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:       0 8px 30px rgba(0,0,0,0.12);

    --radius-sm:       8px;
    --radius-md:       12px;
    --radius-lg:       16px;
    --radius-full:     999px;

    --container-w:     1200px;
    --header-h:        60px;

    --t:              all .25s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color .3s ease, color .3s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

/* ===== 容器 ===== */
.container { max-width: var(--container-w); margin: 0 auto; padding: 0 20px; }

/* ===== 主题切换按钮（全局） ===== */
.theme-toggle {
    position: fixed; top: 14px; right: 16px; z-index: 9999;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--t);
}
.theme-toggle:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }

/* ===== 顶部导航 ===== */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    height: var(--header-h);
    display: flex; align-items: center;
    transition: background-color .3s ease, border-color .3s ease;
}
.header-inner {
    width: 100%; max-width: var(--container-w); margin: 0 auto;
    padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.logo-icon { font-size: 1.5rem; }
.logo-text { background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 14px; border-radius: var(--radius-sm);
    color: var(--text-second); font-size: 0.92rem; font-weight: 500;
    transition: var(--t);
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 10px; }
.credits-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: var(--radius-full);
    background: var(--warning-soft); color: var(--warning);
    font-size: 0.85rem; font-weight: 600;
}
.user-dropdown { position: relative; }
.username { padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; color: var(--text-second); }
.username:hover { background: var(--bg-hover); }
.dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%; margin-top: 6px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); min-width: 160px; overflow: hidden; z-index: 200;
}
.dropdown-menu a { display: block; padding: 10px 16px; color: var(--text-second); font-size: 0.88rem; }
.dropdown-menu a:hover { background: var(--primary-soft); color: var(--primary); }

/* ===== 按钮系统 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; border-radius: var(--radius-sm);
    font-size: 0.92rem; font-weight: 500;
    transition: var(--t); cursor: pointer; border: 1px solid transparent;
    text-decoration: none; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(74,125,255,0.35); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-second); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-warning { background: var(--warning); color: #1a1d28; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== 表单 ===== */
.form { max-width: 500px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-second); font-weight: 500; }
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text-main); font-size: 0.95rem;
    outline: none; transition: var(--t);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-row input:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== 提示框 ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.alert-info { background: var(--info-soft); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }

/* ===== 时间 & 公告栏 ===== */
.time-bar {
    background: linear-gradient(135deg, var(--primary-soft), var(--info-soft));
    border-radius: var(--radius-md); padding: 14px 20px;
    margin: 20px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    transition: background-color .3s ease;
}
.time-center { display: flex; align-items: center; gap: 12px; }
.date-text { font-size: 0.95rem; color: var(--text-second); font-weight: 500; }
.time-text { font-size: 1.15rem; font-weight: 700; color: var(--primary); font-family: 'Courier New', monospace; }
.notice-bar { flex: 1; min-width: 200px; font-size: 0.88rem; color: var(--text-second); display: flex; align-items: center; gap: 6px; }
.notice-label { font-weight: 600; color: var(--warning); }
.notice-content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 搜索框（多色呼吸灯特效） ===== */
.search-wrap { margin: 24px 0; position: relative; }
.search-box {
    display: flex; gap: 10px; max-width: 700px; margin: 0 auto;
    position: relative;
}
.search-box input {
    flex: 1; padding: 14px 20px;
    border: 2px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-input); color: var(--text-main); font-size: 1rem; outline: none;
    transition: var(--t);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-btn {
    padding: 14px 28px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff;
    font-size: 1rem; font-weight: 600; transition: var(--t);
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(74,125,255,0.35); }

/* 多色呼吸灯边框特效 */
.breathing-border {
    animation: breatheBorder 3s ease-in-out infinite;
    border-radius: var(--radius-md);
}
@keyframes breatheBorder {
    0%, 100% {
        box-shadow: 0 0 5px #ff6b6b, 0 0 10px #ff6b6b44, inset 0 0 5px #ff6b6b22;
    }
    25% {
        box-shadow: 0 0 5px #ffd93d, 0 0 10px #ffd93d44, inset 0 0 5px #ffd93d22;
    }
    50% {
        box-shadow: 0 0 5px #6bcb77, 0 0 10px #6bcb7744, inset 0 0 5px #6bcb7722;
    }
    75% {
        box-shadow: 0 0 5px #4d96ff, 0 0 10px #4d96ff44, inset 0 0 5px #4d96ff22;
    }
}

.search-suggestions {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 700px; margin-top: 6px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; z-index: 50;
}

/* ===== 搜索结果 ===== */
.search-results { margin: 24px 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { font-size: 1.15rem; color: var(--text-main); }
.btn-close { padding: 6px 12px; border-radius: var(--radius-sm); background: var(--bg-hover); color: var(--text-second); font-size: 0.85rem; }
.btn-close:hover { background: var(--danger-soft); color: var(--danger); }

.results-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
}
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-second); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 16px; }

/* ===== 正在热映 ===== */
.hot-section { margin: 30px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-header h2 { font-size: 1.2rem; color: var(--text-main); }
.section-subtitle { font-size: 0.85rem; color: var(--text-muted); }

.hot-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }

.video-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; transition: var(--t); display: block; color: inherit;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }

.video-cover { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--bg-hover); }
.video-cover img { width: 100%; height: 100%; object-fit: cover; }
.no-cover { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2.5rem; }
.video-remarks {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.75); color: #fff; font-size: 0.75rem;
    padding: 2px 8px; border-radius: var(--radius-sm); max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hot-badge {
    position: absolute; top: 8px; left: 8px;
    background: var(--danger); color: #fff; font-size: 0.72rem;
    padding: 2px 8px; border-radius: var(--radius-sm); font-weight: 600;
}

.video-info { padding: 10px 12px; }
.video-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.source-tag { background: var(--primary-soft); color: var(--primary); padding: 1px 6px; border-radius: 3px; font-size: 0.72rem; }

/* ===== 分页 ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.page-btn { padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-second); font-size: 0.88rem; transition: var(--t); cursor: pointer; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.page-info { font-size: 0.88rem; color: var(--text-muted); }

/* ===== 网站信息 ===== */
.site-info { margin: 30px 0 20px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); transition: background-color .3s ease, border-color .3s ease; }
.site-stats { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.stat-item { font-size: 0.9rem; color: var(--text-second); }
.site-remark { font-size: 0.82rem; color: var(--text-muted); }

/* ===== 页脚 ===== */
.site-footer { text-align: center; padding: 20px; font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 40px; transition: border-color .3s ease; }

/* ===== 页面头部 ===== */
.page-header { margin: 24px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; color: var(--text-main); }
.page-desc { font-size: 0.88rem; color: var(--text-muted); }

/* ===== 加载动画 ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.loading::after { content: '...'; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0%,20%{content:'...'} 40%{content:'..'} 60%{content:'.'} 80%,100%{content:''} }
