/* ============================================================
 * 歌词同步播放器 - 通用样式
 * ============================================================ */

/* 主题变量 - 默认紫色主题 */
:root {
    --cover-image: url('');
    --primary-color: #d8b4fe;
    --neon-color: #a855f7;
    --secondary-color: #f472b6;
    --accent-color: #fbbf24;
    --bg-dark: #0f0518;
    --glass-bg: rgba(46, 16, 101, 0.4);
    --glass-border: rgba(167, 139, 250, 0.25);
    --active-bg: rgba(126, 34, 206, 0.5);
    --active-border: rgba(216, 180, 254, 0.8);
    --text-main: #ffffff;
    --text-sub: rgba(255, 255, 255, 0.75);
}

/* 基础重置 */
* { box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; align-items: center;
    height: 100vh; overflow: hidden;
    position: relative;
}

/* 背景层 */
.background-layer {
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    background-image: var(--cover-image);
    background-size: cover; background-position: center;
    filter: blur(25px) brightness(0.8);
    z-index: -2;
}

.overlay-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.7) 100%);
    z-index: -1;
}

/* 滚动容器 */
.scroll-container {
    width: 100%; max-width: 700px; height: 100%;
    overflow-y: auto;
    padding: 60px 20px 220px 20px;
    scroll-behavior: smooth;
    position: relative; z-index: 1;
}

.scroll-container::-webkit-scrollbar { width: 4px; }
.scroll-container::-webkit-scrollbar-track { background: transparent; }
.scroll-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* 头部 */
header {
    text-align: center; margin-bottom: 60px;
    display: flex; flex-direction: column; align-items: center;
}

.album-art {
    width: 180px; height: 180px;
    border-radius: 20px;
    background-image: var(--cover-image);
    background-size: cover; background-position: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255,255,255,0.2);
    margin-bottom: 25px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.album-art:hover { transform: scale(1.05) rotate(2deg); }

h1 {
    font-size: 3.5rem; margin: 0; font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.credits {
    margin-top: 15px; color: var(--primary-color);
    font-size: 0.95rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    background: rgba(0,0,0,0.4);
    padding: 8px 20px; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* 段落分隔 */
.section {
    display: flex; align-items: center; justify-content: center;
    margin: 50px 0 25px 0; color: var(--secondary-color);
    font-weight: 700; font-size: 0.8rem; letter-spacing: 0.2em;
    text-transform: uppercase;
}
.section::before, .section::after {
    content: ''; height: 1px; width: 30px;
    background: var(--secondary-color);
    margin: 0 15px; opacity: 0.5;
}

/* 歌词卡片 */
.lyric {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px; margin-bottom: 18px;
    transition: all 0.4s ease;
    position: relative; overflow: hidden;
    opacity: 0.5;
    transform: scale(0.97);
    cursor: pointer;
}

.lyric.active {
    opacity: 1;
    transform: scale(1.02);
    background: var(--active-bg);
    border-color: var(--active-border);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.lyric::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 0; background: var(--primary-color);
    transition: width 0.3s ease;
}
.lyric.active::before { width: 5px; }

.lyric:hover { opacity: 0.8; }

/* 歌词文字 */
.jp {
    font-size: 1.6rem; font-weight: 700;
    color: #fff; line-height: 1.6;
}
ruby { font-size: inherit; }
rt {
    font-size: 0.5em; color: var(--primary-color);
    font-weight: 500;
}
.lyric.active rt { color: #fff; }

.romaji {
    font-size: 0.85rem; color: var(--text-sub);
    font-family: 'Courier New', monospace; margin-top: 8px;
}
.trans {
    margin-top: 10px; font-size: 1rem; color: #ccc;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

/* 特殊样式 - 高亮 */
.lyric.highlight.active {
    border-color: var(--secondary-color);
    background: rgba(244, 114, 182, 0.3);
    box-shadow: 0 0 35px rgba(244, 114, 182, 0.4);
}
.lyric.highlight.active::before { background: var(--secondary-color); }

/* 特殊样式 - 强调 */
.lyric.accent.active {
    border-color: var(--accent-color);
    background: rgba(251, 191, 36, 0.25);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}
.lyric.accent.active::before { background: var(--accent-color); }

/* 播放器控制栏 */
.player {
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 550px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 16px 24px;
    z-index: 100;
}

.player-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.player-row + .player-row { margin-top: 12px; }

/* 进度条 */
input[type=range] {
    flex: 1; min-width: 100px;
    -webkit-appearance: none; background: transparent;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%;
    background: #fff; margin-top: -6px; cursor: pointer;
    box-shadow: 0 0 10px var(--neon-color);
}
input[type=range]::-webkit-slider-runnable-track {
    height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px;
}

/* 按钮 */
.btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.3);
    color: #ddd; padding: 6px 14px; border-radius: 20px;
    cursor: pointer; font-size: 0.8rem; transition: 0.2s;
    white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-play {
    background: var(--neon-color); border: none;
    color: #fff; font-weight: bold;
    min-width: 70px;
}
.btn-play:hover { background: var(--primary-color); }

.time {
    font-family: 'Courier New', monospace; font-size: 0.85rem;
    color: var(--primary-color); min-width: 90px; text-align: center;
}

.file-hint {
    font-size: 0.75rem; color: rgba(255,255,255,0.5);
    text-align: center; flex: 1;
}

select.btn {
    padding: 5px 8px;
    background: rgba(255,255,255,0.1);
}

/* Toast 提示 */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--neon-color); color: white;
    padding: 10px 20px; border-radius: 10px;
    font-weight: bold; z-index: 200;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* 响应式 - 移动端 */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    .jp { font-size: 1.3rem; }
    .album-art { width: 140px; height: 140px; }
    .scroll-container { padding: 40px 15px 200px 15px; }
    .player { padding: 14px 18px; bottom: 15px; border-radius: 20px; }
    .player-row { gap: 8px; }
    .btn { padding: 5px 10px; font-size: 0.75rem; }
    .lyric { padding: 18px; margin-bottom: 14px; }
    .section { margin: 40px 0 20px 0; }
}
