/* ====================================================================== *
 *  style.css - 流媒体平台前端样式
 *  风格：白色 + 浅灰色，卡片式布局，iOS 透明质感，响应式
 * ====================================================================== */

/* ---------- 变量 ---------- */
:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-surface-2: #fbfbfd;
    --color-border: #e8eaee;
    --color-border-strong: #d8dce2;
    --color-text: #1d2129;
    --color-text-sub: #6b7280;
    --color-text-muted: #9aa0a6;
    --color-primary: #007aff;
    --color-primary-soft: rgba(0, 122, 255, 0.1);
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-danger: #ff3b30;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --blur: saturate(180%) blur(20px);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- 通用按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #0066d6; }
.btn-ghost { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); }
.btn-ghost:hover { background: var(--color-surface-2); border-color: var(--color-text-muted); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #e0352b; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 通用输入 ---------- */
.input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
select.input { padding-right: 28px; }

/* ====================================================================== *
 *  播放器页面
 * ====================================================================== */
.player-body { background: #0e0f13; overflow-x: hidden; }
.player-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    color: #f2f3f5;
}
.player-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.live-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--color-danger);
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6);
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
.live-text { color: #ff6b61; }
.stream-name { color: var(--color-text-muted); font-weight: 400; }
.player-header-right { display: flex; align-items: center; gap: 12px; }
.p2p-status {
    font-size: 12px; padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); color: var(--color-text-muted);
}
.p2p-status.ok { background: rgba(52, 199, 89, 0.18); color: #4ade80; }
.p2p-status.fail { background: rgba(255, 59, 48, 0.18); color: #ff6b61; }
.p2p-status.hls { background: rgba(255, 149, 0, 0.18); color: #ffb340; }

/* 纯 HLS 模式横幅 */
.pure-hls-banner {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 149, 0, 0.15);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid rgba(255, 149, 0, 0.25);
    color: #ffb340;
    font-size: 12px;
    z-index: 15;
}
.pure-hls-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(255, 149, 0, 0.3);
    font-size: 11px;
    flex-shrink: 0;
}
.pure-hls-text { line-height: 1.4; }

/* 播放舞台 */
.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.main-video, .ad-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
}
.main-video { display: block; }

/* 遮罩层通用 */
.overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 24px;
    z-index: 30;
}

/* 加载 */
.loading-overlay { background: rgba(0, 0, 0, 0.6); backdrop-filter: var(--blur); color: #fff; gap: 16px; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: rgba(255, 255, 255, 0.85); }

/* 不支持提示 */
.unsupported-overlay { background: rgba(15, 17, 21, 0.92); backdrop-filter: var(--blur); }
.unsupported-box {
    max-width: 560px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    color: #f2f3f5;
}
.unsupported-icon { color: var(--color-warning); margin-bottom: 16px; }
.unsupported-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.unsupported-desc { color: rgba(255, 255, 255, 0.75); font-size: 14px; line-height: 1.7; }
.unsupported-detail {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px; color: var(--color-text-muted); line-height: 1.8;
}

/* 错误 */
.error-overlay { background: rgba(0, 0, 0, 0.7); backdrop-filter: var(--blur); color: #fff; gap: 14px; }
.error-box { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.error-icon { color: var(--color-danger); }
.error-text { font-size: 15px; color: rgba(255, 255, 255, 0.9); }

/* 播放按钮 */
.play-btn {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 20;
    cursor: pointer;
}
.play-btn svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }

/* 广告 */
.ad-container {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #000; z-index: 25;
}
.ad-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.ad-video { z-index: 26; }
.ad-label {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0, 0, 0, 0.6); color: #fff;
    font-size: 12px; padding: 3px 10px; border-radius: 4px;
    z-index: 27;
}
.ad-countdown {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0, 0, 0, 0.6); color: #fff;
    font-size: 12px; padding: 3px 10px; border-radius: 4px;
    z-index: 27;
}

