/* ==================== 深空宇宙风格 - 基础设置 ==================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    /* 宇宙色彩 */
    --color-space: #000814;
    --color-deep-blue: #001d3d;
    --color-cosmic-blue: #003566;
    --color-star: #ffd60a;
    --color-gamma: #00f5ff;
    --color-purple: #7209b7;
    --color-red: #ff006e;

    /* 字体 */
    --font-display: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--color-space);
    color: #ffffff;
    position: relative;
}

/* ==================== 多层星空背景 ==================== */
.space-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.star-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==================== 星云背景 ==================== */
.nebula-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: nebula-drift 60s ease-in-out infinite;
}

.nebula-1 {
    width: 800px;
    height: 800px;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
    animation-delay: 0s;
}

.nebula-2 {
    width: 600px;
    height: 600px;
    top: 50%;
    right: -100px;
    background: radial-gradient(circle, var(--color-cosmic-blue) 0%, transparent 70%);
    animation-delay: 20s;
}

.nebula-3 {
    width: 700px;
    height: 700px;
    bottom: -150px;
    left: 30%;
    background: radial-gradient(circle, var(--color-deep-blue) 0%, transparent 70%);
    animation-delay: 40s;
}

@keyframes nebula-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, -30px) scale(1.1);
    }
}

/* ==================== 主容器 ==================== */
.universe-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
    perspective: 1000px;
}

/* ==================== HUD界面 ==================== */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

.hud-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-gamma);
    opacity: 0.6;
}

.hud-corner.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.hud-corner.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
}

.hud-corner.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.hud-corner.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

.hud-info {
    position: absolute;
    top: 30px;
    right: 80px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--color-gamma);
    text-align: right;
    line-height: 1.8;
    text-shadow: 0 0 10px var(--color-gamma);
}

/* ==================== 导航菜单 ==================== */
.space-nav {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: all;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(0, 8, 20, 0.8);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 1px;
}

.nav-item:hover {
    background: rgba(0, 29, 61, 0.9);
    border-left-color: var(--color-gamma);
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(0, 53, 102, 0.9);
    border-left-color: var(--color-gamma);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.nav-icon {
    font-size: 18px;
    color: var(--color-gamma);
}

.nav-label {
    color: #ffffff;
}

/* ==================== 场景通用样式 ==================== */
.space-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.space-scene.active {
    opacity: 1;
    visibility: visible;
}

.scene-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==================== 场景1: 介绍 ==================== */
.scene-center {
    position: relative;
    z-index: 10;
    text-align: center;
}

.cosmic-title {
    font-family: var(--font-display);
    font-size: clamp(60px, 10vw, 120px);
    font-weight: 900;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.title-symbol {
    font-size: 1.5em;
    color: var(--color-gamma);
    text-shadow:
        0 0 20px var(--color-gamma),
        0 0 40px var(--color-gamma),
        0 0 60px var(--color-gamma);
    animation: symbol-pulse 3s ease-in-out infinite;
}

@keyframes symbol-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.title-main {
    letter-spacing: 0.2em;
    background: linear-gradient(90deg, #ffffff 0%, var(--color-gamma) 50%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-shimmer 3s ease-in-out infinite;
}

@keyframes title-shimmer {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5);
    }
}

.cosmic-subtitle {
    font-size: clamp(16px, 2.5vw, 24px);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3em;
    font-weight: 300;
}

.energy-wave {
    margin-top: 40px;
    width: 300px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-gamma), transparent);
    animation: wave-expand 2s ease-in-out infinite;
}

@keyframes wave-expand {
    0%, 100% {
        transform: scaleX(1);
        opacity: 1;
    }
    50% {
        transform: scaleX(1.5);
        opacity: 0.5;
    }
}

/* ==================== 天体对象通用样式 ==================== */
.celestial-object {
    position: relative;
    width: 400px;
    height: 400px;
    margin-right: 100px;
}

.scene-info {
    max-width: 500px;
    z-index: 10;
}

.scene-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--color-gamma);
    text-shadow: 0 0 20px var(--color-gamma);
}

.scene-desc {
    font-size: clamp(16px, 2vw, 20px);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    line-height: 1.6;
}

.data-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 29, 61, 0.5);
    border-left: 3px solid var(--color-gamma);
    font-family: var(--font-display);
}

.data-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.data-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-gamma);
}

