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

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-hover: #252545;
    --bg-active: #6da3d6;
    --bg-backhome: #07743f;
    --accent: #459ae9;
    --accent-hover: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a4a;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    height: 60px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-sidebar) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--bg-active);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    /* background-color: var(--bg-backhome); */
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-home:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(233, 69, 96, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ===== Main ===== */
.main-container {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ===== Player Area ===== */
.player-area {
    flex: 1;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-wrapper video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

.video-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.video-placeholder-icon {
    font-size: 64px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.video-placeholder-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.video-placeholder-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 420px;
}

.video-placeholder-subtext {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.development-tip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
}

.development-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(233, 69, 96, 0.16);
    color: #ff8f9c;
    font-size: 12px;
    font-weight: 600;
}

.development-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.development-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 340px;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ---- Playlist Tabs ---- */
.playlist-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pl-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pl-tab:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.pl-tab.active {
    border-color: var(--accent);
    background-color: rgba(233, 69, 96, 0.12);
    color: var(--accent);
}

.pl-tab-icon {
    font-size: 14px;
}

.pl-tab-title {
    font-weight: 500;
}

/* ---- Playlist Info ---- */
.playlist-info {
    padding: 0 4px;
}

.playlist-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.playlist-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Video List ---- */
.video-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.video-list::-webkit-scrollbar {
    width: 6px;
}

.video-list::-webkit-scrollbar-track {
    background: transparent;
}

.video-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.empty-tip {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.video-item {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.video-item:hover {
    background-color: var(--bg-hover);
    transform: translateX(-4px);
}

.video-item.active {
    border-color: var(--accent);
    background-color: rgba(233, 69, 96, 0.1);
}

.video-thumb {
    width: 100px;
    height: 64px;
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumb-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    font-family: "DIN Alternate", "Roboto", monospace;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(233, 69, 96, 0.12);
    color: var(--accent);
}

.video-duration {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: "DIN Alternate", "Roboto", monospace;
}

/* ===== Control Bar ===== */
.control-bar {
    height: 90px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-sidebar) 100%);
    border-top: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-display {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: "DIN Alternate", "Roboto", monospace;
    min-width: 90px;
}

.time-display.current {
    text-align: right;
}

.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-wrapper:hover .progress-bar::after {
    opacity: 1;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.control-btn:hover {
    background-color: var(--bg-hover);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.play-btn {
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: 50%;
}

.play-btn:hover {
    background: var(--accent-hover);
}

.play-btn svg {
    width: 26px;
    height: 26px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }

    .video-thumb {
        width: 80px;
        height: 52px;
    }

    .header {
        padding: 0 16px;
    }

    .control-bar {
        padding: 0 16px;
        height: 80px;
    }

    .time-display {
        min-width: 70px;
        font-size: 12px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .play-btn {
        width: 50px;
        height: 50px;
    }

    .pl-tab {
        font-size: 11px;
        padding: 6px 4px;
    }

    .pl-tab-title {
        display: none;
    }
}

@media (max-width: 600px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 220px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .video-list {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px;
    }

    .video-item {
        min-width: 240px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
}

/* ===== Animation ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading .progress-bar {
    animation: pulse 1.5s infinite;
}
