/*  
 * ModernCinema Pro - 现代影视增强放映厅核心样式表 (v1.5.0 全端黄金比例自适应版)
 * assets/modern.css
 */

/* 1. 核心加密锁及视听沙箱主容器 */
.m-lock {
    /* ⚡ 核心变量组：后台配置的主题色会自动通过 HTML root 注入覆盖这里的默认蓝 */
    --cinema-theme-color: #0a84ff; 
    --cinema-bg: #ffffff;
    --cinema-border: rgba(0, 0, 0, 0.06);
    --cinema-text: #1d1d1f;
    --cinema-input-bg: rgba(0, 0, 0, 0.02);
    --cinema-btn-bg: rgba(0, 0, 0, 0.05);
    --cinema-btn-text: #333333;
    --cinema-btn-hover: rgba(0, 0, 0, 0.08);
    --cinema-scrollbar: rgba(0, 0, 0, 0.15);

    background: var(--cinema-bg);
    border-radius: 14px;
    padding: 5px 5px;
    text-align: center;
    border: 1px solid var(--cinema-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin: 5px 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.3s ease, border-color 0.3s ease, padding 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 🌙 暗色模式：纯变量置换，拒绝 !important 污染 */
@media (prefers-color-scheme: dark) {
    .m-lock {
        --cinema-bg: #1c1c1e;
        --cinema-border: rgba(255, 255, 255, 0.08);
        --cinema-text: #eaeaea;
        --cinema-input-bg: rgba(255, 255, 255, 0.04);
        --cinema-btn-bg: rgba(255, 255, 255, 0.06);
        --cinema-btn-text: #cccccc;
        --cinema-btn-hover: rgba(255, 255, 255, 0.12);
        --cinema-scrollbar: rgba(255, 255, 255, 0.2);
        
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    }
}

/* 🔒 锁图标精致微调 */
.lock-icon {
    font-size: 25px;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
    animation: lockPulse 2s infinite ease-in-out;
}

.m-lock h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--cinema-text);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

/* 2. 控制台表单区域 */
.m-lock-ctrl {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    margin: 10px auto 0 auto;
}

/* 访问码输入框 */
.m-lock-ctrl input[type="password"].m-vlock-pass-input,
.m-lock-ctrl input[type="password"] {
    flex: 1;
    min-width: 0;
    padding: 11px 15px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background: var(--cinema-input-bg);
    color: var(--cinema-text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.m-lock-ctrl input[type="password"]:focus {
    border-color: var(--cinema-theme-color);
    background: var(--cinema-bg);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15); /* 优雅地随配置色变化 */
}

/* 验证按钮 */
.m-lock-ctrl button.m-vlock-unlock-btn,
.m-lock-ctrl button {
    background: var(--cinema-theme-color);
    color: #ffffff !important;
    width: 35%;
    border: none;
    padding: 11px 2px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.2);
}

.m-lock-ctrl button:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
    transform: translateY(-1px);
}

.m-lock-ctrl button:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* 3. 播放器容器及内容展现层 */
.m-lock-content {
    width: 100%;
    box-sizing: border-box;
}

/* 🛠️ 解锁成功后，重塑面板全局内边距，使播放器比例在大屏和移动端都具备极强的包裹感 */
.m-lock:has(.m-lock-content[style*="display: block"]),
.m-lock.is-unlocked { 
    padding: 16px !important; 
}

/* ================== 【核心修复：院线级自适应黄金比例沙箱】 ================== */
.artplayer-holder {
    width: 100% !important;
    height: auto !important;
    /* 核心精髓：锁死 16:9 影视黄金比例，不管是多小的手机都能横向撑满且绝不产生黑边 */
    aspect-ratio: 16 / 9 !important; 
    max-height: 520px;
    background: #000000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin: 0 0 16px 0; 
    position: relative;
    transform: translateZ(0); 
    will-change: transform;
}

/* 兼容极为古董、不支持 aspect-ratio 属性的设备兜底 */
@supports not (aspect-ratio: 16 / 9) {
    .artplayer-holder {
        height: 0 !important;
        padding-bottom: 56.25% !important;
        position: relative;
    }
    .artplayer-holder .artplayer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}
/* ======================================================================== */

/* 4. 选集控制中心 */
.m-v-selector {
    display: block;
    width: 100%;
    margin-top: 15px;
}

/* 剧集容器 Flex 网格化平铺 */
.cinema-ep-list {
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* 丝滑的微型果冻滚动条 */
.cinema-ep-list::-webkit-scrollbar {
    width: 5px;
}
.cinema-ep-list::-webkit-scrollbar-thumb {
    background: var(--cinema-scrollbar);
    border-radius: 10px;
}
.cinema-ep-list::-webkit-scrollbar-track {
    background: transparent;
}

/* 统一选集纽扣的核心样式定义 */
.m-btn, .cinema-ep-btn {
    background: var(--cinema-btn-bg);
    color: var(--cinema-btn-text);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

/* 悬停未激活的普通按钮：加入优雅上浮反馈 */
.m-btn:hover, .cinema-ep-btn:hover {
    background: var(--cinema-btn-hover);
    transform: translateY(-2px); /* 悬浮时轻轻向上漂移 2px，极具动态美感 */
    color: var(--cinema-text);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* 点击下压动力学反馈 */
.m-btn:active, .cinema-ep-btn:active {
    transform: translateY(0) scale(0.96); /* 按下时具有轻微的弹性缩放果冻感 */
}

/* 完美高亮激活态 - 强制继承后台配置的 --cinema-theme-color 变量 */
.m-btn.active, .cinema-ep-btn.active {
    background: var(--cinema-theme-color) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px var(--cinema-theme-color); /* 发光阴影也同步跟随配置色 */
    transform: translateY(0) !important;
}

/* 5. 辅助动画库 */
@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes cinemaShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* 密码报错动画 */
.shake-error { 
    animation: cinemaShake 0.4s ease-in-out !important; 
    background-color: #ff3b30 !important; 
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3) !important;
}

/* 📱 6. 移动端极致响应式自适应适配规则 */
@media (max-width: 480px) {
    .m-lock {
        padding: 5px 5px;
        margin: 5px 0;
    }
    
    /* 【关键微调】：移动端解锁成功后，保持 8px 的内边距。
       既能让播放器横向拉伸显得更大，又留下了舒适的安全边距，防止选集按钮直接死死贴到手机屏幕外壳上 */
    .m-lock:has(.m-lock-content[style*="display: block"]),
    .m-lock.is-unlocked { 
        padding: 8px !important; 
    }

    .lock-icon { font-size: 36px; }
    
    .artplayer-holder {
        border-radius: 6px; /* 手机端圆角稍微减小，匹配手机屏幕的边缘感 */
        margin-bottom: 12px;
    }
    
    /* 手机端输入框与按钮自动垂直叠放 */
    .m-lock-ctrl {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }
    .m-lock-ctrl input[type="password"] {
        width: 100%;
        text-align: center;
        padding: 12px 15px; /* 稍微放大手机端的输入触点 */
    }
    .m-lock-ctrl button {
        width: 100%;
        padding: 12px 15px; /* 稍微放大手机端的点击触点 */
    }
    
    /* 移动端剧集列表自适应居中平铺 */
    .cinema-ep-list {
        justify-content: center;
        gap: 8px; /* 手机端按钮间距稍微收紧 */
    }
    
    .m-btn, .cinema-ep-btn {
        padding: 6px 12px; /* 优化手机端单按钮的胖瘦比例 */
        font-size: 12px;
    }
}