/* style.css - 全局样式 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 登录页样式 */
.login-card {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    margin: 0 auto;
}

.app-title {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.app-description {
    color: #666;
    margin-bottom: 40px;
}

.login-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-hint {
    margin-top: 16px;
    color: #999;
    font-size: 14px;
}

/* 演示音乐区域 */
.demo-section {
    margin-top: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.demo-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
}

.demo-hint {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 20px;
}

.demo-playlist {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
}

.demo-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.demo-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.demo-icon {
    font-size: 32px;
    margin-right: 16px;
}

.demo-info {
    flex: 1;
}

.demo-title {
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
}

.demo-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 昵称设置页样式 */
.nickname-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    margin: 0 auto;
}

.card-header {
    margin-bottom: 30px;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active {
    background: #667eea;
}

.step-label {
    font-weight: 600;
    color: #667eea;
}

.card-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.card-description {
    color: #666;
    margin-bottom: 30px;
}

.nickname-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-hint {
    font-size: 12px;
    color: #999;
}

.error-message {
    color: #ff4757;
    font-size: 14px;
    min-height: 20px;
    display: none;
}

.error-message.show {
    display: block;
}

.submit-button {
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-footer {
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 用户页样式 */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: white;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.app-logo {
    font-size: 24px;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 24px;
}

.user-nickname {
    font-weight: 600;
}

.logout-button {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-button:hover {
    background: #e0e0e0;
}

.main-content {
    display: flex;
    flex: 1;
    padding: 40px;
    gap: 40px;
}

/* 播放列表区域 */
.playlist-section {
    flex: 0 0 400px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    margin: 0;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.icon-button:hover {
    color: #667eea;
}

.playlist-container {
    flex: 1;
    overflow-y: auto;
}

.playlist-items {
    display: flex;
    flex-direction: column;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.playlist-item.active {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
}

.item-number {
    width: 30px;
    color: #999;
    font-size: 14px;
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 12px;
    color: #999;
}

.item-duration {
    color: #666;
    font-size: 14px;
}

/* 播放器区域 */
.player-section {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container {
    width: 100%;
    max-width: 600px;
}

.now-playing {
    text-align: center;
    margin-bottom: 40px;
}

.album-art {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.album-placeholder {
    font-size: 64px;
}

.track-info h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.track-info p {
    color: #666;
}

/* 播放控制 */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    transition: transform 0.2s, color 0.2s;
}

.control-button:hover {
    transform: scale(1.1);
    color: #667eea;
}

.play-button {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.play-button:hover {
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* 进度条 */
.progress-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.time {
    min-width: 45px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.progress-bar {
    flex: 1;
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    pointer-events: none;
}

.progress-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 音量控制 */
.volume-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.volume-button:hover {
    color: #667eea;
}

.volume-bar {
    flex: 1;
}

.volume-bar input[type="range"] {
    width: 100%;
    cursor: pointer;
}

/* 加载和错误状态 */
.playlist-loading,
.playlist-error,
.empty-playlist {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon,
.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.retry-button {
    margin-top: 20px;
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.retry-button:hover {
    background: #5568d3;
}

.empty-hint {
    font-size: 14px;
    margin-top: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 20px;
    }

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

    .app-header {
        padding: 12px 20px;
    }

    .app-logo {
        font-size: 20px;
    }
}
