/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #0b0e14;
    color: #e0e6ee;
}

/* ===== 左侧边栏 ===== */
#sidebar {
    width: 280px;
    min-width: 200px;
    background: #141a22;
    border-right: 1px solid #2a323c;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #2a323c;
    background: #1a212b;
}
.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.btn-manage {
    background: #2a3a4a;
    border: none;
    color: #c8d0d8;
    font-size: 20px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-manage:hover {
    background: #3a4a5a;
}

.filter-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #0f161e;
    border-bottom: 1px solid #2a323c;
}
.filter-bar input {
    flex: 1;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #e0e6ee;
    font-size: 13px;
}
.filter-bar select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #e0e6ee;
    font-size: 13px;
}

.video-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.video-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.video-item:hover {
    background: #1f2935;
}
.video-item.active {
    background: #1e2a38;
    border-left-color: #4a9eff;
}
.video-item img {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    background: #2a323c;
}
.video-item .info {
    flex: 1;
    min-width: 0;
}
.video-item .name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-item .category {
    font-size: 11px;
    color: #8a9aa8;
    background: #1f2935;
    padding: 1px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 2px;
}

.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid #2a323c;
    font-size: 13px;
    color: #8a9aa8;
    text-align: center;
}
.load-more {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #1f2a3a;
    border: none;
    border-radius: 6px;
    color: #a0b0c0;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.load-more:hover {
    background: #2a3a4a;
}

/* ===== 右侧播放区域 ===== */
#playerArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0b0e14;
}
#playerWrapper {
    position: relative;
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
#videoPlayer {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    background: #000;
    display: none;
}
#videoPlayer:not([src=""]) {
    display: block;
}
#playerPlaceholder {
    text-align: center;
    color: #5a6a7a;
}
#playerPlaceholder span {
    font-size: 60px;
    display: block;
}
#playerPlaceholder p {
    margin-top: 12px;
    font-size: 16px;
}

.video-info {
    padding: 14px 24px;
    background: #141a22;
    border-top: 1px solid #2a323c;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
#videoTitle {
    font-size: 18px;
    font-weight: 500;
}
.tag {
    background: #1f2a3a;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #8ab4f8;
}

/* ===== 模态框 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-content {
    background: #1a212b;
    padding: 30px 28px;
    border-radius: 16px;
    max-width: 780px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid #2a323c;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 16px; right: 22px;
    font-size: 28px;
    color: #8a9aa8;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #fff;
}
.modal h2 {
    margin-bottom: 18px;
    font-size: 22px;
}
.modal h3 {
    font-size: 16px;
    margin: 18px 0 10px 0;
    color: #b0c0ce;
}

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #2a323c;
    margin-bottom: 16px;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: #8a9aa8;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab-btn.active {
    color: #e0e6ee;
    border-bottom-color: #4a9eff;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

.form-section form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.form-section form input, .form-section form select {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #e0e6ee;
    font-size: 14px;
}
.form-section form input:focus, .form-section form select:focus {
    outline: none;
    border-color: #4a9eff;
}
.form-section form button {
    grid-column: 1 / -1;
    padding: 10px;
    background: #2a6b9a;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.form-section form button:hover {
    background: #3a7bba;
}

.batch-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.batch-bar input, .batch-bar select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #e0e6ee;
    font-size: 13px;
    flex: 1 0 100px;
}
.batch-bar button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #2a3a4a;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.batch-bar button:hover {
    background: #3a4a5a;
}
.btn-danger {
    background: #8a3a3a !important;
}
.btn-danger:hover {
    background: #aa4a4a !important;
}

.admin-list-wrap {
    margin-top: 16px;
    border-top: 1px solid #2a323c;
    padding-top: 12px;
}
.admin-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #8a9aa8;
}
.admin-list-header input[type="checkbox"] {
    accent-color: #4a9eff;
    width: 16px;
    height: 16px;
    margin-right: 6px;
}
.admin-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #0b0e14;
    border-radius: 6px;
    font-size: 14px;
}
.admin-item input[type="checkbox"] {
    accent-color: #4a9eff;
    width: 16px;
    height: 16px;
}
.admin-item .admin-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-item .admin-url {
    color: #6a8a9a;
    font-size: 12px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-row {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
    flex-wrap: wrap;
}
.form-row input, .form-row select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #e0e6ee;
    font-size: 14px;
    flex: 1;
}
.form-row button {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: #2a6b9a;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.category-list {
    list-style: none;
    padding: 0;
}
.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #0b0e14;
    margin-bottom: 4px;
    border-radius: 4px;
}
.category-list li .cat-actions button {
    background: transparent;
    border: none;
    color: #8a9aa8;
    cursor: pointer;
    margin-left: 8px;
}
.category-list li .cat-actions button:hover {
    color: #e0e6ee;
}
.category-list li .cat-actions .delete-cat {
    color: #d06060;
}

.auth-box {
    max-width: 380px;
    text-align: center;
}
.auth-box input {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid #2a323c;
    background: #0b0e14;
    color: #fff;
    font-size: 16px;
}
.auth-box button {
    width: 100%;
    padding: 12px;
    background: #2a6b9a;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}
.auth-box .error-msg {
    color: #e06060;
    font-size: 14px;
    display: block;
    margin-top: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 680px) {
    body {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        min-width: unset;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #2a323c;
    }
    #playerArea {
        height: 60vh;
    }
    .form-section form {
        grid-template-columns: 1fr;
    }
    .batch-bar input {
        flex: 1 0 60px;
    }
    .modal-content {
        padding: 20px;
    }
    .video-info {
        padding: 10px 16px;
    }
    #videoTitle {
        font-size: 16px;
    }
}
