:root {
    --bg: #ffffff;
    --surface: #f7f7f7;
    --text: #111111;
    --text-muted: #666666;
    --brand: #4f46e5;
    --brand-hover: #4338ca;
    --border: #e5e5e5;
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --text: #f5f5f5;
    --text-muted: #a3a3a3;
    --brand: #6366f1;
    --brand-hover: #818cf8;
    --border: #2a2a2a;
}

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

/* 滚动条跟随主题 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
    padding-bottom: 60px;
    overflow-x: hidden;
}

.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: -0.5px;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: border-color 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--brand);
}

.header-announcement {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 0 20px;
}

.announce-marquee {
    max-width: 720px;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 22px;
    line-height: 22px;
}

.announce-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.announce-track.scrolling {
    animation: announce-scroll var(--announce-duration, 18s) linear infinite;
}

.announce-marquee:hover .announce-track.scrolling {
    animation-play-state: paused;
}

@keyframes announce-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.announce-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 28px;
}

.announce-tag {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    border-radius: 4px;
    background: var(--brand);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.announce-bell {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.announce-bell svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.announce-bell:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.bell-dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: none;
}

.announce-panel {
    position: fixed;
    top: 66px;
    right: 24px;
    transform: translateY(-8px);
    width: 380px;
    max-width: calc(100% - 32px);
    max-height: 70vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    display: flex;
    flex-direction: column;
}

.announce-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.announce-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.announce-panel-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.announce-panel-close:hover {
    color: var(--text);
}

.announce-panel-body {
    overflow-y: auto;
    padding: 8px;
}

.announce-entry {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--bg);
    margin-bottom: 8px;
}

.announce-entry:last-child {
    margin-bottom: 0;
}

.announce-entry .announce-entry-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.announce-entry .announce-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    word-break: break-word;
}

.announce-entry .announce-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.announce-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
    font-size: 13px;
}

.layout {
    flex: 1;
    display: flex;
    width: 100%;
    padding-left: 180px;
}

.sidebar {
    width: 180px;
    padding: 24px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 58px;
    left: 0;
    height: calc(100vh - 58px);
    overflow-y: auto;
}

.nav-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background: var(--bg);
    color: var(--text);
}

.content {
    flex: 1;
    padding: 40px 24px 24px;
    min-width: 0;
}

.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -1px;
}

.slogan {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    gap: 8px;
    justify-content: center;
    max-width: 420px;
    margin: 0 auto;
    position: relative;
}

.search-box.stuck {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 48px);
    max-width: 420px;
    margin: 0;
    background: var(--surface);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--brand);
}

.search-box button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.search-box button:hover {
    background: var(--brand-hover);
}

.search-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.search-suggest.active {
    display: block;
}

.search-suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s;
}

.search-suggest-item:hover,
.search-suggest-item.active {
    background: var(--bg);
    color: var(--brand);
}

.section {
    display: none;
    margin-bottom: 36px;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    font-weight: 600;
}

.about-content {
    line-height: 1.8;
    color: var(--text);
    font-size: 14px;
    max-width: 760px;
}

.about-content p {
    margin-bottom: 12px;
}

.about-content a {
    color: var(--brand);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

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

.media-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.media-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--surface);
}

.media-info {
    padding: 12px;
}

.media-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.media-sub {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.card-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 14px;
}

.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg);
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
}

.site-footer p {
    margin: 0;
}

.footer-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.footer-copyright {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.footer-register-mode {
    position: absolute;
    right: 0;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.mini-player {
    position: fixed;
    right: 24px;
    bottom: 84px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 30;
}

.mini-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.player-cover:hover {
    transform: scale(1.05);
}

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

.player-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.player-lyric {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-top: 2px;
    min-height: 16px;
}

.mini-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-label {
    font-size: 10px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 30px;
    text-align: center;
}

.progress-track {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--brand);
    border-radius: 2px;
    position: relative;
}

.progress-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: var(--brand);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.progress-track:hover .progress-thumb,
.progress-track.dragging .progress-thumb {
    transform: translateY(-50%) scale(1);
}

.mini-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ctrl-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ctrl-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.ctrl-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.play-btn {
    width: 38px;
    height: 38px;
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.play-btn svg {
    width: 18px;
    height: 18px;
}

.play-btn:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: #fff;
}

.list-btn {
    position: relative;
    margin-left: 2px;
}

.playlist-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.volume-icon {
    padding: 0;
}

.volume-popup {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: bottom center;
    width: 40px;
    height: 110px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 40;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.volume-wrap:hover .volume-popup,
.volume-popup:hover {
    transform: translateX(-50%) scaleY(1);
    pointer-events: auto;
}

.volume-vertical {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 4px;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
}

.volume-vertical::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    border: none;
}

#player-audio {
    display: none;
}

.player-panel {
    position: fixed;
    right: 24px;
    bottom: 230px;
    width: 300px;
    max-height: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 35;
    display: flex;
    flex-direction: column;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.player-panel.open {
    min-height: 300px;
    max-height: 520px;
    opacity: 1;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

.panel-cover {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.panel-meta {
    flex: 1;
    min-width: 0;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-artist {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text);
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.panel-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: color 0.2s ease, background 0.2s ease;
}

.panel-tab.active {
    color: var(--brand);
    background: var(--bg);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 360px;
    padding: 12px;
}

.panel-playlist-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.panel-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.panel-clear-btn:hover {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

.playlist-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: var(--bg);
}

.playlist-item span:last-child {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}

.playlist-item-remove {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 77, 77, 0.9);
    color: #fff;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 2;
}

.playlist-item:hover .playlist-item-remove {
    opacity: 1;
    visibility: visible;
}

.panel-lyrics {
    text-align: center;
    line-height: 2;
    font-size: 14px;
}

.lyric-line {
    padding: 4px 0;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.lyric-line.active {
    color: var(--brand);
    font-weight: 600;
}

.panel-playlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-playlist .lyric-line,
.playlist-empty,
.lyric-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 14px;
    cursor: default;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.playlist-item:hover,
.playlist-item.active {
    background: var(--brand);
    color: #fff;
}

.playlist-item span:last-child {
    color: var(--text-muted);
    font-size: 11px;
}

.playlist-item.active span:last-child,
.playlist-item:hover span:last-child {
    color: rgba(255, 255, 255, 0.8);
}

.login-btn {
    margin-top: 12px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.login-btn:hover {
    background: var(--brand-hover);
}

.back-btn {
    margin-top: 12px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.back-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.search-keyword {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

.me-profile {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.me-user {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.me-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.me-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.me-tab.active,
.me-tab:hover {
    background: var(--surface);
    color: var(--text);
}

.me-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    min-height: 120px;
}

.me-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
}

.fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s, color 0.15s;
}

.fav-btn:hover {
    transform: scale(1.1);
    color: var(--brand);
}

.fav-btn.favorited {
    color: #ff4d4d;
}

.add-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s, color 0.15s;
}

.add-btn:hover {
    transform: scale(1.1);
    color: var(--brand);
}

.picker-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

.picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.picker-content {
    position: relative;
    width: 320px;
    max-width: calc(100% - 32px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.picker-content h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.picker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 60px;
}

.picker-list li {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s;
    font-size: 14px;
}

.picker-list li:last-child {
    border-bottom: none;
}

.picker-list li:hover {
    background: var(--bg);
    color: var(--brand);
}

.picker-empty,
.picker-loading {
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.playlist-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 102;
}

.playlist-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.playlist-content {
    position: relative;
    width: 420px;
    max-width: calc(100% - 32px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.playlist-content h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.playlist-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.playlist-close:hover {
    color: var(--text);
}

.cover-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.cover-preset {
    aspect-ratio: 1;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: border-color 0.2s, transform 0.2s;
}

.cover-preset:hover,
.cover-preset.selected {
    border-color: var(--brand);
    transform: scale(1.05);
}

.playlist-detail-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.playlist-songs {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 60px;
}

.playlist-songs li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.playlist-songs li:last-child {
    border-bottom: none;
}

.playlist-song-info {
    flex: 1;
    overflow: hidden;
}

.playlist-song-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-song-artist {
    font-size: 12px;
    color: var(--text-muted);
}

.playlist-song-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

.playlist-song-remove:hover {
    color: #ff4d4d;
}

.view-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s, color 0.15s;
}

.view-btn:hover {
    transform: scale(1.1);
    color: var(--brand);
}

.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, color 0.2s;
}

.user-menu:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.user-menu-icon {
    width: 18px;
    height: 18px;
    color: var(--text);
}

.user-menu-icon svg {
    width: 100%;
    height: 100%;
}

.user-menu-nickname {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.user-menu:hover .user-menu-nickname {
    color: var(--brand);
}

.user-menu-nickname:empty {
    display: none;
}

.user-menu-name {
    display: none;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-name:not(:empty) {
    display: block;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 110px;
    padding: 6px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 50;
}

.user-menu:hover .user-menu-dropdown,
.user-menu-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-link {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.user-menu-link:hover {
    background: var(--bg);
    color: var(--brand);
}

.confirm-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 103;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.confirm-content {
    position: relative;
    width: 320px;
    max-width: calc(100% - 32px);
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
    text-align: center;
}

.confirm-content p {
    margin-bottom: 20px;
    font-size: 15px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 200;
    max-width: 80%;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#me-login-form .form-input {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
    position: relative;
    width: 360px;
    max-width: calc(100% - 32px);
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.auth-modal-close:hover {
    color: var(--text);
}

.auth-modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.auth-modal-content .form-input,
.playlist-content .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.auth-modal-content .login-btn {
    width: 100%;
    margin-top: 4px;
}

.auth-captcha-row {
    display: none;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.auth-captcha-row.visible {
    display: flex;
}

.auth-captcha-row .form-input {
    flex: 1;
    margin-bottom: 0;
}

.auth-captcha {
    flex-shrink: 0;
    width: 100px;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    object-fit: contain;
}

.search-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.search-tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.search-tab.active,
.search-tab:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    z-index: 1;
}

.video-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.video-modal video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 28px;
    }

    .header-announcement {
        display: none;
    }

    .announce-panel {
        top: 64px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .layout {
        flex-direction: column;
        padding-left: 0;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 57px;
        left: auto;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
    }

    .nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }

    .content {
        padding: 24px 16px 80px;
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-player {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
        max-width: 300px;
    }

    .player-panel {
        right: 12px;
        bottom: 230px;
        width: calc(100% - 24px);
        max-width: 300px;
    }

    #player-audio {
        width: 120px;
    }
}
