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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

#playlist-info {
    color: #666;
    font-size: 0.9rem;
}

.main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.player-section {
    position: sticky;
    top: 16px;
    height: fit-content;
}

.player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.player-wrapper iframe,
.player-wrapper #player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    max-width: 100%;
}

.now-playing {
    margin-top: 16px;
}

.now-playing h2 {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
}

.now-playing p {
    color: #666;
    font-size: 0.95rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.control-btn {
    padding: 10px 20px;
    background: #e0e0e0;
    border: none;
    border-radius: 20px;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.control-btn:hover:not(:disabled) {
    background: #d0d0d0;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.autoplay-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
}

.autoplay-toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.playlist-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.banner {
    width: 100%;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f0f0f0;
}

.playlist-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

#video-count {
    color: #666;
    font-size: 0.85rem;
}

.playlist {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.playlist-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
}

.playlist-item:hover {
    background: #f5f5f5;
}

.playlist-item.active {
    background: #e8e8e8;
}

.playlist-item .index {
    color: #999;
    font-size: 0.85rem;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-item.active .index {
    color: #333;
}

.playlist-item .thumbnail {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.playlist-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playlist-item .title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.playlist-item .meta {
    font-size: 0.8rem;
    color: #666;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }

    .player-section {
        position: static;
    }

    .playlist-section {
        max-height: 400px;
    }

    .playlist-item .thumbnail {
        width: 100px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .now-playing h2 {
        font-size: 1rem;
    }

    .controls {
        flex-wrap: wrap;
    }

    .autoplay-toggle {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .playlist-item .thumbnail {
        width: 80px;
        height: 45px;
    }

    .playlist-item .title {
        font-size: 0.85rem;
    }
}

.footer {
    text-align: center;
    padding: 24px 16px;
    color: #888;
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
    margin-top: 24px;
}

.footer p {
    margin: 4px 0;
}
