/* ==========================================
   首页样式
   ========================================== */

/* 星空 */
.stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg,
        var(--color-night-deep) 0%,
        var(--color-night) 40%,
        var(--color-night-mid) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 云 */
.clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: cloudFloat 40s infinite linear;
}

.cloud-1 { width: 400px; height: 150px; top: 15%; left: -200px; animation-duration: 50s; }
.cloud-2 { width: 300px; height: 100px; top: 60%; left: -150px; animation-duration: 70s; animation-delay: -25s; }
.cloud-3 { width: 350px; height: 120px; top: 35%; left: -180px; animation-duration: 60s; animation-delay: -40s; }

@keyframes cloudFloat {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 400px)); }
}

/* 月亮 */
.moon-wrapper {
    position: absolute;
    top: 12%;
    right: 15%;
    width: 280px;
    height: 280px;
    animation: moonFloat 8s ease-in-out infinite;
}

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

.moon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 80px rgba(255, 165, 0, 0.3));
    animation: moonGlow 4s ease-in-out infinite;
}

@keyframes moonGlow {
    0%, 100% { filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 80px rgba(255, 165, 0, 0.3)); }
    50% { filter: drop-shadow(0 0 60px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 120px rgba(255, 165, 0, 0.5)); }
}

.rabbit {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    opacity: 0.85;
    animation: rabbitHop 3s ease-in-out infinite;
}

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

/* 灯笼 */
.lantern {
    position: absolute;
    top: 0;
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lanternSwing 4s ease-in-out infinite;
    transform-origin: top center;
}

.lantern-left { left: 8%; animation-delay: 0s; }
.lantern-right { right: 8%; animation-delay: -2s; }

@keyframes lanternSwing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.lantern-string {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, transparent, #8b7355);
}

.lantern-body {
    width: 60px;
    height: 70px;
    background: linear-gradient(180deg, #ff6b35 0%, #c8102e 50%, #8b0000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(255, 107, 53, 0.5),
        inset 0 -10px 20px rgba(139, 0, 0, 0.5),
        inset 0 10px 20px rgba(255, 200, 100, 0.3);
    position: relative;
}

.lantern-body::before,
.lantern-body::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 6px;
    background: #8b0000;
    border-radius: 3px;
}

.lantern-body::before { top: -3px; }
.lantern-body::after { bottom: -3px; }

.lantern-body span {
    font-family: var(--font-calligraphy);
    font-size: 32px;
    color: var(--color-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.lantern-tassel {
    width: 2px;
    height: 30px;
    background: #8b0000;
    position: relative;
}

.lantern-tassel::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--color-gold);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

/* Hero 内容 */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 24px;
    max-width: 900px;
    margin-top: 80px;
}

.hero-subtitle {
    font-size: 16px;
    letter-spacing: 8px;
    color: var(--color-gold-soft);
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeIn 1.5s 0.3s forwards;
}

.hero-title {
    font-family: var(--font-calligraphy);
    font-size: clamp(72px, 14vw, 180px);
    font-weight: normal;
    color: var(--color-gold);
    letter-spacing: 16px;
    margin-bottom: 32px;
    text-shadow:
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 165, 0, 0.3),
        0 4px 0 var(--color-red-deep);
    opacity: 0;
    animation: titleReveal 2s 0.6s forwards;
}

@keyframes titleReveal {
    from { opacity: 0; transform: scale(0.8) translateY(30px); letter-spacing: 40px; }
    to { opacity: 1; transform: scale(1) translateY(0); letter-spacing: 16px; }
}

.hero-poem {
    font-family: var(--font-poem);
    font-size: clamp(18px, 2.5vw, 26px);
    color: var(--color-cream);
    letter-spacing: 4px;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeIn 1.5s 1.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* 倒计时 */
.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeIn 1.5s 1.5s forwards;
}

.countdown-item {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px 28px;
    min-width: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.countdown-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.6);
}

.countdown-num {
    display: block;
    font-family: var(--font-title);
    font-size: 42px;
    font-weight: bold;
    color: var(--color-gold);
    text-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    display: block;
    font-size: 14px;
    color: var(--color-cream);
    margin-top: 6px;
    letter-spacing: 4px;
}

.countdown-target {
    font-size: 14px;
    color: var(--color-gold-soft);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 1.5s 1.8s forwards;
}

#target-date { color: var(--color-gold); font-weight: bold; padding: 0 4px; }

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    animation: fadeIn 1.5s 2.5s forwards;
}

.scroll-hint span {
    display: block;
    font-size: 12px;
    color: var(--color-cream);
    letter-spacing: 4px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.arrow-down {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    border-right: 2px solid var(--color-gold);
    border-bottom: 2px solid var(--color-gold);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.7; }
    50% { transform: rotate(45deg) translate(8px, 8px); opacity: 1; }
}

/* ==========================================
   模块导览卡片
   ========================================== */
.modules-section {
    padding: 100px 0 120px;
    background: linear-gradient(180deg,
        var(--color-night-mid) 0%,
        var(--color-night) 50%,
        var(--color-night-deep) 100%);
}

.modules-title {
    font-family: var(--font-calligraphy);
    font-size: clamp(36px, 5vw, 56px);
    color: var(--color-gold);
    text-align: center;
    letter-spacing: 8px;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.modules-subtitle {
    text-align: center;
    color: var(--color-gold-soft);
    font-size: 14px;
    letter-spacing: 4px;
    opacity: 0.7;
    margin-bottom: 80px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.module-card {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.04) 0%,
        rgba(200, 16, 46, 0.04) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 40px 32px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s;
    display: block;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-red) 100%);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.module-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-gold);
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.15);
}

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

.module-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.4s;
}

.module-card:hover .module-icon {
    transform: scale(1.2) rotate(-8deg);
}

.module-title {
    font-family: var(--font-title);
    font-size: 22px;
    color: var(--color-gold);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.module-count {
    font-size: 12px;
    color: var(--color-gold-soft);
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 12px;
}

.module-desc {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255, 248, 220, 0.8);
}

.module-link {
    margin-top: 16px;
    display: inline-block;
    color: var(--color-gold);
    font-size: 13px;
    letter-spacing: 2px;
}

/* ==========================================
   特性区域
   ========================================== */
.features-section {
    padding: 80px 0;
    background: var(--color-night-deep);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-item {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 215, 0, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 14px;
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-4px);
    border-color: var(--color-gold);
}

.feature-num {
    font-family: var(--font-calligraphy);
    font-size: 40px;
    color: var(--color-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.feature-label {
    font-size: 14px;
    color: var(--color-cream);
    letter-spacing: 2px;
}

/* ==========================================
   滚动渐显
   ========================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s, transform 0.8s;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   月饼雨彩蛋
   ========================================== */
.mooncake-fall {
    position: fixed;
    font-size: 36px;
    pointer-events: none;
    z-index: 1000;
    animation: mooncakeDrop 3s ease-in forwards;
}

@keyframes mooncakeDrop {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(0.3);
    }
    15% {
        opacity: 1;
        transform: translate(calc(var(--dx) * 0.3), 80px) rotate(calc(var(--rot) * 0.3)) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), 100vh) rotate(var(--rot)) scale(0.8);
    }
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 968px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .moon-wrapper { width: 200px; height: 200px; top: 8%; right: 5%; }
    .lantern { display: none; }
    .countdown { gap: 12px; }
    .countdown-item { padding: 16px 20px; min-width: 70px; }
    .countdown-num { font-size: 28px; }
}

@media (max-width: 568px) {
    .modules-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr; }
}
