/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    background-color: #000;
    overflow-x: hidden;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 宇宙背景 */
.universe-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #050a1a 0%, #0a0a2a 50%, #121236 100%);
    transition: background-color 1s ease;
}

/* 星星效果 */
#stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 单个星星 */
.star {
    position: absolute;
    border-radius: 50%;
    animation: twinkle 20s linear infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* 不同类型星星的样式 */
.star.supergiant {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.9), 0 0 50px rgba(255, 255, 255, 0.5);
    animation-name: twinkleIrregular;
    animation-duration: 10s;
}

.star.giant {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.4);
    animation-name: twinkleSlow;
    animation-duration: 15s;
}

.star.mainsequence {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(255, 255, 255, 0.3);
    animation-name: twinkle;
    animation-duration: 20s;
}

.star.dwarf {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    animation-name: twinkleFast;
    animation-duration: 8s;
}

/* 星星闪烁动画 - 标准 */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* 星星闪烁动画 - 慢速 */
@keyframes twinkleSlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* 星星闪烁动画 - 快速 */
@keyframes twinkleFast {
    0%, 100% {
        opacity: 0.1;
        transform: scale(0.7);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3);
    }
}

/* 星星闪烁动画 - 不规则 */
@keyframes twinkleIrregular {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    23% {
        opacity: 0.5;
        transform: scale(1);
    }
    47% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    71% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    85% {
        opacity: 0.6;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

/* 星云流动动画 */
@keyframes nebulaFlow {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translate(-20px, 15px) scale(1.05) rotate(5deg);
        opacity: 0.9;
    }
    50% {
        transform: translate(10px, -10px) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    75% {
        transform: translate(20px, -20px) scale(0.95) rotate(-5deg);
        opacity: 0.6;
    }
}

/* 星云样式 */
.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.7;
    animation: nebulaFlow 40s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* 发射星云 - 粉红色 */
.nebula.emission {
    background: radial-gradient(circle, rgba(255, 105, 180, 0.4) 0%, rgba(255, 105, 180, 0.1) 70%);
}

/* 反射星云 - 蓝色 */
.nebula.reflection {
    background: radial-gradient(circle, rgba(135, 206, 250, 0.4) 0%, rgba(135, 206, 250, 0.1) 70%);
}

/* 暗星云 - 黑色 */
.nebula.dark {
    background: radial-gradient(circle, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 70%);
}

/* 小型不规则星云 */
.nebula.small {
    filter: blur(15px);
    opacity: 0.5;
    animation-duration: 60s;
}

/* 小型不规则星云（独立类） */
.small-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.5;
    animation: nebulaFlow 60s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* 银河样式 */
.galaxy {
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 150%;
    background: radial-gradient(ellipse at center, 
        rgba(65, 105, 225, 0.1) 0%, 
        rgba(153, 50, 204, 0.08) 30%, 
        rgba(255, 105, 180, 0.05) 60%, 
        rgba(0, 0, 0, 0) 100%);
    transform: translate(-25%, -25%);
    pointer-events: none;
    z-index: 0;
    animation: galaxyRotate 1000s linear infinite;
}

/* 银河旋转动画 */
@keyframes galaxyRotate {
    from {
        transform: rotate(-45deg);
    }
    to {
        transform: rotate(315deg);
    }
}

/* 银河旋臂样式 */
.galaxy-arm {
    position: absolute;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(216, 191, 216, 0.2) 50%, 
        rgba(255, 255, 255, 0) 100%);
    opacity: 0.4;
    filter: blur(20px);
    z-index: 1;
}

/* 头部区域样式 */
header {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-content {
    text-align: center;
    z-index: 2;
    transform: translateY(0);
    transition: all 0.5s ease;
    padding: 2rem;
}

.header-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
}

.header-content h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #0ff, transparent);
    margin: 1rem auto 0;
}

.header-content p {
    font-size: 1.5rem;
    color: #f0f;
    margin-bottom: 2rem;
    text-shadow: 0 0 5px #f0f;
}

/* 发光效果动画 */
@keyframes glow {
    from {
        text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff;
    }
    to {
        text-shadow: 0 0 20px #0ff, 0 0 30px #0ff, 0 0 40px #0ff;
    }
}

/* 流星效果 */
.meteor {
    position: absolute;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    border-radius: 5px;
    z-index: 2;
    pointer-events: none;
}

@keyframes meteor {
    from {
        transform: translateX(-100%) translateY(-100%) rotate(25deg);
        opacity: 0.8;
    }
    to {
        transform: translateX(100%) translateY(100%) rotate(25deg);
        opacity: 0;
    }
}

/* 漂浮的科技元素 */
.tech-element {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.tech-circle {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tech-square {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 0, 255, 0.2) 0%, rgba(255, 0, 255, 0) 70%);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(10px) translateX(-20px);
    }
    75% {
        transform: translateY(-10px) translateX(15px);
    }
}

/* 鼠标跟随光晕 */
.mouse-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(100, 100, 255, 0.1) 0%, rgba(100, 100, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.1s ease-out;
}

/* 主内容区域 */
main {
    position: relative;
    z-index: 1;
    background: none;
    padding: 4rem 2rem;
}

/* 宇宙科技背景层 */
.cosmic-tech-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #050a1a 0%, #0a0a2a 50%, #121236 100%);
    overflow: hidden;
}

/* 科技线条背景 */
.tech-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* 画廊区域 */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.gallery-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    position: relative;
}

.gallery-section h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #0ff, transparent);
    margin: 1rem auto 0;
}

/* 画廊容器 - 三列布局 */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    padding: 1rem;
    justify-items: center;
}

/* 单个图片项 */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.2rem;
    width: 85%;
    max-width: 200px;
}

.gallery-item.hovered {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.3);
    border-color: rgba(0, 255, 255, 0.5);
}

/* 图片项渐入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图片链接 */
.image-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    height: 100%;
    width: 100%;
}

/* 画廊图片 */
.gallery-image {
    width: 45%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 3px;
    margin-top: 0.3rem;
    margin-bottom: 0.5rem;
    transition: transform 0.5s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gallery-item.hovered .gallery-image {
    transform: scale(1.1);
}

/* 图片下方文字 */
.gallery-text {
    padding: 0.5rem 0.2rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 255, 0.1));
    position: relative;
    margin: 0;
}

/* 科技光效容器 */
.tech-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item.hovered .tech-glow {
    opacity: 1;
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 科技波纹效果 */
.tech-ripple {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    z-index: 3;
    pointer-events: none;
    animation: ripple 2s ease-out forwards;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* 页脚样式 */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    background: rgba(10, 10, 30, 0.9);
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

footer p {
    color: #a8d8ea;
    font-size: 0.9rem;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-content h1 {
        font-size: 3rem;
    }
    
    .header-content p {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 2rem 0.5rem;
    }
    
    .gallery-section h2 {
        font-size: 2rem;
    }
    
    .gallery-container {
        gap: 0.5rem;
    }
    
    .header-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .gallery-section h2 {
        font-size: 1.8rem;
    }
    
    .gallery-text {
        font-size: 0.7rem;
        padding: 0.4rem 0.1rem;
        letter-spacing: 0;
        word-break: keep-all;
    }
}