/* karaokeking 样式 - 移动端优先 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --bg: #0f0f23;
    --card-bg: #1a1a2e;
    --text: #ffffff;
    --text-muted: #9ca3af;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景渐变 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* 页面切换 */
.page {
    display: none;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.page.active {
    display: flex;
}

/* 首页 */
.intro {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.intro-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.intro p {
    color: var(--text-muted);
    font-size: 18px;
}

.intro .tip {
    font-size: 12px;
    color: #6366f1;
    margin-top: 30px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 280px;
    margin-top: 20px;
}

.btn-primary:active {
    transform: scale(0.98);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
    max-width: 280px;
}

/* 录音页面 */
.record-guide {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.mic-icon {
    font-size: 80px;
}

#record-status {
    color: var(--text-muted);
    font-size: 16px;
}

/* 波形动画 */
.waveform {
    display: flex;
    gap: 4px;
    height: 60px;
    align-items: center;
    justify-content: center;
}

.waveform span {
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.waveform span:nth-child(1) { animation-delay: 0s; }
.waveform span:nth-child(2) { animation-delay: 0.1s; }
.waveform span:nth-child(3) { animation-delay: 0.2s; }
.waveform span:nth-child(4) { animation-delay: 0.3s; }
.waveform span:nth-child(5) { animation-delay: 0.4s; }
.waveform span:nth-child(6) { animation-delay: 0.5s; }
.waveform span:nth-child(7) { animation-delay: 0.6s; }
.waveform span:nth-child(8) { animation-delay: 0.7s; }
.waveform span:nth-child(9) { animation-delay: 0.8s; }

.waveform.active span {
    animation: wave 0.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { height: 20px; }
    50% { height: 60px; }
}

.timer {
    font-size: 36px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.btn-record {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.btn-record:active {
    transform: scale(0.95);
}

/* 加载页面 */
.loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.loading-icon {
    font-size: 64px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

/* 结果页面 */
.result-card {
    background: linear-gradient(145deg, #1e1e3f, #16162a);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    width: 100%;
    max-width: 340px;
    margin: 20px 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.result-header {
    margin-bottom: 20px;
}

.crown {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.result-header h2 {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
}

.singer-info {
    margin: 30px 0;
}

.singer-emoji {
    font-size: 72px;
    margin-bottom: 10px;
}

#singer-name {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#singer-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

.similarity {
    margin: 30px 0;
}

.similarity-value {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary), #fcd34d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.similarity p {
    color: var(--text-muted);
    font-size: 14px;
}

.result-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-name {
    color: var(--text-muted);
    font-size: 12px;
}

.actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-bottom: 20px;
}
