/* ========================================================
   Aurora Cinema - 现代化响应式设计规范
   ======================================================== */

:root {
    --bg-base: #090a10;
    --bg-surface: #12141e;
    --bg-card: rgba(26, 29, 44, 0.7);
    --bg-card-hover: rgba(38, 42, 64, 0.85);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-player: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px -5px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    
    --max-content-width: 1720px;
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 10% 20%, rgba(236, 72, 153, 0.05) 0%, transparent 40%);
}

/* ================= 顶部导航栏 ================= */
.navbar {
    height: 72px;
    background: rgba(18, 20, 30, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-badge {
    background: var(--primary-gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-desc {
    color: var(--text-muted);
    font-size: 13px;
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
    display: none;
}

@media (min-width: 768px) {
    .brand-desc {
        display: inline-block;
    }
}

/* 输入栏 */
.url-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 680px;
    background: rgba(10, 11, 16, 0.6);
    border: 1px solid var(--border-color);
    padding: 5px 6px 5px 16px;
    border-radius: 9999px;
    transition: all 0.25s ease;
}

.url-input-group:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(10, 11, 16, 0.9);
}

.url-input-group input {
    flex: 1;
    min-width: 0;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
}

.url-input-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    outline: none;
    padding: 9px 20px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ================= 核心工作区（左右留白，居中播放） ================= */
.theater-workspace {
    flex: 1;
    max-width: var(--max-content-width);
    width: 100%;
    margin: 28px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 28px;
    align-items: start;
}

/* 左右预留位（广告与挂件位） */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ad-slot-placeholder {
    background: var(--bg-card);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s ease;
}

.ad-slot-placeholder:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.slot-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.slot-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.slot-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.slot-content p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ================= 中央播放器大厅 ================= */
.player-center-stage {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* 16:9 标准播放器视窗 */
.player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 纵横比 */
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-player);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* 加载遮罩与状态指示器 */
.player-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 10, 16, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    gap: 16px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.player-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-tip {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ================= 线路切换器面板 ================= */
.route-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.current-route-badge {
    font-size: 12px;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.route-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.route-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.route-btn span {
    display: block;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.route-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ================= 辅助信息与操作卡片 ================= */
.utility-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.utility-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    max-width: 65%;
    min-width: 0;
}

.source-url-text {
    color: #38bdf8;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    text-decoration: underline;
    min-width: 0;
    max-width: 100%;
    display: inline-block;
}

.utility-actions {
    display: flex;
    gap: 10px;
    min-width: 0;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.icon-svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ================= 底部版权 ================= */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* ================= 响应式断点适配 ================= */
@media (max-width: 1360px) {
    .theater-workspace {
        grid-template-columns: 220px 1fr 220px;
        gap: 20px;
    }
    .ad-slot-placeholder {
        min-height: 420px;
    }
}

@media (max-width: 1080px) {
    /* 平板及中小屏：隐藏左右预留位，保证主播放器享有最大可视面积 */
    .theater-workspace {
        grid-template-columns: 100%;
        padding: 0 16px;
        margin: 18px auto;
        gap: 20px;
        width: 100%;
        max-width: 100%;
    }
    .side-column {
        display: none !important;
    }
    .utility-info {
        max-width: 100%;
    }
}

/* 手机竖屏与中小型移动设备 (< 768px) 深度优化 */
@media (max-width: 768px) {
    /* 顶部导航栏紧凑化 */
    .navbar {
        height: auto;
        padding: 8px 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .brand {
        justify-content: center;
        gap: 8px;
    }
    .brand-name {
        font-size: 16px;
    }
    .url-input-group {
        width: 100%;
        max-width: 100%;
        padding: 3px 3px 3px 12px;
        background: rgba(10, 11, 16, 0.85);
        box-sizing: border-box;
    }
    .url-input-group input {
        font-size: 13px;
        min-width: 0;
    }
    .btn-primary {
        padding: 7px 12px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 核心舞台区域全宽化，减少屏幕边缘黑边浪费 */
    .theater-workspace {
        margin: 8px auto;
        padding: 0 8px;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .player-center-stage {
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .player-wrapper {
        border-radius: 10px;
        box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.9);
        width: 100%;
        max-width: 100%;
    }

    /* 线路切换面板适配为整齐双列网格，使用 minmax(0, 1fr) 严防撑大 */
    .route-panel {
        padding: 12px 10px;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .route-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        margin-bottom: 10px;
        width: 100%;
        min-width: 0;
    }
    .title-with-icon {
        font-size: 12px;
        min-width: 0;
        overflow: hidden;
    }
    .title-with-icon span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }
    .current-route-badge {
        font-size: 11px;
        padding: 2px 6px;
        flex-shrink: 0;
    }
    .route-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        max-width: 100%;
    }
    .route-btn {
        padding: 9px 4px;
        font-size: 11px;
        border-radius: 6px;
        text-align: center;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .route-btn span {
        font-size: 11px;
        display: block;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 辅助卡片移动端自适应平铺 */
    .utility-card {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .utility-info {
        max-width: 100%;
        width: 100%;
        font-size: 12px;
        min-width: 0;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .source-url-text {
        max-width: 100%;
        min-width: 0;
        display: inline;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .utility-actions {
        display: flex;
        width: 100%;
        gap: 6px;
        min-width: 0;
    }
    .btn-secondary {
        flex: 1 1 0%;
        min-width: 0;
        justify-content: center;
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    .footer {
        padding: 14px 10px;
        font-size: 11px;
    }
}

/* 超窄屏手机设备 (< 360px) 极简适配 */
@media (max-width: 360px) {
    .theater-workspace {
        padding: 0 4px;
    }
    .route-list {
        grid-template-columns: 1fr;
    }
}
