* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none !important; }
:root {
    --primary: #f97316;
    --bg: #0f0f13;
    --card-bg: rgba(255,255,255,0.06);
    --card-border: rgba(255,255,255,0.08);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; overflow-x: hidden;
}

/* Background */
.page-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://objectstorageapi.gzg.sealos.run/ykb656yi-abb-1/downloaded-image.png') center/cover no-repeat;
    z-index: -2;
}
.page-bg-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,15,19,0.88);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    z-index: -1;
}

/* Top Nav */
.play-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 56px; display: flex; align-items: center; padding: 0 24px; gap: 16px;
    background: rgba(15,15,19,0.7); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}
.play-nav .nav-logo {
    color: var(--primary); font-weight: 700; font-size: 16px;
    display: flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
    flex-shrink: 0;
}
.play-nav .nav-logo svg { width: 20px; height: 20px; stroke: var(--primary); }
.play-nav .nav-search {
    flex: 1; max-width: 400px; margin: 0 auto;
    position: relative;
}
.play-nav .nav-search input {
    width: 100%; padding: 8px 44px 8px 16px; border-radius: 20px;
    background: rgba(255,255,255,0.08); border: 1px solid var(--card-border);
    color: var(--text); font-size: 14px; outline: none;
    transition: all 0.2s;
}
.play-nav .nav-search input::placeholder { color: var(--text-muted); }
.play-nav .nav-search input:focus {
    background: rgba(255,255,255,0.12); border-color: var(--primary);
}
.play-nav .nav-search button {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px;
    background: transparent; border: none; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.play-nav .nav-search button:hover { color: var(--text); }
.play-nav .nav-search button svg { width: 18px; height: 18px; }
.play-nav .nav-right {
    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
}
.play-nav .nav-history,
.play-nav .nav-icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.play-nav .nav-history:hover,
.play-nav .nav-icon-btn:hover { background: rgba(255,255,255,0.12); }
.play-nav .nav-history svg,
.play-nav .nav-icon-btn svg { width: 18px; height: 18px; stroke: var(--text-secondary); }
@media (max-width: 768px) {
    .play-nav .nav-search { display: none; }
    .play-nav .nav-right { margin-left: auto; }
}

/* Main Content */
.play-container {
    max-width: 1200px; margin: 0 auto;
    padding: 72px 24px 40px;
}

/* Player Area */
.player-wrap {
    width: 100%; aspect-ratio: 16/9;
    background: #000; border-radius: 6px 6px 0 0;
    overflow: hidden; position: relative;
}
.player-wrap .art-video-player { width: 100% !important; height: 100% !important; }
/* 隐藏播放器内置弹幕控制按钮（已移到弹幕栏） */
.apd-toggle { display: none !important; }
.apd-config { display: none !important; }

/* Loading State */
.player-loading {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #000; gap: 16px;
}
.player-loading .spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-loading .loading-text { color: var(--text-muted); font-size: 14px; }
.player-error {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #000; gap: 12px;
}
.player-error svg { width: 48px; height: 48px; stroke: #ef4444; }
.player-error .error-text { color: #ef4444; font-size: 14px; }
.player-error .retry-btn {
    margin-top: 8px; padding: 8px 24px; border-radius: 20px;
    background: var(--primary); color: #fff; border: none;
    cursor: pointer; font-size: 13px;
}

/* Video Info */
.video-info {
    margin-top: 16px; padding: 20px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 6px;
}
.video-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.video-title { font-size: 20px; font-weight: 700; flex: 1; }
.video-tags { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.video-tag {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    white-space: nowrap;
}
.video-tag.tag-source { background: rgba(249,115,22,0.15); color: var(--primary); }
.video-tag.tag-score { background: rgba(239,68,68,0.15); color: #ef4444; }
.video-tag.tag-year { background: rgba(99,102,241,0.15); color: #818cf8; }
.video-tag.tag-type { background: rgba(168,85,247,0.15); color: #c084fc; }
.video-meta {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-meta span { margin-right: 16px; }
.video-desc {
    font-size: 13px; color: var(--text-muted); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Episodes Section */
.episodes-section {
    margin-top: 16px; padding: 20px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 6px;
}
.episodes-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: nowrap;
}
.episodes-title { font-size: 16px; font-weight: 600; flex-shrink: 0; }
.episodes-count {
    font-size: 13px; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
    min-width: 0; overflow: hidden;
}

/* Source Tabs */
.source-tabs {
    display: flex; gap: 8px; margin-bottom: 16px;
    overflow-x: auto; padding-bottom: 4px;
}
.source-tabs::-webkit-scrollbar { height: 0; }
.source-tab {
    padding: 6px 16px; border-radius: 20px; font-size: 13px;
    background: rgba(255,255,255,0.06); color: var(--text-secondary);
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: all 0.2s;
}
.source-tab:hover { background: rgba(255,255,255,0.1); }
.source-tab.active {
    background: rgba(249,115,22,0.15); color: var(--primary);
    border-color: rgba(249,115,22,0.3);
}

/* Episode Grid */
.episode-grid {
    display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 8px; max-height: 320px; overflow-y: auto;
    padding-right: 4px;
}
/* PC 各档位列数 */
.episode-grid.ep-xs { grid-template-columns: repeat(6, 1fr); }
.episode-grid.ep-sm { grid-template-columns: repeat(5, 1fr); }
.episode-grid.ep-md { grid-template-columns: repeat(4, 1fr); }
.episode-grid.ep-lg { grid-template-columns: repeat(3, 1fr); }
.episode-grid.ep-xl { grid-template-columns: repeat(2, 1fr); }
.episode-grid::-webkit-scrollbar { width: 4px; }
.episode-grid::-webkit-scrollbar-track { background: transparent; }
.episode-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.episode-btn {
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06); color: var(--text-secondary);
    border: 1px solid transparent; cursor: pointer;
    font-size: 13px; text-align: center; transition: all 0.2s;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.episode-grid.align-left .episode-btn {
    text-align: left;
}
.episode-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.episode-btn.active {
    background: rgba(249,115,22,0.2); color: var(--primary);
    border-color: rgba(249,115,22,0.4); font-weight: 600;
}
.episode-btn.loading {
    opacity: 0.6; pointer-events: none;
}

/* Page Loading */
.page-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 60vh; gap: 16px;
}
.page-loading .spinner {
    width: 44px; height: 44px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Now Playing Indicator */
.now-playing {
    font-size: 13px; color: var(--primary);
    display: flex; align-items: center; max-width: 400px;
    overflow: hidden;
}
.now-playing .dot {
    flex-shrink: 0;
    width: 6px; height: 6px; background: var(--primary);
    border-radius: 50%; animation: pulse 1.5s infinite;
    margin-right: 6px;
}
.now-playing-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== History Modal ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 200;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: #1a1a22; border: 1px solid var(--card-border);
    border-radius: var(--radius); width: 90%; max-width: 520px;
    max-height: 60vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--card-border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.06); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.4); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.6); }
.modal-empty {
    text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px;
}
.history-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; margin-bottom: 4px;
}
.history-item:hover { background: rgba(255,255,255,0.06); }
.history-info { flex: 1; min-width: 0; }
.history-title {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 14px;
}
.history-title .h-name { font-weight: 500; color: var(--text); flex-shrink: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.history-title .h-ep { color: var(--primary); overflow: hidden; text-overflow: ellipsis; }
.history-meta {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    display: flex; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-progress {
    width: 100%; height: 3px; background: rgba(255,255,255,0.1);
    border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.history-progress-bar {
    height: 100%; background: var(--primary); border-radius: 2px;
}
.history-del {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.history-del:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.history-del svg { width: 14px; height: 14px; }
.modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--card-border);
    text-align: center;
}
.modal-footer button {
    padding: 6px 20px; border-radius: 16px; border: none;
    background: rgba(239,68,68,0.15); color: #ef4444;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.modal-footer button:hover { background: rgba(239,68,68,0.25); }

/* Resume Toast */
.resume-toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.9); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 12px 16px; z-index: 100;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text); backdrop-filter: blur(8px);
    white-space: nowrap; max-width: 90vw;
}
.resume-toast button {
    padding: 8px 14px; border-radius: 12px; border: none;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
    white-space: nowrap; flex-shrink: 0;
}
.resume-toast .resume-btn { background: var(--primary); color: #fff; }
.resume-toast .resume-btn:hover { background: #ea580c; }
.resume-toast .resume-skip { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.resume-toast .resume-skip:hover { background: rgba(255,255,255,0.2); }

/* ===== Danmaku Bar (单行弹幕栏) ===== */
.danmaku-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: rgba(20,20,28,0.95);
    border: 1px solid var(--card-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    min-height: 44px;
}
.danmaku-bar-left {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.dm-icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 4px;
    background: none; border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted); cursor: pointer; transition: all 0.2s;
    flex-shrink: 0;
}
.dm-icon-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.dm-icon-btn.active { color: var(--primary); border-color: rgba(249,115,22,0.3); }
.dm-icon-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.danmaku-online {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-muted);
    padding: 2px 6px; height: 32px; line-height: 1;
}
.danmaku-online span { display: inline-flex; align-items: center; }
.online-dot {
    display: inline-block; vertical-align: middle;
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}
.danmaku-toggle {
    position: relative;
    display: flex; align-items: center; gap: 4px;
    background: none; border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 12px; cursor: pointer; padding: 4px 8px;
    border-radius: 4px; transition: all 0.2s; height: 32px;
    line-height: 1;
}
.danmaku-toggle:hover { color: var(--text-secondary); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.danmaku-toggle.active { color: var(--primary); border-color: rgba(249,115,22,0.3); }
.toggle-arrow { transition: transform 0.25s ease; flex-shrink: 0; vertical-align: middle; }
.toggle-arrow.expanded { transform: rotate(180deg); }
.new-msg-dot {
    position: absolute; top: 4px; right: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.6);
    animation: pulse 1.5s infinite;
}
.danmaku-bar-center {
    flex: 1; display: flex; align-items: center; min-width: 0;
}
.chat-input-wrap {
    flex: 1; display: flex; align-items: center;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; height: 32px; transition: all 0.2s;
}
.chat-input-wrap:focus-within {
    background: rgba(255,255,255,0.1);
    border-color: rgba(249,115,22,0.4);
}
.chat-color-picker { position: relative; flex-shrink: 0; padding-left: 8px; display: flex; align-items: center; height: 100%; }
.color-btn {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer; transition: all 0.2s;
    flex-shrink: 0;
}
.color-btn:hover { border-color: rgba(255,255,255,0.4); transform: scale(1.1); }
.color-palette {
    position: absolute; bottom: 100%; left: 0;
    margin-bottom: 8px; padding: 8px;
    background: #1a1a22; border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 100;
}
.color-item {
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; transition: all 0.15s;
    border: 2px solid transparent;
}
.color-item:hover { transform: scale(1.15); }
.color-item.active { border-color: var(--primary); box-shadow: 0 0 6px rgba(249,115,22,0.4); }
.chat-input {
    flex: 1; padding: 0 12px; height: 100%;
    background: transparent; border: none;
    color: var(--text); font-size: 13px; outline: none;
    min-width: 0;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-send-btn {
    padding: 0 18px; border-radius: 4px; border: none; height: 32px;
    background: var(--primary); color: #fff;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.2s; flex-shrink: 0;
}
.chat-send-btn:hover { background: #ea580c; }
.chat-send-btn:disabled {
    background: rgba(255,255,255,0.06); color: var(--text-muted);
    cursor: not-allowed;
}

/* 可展开聊天记录 */
/* Toast 提示 */
.danmaku-toast {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-10px);
    background: rgba(0,0,0,0.85); color: #fff; padding: 10px 24px;
    border-radius: 8px; font-size: 13px; z-index: 9999;
    opacity: 0; transition: all 0.3s ease;
    pointer-events: none; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.danmaku-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 昵称设置弹窗 */
.nick-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.nick-dialog {
    background: #1a1a24; border: 1px solid var(--card-border);
    border-radius: 12px; padding: 28px 32px;
    width: 360px; max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    animation: fadeInMsg 0.25s ease-out;
}
.nick-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.nick-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.nick-input {
    width: 100%; padding: 10px 14px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text); font-size: 14px; outline: none;
    transition: border-color 0.2s; box-sizing: border-box;
}
.nick-input:focus { border-color: var(--primary); }
.nick-input::placeholder { color: var(--text-muted); }
.nick-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.nick-btn {
    padding: 8px 20px; border-radius: 8px; font-size: 13px;
    cursor: pointer; border: none; transition: all 0.2s; font-weight: 500;
}
.nick-skip { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.nick-skip:hover { background: rgba(255,255,255,0.14); }
.nick-confirm { background: var(--primary); color: #fff; }
.nick-confirm:hover { background: #ea580c; }
.nick-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

/* 房间图标+文字按钮 */
.room-label-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; color: var(--text-muted);
    background: none; border: none; cursor: pointer;
    padding: 2px 6px; white-space: nowrap; height: 32px;
    transition: color 0.2s; vertical-align: middle;
}
.room-label-btn svg { flex-shrink: 0; }
.room-label-btn:hover { color: var(--text-primary); }
.room-label-btn.active { color: var(--primary); }
.room-icon-btn:hover { color: var(--primary); }
.room-leave-btn:hover { color: #ef4444; }


/* 房间入口全屏遮罩 */
.room-entry-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: 100;
    display: flex; align-items: center; justify-content: center;
}

/* 房间弹窗 Tabs */
.room-tabs {
    display: flex; gap: 0; margin-bottom: 16px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.room-tab {
    flex: 1; padding: 8px 0; border: none; cursor: pointer;
    font-size: 13px; font-weight: 500; transition: all 0.2s;
    background: rgba(255,255,255,0.04); color: var(--text-muted);
}
.room-tab.active { background: var(--primary); color: #fff; }
.room-tab:hover:not(.active) { background: rgba(255,255,255,0.08); }

/* 房间错误提示 */
.room-error {
    color: #ef4444; font-size: 12px;
    margin-top: 8px; padding: 0 2px;
}

/* 房间链接框 */
.room-link-box { margin-top: 12px; }

.chat-history-tip {
    text-align: center; font-size: 11px; color: var(--text-muted);
    padding: 10px 0 4px; opacity: 0.5;
    letter-spacing: 0.5px;
}
.chat-history {
    background: linear-gradient(180deg, rgba(15,15,20,0.98) 0%, rgba(20,20,28,0.95) 100%);
    border: 1px solid var(--card-border); border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.chat-messages {
    max-height: 260px; overflow-y: auto;
    padding: 6px 16px 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
.chat-msg {
    display: flex; align-items: baseline; gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 13px; line-height: 1.6;
    animation: fadeInMsg 0.25s ease-out;
    transition: background 0.15s;
}
.chat-msg:hover { background: rgba(255,255,255,0.06); }
@keyframes fadeInMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-msg.chat-system { justify-content: center; background: transparent; padding: 4px 0; }
.msg-system {
    color: var(--text-muted); font-size: 11px;
    background: rgba(255,255,255,0.05);
    padding: 3px 12px; border-radius: 12px;
    display: inline-block;
}
.msg-nick {
    font-weight: 600; font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.8;
}
.msg-nick::after { content: ':'; }
.msg-text { word-break: break-all; flex: 1; }
.chat-empty {
    text-align: center; color: var(--text-muted); font-size: 13px;
    padding: 40px 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .play-container { padding: 64px 12px 24px; }
    .play-nav { padding: 0 12px; height: 50px; }
    .player-wrap { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
    .video-info { padding: 14px; margin-top: 12px; }
    .video-title { font-size: 17px; }
    .video-header { flex-direction: column; gap: 8px; }
    .episodes-section { padding: 14px; margin-top: 12px; }
    .episode-grid { gap: 8px; max-height: 240px; }
    .episode-grid.ep-xs { grid-template-columns: repeat(3, 1fr); }
    .episode-grid.ep-sm { grid-template-columns: repeat(3, 1fr); }
    .episode-grid.ep-md { grid-template-columns: repeat(2, 1fr); }
    .episode-grid.ep-lg { grid-template-columns: repeat(2, 1fr); }
    .episode-grid.ep-xl { grid-template-columns: repeat(1, 1fr); }
    .episode-btn { padding: 8px 6px; font-size: 12px; min-width: 0; }
    .now-playing { max-width: 200px; }
    .danmaku-bar { padding: 6px 8px; gap: 4px; min-height: unset; flex-wrap: wrap; align-items: center; }
    .danmaku-bar-left { gap: 4px; align-items: center; width: 100%; padding:5px}
    .danmaku-bar-center { width: 100%; }
    .dm-report-btn { display: none; }
    .dm-icon-btn { width: 28px; height: 28px; }
    .dm-icon-btn svg { width: 13px; height: 13px; }
    .danmaku-online { font-size: 10px; padding: 0 2px; height: 28px; }
    .room-label-btn { font-size: 10px; height: 28px; padding: 2px 4px; }
    .danmaku-toggle { height: 28px; font-size: 11px; padding: 2px 6px; }
    .toggle-arrow { width: 10px; height: 10px; }
    .chat-input-wrap { height: 36px; }
    .chat-input { font-size: 12px; padding: 0 8px; }
    .color-btn { width: 14px; height: 14px; }
    .chat-color-picker { padding-left: 6px; }
    .chat-send-btn { padding: 0 10px; height: 36px; font-size: 12px; }
    .chat-messages { max-height: 150px; }
}

/* 全屏弹幕发送栏 */
.art-dm-sender {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 34px;
}
.art-dm-online {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}
.art-dm-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #67c23a;
    flex-shrink: 0;
}
.art-dm-box {
    display: flex;
    align-items: center;
    height: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    transition: border-color .2s;
}
.art-dm-box:focus-within {
    border-color: var(--primary, #f97316);
    background: rgba(255,255,255,0.12);
}
.art-dm-input {
    width: 220px;
    height: 100%;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 13px;
    padding: 0 14px;
    outline: none;
}
.art-dm-input::placeholder { color: rgba(255,255,255,0.4); }
.art-dm-btn {
    height: 100%;
    padding: 0 16px;
    border: none;
    background: var(--primary, #f97316);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}
.art-dm-btn:hover { opacity: 0.85; }

/* 播放器内选集面板 - 居中模态框 */
.art-ep-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
.art-ep-panel.art-ep-show {
    display: flex;
}
.art-ep-modal {
    background: linear-gradient(135deg, rgba(30,30,40,0.75) 0%, rgba(20,20,30,0.85) 100%);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    width: 85%;
    max-width: 560px;
    max-height: 65%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
/* 手机端: 右侧滑出面板 */
@media (max-width: 640px), (max-height: 500px) {
    .art-ep-panel {
        background: rgba(0,0,0,0.5);
        align-items: stretch;
        justify-content: flex-end;
    }
    .art-ep-modal {
        width: 280px;
        max-width: 45%;
        max-height: 100%;
        height: 100%;
        border-radius: 12px 0 0 12px;
        background: linear-gradient(180deg, rgba(20,20,28,0.92) 0%, rgba(16,16,24,0.96) 100%);
        border: none;
        border-left: 1px solid rgba(255,255,255,0.08);
        box-shadow: -8px 0 32px rgba(0,0,0,0.5);
        animation: ep-slide-in .25s ease-out;
    }
    @keyframes ep-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
    .art-ep-header { padding: 14px 14px 10px; }
    .art-ep-title { font-size: 14px; }
    .art-ep-grid { padding: 8px 12px; gap: 6px; }
    .art-ep-btn { height: 34px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
}
.art-ep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.art-ep-title {
    font-size: 15px;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.art-ep-total {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-weight: normal;
    margin-left: 4px;
}
.art-ep-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    transition: all .2s;
}
.art-ep-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.art-ep-grid {
    display: grid;
    gap: 8px;
    padding: 14px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.art-ep-grid::-webkit-scrollbar { width: 4px; }
.art-ep-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
/* 短标题≤4字: PC4个, 手机3个 */
.ep-grid-xs { grid-template-columns: repeat(4, 1fr); }
/* 中标题≤8字: PC4个, 手机3个 */
.ep-grid-sm { grid-template-columns: repeat(4, 1fr); }
/* 长标题>8字: PC2个, 手机1个, 靠左对齐 */
.ep-grid-lg { grid-template-columns: repeat(2, 1fr); }
.ep-grid-lg .art-ep-btn { text-align: left; }

@media (max-width: 640px), (max-height: 500px) {
    .ep-grid-xs { grid-template-columns: repeat(3, 1fr); }
    .ep-grid-sm { grid-template-columns: 1fr; }
    .ep-grid-sm .art-ep-btn { text-align: left; }
    .ep-grid-lg { grid-template-columns: 1fr; }
}

.art-ep-btn {
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    transition: all .25s ease;
}
.art-ep-btn:hover {
    border-color: rgba(249,115,22,0.5);
    color: var(--primary, #f97316);
    background: rgba(249,115,22,0.08);
    transform: translateY(-1px);
}
.art-ep-btn.active {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(249,115,22,0.35);
}

/* 播放器内解析加载遮罩 */
.art-parse-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: #000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.art-parse-overlay ~ .art-loading-show,
.art-parse-overlay ~ .art-state,
.art-parse-overlay ~ .art-loading { display: none !important; }
.art-parse-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--primary, #f97316);
    border-radius: 50%;
    animation: art-spin 0.8s linear infinite;
}
@keyframes art-spin { to { transform: rotate(360deg); } }
.art-parse-text {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

/* ===== Footer ===== */
.play-footer {
    text-align: center;
    padding: 24px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 0px;
}