/* ==================== 场景2: 超新星 ==================== */
.supernova-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.supernova-visual .core {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #ffffff 0%, var(--color-star) 50%, var(--color-red) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 40px var(--color-star),
        0 0 80px var(--color-red);
    animation: core-pulse 2s ease-in-out infinite;
}

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

.explosion-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    animation: explosion-expand 3s ease-out infinite;
}

.ring-1 {
    width: 150px;
    height: 150px;
    border-color: var(--color-red);
    animation-delay: 0s;
}

.ring-2 {
    width: 250px;
    height: 250px;
    border-color: var(--color-star);
    animation-delay: 1s;
}

.ring-3 {
    width: 350px;
    height: 350px;
    border-color: var(--color-gamma);
    animation-delay: 2s;
}

@keyframes explosion-expand {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.shockwave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, var(--color-red) 50%, transparent 60%);
    animation: shockwave-pulse 4s ease-in-out infinite;
}

@keyframes shockwave-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

/* ==================== 场景3: 黑洞 ==================== */
.blackhole-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-horizon {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #000000 0%, #000000 60%, transparent 100%);
    border-radius: 50%;
    box-shadow:
        inset 0 0 40px rgba(0, 245, 255, 0.5),
        0 0 60px rgba(0, 0, 0, 0.9);
    animation: horizon-distort 5s ease-in-out infinite;
}

@keyframes horizon-distort {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.accretion-disk {
    position: absolute;
    width: 300px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--color-star) 0deg,
        var(--color-red) 90deg,
        var(--color-purple) 180deg,
        var(--color-gamma) 270deg,
        var(--color-star) 360deg
    );
    opacity: 0.7;
    animation: disk-rotate 10s linear infinite;
    filter: blur(2px);
}

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

.jet {
    position: absolute;
    width: 20px;
    height: 200px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, var(--color-gamma), transparent);
    filter: blur(5px);
    animation: jet-pulse 2s ease-in-out infinite;
}

.jet-top {
    top: -200px;
}

.jet-bottom {
    bottom: -200px;
    animation-delay: 1s;
}

@keyframes jet-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ==================== 场景4: 脉冲星 ==================== */
.pulsar-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.neutron-star {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ffffff 0%, var(--color-gamma) 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px var(--color-gamma);
    animation: star-spin 2s linear infinite;
}

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

.magnetic-field {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px dashed var(--color-purple);
    border-radius: 50%;
    opacity: 0.4;
    animation: field-pulse 3s ease-in-out infinite;
}

@keyframes field-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

.beam {
    position: absolute;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-gamma), transparent);
    left: 50%;
    top: 50%;
    transform-origin: left center;
    filter: blur(2px);
    animation: beam-rotate 2s linear infinite;
}

.beam-1 {
    animation-delay: 0s;
}

.beam-2 {
    animation-delay: 1s;
}

@keyframes beam-rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ==================== 场景5: 伽马射线暴 ==================== */
.grb-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grb-core {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 40px var(--color-gamma),
        0 0 80px var(--color-gamma),
        0 0 120px var(--color-gamma);
    animation: grb-flash 1s ease-in-out infinite;
}

@keyframes grb-flash {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

.grb-burst {
    position: absolute;
    width: 400px;
    height: 400px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--color-gamma) 45deg,
        transparent 90deg,
        transparent 180deg,
        var(--color-gamma) 225deg,
        transparent 270deg
    );
    border-radius: 50%;
    opacity: 0.6;
    animation: burst-rotate 3s linear infinite;
    filter: blur(10px);
}

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

/* ==================== 页脚 ==================== */
.space-footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    font-family: var(--font-display);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .space-nav {
        left: 20px;
        gap: 15px;
    }

    .nav-item {
        padding: 10px 15px;
        font-size: 12px;
    }

    .celestial-object {
        width: 300px;
        height: 300px;
        margin-right: 50px;
    }

    .scene-info {
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .hud-corner {
        width: 30px;
        height: 30px;
    }

    .hud-info {
        font-size: 10px;
        right: 50px;
    }

    .space-nav {
        left: 10px;
        gap: 10px;
    }

    .nav-label {
        display: none;
    }

    .nav-item {
        padding: 10px;
    }

    .space-scene {
        flex-direction: column;
        padding: 100px 20px;
    }

    .celestial-object {
        width: 250px;
        height: 250px;
        margin-right: 0;
        margin-bottom: 30px;
    }

    .scene-info {
        max-width: 100%;
    }

    .cosmic-title {
        flex-direction: column;
        gap: 10px;
    }
}
