:root {
    --bg: #0b0f17;
    --surface: #121a26;
    --surface-soft: #1b2534;
    --text: #eaf1fb;
    --muted: #9caec7;
    --line: #26374d;
    --primary: #6bc3ff;
    --danger: #f56b8a;
    --ok: #31d4ac;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at -10% -20%, rgba(72, 132, 255, 0.28), transparent 42%),
        radial-gradient(circle at 110% -10%, rgba(63, 208, 255, 0.18), transparent 38%),
        linear-gradient(180deg, #0b1220 0%, var(--bg) 56%);
    min-height: 100vh;
}

.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 26px 20px 34px;
}

.topbar {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 12, 20, 0.88);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
}

.brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(92, 164, 255, 0.35));
}

.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(121, 144, 174, 0.25);
    border-radius: 999px;
    background: rgba(14, 22, 35, 0.75);
}

.topnav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
}

.topnav a.active {
    color: #0a1724;
    background: linear-gradient(120deg, #6bc3ff, #9ad7ff);
    font-weight: 700;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 20px;
}

.card {
    background: linear-gradient(180deg, rgba(20, 30, 44, 0.93), rgba(15, 22, 34, 0.94));
    border: 1px solid rgba(113, 139, 171, 0.26);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.muted {
    color: var(--muted);
}

.ok, .alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.ok {
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(45, 212, 191, 0.45);
}

.alert {
    background: rgba(239, 71, 111, 0.12);
    border: 1px solid rgba(239, 71, 111, 0.45);
}

.form {
    display: grid;
    gap: 10px;
}

label {
    color: var(--muted);
    font-size: 13px;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0e1520;
    color: var(--text);
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--text);
    background: #253548;
}

.btn-primary {
    background: linear-gradient(120deg, #6bc3ff, #87d4ff);
    color: #07131e;
}

.btn-ghost {
    border-color: rgba(121, 144, 174, 0.3);
    background: rgba(19, 28, 40, 0.72);
}

.btn-danger {
    border-color: rgba(239, 71, 111, 0.5);
    background: rgba(239, 71, 111, 0.18);
}

.video-list {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.video-item {
    padding: 14px;
    border: 1px solid rgba(121, 144, 174, 0.25);
    border-radius: 12px;
    background: rgba(11, 17, 27, 0.66);
    transition: transform .14s ease, border-color .14s ease;
}

.thumb-link {
    display: block;
    margin-bottom: 10px;
    text-decoration: none;
}

.thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(121, 144, 174, 0.28);
    background: #070b12;
}

.thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px dashed rgba(121, 144, 174, 0.4);
    color: #bed0e8;
    background:
        radial-gradient(circle at 80% 20%, rgba(91, 155, 255, 0.2), transparent 48%),
        linear-gradient(140deg, #121a29, #0c1320);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.video-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.video-head h3 {
    margin: 0;
    font-size: 16px;
}

.chip {
    border: 1px solid rgba(121, 144, 174, 0.4);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--muted);
    font-size: 12px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.login-page {
    display: grid;
    place-items: center;
}

.login-wrap {
    width: min(460px, 94vw);
    padding: 28px 0;
}

.login-card {
    background: linear-gradient(180deg, rgba(27, 37, 50, 0.95), rgba(20, 27, 36, 0.95));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
}

.password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.embed-page {
    margin: 0;
    background: #000;
}

.embed-wrap {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.html5-embed-wrap {
    background: radial-gradient(circle at top, #0f1622 0%, #020307 62%);
}

.embed-head {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(4, 8, 12, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.embed-title {
    color: #dce6f5;
    font-size: 12px;
    font-weight: 600;
}

.video {
    width: 100%;
    height: auto;
    max-height: 78vh;
    display: block;
    background: #000;
}

.embed-wrap .video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.embed-watermark,
.player-watermark {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    line-height: 0;
}

.embed-watermark img,
.player-watermark img {
    width: 96px;
    height: 24px;
    opacity: 0.94;
}

.toast {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(5, 10, 16, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.upload-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #0b1119;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4cc9f0, #2dd4bf);
    transition: width .15s linear;
}

.upload-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.footer {
    border-top: 1px solid rgba(121, 144, 174, 0.24);
    padding: 20px;
    color: var(--muted);
    background: rgba(8, 12, 19, 0.92);
}

.footer-inner {
    max-width: 1260px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.footer-inner strong {
    display: block;
    color: #e9f2ff;
    margin-bottom: 6px;
    font-size: 13px;
}

.footer-inner p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.admin-grid {
    grid-template-columns: 1fr 1.2fr;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.folder-item {
    display: block;
    text-decoration: none;
    color: var(--text);
    border: 1px solid rgba(121, 144, 174, 0.25);
    border-radius: 12px;
    background: rgba(13, 18, 27, 0.62);
    padding: 10px;
    transition: transform .14s ease, border-color .14s ease;
}

.folder-item h3 {
    margin: 8px 0 4px;
    font-size: 15px;
}

.folder-item:hover,
.video-item:hover {
    border-color: rgba(152, 188, 230, 0.45);
    transform: translateY(-1px);
}

.yt-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
}

.yt-main {
    min-width: 0;
}

.yt-player-shell {
    position: relative;
    border: 1px solid #223041;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45);
}

.yt-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: none;
}

.yt-player-shell.window-mode {
    width: min(960px, 96vw);
    margin: 0 auto;
}

.yt-title {
    margin: 12px 0 6px;
    font-size: 20px;
}

.yt-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.yt-channel {
    color: #dce8ff;
    font-weight: 600;
}

.yt-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #5b6d87;
}

.yt-side {
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.playlist-list {
    display: grid;
    gap: 10px;
}

.playlist-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid rgba(121, 144, 174, 0.25);
    border-radius: 10px;
    padding: 8px;
    background: rgba(13, 18, 27, 0.62);
}

.playlist-item.active {
    border-color: #6bc3ff;
    background: rgba(107, 195, 255, 0.16);
}

.playlist-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    background: #090d14;
}

.playlist-thumb.placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
}

.playlist-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .panel-grid,
    .yt-layout {
        grid-template-columns: 1fr;
    }

    .upload-stats {
        grid-template-columns: 1fr;
    }

    .yt-side {
        max-height: none;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .topnav {
        width: 100%;
        overflow-x: auto;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .player-watermark,
    .embed-watermark {
        top: 8px;
        right: 8px;
    }

    .player-watermark img,
    .embed-watermark img {
        width: 88px;
        height: 22px;
    }
}
