@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --bg-card: #1c2128;
    --bg-elevated: #22272e;
    --border: #2d333b;
    --border-soft: #21262d;
    --text: #e6edf3;
    --text-muted: #768390;
    --text-faint: #636c76;
    --primary: #5cadff;
    --primary-soft: rgba(92, 173, 255, 0.14);
    --primary-hover: #79c2ff;
    --accent: #a371f7;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.4), 0 0 40px rgba(92,173,255,0.06);
}

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

html, body {
    height: 100%;
}

body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(92,173,255,0.07), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(163,113,247,0.05), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent), var(--bg-soft);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.2px;
}

.logo-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(92,173,255,0.35);
}

.logo-text {
    background: linear-gradient(135deg, #e6edf3, #a9b6c4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box::before {
    content: "";
    position: absolute;
    left: 14px;
    width: 14px;
    height: 14px;
    border: 1.6px solid var(--text-faint);
    border-radius: 50%;
    pointer-events: none;
    transition: border-color .2s;
}
.search-box::after {
    content: "";
    position: absolute;
    left: 25px;
    top: 21px;
    width: 7px;
    height: 1.6px;
    background: var(--text-faint);
    transform: rotate(45deg);
    border-radius: 2px;
    pointer-events: none;
    transition: background .2s;
}
.search-box input {
    width: 280px;
    padding: 9px 16px 9px 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--bg-card);
}
.search-box input:focus ~ ::before,
.search-box input:focus ~ ::after { color: var(--primary); }

/* Layout */
.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    padding: 24px 32px;
    max-width: 1640px;
    width: 100%;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent), var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 18px;
    min-height: 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.playlist {
    list-style: none;
    flex: 1;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding-right: 4px;
    margin-right: -4px;
}

.playlist-item {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .12s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    position: relative;
}
.playlist-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
}
.playlist-item.active {
    background: linear-gradient(135deg, var(--primary-soft), rgba(163,113,247,0.12));
    border-color: rgba(92,173,255,0.4);
    box-shadow: 0 0 0 1px rgba(92,173,255,0.18), 0 4px 16px rgba(92,173,255,0.12);
}
.playlist-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.playlist-item .idx {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    background: var(--bg-card);
    flex-shrink: 0;
    transition: all .18s;
    font-variant-numeric: tabular-nums;
}
.playlist-item:hover .idx { color: var(--text-muted); }
.playlist-item.active .idx {
    color: var(--primary);
    background: rgba(92,173,255,0.15);
}

.playlist-item .title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.playlist-item.active .title { color: #fff; }

.empty-hint {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
    padding: 28px 10px;
    display: block;
    text-align: center;
}
.empty-hint code {
    background: var(--bg-card);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--border-soft);
}

/* Player area */
.player-area {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.player-wrapper {
    position: relative;
    width: 100%;
    height: min(70vh, 720px);
    min-height: 320px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.player-wrapper .video-js {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.player-wrapper .vjs-tech,
.player-wrapper video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000;
}

.player-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 2px;
}

.now-title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.now-title::before {
    content: "";
    width: 4px;
    height: 22px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    flex-shrink: 0;
}

.now-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: border-color .18s, transform .1s, box-shadow .18s, background .18s;
}
.btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.btn:active { transform: translateY(1px); }

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-faint);
    font-size: 13px;
    border-top: 1px solid var(--border-soft);
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 860px) {
    .header { padding: 14px 18px; }
    .layout {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    .playlist {
        max-height: 280px;
    }
    .search-box input {
        width: 180px;
    }
    .now-title { font-size: 18px; }
}