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

/* 星空 */
.starfield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    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)); }
}

/* 河灯 + 水面 */
.zhongyuan-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.zhongyuan-sky canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.zhongyuan-hint {
    position: absolute;
    bottom: 28%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-calligraphy);
    font-size: 14px;
    color: var(--color-gold-soft);
    letter-spacing: 6px;
    opacity: 0.7;
    text-shadow: 0 0 8px rgba(232, 216, 184, 0.6);
    animation: hintPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.95; }
}

/* 莲花河灯 */
.river-lantern {
    position: absolute;
    bottom: 60px;
    width: 60px;
    height: 80px;
    animation: riverDrift 9s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(200, 74, 30, 0.7));
}

.lantern-1 { left: 12%; animation-delay: 0s; }
.lantern-2 { left: 48%; animation-delay: -3s; bottom: 40px; transform: scale(0.85); }
.lantern-3 { right: 12%; animation-delay: -6s; }

@keyframes riverDrift {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-14px) rotate(2deg); }
}

.lantern-light {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #fff5e8 0%, #ffaa3c 35%, #c84a1e 70%, transparent 90%);
    border-radius: 50%;
    box-shadow:
        0 0 24px rgba(255, 170, 60, 0.9),
        0 0 48px rgba(200, 74, 30, 0.5);
    animation: riverGlow 2.4s ease-in-out infinite;
}

@keyframes riverGlow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

.lantern-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 28px;
    background: linear-gradient(180deg, #c84a1e 0%, #8b0000 100%);
    border-radius: 0 0 28px 28px;
    box-shadow:
        inset 0 -6px 12px rgba(74, 0, 0, 0.6),
        0 4px 12px rgba(139, 0, 0, 0.4);
}

.lantern-base::before,
.lantern-base::after {
    content: '';
    position: absolute;
    top: -6px;
    width: 14px;
    height: 22px;
    background: linear-gradient(180deg, #ffaa3c 0%, #c84a1e 100%);
    border-radius: 50% 50% 0 0;
    box-shadow: inset 0 2px 4px rgba(255, 245, 232, 0.6);
}

.lantern-base::before { left: 8px; transform: rotate(-20deg); }
.lantern-base::after { right: 8px; transform: rotate(20deg); }

/* 灯笼 */
.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, #ffc0e0 0%, #ff7fb3 50%, #c84a8e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(255, 127, 179, 0.5),
        inset 0 -10px 20px rgba(142, 46, 106, 0.5),
        inset 0 10px 20px rgba(255, 240, 248, 0.3);
    position: relative;
}

.lantern-body::before,
.lantern-body::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 6px;
    background: #c84a8e;
    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, 192, 224, 0.8);
}

.lantern-tassel {
    width: 2px;
    height: 30px;
    background: #c84a8e;
    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, 192, 224, 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, 192, 224, 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, 192, 224, 0.08);
    border: 1px solid rgba(255, 192, 224, 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, 192, 224, 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, 192, 224, 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, 192, 224, 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, 74, 142, 0.04) 100%);
    border: 1px solid rgba(255, 192, 224, 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, 192, 224, 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, 240, 248, 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, 192, 224, 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, 192, 224, 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);
}

/* ==========================================
   河灯雨彩蛋
   ========================================== */
.zhongyuan-fall {
    position: fixed;
    font-size: 36px;
    pointer-events: none;
    z-index: 1000;
    animation: zhongyuanFall 3s ease-in forwards;
}

@keyframes zhongyuanFall {
    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);
    }
}

/* ==========================================
   今日月相 + 每日一句
   ========================================== */
.daily-section {
    padding: 80px 0;
    background: linear-gradient(180deg,
        var(--color-night-deep) 0%,
        var(--color-night) 100%);
}

.daily-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.daily-card {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05) 0%,
        rgba(200, 74, 142, 0.04) 100%);
    border: 1px solid rgba(255, 192, 224, 0.2);
    border-radius: 18px;
    padding: 32px 28px;
}

.daily-label {
    font-family: var(--font-calligraphy);
    font-size: 22px;
    color: var(--color-gold);
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 0 12px rgba(255, 192, 224, 0.3);
}

