/* ============================================
   MusicSite - 主样式表
   ============================================ */

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd1;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-surface: #16162a;
    --text: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #55556a;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --border: #2a2a44;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: var(--bg);
    overflow: hidden;
}

/* ===== 顶部导航 ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.top-bar-left {
    width: 40px;
    display: flex;
    align-items: center;
}

.top-bar-left .icon {
    color: var(--text-secondary);
    cursor: pointer;
}

.top-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3px;
}

.tab {
    padding: 6px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background: var(--primary);
    color: #fff;
}

.top-bar-right {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
}

.top-bar-right .icon {
    color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
}

.top-bar-right:hover .icon {
    color: var(--primary-light);
}

/* ===== 页面容器 ===== */
.page {
    display: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ===== 搜索栏 ===== */
.search-bar {
    position: relative;
    padding: 12px 16px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== 分类滚动 ===== */
.category-scroll {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-tag {
    flex-shrink: 0;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.category-tag:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ===== 区块 ===== */
.section {
    padding: 16px 0 0;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    padding: 0 16px;
    margin-bottom: 12px;
    color: var(--text);
}

/* ===== 歌曲列表 ===== */
.song-list {
    padding: 0 16px;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    gap: 12px;
}

.song-item:hover {
    background: var(--bg-card-hover);
}

.song-item:active {
    transform: scale(0.98);
}

.song-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.song-duration {
    font-size: 12px;
    color: var(--text-muted);
}

.song-fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.song-fav-btn.active {
    color: var(--accent);
}

.song-fav-btn:hover {
    color: var(--accent);
}

/* ===== 我的页 ===== */
.mine-header {
    padding: 32px 16px 24px;
    text-align: center;
}

.mine-login-prompt {
    cursor: pointer;
}

.avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-large .icon {
    color: var(--text-muted);
}

.login-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.mine-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.mine-profile .avatar-large {
    margin: 0;
    width: 64px;
    height: 64px;
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 600;
}

.profile-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mine-menu {
    padding: 0 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    gap: 12px;
}

.menu-item:hover {
    opacity: 0.8;
}

.menu-item .icon {
    color: var(--text-secondary);
}

.menu-item span {
    flex: 1;
    font-size: 15px;
}

.menu-item .arrow {
    color: var(--text-muted);
}

/* ===== 子页面 ===== */
.sub-page {
    display: none;
    padding: 16px;
}

.sub-page.active {
    display: flex;
    flex-direction: column;
}

.sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sub-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

/* ===== 迷你播放器 ===== */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 200;
}

.mini-progress {
    height: 2px;
    background: var(--border);
}

.mini-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s linear;
}

.mini-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
}

.mini-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.mini-info {
    flex: 1;
    min-width: 0;
}

.mini-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.mini-btn:hover {
    background: var(--bg-card);
}

/* ===== 全屏播放器 ===== */
.full-player {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--bg);
    z-index: 300;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.full-player.active {
    transform: translateX(-50%) translateY(0);
}

.full-player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg) 100%);
    z-index: 0;
}

.full-player-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
}

.full-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.full-back {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.full-info {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.full-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.full-artist {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 封面区域 */
.cover-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.vinyl-container {
    width: 260px;
    height: 260px;
}

.vinyl-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, #333 0%, #111 30%, #222 31%, #111 60%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    animation: vinyl-spin 8s linear infinite;
    animation-play-state: paused;
}

.vinyl-disc.playing {
    animation-play-state: running;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vinyl-cover {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card);
}

.vinyl-center {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
}

/* 歌词区域 */
.lyrics-area {
    height: 120px;
    overflow: hidden;
    flex-shrink: 0;
}

.lyrics-scroll {
    text-align: center;
    padding: 8px 0;
}

.lyric-line {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}

.lyric-line.active {
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
}

.lyric-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px 0;
}

/* 进度条 */
.progress-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    flex-shrink: 0;
}

.time-current, .time-total {
    font-size: 11px;
    color: var(--text-muted);
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.progress-bar {
    flex: 1;
    cursor: pointer;
    padding: 8px 0;
}

.progress-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

/* 控制按钮 */
.full-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 0 24px;
    flex-shrink: 0;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.08);
}

.ctrl-btn.play-btn {
    width: 56px;
    height: 56px;
    background: var(--primary);
}

.ctrl-btn.play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== 登录弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 360px;
    padding: 24px;
    position: relative;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 3px;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab.active {
    background: var(--primary);
    color: #fff;
}

.form-group {
    margin-bottom: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 50, 0.95);
    color: var(--text);
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 500;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 工具类 ===== */
.hidden { display: none !important; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}


/* ===== 登录页 ===== */
.login-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, sans-serif;
    z-index: 1;
    padding: 20px;
}
.login-logo { margin-bottom: 12px; }
.login-title { color: #e8e8f0; font-size: 24px; font-weight: 700; margin: 0; }
.login-subtitle { color: #8888a8; font-size: 14px; margin: 0 0 8px; }
.auth-form { width: 100%; max-width: 320px; }
