/* 公共样式 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #11998e;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-color: #333;
    --text-light: #666;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.25);
    --nav-text: white;
    --footer-bg: rgba(102, 126, 234, 0.15);
    --scrollbar-color: #667eea;
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-text: #333;
    --footer-bg: rgba(245, 247, 250, 0.95);
    --scrollbar-color: #667eea;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

.frosted-glass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1;
    pointer-events: none;
}

.site-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1001;
    background: var(--nav-bg); backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.site-header .container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px;
}

.logo { display: flex; align-items: center; gap: -15px; }
.logo img { height: 28px; width: 28px; }
.logo h1 { font-size: 24px; color: var(--nav-text); margin: 0; text-shadow: 1px 1px 3px rgba(0,0,0,0.1); }

.main-nav ul { display: flex; list-style: none; gap: 25px; margin: 0; padding: 0; }

.main-nav a {
    font-size: 15px; font-weight: 500; padding: 8px 0; position: relative;
    color: var(--nav-text); text-decoration: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1); transition: opacity 0.3s;
}

.main-nav a.active::before {
    content: ''; position: absolute; top: 50%; left: -12px;
    transform: translateY(-50%); width: 8px; height: 8px;
    background: var(--accent-color); border-radius: 50%;
}
.main-nav a:hover { opacity: 0.8; }

.nav-tools { display: flex; align-items: center; gap: 15px; }
.theme-toggle {
    background: none; border: none; cursor: pointer; font-size: 20px;
    padding: 5px; border-radius: 50%; transition: all 0.3s; color: var(--nav-text);
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); transform: rotate(180deg); }

/* 页面过渡动画 */
.page-transition {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #11998e);
    transform: scaleX(0); transform-origin: left; z-index: 9999;
    transition: transform 0.3s ease;
}
.page-transition.active { transform: scaleX(1); }

/* Loading 动画 */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; justify-content: center;
    align-items: center; z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; }
.loading-spinner { width: 60px; height: 60px; position: relative; }
.loading-spinner .circle {
    position: absolute; width: 100%; height: 100%;
    border: 4px solid transparent; border-top-color: white;
    border-radius: 50%; animation: spin 1s linear infinite;
}
.loading-spinner .circle:nth-child(2) {
    width: 80%; height: 80%; top: 10%; left: 10%;
    animation-delay: 0.1s; border-top-color: rgba(255, 255, 255, 0.7);
}
.loading-spinner .circle:nth-child(3) {
    width: 60%; height: 60%; top: 20%; left: 20%;
    animation-delay: 0.2s; border-top-color: rgba(255, 255, 255, 0.5);
}
.loading-text { color: white; margin-top: 20px; font-size: 14px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* 返回顶部按钮 */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: #11998e; color: white; border: none;
    border-radius: 50%; cursor: pointer; font-size: 20px;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.3s ease; box-shadow: 0 5px 20px rgba(17,153,142,0.3); z-index: 999;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(17,153,142,0.4); }

/* 画布样式 */
#fireworks-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9998; }
#myCanvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
#mouse-trail-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9997; pointer-events: none;
}

/* 浮动歌词样式 */
.floating-lyrics {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}
.floating-lyrics .lyric-line {
    position: absolute;
    font-size: 16px;
    color: white;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(102,126,234,0.8), 0 0 20px rgba(118,75,162,0.5);
    letter-spacing: 2px;
    white-space: nowrap;
    transition: opacity 0.8s ease-out;
}
.floating-lyrics .lyric-ball {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(102,126,234,0.8), rgba(118,75,162,0.6));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(102,126,234,0.8), 0 0 40px rgba(118,75,162,0.5), inset 0 0 10px rgba(255,255,255,0.3);
    pointer-events: none;
}
.floating-lyrics .lyric-line.active {
    animation: lyricShake 0.3s ease-in-out infinite;
}
.floating-lyrics .lyric-line span {
    display: inline;
    transition: color 0.1s ease, text-shadow 0.1s ease;
}
@keyframes lyricShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, 2px); }
}
.floating-lyrics .lyric-line.garbled {
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b, 0 0 20px #ff6b6b;
}

/* 音乐播放器样式 - 最小化按钮版 */
.music-player-wrapper {
    position: fixed !important;
    bottom: 75px !important;
    left: 20px !important;
    z-index: 1001 !important;
    display: flex;
    align-items: center;
}
.music-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
    transition: all 0.3s ease;
    animation: musicPulse 2s ease-in-out infinite;
}
.music-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.5);
}
.music-toggle-btn.playing {
    animation: musicRotate 2s linear infinite !important;
}
@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes musicRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.music-player-container {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 380px;
    animation: slideUp 0.3s ease;
}
.music-player-container.show {
    display: block;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.music-player-container .aplayer {
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}
.aplayer-lrc {
    background: transparent !important;
    box-shadow: none !important;
}
.aplayer-lrc-contents, .aplayer-lrc-display {
    background: transparent !important;
}
.aplayer-lrc-line {
    background: transparent !important;
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
}
.aplayer-lrc-current {
    background: transparent !important;
    color: #ffeaa7 !important;
}
.aplayer-lrc p {
    background: transparent !important;
}

/* APlayer 其他样式覆盖 */
.aplayer .aplayer-body {
    position: relative !important;
}
.aplayer .aplayer-info {
    padding: 10px 10px 5px !important;
}
.aplayer .aplayer-list {
    max-height: 200px !important;
}
.aplayer .aplayer-list ol li {
    border-top: 1px solid #eee !important;
}
.aplayer .aplayer-list ol li:hover {
    background: #f5f5f5 !important;
}
.aplayer .aplayer-list ol li.aplayer-list-light {
    background: #e8f8f5 !important;
}

/* 音乐播放器 - 嵌入式旧版 */
.music-player {
    position: fixed; bottom: 30px; left: 30px; z-index: 998;
}
.music-toggle {
    width: 50px; height: 50px; border-radius: 50%;
    background: #11998e; color: white; border: none;
    cursor: pointer; font-size: 20px; display: flex;
    justify-content: center; align-items: center;
    box-shadow: 0 5px 20px rgba(17,153,142,0.3);
    transition: all 0.3s;
}
.music-toggle:hover { transform: scale(1.1); }
.music-panel {
    position: absolute; bottom: 60px; left: 0;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px);
    border-radius: 15px; padding: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transform: scale(0.8); opacity: 0;
    visibility: hidden; transition: all 0.3s;
}
.music-panel.show { transform: scale(1); opacity: 1; visibility: visible; }
.music-panel h4 { color: #333; font-size: 14px; margin: 0 0 10px 0; }
.music-panel iframe { width: 100%; height: 380px; border: none; border-radius: 10px; }

/* Live2D 角色 */
.live2d-widget {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 400px;
    z-index: 999;
    pointer-events: none;
}
#live2d-canvas {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
    .music-player-wrapper { left: 15px !important; bottom: 15px !important; }
    .music-player { left: 15px; bottom: 15px; }
    .live2d-widget { display: none; }
    .floating-lyrics .lyric-line { font-size: 12px; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .main-nav ul { gap: 15px; }
    .logo h1 { font-size: 20px; }
    .main-nav a.active::before { display: none; }
}