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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.moon-icon {
    font-size: 2rem;
    animation: rotate 10s linear infinite;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 主要内容区域 */
main {
    margin-top: 80px;
}

/* 首页英雄区域 */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="white" opacity="0.3"/><circle cx="80" cy="40" r="0.5" fill="white" opacity="0.5"/><circle cx="40" cy="80" r="1.5" fill="white" opacity="0.2"/><circle cx="90" cy="90" r="0.8" fill="white" opacity="0.4"/><circle cx="10" cy="60" r="0.3" fill="white" opacity="0.6"/></svg>') repeat;
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
    position: relative;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.8;
}

.cta-button {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.hero-animation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.earth {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.5);
    animation: earthRotate 20s linear infinite;
}

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

.moon-orbit {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: orbit 10s linear infinite;
}

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

.moon {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    border-radius: 50%;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

/* 区域样式 */
section {
    padding: 4rem 0;
    margin: 2rem 0;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section-desc {
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
}

/* 月相模拟器样式 */
.simulator-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 2rem;
    padding: 3rem;
}

.simulator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.moon-display {
    text-align: center;
}

.moon-phase {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.moon-surface {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    border-radius: 50%;
    position: relative;
}

.moon-shadow {
    position: absolute;
    top: 0;
    background: #2c3e50;
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.phase-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.phase-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

.controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.slider-container {
    margin-bottom: 2rem;
}

.slider-container label {
    display: block;
    color: white;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.phase-slider,
.speed-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.phase-slider::-webkit-slider-thumb,
.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

.day-counter {
    text-align: center;
    color: white;
    font-weight: 600;
    margin-top: 0.5rem;
}

.control-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.speed-control label {
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

#speedValue {
    color: white;
    font-weight: 600;
    min-width: 30px;
}

/* 时间轴样式 */
.phase-timeline {
    margin-top: 3rem;
    grid-column: 1 / -1;
}

.phase-timeline h3 {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.timeline {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.timeline-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 10px;
}

.timeline-item:hover,
.timeline-item.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.timeline-moon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    position: relative;
    overflow: hidden;
}

.new-moon {
    background: #2c3e50;
}

.first-quarter {
    background: linear-gradient(90deg, #f1c40f 50%, #2c3e50 50%);
}

.full-moon {
    background: #f1c40f;
}

.last-quarter {
    background: linear-gradient(90deg, #2c3e50 50%, #f1c40f 50%);
}

.timeline-item span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 知识百科样式 */
.knowledge-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 2rem;
    padding: 3rem;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.knowledge-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.knowledge-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.knowledge-card h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.knowledge-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.learn-more {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.learn-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: white;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    transition: all 0.3s ease;
}

.close:hover {
    transform: scale(1.2);
    color: #ff6b6b;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.modal-content h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
    color: #feca57;
}

.modal-content h4 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
    color: #ff6b6b;
}

.modal-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.modal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 游戏区域样式 */
.games-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 2rem;
    padding: 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.game-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.game-card p {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 2rem;
}

/* 拼图游戏样式 */
.puzzle-container {
    margin-bottom: 2rem;
}

.puzzle-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
}

.drop-zone {
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    color: white;
    font-size: 0.9rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    background: rgba(255, 255, 255, 0.3);
    border-color: #feca57;
}

.drop-zone.correct {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    font-size: 2rem;
}

.drop-zone.incorrect {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.puzzle-pieces {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.puzzle-piece {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-size: 2rem;
    cursor: grab;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.puzzle-piece:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.3);
}

.puzzle-piece.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* 记忆游戏样式 */
.memory-container {
    margin-bottom: 2rem;
}

.memory-board {
    display: none;
    gap: 10px;
    margin-bottom: 2rem;
}

.memory-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    perspective: 1000px;
}

.memory-card:hover {
    transform: scale(1.05);
}

.card-back,
.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backface-visibility: hidden;
    transition: transform 0.6s ease;
}

.card-back {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
}

.card-front {
    background: rgba(255, 255, 255, 0.9);
    transform: rotateY(180deg);
}

.memory-card.flipped .card-back {
    transform: rotateY(180deg);
}

.memory-card.flipped .card-front {
    transform: rotateY(0deg);
}

.memory-card.matched {
    opacity: 0.6;
    pointer-events: none;
}

.game-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto 1rem;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-result {
    text-align: center;
    margin-top: 1rem;
}

.success {
    color: #2ecc71;
    font-weight: 600;
    font-size: 1.2rem;
    animation: bounce 1s ease-in-out;
}

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

.game-stats {
    display: flex;
    justify-content: space-around;
    color: white;
    font-weight: 500;
    margin-top: 1rem;
}

/* 测验区域样式 */
.quiz-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 2rem;
    padding: 3rem;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-content {
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.quiz-question h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.6;
}

.answer-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-option {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: left;
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.answer-option.correct {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
}

.answer-option.incorrect {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
}

.answer-option:disabled {
    cursor: not-allowed;
}

.answer-explanation {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    color: white;
    margin-top: 1rem;
    border-left: 4px solid #feca57;
}

.quiz-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
}

.quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    color: white;
    font-weight: 500;
    min-width: 50px;
}

.quiz-result {
    text-align: center;
}

.quiz-final-result {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.score-display {
    margin: 2rem 0;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.score-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.score-message {
    font-size: 1.2rem;
    color: #feca57;
    font-weight: 600;
    margin-top: 1rem;
}

/* 页脚样式 */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #feca57;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-animation {
        margin-top: 2rem;
    }
    
    .simulator-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .puzzle-board,
    .puzzle-pieces {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline {
        flex-direction: column;
        gap: 1rem;
    }
    
    .timeline-item {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    section {
        margin: 1rem;
        padding: 2rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .moon-phase {
        width: 150px;
        height: 150px;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .puzzle-board,
    .puzzle-pieces {
        grid-template-columns: 1fr;
    }
    
    .timeline-moon {
        width: 40px;
        height: 40px;
    }
    
    section h2 {
        font-size: 2rem;
    }
}