/* 月相 */
.lunar-phase {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lunar-phase-visual {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        #fff0f8 0%, #ffe4f0 50%, #d4739a 100%);
    box-shadow:
        0 0 24px rgba(255, 192, 224, 0.5),
        inset 0 -8px 16px rgba(212, 115, 154, 0.4),
        inset 0 8px 16px rgba(255, 240, 248, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}

.lunar-phase-shadow {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #0a0518;
    border-radius: 50%;
    transform-origin: center;
    transition: clip-path 0.4s;
}

.lunar-phase-info {
    flex: 1;
    min-width: 0;
}

.lunar-phase-name {
    font-family: var(--font-calligraphy);
    font-size: 28px;
    color: var(--color-gold);
    margin-bottom: 6px;
}

.lunar-phase-meta {
    font-size: 12px;
    color: var(--color-cream);
    opacity: 0.7;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.lunar-phase-desc {
    font-size: 13px;
    color: var(--color-gold-soft);
    letter-spacing: 1px;
}

/* 每日一句 */
.daily-quote {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--color-gold);
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.daily-quote-text {
    font-family: var(--font-poem);
    font-size: 18px;
    color: var(--color-cream);
    line-height: 1.8;
    margin-bottom: 8px;
}

.daily-quote-author {
    font-size: 13px;
    color: var(--color-gold-soft);
    letter-spacing: 2px;
    text-align: right;
}

.daily-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .daily-grid { grid-template-columns: 1fr; }
    .daily-card { padding: 24px 20px; }
    .lunar-phase-visual { width: 72px; height: 72px; }
    .lunar-phase-name { font-size: 24px; }
    .daily-quote-text { font-size: 16px; }
}
@media (max-width: 968px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .zhongyuan-sky { display: none; }
    .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; }
}

/* ==========================================
   晨曦主题覆盖
   ========================================== */
html[data-theme="light"] body {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe8d0 35%, #ffd9b3 70%, #f5d5a8 100%);
}

html[data-theme="light"] .hero-title,
html[data-theme="light"] .hero-poem {
    color: var(--color-red-deep);
}

html[data-theme="light"] .hero-subtitle {
    color: var(--color-text);
    opacity: 0.75;
}

html[data-theme="light"] .countdown-target {
    color: var(--color-text);
}

html[data-theme="light"] .countdown-item {
    background: rgba(255, 250, 240, 0.7);
    border-color: rgba(200, 74, 142, 0.2);
}

html[data-theme="light"] .countdown-label {
    color: var(--color-text);
    opacity: 0.7;
}

html[data-theme="light"] .lantern-body {
    background: linear-gradient(135deg, var(--color-red) 0%, var(--color-orange) 100%);
    color: var(--color-cream);
}

html[data-theme="light"] .module-card {
    background: rgba(255, 245, 250, 0.85);
    border-color: rgba(200, 74, 142, 0.2);
}

html[data-theme="light"] .module-card:hover {
    border-color: var(--color-red);
}

html[data-theme="light"] .module-title {
    color: var(--color-red-deep);
}

html[data-theme="light"] .module-count,
html[data-theme="light"] .module-desc {
    color: var(--color-text);
    opacity: 0.8;
}

html[data-theme="light"] .feature-item {
    background: rgba(255, 245, 250, 0.85);
    border-color: rgba(200, 74, 142, 0.2);
}

html[data-theme="light"] .feature-num {
    color: var(--color-red-deep);
}

html[data-theme="light"] .feature-label {
    color: var(--color-text);
}

html[data-theme="light"] .daily-card {
    background: rgba(255, 245, 250, 0.85);
    border-color: rgba(200, 74, 142, 0.2);
}

html[data-theme="light"] .daily-label {
    color: var(--color-text);
    opacity: 0.85;
}

html[data-theme="light"] .daily-quote-text {
    color: var(--color-red-deep);
}

html[data-theme="light"] .daily-quote-author {
    color: var(--color-text);
    opacity: 0.7;
}

html[data-theme="light"] .lunar-phase-name {
    color: var(--color-red-deep);
}

html[data-theme="light"] .lunar-phase-meta {
    color: var(--color-text);
    opacity: 0.7;
}

html[data-theme="light"] .lunar-phase-desc {
    color: var(--color-text);
    opacity: 0.8;
}

html[data-theme="light"] .speak-btn,
html[data-theme="light"] .share-btn {
    background: rgba(200, 74, 142, 0.08);
    border-color: rgba(200, 74, 142, 0.3);
    color: var(--color-text);
}

html[data-theme="light"] .speak-btn:hover,
html[data-theme="light"] .share-btn:hover {
    background: rgba(200, 74, 142, 0.15);
}
