/* Lo-fi沉浸式空间样式 */

/* 场景选择 */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 8px; }
/* 场景卡片hover描述 */
.scene-card { display: flex; flex-direction: column; align-items: center; padding: 16px 12px; background: #fafafa; border: 2px solid #e0e0e0; border-radius: 12px; cursor: pointer; transition: all 0.3s; position: relative; }
.scene-card:hover { border-color: #e94560; background: #fff0f3; transform: translateY(-2px); }
.scene-card.active { border-color: #e94560; background: linear-gradient(135deg, #fff0f3 0%, #ffe0e6 100%); box-shadow: 0 4px 12px rgba(233,69,96,0.2); }
.scene-icon { font-size: 32px; margin-bottom: 8px; }
.scene-name { font-size: 13px; font-weight: 600; color: #333; text-align: center; }

.radio-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 14px; border: 1px solid #e0e0e0; border-radius: 20px; transition: all 0.2s; font-size: 14px; }
.radio-label:hover { border-color: #e94560; }
.radio-label:has(input:checked) { background: #fff0f3; border-color: #e94560; color: #e94560; }
button.secondary.active { background: #e94560; color: white; border-color: #e94560; }

.query-select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; margin-top: 6px; }
.hint-text { color: #888; font-size: 12px; display: block; margin-top: 4px; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.shortcuts-info { color: #999; font-size: 12px; padding: 8px 0; border-top: 1px dashed #eee; margin-top: 12px; }

/* 输入框组件 */
.input-box { display: flex; align-items: center; background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 10px; padding: 0 12px; transition: all 0.2s; margin-top: 6px; }
.input-box:focus-within { border-color: #e94560; background: #fff; box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }
.input-icon { font-size: 16px; margin-right: 10px; opacity: 0.6; }
.lofi-input { flex: 1; border: none; background: transparent; padding: 12px 0; font-size: 14px; outline: none; }
.lofi-input::placeholder { color: #aaa; }
.ai-input-box { background: linear-gradient(135deg, #f8f9fa 0%, #f0f4ff 100%); border-color: #d0d8e8; }
.ai-input-box:focus-within { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }

/* 沉浸式空间 */
.immersive-space { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; overflow: hidden; }
.scene-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: background 1s ease; }
.effects-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.character-layer { position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); }

/* 控制栏 */
.control-bar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); opacity: 0; transition: opacity 0.3s; }
.control-bar.visible { opacity: 1; }
.control-left, .control-right { display: flex; align-items: center; gap: 12px; }
.ctrl-btn { width: 40px; height: 40px; border: none; background: rgba(255,255,255,0.15); color: white; border-radius: 50%; cursor: pointer; font-size: 16px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.ctrl-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }
.ctrl-btn.active { background: #e94560; }
.ctrl-btn.exit-btn { background: rgba(233,69,96,0.6); }
.ctrl-btn.exit-btn:hover { background: #e94560; }

.volume-control { display: flex; align-items: center; gap: 8px; }
.volume-icon { color: white; font-size: 16px; }
#volumeSlider { width: 80px; accent-color: #e94560; }

.now-playing { color: rgba(255,255,255,0.8); font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 氛围文字 */
.ambient-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: white; opacity: 0; transition: opacity 1s ease; max-width: 80%; cursor: pointer; }
.ambient-text.visible { opacity: 1; pointer-events: auto; }
.quote { font-size: 24px; font-weight: 300; letter-spacing: 2px; text-shadow: 0 2px 20px rgba(0,0,0,0.5); margin-bottom: 16px; line-height: 1.6; }
.scene-desc { font-size: 14px; color: rgba(255,255,255,0.7); }

/* 时间显示 */
.time-display { position: absolute; top: 24px; right: 24px; color: rgba(255,255,255,0.6); font-size: 48px; font-weight: 200; letter-spacing: 4px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }

/* 场景切换提示 */
.scene-toast { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.7); color: white; padding: 16px 32px; border-radius: 12px; font-size: 20px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 100; }
.scene-toast.visible { opacity: 1; }

/* 沉浸空间错误提示 */
.immersive-error { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); background: rgba(233,69,96,0.9); color: white; padding: 12px 24px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 100; }
.immersive-error.visible { opacity: 1; }

/* 快捷键提示 */
.shortcut-hint { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px; background: rgba(0,0,0,0.6); padding: 12px 24px; border-radius: 24px; opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.shortcut-hint.visible { opacity: 1; }
.shortcut-hint span { color: rgba(255,255,255,0.8); font-size: 13px; white-space: nowrap; }

/* 雨滴效果 */
.rain-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.raindrop { position: absolute; top: -20px; width: 2px; height: 20px; background: linear-gradient(transparent, rgba(174,194,224,0.6)); animation: rain-fall linear infinite; }
@keyframes rain-fall { 0% { transform: translateY(0); } 100% { transform: translateY(100vh); } }

/* 星星效果 */
.stars-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.star { position: absolute; background: white; border-radius: 50%; animation: star-twinkle 3s ease-in-out infinite; }
@keyframes star-twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* 雪花效果 */
.snow-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.snowflake { position: absolute; top: -30px; color: white; animation: snow-fall linear infinite; }
@keyframes snow-fall { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(100vh) rotate(360deg); } }

/* 蒸汽效果 */
.steam-container { position: absolute; bottom: 20%; left: 0; width: 100%; }
.steam-particle { position: absolute; width: 30px; height: 30px; background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%); border-radius: 50%; animation: steam-rise 3s ease-out infinite; }
@keyframes steam-rise { 0% { transform: translateY(0) scale(1); opacity: 0.6; } 100% { transform: translateY(-150px) scale(2); opacity: 0; } }

/* 海浪效果 */
.waves-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 30%; }
.wave { position: absolute; bottom: 0; left: -50%; width: 200%; height: 100%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath fill='rgba(255,255,255,0.1)' d='M0,60 C300,20 600,100 900,60 C1050,30 1200,60 1200,60 L1200,120 L0,120 Z'/%3E%3C/svg%3E"); background-size: 100% 100%; animation: wave-motion linear infinite; }
.wave1 { animation-duration: 8s; opacity: 0.8; }
.wave2 { animation-duration: 12s; animation-delay: -2s; opacity: 0.5; bottom: 10px; }
.wave3 { animation-duration: 16s; animation-delay: -4s; opacity: 0.3; bottom: 20px; }
@keyframes wave-motion { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }

/* 阳光效果 */
.sunbeams-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.sunbeam { position: absolute; top: 0; width: 100px; height: 100%; background: linear-gradient(180deg, rgba(255,255,200,0.3) 0%, transparent 60%); transform: skewX(-15deg); animation: sunbeam-pulse 4s ease-in-out infinite; }
@keyframes sunbeam-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

/* 树叶效果 */
.leaves-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.leaf { position: absolute; top: -30px; font-size: 20px; animation: leaf-fall linear infinite; }
@keyframes leaf-fall { 0% { transform: translateY(0) rotate(0deg) translateX(0); } 50% { transform: translateY(50vh) rotate(180deg) translateX(30px); } 100% { transform: translateY(100vh) rotate(360deg) translateX(0); } }

/* 闪电效果 */
.lightning-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; transition: background 0.1s; }
.lightning-container.flash { background: rgba(255,255,255,0.3); }

/* 流星效果 */
.shooting-star { position: absolute; width: 100px; height: 2px; background: linear-gradient(90deg, white, transparent); transform: rotate(-45deg); animation: shooting 1s linear forwards; }
@keyframes shooting { 0% { transform: translateX(0) translateY(0) rotate(-45deg); opacity: 1; } 100% { transform: translateX(300px) translateY(300px) rotate(-45deg); opacity: 0; } }

/* 光效 */
.warm-glow { position: absolute; bottom: 20%; left: 40%; width: 200px; height: 200px; background: radial-gradient(circle, rgba(255,200,100,0.3) 0%, transparent 70%); animation: glow-pulse 3s ease-in-out infinite; }
.fire-glow { position: absolute; bottom: 15%; left: 30%; width: 250px; height: 150px; background: radial-gradient(ellipse, rgba(255,100,50,0.4) 0%, transparent 70%); animation: fire-pulse 2s ease-in-out infinite; }
.sunset-glow { position: absolute; top: 0; left: 0; width: 100%; height: 60%; background: radial-gradient(ellipse at 50% 0%, rgba(255,150,100,0.3) 0%, transparent 70%); }
@keyframes glow-pulse { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes fire-pulse { 0%, 100% { opacity: 0.7; } 25% { opacity: 0.5; } 50% { opacity: 0.9; } 75% { opacity: 0.6; } }

/* 角色层 - 学习 */
.study-char { position: relative; width: 200px; height: 150px; }
.study-char .desk { position: absolute; bottom: 0; left: 0; width: 180px; height: 60px; background: #3d2817; border-radius: 4px; }
.study-char .person { position: absolute; bottom: 50px; left: 30px; }
.study-char .head { width: 30px; height: 35px; background: #f5d0b0; border-radius: 50% 50% 45% 45%; }
.study-char .body { width: 40px; height: 50px; background: #4a5568; border-radius: 8px 8px 0 0; margin-left: -5px; }
.study-char .arm { width: 35px; height: 8px; background: #4a5568; border-radius: 4px; position: absolute; top: 50px; left: 25px; animation: arm-write 2s ease-in-out infinite; }
@keyframes arm-write { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.study-char .lamp { position: absolute; right: 20px; bottom: 60px; }
.study-char .lamp-light { width: 40px; height: 25px; background: #ffd700; border-radius: 0 0 50% 50%; box-shadow: 0 10px 30px rgba(255,215,0,0.5); animation: lamp-flicker 4s ease-in-out infinite; }
@keyframes lamp-flicker { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; } 90% { opacity: 0.85; } }

/* 角色层 - 观星 */
.stargazing-char { position: relative; width: 150px; height: 120px; }
.stargazing-char .person-silhouette { position: absolute; bottom: 0; left: 20px; width: 50px; height: 80px; background: #1a1a2e; border-radius: 20px 20px 0 0; }
.stargazing-char .telescope { position: absolute; bottom: 40px; left: 60px; width: 60px; height: 8px; background: #2d3561; transform: rotate(-30deg); border-radius: 4px; }

/* 角色层 - 咖啡馆 */
.cafe-char { position: relative; width: 150px; height: 100px; }
.cafe-char .table { position: absolute; bottom: 0; left: 0; width: 120px; height: 40px; background: #5a4a3a; border-radius: 4px; }
.cafe-char .cup { position: absolute; bottom: 40px; left: 30px; width: 25px; height: 30px; background: white; border-radius: 0 0 8px 8px; }
.cafe-char .cup-steam { position: absolute; top: -20px; left: 5px; width: 15px; height: 20px; background: transparent; }
.cafe-char .cup-steam::before, .cafe-char .cup-steam::after { content: ''; position: absolute; width: 8px; height: 15px; border-radius: 50%; background: rgba(255,255,255,0.3); animation: steam-rise 2s ease-out infinite; }
.cafe-char .cup-steam::after { left: 8px; animation-delay: 0.5s; }
.cafe-char .book { position: absolute; bottom: 40px; left: 65px; width: 35px; height: 25px; background: #8b4513; border-radius: 2px; }

/* 角色层 - 小屋 */
.cabin-char { position: relative; width: 200px; height: 150px; }
.cabin-char .window-frame { position: absolute; top: 0; left: 50px; width: 80px; height: 60px; border: 6px solid #3d2817; background: linear-gradient(180deg, #2a3a4d 0%, #1a2433 100%); }
.cabin-char .fireplace { position: absolute; bottom: 0; left: 20px; width: 60px; height: 50px; background: #2d2d2d; border-radius: 8px 8px 0 0; }
.cabin-char .fire { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 30px; height: 35px; background: linear-gradient(transparent, #ff6b35, #ffd93d); border-radius: 50% 50% 20% 20%; animation: fire-dance 0.5s ease-in-out infinite alternate; }
@keyframes fire-dance { 0% { transform: translateX(-50%) scaleY(1) scaleX(1); } 100% { transform: translateX(-50%) scaleY(1.1) scaleX(0.9); } }
.cabin-char .armchair { position: absolute; bottom: 0; right: 20px; width: 50px; height: 45px; background: #8b4513; border-radius: 10px 10px 0 0; }

/* 角色层 - 海滩 */
.beach-char { position: relative; width: 200px; height: 150px; }
.beach-char .horizon { position: absolute; top: 40%; left: 0; width: 100%; height: 2px; background: rgba(255,255,255,0.3); }
.beach-char .sun { position: absolute; top: 10%; left: 50%; transform: translateX(-50%); width: 60px; height: 60px; background: #ff7e5f; border-radius: 50%; box-shadow: 0 0 60px rgba(255,126,95,0.6); }
.beach-char .beach-person { position: absolute; bottom: 10%; left: 40%; width: 30px; height: 50px; background: #1a1a2e; border-radius: 15px 15px 0 0; }

/* 角色层 - 森林 */
.forest-char { position: relative; width: 250px; height: 180px; }
.forest-char .trees { position: absolute; bottom: 0; left: 0; width: 100%; height: 150px; background: repeating-linear-gradient(90deg, transparent 0px, transparent 30px, #1a3d1a 30px, #1a3d1a 35px, transparent 35px, transparent 60px); }
.forest-char .path { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 40px; height: 80px; background: linear-gradient(180deg, #3d2817 0%, #5a4a3a 100%); clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%); }
.forest-char .sunbeam-overlay { position: absolute; top: 0; left: 30%; width: 80px; height: 100%; background: linear-gradient(180deg, rgba(255,255,200,0.4) 0%, transparent 80%); transform: skewX(-10deg); animation: sunbeam-pulse 4s ease-in-out infinite; }

/* 加载和错误 */
.loading-panel { text-align: center; padding: 40px 20px; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid #f0f0f0; border-top: 3px solid #e94560; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 600px) {
    .scene-grid { grid-template-columns: repeat(2, 1fr); }
    .quote { font-size: 18px; }
    .time-display { font-size: 32px; top: 16px; right: 16px; }
    .control-bar { padding: 12px 16px; }
    #volumeSlider { width: 60px; }
    .now-playing { display: none; }
    .shortcut-hint { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
    .shortcut-hint span { font-size: 12px; }
    .scene-toast { font-size: 16px; padding: 12px 24px; }
}