/* 暂停广告 */
.pause-ad-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 18;
}
.pause-ad-content img, .pause-ad-content video {
    max-width: 80%; max-height: 80%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* 角标广告 */
.corner-ad {
    position: absolute; bottom: 70px; right: 12px;
    max-width: 180px; max-height: 120px;
    z-index: 16;
    border-radius: var(--radius-sm);
    overflow: visible;
}
.corner-ad img { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.corner-ad-close {
    position: absolute; top: -8px; right: -8px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.7); color: #fff;
    font-size: 12px; line-height: 20px; text-align: center;
    cursor: pointer;
}

/* 统计面板 */
.stats-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 20px;
    color: #f2f3f5;
}
.stats-panel-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 14px;
}
.stat-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 600; color: #fff; }
.stat-bar {
    margin-top: 8px; height: 4px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.1); overflow: hidden;
}
.stat-bar-fill { height: 100%; background: var(--color-primary); transition: width 0.4s ease; }

.player-footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.8;
    padding: 8px 0 16px;
}
.footer-hint { opacity: 0.7; }

/* ====================================================================== *
 *  管理后台
 * ====================================================================== */
.admin-body { background: var(--color-bg); }
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 15px;
}
.brand-mark {
    width: 24px; height: 24px; border-radius: 6px;
    background: linear-gradient(135deg, var(--color-primary), #5ac8fa);
}
.nav-list { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-sub);
    font-size: 14px;
    transition: all 0.15s;
}
.nav-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.nav-item.active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 500; }
.nav-ico { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; background: var(--color-border-strong); }
.nav-item.active .nav-ico { background: var(--color-primary); }
.nav-ico-dashboard { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.nav-ico-streams { background: linear-gradient(135deg, #34c759, #30d158); }
.nav-ico-ads { background: linear-gradient(135deg, #ff9500, #ffcc00); }
.nav-ico-access { background: linear-gradient(135deg, #ff3b30, #ff6b61); }
.nav-ico-settings { background: linear-gradient(135deg, #8e8e93, #c7c7cc); }
.nav-ico-embed { background: linear-gradient(135deg, #af52de, #bf5af2); }
.nav-ico-analytics { background: linear-gradient(135deg, #5ac8fa, #64d2ff); }

/* ===== 嵌入管理 ===== */
.embed-add-row {
    display: flex; gap: 8px; align-items: center;
    padding: 10px 14px; margin: 0 0 12px;
    background: rgba(0, 122, 255, 0.05);
    border: 1px dashed var(--color-border-strong, #d8dce3);
    border-radius: var(--radius-md, 10px);
}
.embed-add-row .input { flex: 1; }
.embed-code {
    width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; padding: 8px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 10px);
    background: #f7f8fa; color: #333;
    resize: vertical; min-height: 34px;
}
textarea.input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; min-height: 72px; resize: vertical;
}
.embed-section-title {
    font-size: 13px; font-weight: 600; color: var(--color-text, #1d1d1f);
    margin: 18px 0 8px; padding-top: 14px;
    border-top: 1px solid var(--color-border, #eef0f3);
}
.kbd-hint { font-size: 12px; color: var(--muted, #6c757d); }
.kbd-hint kbd {
    background: #f0f1f4; border: 1px solid #d8dce3; border-bottom-width: 2px;
    border-radius: 4px; padding: 1px 5px; font-size: 11px;
    font-family: ui-monospace, Menlo, monospace;
}
.analytics-code-cell textarea { min-width: 260px; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--color-border); }
.ws-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-muted); }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-muted); }
.ws-status.online .ws-dot { background: var(--color-success); box-shadow: 0 0 6px var(--color-success); }
.ws-status.online .ws-text { color: var(--color-success); }

/* 主区域 */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--color-border);
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.refresh-tip { font-size: 12px; color: var(--color-text-muted); }
.menu-toggle {
    display: none;
    flex-direction: column; gap: 4px;
    width: 32px; height: 32px;
    justify-content: center; align-items: center;
}
.menu-toggle span { width: 18px; height: 2px; background: var(--color-text); border-radius: 1px; }

.content { padding: 24px; flex: 1; }

/* 卡片行 */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.metric-label { font-size: 13px; color: var(--color-text-sub); margin-bottom: 8px; }
.metric-value { font-size: 28px; font-weight: 700; color: var(--color-text); }
.metric-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; }
.metric-bar { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--color-border); overflow: hidden; }
.metric-bar-fill { height: 100%; background: linear-gradient(90deg, var(--color-primary), #5ac8fa); transition: width 0.4s; }

/* 面板 */
.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.panel-title { font-size: 15px; font-weight: 600; }
.panel-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--color-primary-soft); color: var(--color-primary); }
.panel-hint { font-size: 12px; color: var(--color-text-muted); }
.panel-actions { display: flex; align-items: center; gap: 8px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left; padding: 12px 16px;
    background: var(--color-surface-2);
    color: var(--color-text-sub);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-surface-2); }
.empty-row { text-align: center; color: var(--color-text-muted); padding: 24px !important; }
.action-cell { white-space: nowrap; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--color-border); color: var(--color-text-sub); }
.badge-live { background: rgba(52, 199, 89, 0.15); color: var(--color-success); }
.badge-idle { background: rgba(255, 149, 0, 0.15); color: var(--color-warning); }

/* 图表 */
.chart-wrap { padding: 16px 20px; }
.chart-wrap canvas { width: 100%; display: block; }

/* 事件日志 */
.log-list { padding: 8px 0; max-height: 280px; overflow-y: auto; }
.log-item { display: flex; gap: 12px; padding: 8px 20px; font-size: 13px; border-bottom: 1px solid var(--color-border); }
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.log-text { color: var(--color-text); }

/* 列表编辑（访问控制） */
.list-edit { padding: 12px 20px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.list-value { font-size: 13px; color: var(--color-text); font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* 国家网格 */
.country-grid {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.country-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
}
.country-item input { margin: 0; }
.country-name { color: var(--color-text-sub); margin-left: auto; font-size: 12px; }

/* 表单 */
.form-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--color-text-sub); font-weight: 500; }
.form-row.full { grid-column: 1 / -1; }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; }
.form-actions { display: flex; gap: 12px; padding: 0 20px 20px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--color-border-strong);
    border-radius: 26px; transition: 0.25s;
}
.slider:before {
    content: ""; position: absolute;
    height: 20px; width: 20px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--color-success); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    width: 560px; max-width: 100%; max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal-sm { width: 380px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 24px; color: var(--color-text-muted); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--color-border); }

/* Toast */
.toast {
    position: fixed; bottom: 32px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(29, 33, 41, 0.92);
    backdrop-filter: var(--blur);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(52, 199, 89, 0.95); }
.toast.error { background: rgba(255, 59, 48, 0.95); }

/* ====================================================================== *
 *  响应式
 * ====================================================================== */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .menu-toggle { display: flex; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .refresh-tip { display: none; }

    /* 播放器 */
    .player-wrap { padding: 10px; gap: 10px; }
    .player-header { padding: 10px 12px; }
    .corner-ad { bottom: 56px; max-width: 120px; }
    .stats-panel { padding: 14px; }
    .stat-value { font-size: 16px; }
    .unsupported-box { padding: 24px 18px; }
    .unsupported-title { font-size: 18px; }
}

@media (max-width: 480px) {
    .cards-row { grid-template-columns: 1fr 1fr; }
    .metric-value { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .panel-actions { flex-wrap: wrap; }
    .modal { width: 100%; }
}

/* ---------- 登录遮罩 ---------- */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 246, 248, 0.88);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}
.auth-card {
    width: 360px;
    max-width: calc(100vw - 48px);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px 32px;
    text-align: center;
}
.auth-brand { margin-bottom: 28px; }
.auth-logo {
    display: inline-block;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-primary), #5ac8fa);
    margin-bottom: 16px;
}
.auth-brand h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}
.auth-brand p {
    font-size: 13px;
    color: var(--color-text-muted);
}
.auth-field { margin-bottom: 14px; }
.auth-field .input {
    width: 100%;
    height: 44px;
    text-align: center;
    font-size: 15px;
}
.auth-btn {
    width: 100%;
    height: 44px;
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
}
.auth-error {
    margin-top: 14px;
    font-size: 13px;
    color: var(--color-danger);
    min-height: 18px;
}

/* ---------- 播放器退出按钮 ---------- */
.header-logout-btn {
    margin-left: 12px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-sub);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.header-logout-btn:hover {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: rgba(255, 59, 48, 0.08);
}
