/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fafafa;
    color: #222;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Layout ===== */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ===== Index Page ===== */
.playlist-list {
    list-style: none;
}

.playlist-list li {
    border-bottom: 1px solid #e5e5e5;
}

.playlist-list li a {
    display: block;
    padding: 1rem 0;
}

.playlist-list li a:hover .title {
    color: #555;
}

.playlist-list .title {
    display: block;
    font-weight: 500;
    transition: color 0.15s;
}

.playlist-list .desc {
    display: block;
    font-size: 0.875rem;
    color: #777;
    margin-top: 0.25rem;
}

.empty {
    color: #999;
    padding: 2rem 0;
    text-align: center;
}

/* ===== Playlist Page ===== */
.playlist-header {
    margin-bottom: 2rem;
}

.description {
    color: #666;
    font-size: 0.9rem;
}

/* ===== Player ===== */
.player {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 1rem;
    z-index: 10;
}

.player-cover {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.player-main {
    flex: 1;
    min-width: 0;
}

.now-playing {
    margin-bottom: 0.75rem;
}

.now-playing .track-title {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
}

.now-playing .track-artist {
    display: block;
    font-size: 0.8rem;
    color: #777;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    color: #333;
    transition: color 0.15s;
}

.btn:hover {
    color: #000;
}

.btn-play {
    font-size: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.time {
    font-size: 0.75rem;
    color: #999;
    min-width: 2.5rem;
    font-variant-numeric: tabular-nums;
}

.progress-bar, .volume-bar {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #e5e5e5;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #555;
    cursor: pointer;
    transition: background 0.15s;
}

.progress-bar::-webkit-slider-thumb:hover,
.volume-bar::-webkit-slider-thumb:hover {
    background: #222;
}

.progress-bar {
    flex: 1;
}

.volume {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
}

.volume-icon {
    font-size: 0.9rem;
    color: #777;
}

.volume-bar {
    width: 80px;
}

/* ===== Track List ===== */
.track-list {
    list-style: none;
    padding: 0;
}

.track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
}

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

.track-item.active {
    background: #f0f0f0;
}

.track-item.active .track-name {
    font-weight: 600;
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.track-name {
    font-size: 0.9rem;
}

.track-artist-name {
    font-size: 0.8rem;
    color: #888;
}

.track-duration {
    font-size: 0.8rem;
    color: #999;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .player {
        position: static;
    }

    .player-cover {
        width: 60px;
        height: 60px;
    }

    .track-item {
        padding: 0.6rem 0.25rem;
    }
}
