/* 宇宙演化可视化 - 样式表 */

:root {
    --cosmic-black: #0a0a0f;
    --nebula-purple: #4a1a6b;
    --plasma-orange: #ff6b35;
    --star-white: #f0f0ff;
    --quasar-blue: #00d4ff;
    --void-gray: #1a1a2e;
    --accretion-gold: #ffd700;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--cosmic-black);
    color: var(--star-white);
    overflow: hidden;
    min-height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 加载界面 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cosmic-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease, visibility 1s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.singularity {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #fff 0%, var(--plasma-orange) 30%, var(--nebula-purple) 60%, transparent 70%);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: pulse 1.5s ease-in-out infinite, glow 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--plasma-orange), 0 0 40px var(--nebula-purple); }
    50% { box-shadow: 0 0 40px var(--plasma-orange), 0 0 80px var(--quasar-blue); }
}

.loader p {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--quasar-blue);
    text-transform: uppercase;
}

/* 标题 */
#title-header {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
}

#title-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--star-white) 0%, var(--quasar-blue) 50%, var(--nebula-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    margin-bottom: 8px;
}

#title-header .subtitle {
    font-size: 0.9rem;
    letter-spacing: 4px;
    color: rgba(240, 240, 255, 0.6);
    text-transform: uppercase;
}

/* 信息面板 */
#info-panel {
    position: fixed;
    top: 120px;
    right: 30px;
    width: 320px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 25px;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.era-info h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--quasar-blue);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.era-info #era-time {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--plasma-orange);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.era-info #era-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(240, 240, 255, 0.8);
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.physics-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    font-size: 0.8rem;
    color: rgba(240, 240, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item .value {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--accretion-gold);
    font-weight: 700;
}

/* 时间轴控制 */
#timeline-control {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    z-index: 100;
}

.timeline-wrapper {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    padding: 25px 30px 50px;
    margin-bottom: 15px;
}

#timeline-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, 
        var(--plasma-orange) 0%, 
        var(--nebula-purple) 25%, 
        var(--quasar-blue) 50%, 
        var(--accretion-gold) 75%, 
        var(--star-white) 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #fff 30%, var(--quasar-blue) 70%);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 20px var(--quasar-blue), 0 0 40px rgba(0, 212, 255, 0.5);
    transition: transform 0.2s ease;
}

#timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#timeline-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

#timeline-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #fff 30%, var(--quasar-blue) 70%);
    border-radius: 50%;
    cursor: grab;
    border: none;
    box-shadow: 0 0 20px var(--quasar-blue), 0 0 40px rgba(0, 212, 255, 0.5);
}

.timeline-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 0 5px;
}

.timeline-markers .marker {
    font-size: 0.7rem;
    color: rgba(240, 240, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.timeline-markers .marker:hover {
    color: var(--quasar-blue);
    transform: translateY(-2px);
}

.playback-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: rgba(10, 10, 15, 0.9);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    color: var(--quasar-blue);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--quasar-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transform: scale(1.1);
}

.control-btn.playing .play-icon {
    display: inline-block;
}

.play-icon {
    font-size: 1rem;
}

/* 事件通知 */
#event-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid var(--quasar-blue);
    border-radius: 20px;
    padding: 30px 50px;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.4);
}

#event-notification.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

.event-content {
    text-align: center;
}

#event-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    animation: float 2s ease-in-out infinite;
}

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

#event-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--star-white);
    letter-spacing: 2px;
}

/* 控制提示 */
#controls-hint {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

#controls-hint p {
    font-size: 0.75rem;
    color: rgba(240, 240, 255, 0.4);
    letter-spacing: 1px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    #info-panel {
        width: 280px;
        right: 20px;
        top: 100px;
        padding: 20px;
    }
    
    #title-header h1 {
        font-size: 2rem;
    }
    
    #timeline-control {
        width: 90%;
    }
}

@media (max-width: 768px) {
    #info-panel {
        position: fixed;
        top: auto;
        bottom: 180px;
        right: 50%;
        transform: translateX(50%);
        width: 90%;
        max-width: 400px;
    }
    
    #title-header {
        top: 20px;
    }
    
    #title-header h1 {
        font-size: 1.5rem;
        letter-spacing: 4px;
    }
    
    #title-header .subtitle {
        font-size: 0.7rem;
    }
    
    .timeline-markers .marker {
        font-size: 0.6rem;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
}

/* 隐藏辅助类 */
.hidden {
    display: none !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cosmic-black);
}

::-webkit-scrollbar-thumb {
    background: var(--nebula-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--quasar-blue);
}

