@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    --bg-color: #0a192f;
    --card-bg-color: rgba(17, 34, 64, 0.85);
    --text-color: #ccd6f6;
    --heading-color: #e6f1ff;
    --subtle-text-color: #8892b0;
    --accent-color: #64ffda;
    --shadow-color: rgba(100, 255, 218, 0.1);
}

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

/* 确保container类正确定位 */
.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    pointer-events: none;
}

/* slideshow覆盖整个屏幕 */
.slideshow {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* 确保WebGL画布正确显示 */
#container {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* 粒子画布样式 */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    user-select: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#particle-canvas.hidden {
    opacity: 0;
}

body {
    font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    background: var(--bg-color);
}

/* 遮罩层调整 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(10, 25, 47, 0.2) 0%,
        rgba(10, 25, 47, 0.3) 50%,
        rgba(10, 25, 47, 0.4) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* 隐藏不支持WebGL的提示 */
.nosupport {
    display: none;
}

.no-webgl .nosupport {
    display: block;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 1em;
    background: #a74e71;
    color: white;
    text-align: center;
    z-index: 1000;
}

/* 不同天气的背景调整 */
.weather-storm .container {
    filter: brightness(0.7);
}

.weather-drizzle .container {
    filter: brightness(0.85) saturate(0.8);
}

.weather-sunny .container {
    filter: brightness(1.2) saturate(1.1);
}

.weather-fallout .container {
    filter: brightness(0.6) sepia(0.2) hue-rotate(60deg);
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* 主要内容的背景板 */
.main-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(10, 25, 47, 0.4) 0%,
        rgba(10, 25, 47, 0.2) 40%,
        transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* 控制按钮组 */
.effect-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.effect-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(17, 34, 64, 0.9);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.effect-toggle:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
}

.effect-toggle.disabled {
    opacity: 0.5;
    color: var(--subtle-text-color);
    border-color: var(--subtle-text-color);
}

/* 保持原有的卡片和其他样式... */
header {
    margin-bottom: 4rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--heading-color);
    letter-spacing: 2px;
    text-shadow: 
        0 0 20px rgba(100, 255, 218, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.6);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { 
        text-shadow: 
            0 0 20px rgba(100, 255, 218, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.6);
    }
    to { 
        text-shadow: 
            0 0 30px rgba(100, 255, 218, 0.5), 
            0 0 40px rgba(100, 255, 218, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.6);
    }
}

header p {
    font-size: 1.1rem;
    color: var(--subtle-text-color);
    margin-top: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}

.card {
    background: linear-gradient(135deg, 
        rgba(17, 34, 64, 0.92) 0%,
        rgba(17, 34, 64, 0.85) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 255, 218, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(100, 255, 218, 0.1) 0%, 
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 10px 30px -15px var(--shadow-color),
        0 0 40px -10px rgba(100, 255, 218, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    background: linear-gradient(135deg, 
        rgba(17, 34, 64, 0.95) 0%, 
        rgba(17, 34, 64, 0.88) 100%);
}

.card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(100, 255, 218, 0.3));
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 1rem;
    color: var(--subtle-text-color);
    line-height: 1.6;
}

.card p.powered-by {
    font-size: 0.8rem;
    color: var(--subtle-text-color);
    opacity: 0.7;
    margin-top: 20px;
    line-height: 1.2;
}

footer {
    width: 100%;
    text-align: center;
    color: var(--subtle-text-color);
    font-size: 0.9rem;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

@media (max-width: 600px) {
    .main-container {
        padding: 3rem 1rem;
    }
    header {
        margin-bottom: 3rem;
    }
    header h1 {
        font-size: 2.5rem;
    }
    .card-grid {
        gap: 1.5rem;
    }
    .effect-controls {
        bottom: 10px;
        right: 10px;
        flex-direction: row;
    }
    .effect-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* --- 动态 Slogan 特效样式 --- */
.slogan-container {
    position: relative; /* 为覆盖层提供定位基准 */
    min-height: 24px; /* 防止文本切换时高度变化导致跳动 */
    display: flex;
    justify-content: center;
    align-items: center;
}

#dynamic-slogan {
    transition: opacity 0.2s ease-in-out; /* 让文本切换更柔和一点 */
}

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none; /* 让覆盖层不影响鼠标操作 */
    display: none; /* 默认隐藏 */
}

.glitch-block {
    position: absolute;
    opacity: 0;
    animation: glitch-block-anim 0.5s ease-out forwards;
}

@keyframes glitch-block-anim {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(calc(var(--randX) * 30px), calc(var(--randY) * 30px)) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--randX) * -30px), calc(var(--randY) * -30px)) scale(0.5);
    }
}

html, body {
    max-height: 100vh;
    overflow-x: hidden;
}
