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

/* 全局加载动画样式 */
.loading-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-animation.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-heart {
    font-size: 60px;
    color: var(--accent-color);
    animation: loadingHeartbeat 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: bold;
    animation: loadingPulse 1s ease-in-out infinite;
}

@keyframes loadingHeartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* CSS变量定义 - 默认白天主题 */
:root {
    --bg-primary: linear-gradient(to bottom, #f5f5f5 0%, #e8f5e8 100%);
    --bg-pattern: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    --text-primary: #333;
    --text-secondary: #666;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --accent-color: #ff6b35;
    --scroll-progress-bg: #e8f5e8;
    --scroll-progress-text: #2ed573;
    --bottom-menu-bg: rgba(255, 255, 255, 0.95);
    --bottom-menu-shadow: rgba(0, 0, 0, 0.15);
    --bottom-menu-text: #666;
    --bottom-menu-hover-bg: #f0f0f0;
    --bottom-menu-hover-text: #333;
    --top-nav-bg: rgba(255, 255, 255, 0.95);
    --top-nav-shadow: rgba(0, 0, 0, 0.1);
    --nav-link-text: #333;
    --nav-link-hover-bg: #e8f5e8;
    --nav-link-hover-text: #2ed573;
    --nav-link-active-bg: #2ed573;
    --nav-link-active-text: white;

    --module-bg: rgba(255, 255, 255, 0.9);
    --module-shadow: rgba(0, 0, 0, 0.1);
    --module-hover-shadow: rgba(0, 0, 0, 0.15);
    --bubble-bg: rgba(255, 255, 255, 0.95);
    --bubble-shadow: rgba(0, 0, 0, 0.15);
    --bubble-text: #333;
}

/* 暗黑主题变量 */
body.dark-theme {
    --bg-primary: linear-gradient(to bottom, #1a1a1a 0%, #2d3436 100%);
    --bg-pattern: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    --text-primary: #f5f5f5;
    --text-secondary: #bdc3c7;
    --card-bg: rgba(45, 52, 54, 0.9);
    --card-shadow: rgba(0, 0, 0, 0.3);
    --accent-color: #ff6b35;
    --scroll-progress-bg: #34495e;
    --scroll-progress-text: #27ae60;
    --bottom-menu-bg: rgba(45, 52, 54, 0.95);
    --bottom-menu-shadow: rgba(0, 0, 0, 0.3);
    --bottom-menu-text: #bdc3c7;
    --bottom-menu-hover-bg: #34495e;
    --bottom-menu-hover-text: #ffffff;
    --top-nav-bg: rgba(45, 52, 54, 0.95);
    --top-nav-shadow: rgba(0, 0, 0, 0.3);
    --nav-link-text: #bdc3c7;
    --nav-link-hover-bg: #34495e;
    --nav-link-hover-text: #27ae60;
    --nav-link-active-bg: #27ae60;
    --nav-link-active-text: white;

    --module-bg: rgba(45, 52, 54, 0.9);
    --module-shadow: rgba(0, 0, 0, 0.3);
    --module-hover-shadow: rgba(0, 0, 0, 0.4);
    --bubble-bg: rgba(45, 52, 54, 0.95);
    --bubble-shadow: rgba(0, 0, 0, 0.3);
    --bubble-text: #f5f5f5;
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-primary);
    background-image: var(--bg-pattern);
    background-size: 20px 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 气泡消息样式 */
.bubble-container {
    position: absolute;
    top: 134px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
    z-index: 1000;
}

.bubble {
    position: absolute;
    background: var(--bubble-bg);
    padding: 6px 10px;
    border-radius: 25px;
    box-shadow: 0 4px 15px var(--bubble-shadow);
    font-size: 16px;
    color: var(--bubble-text);
    animation: bubbleFloat 3s ease-out forwards;
    opacity: 0;
    white-space: nowrap;
}

/* 不同气泡的颜色变化 */
.bubble:nth-child(1) {
    background: rgba(255, 182, 193, 0.95);
    left: calc(50% - 120px);
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    background: rgba(173, 216, 230, 0.95);
    left: calc(50% + 20px);
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    background: rgba(221, 160, 221, 0.95);
    left: calc(50% - 80px);
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    background: rgba(255, 228, 196, 0.95);
    left: calc(50% - 60px);
    animation-delay: 3s;
}

.bubble:nth-child(5) {
    background: rgba(152, 251, 152, 0.95);
    left: calc(50% + 40px);
    animation-delay: 4s;
}

.bubble:nth-child(6) {
    background: rgba(255, 218, 185, 0.95);
    left: calc(50% - 140px);
    animation-delay: 5s;
}

.bubble:nth-child(7) {
    background: rgba(224, 255, 255, 0.95);
    left: calc(50% + 60px);
    animation-delay: 6s;
}

.bubble:nth-child(8) {
    background: rgba(255, 222, 173, 0.95);
    left: calc(50% - 100px);
    animation-delay: 7s;
}

.bubble:nth-child(9) {
    background: rgba(240, 248, 255, 0.95);
    left: calc(50% + 10px);
    animation-delay: 8s;
}

.bubble:nth-child(10) {
    background: rgba(255, 239, 213, 0.95);
    left: calc(50% - 160px);
    animation-delay: 9s;
}

.bubble:nth-child(11) {
    background: rgba(255, 192, 203, 0.95);
    left: calc(50% + 80px);
    animation-delay: 10s;
}

/* 气泡上浮动画 */
@keyframes bubbleFloat {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-100px) scale(1);
    }
    100% {
        transform: translateY(-150px) scale(1);
        opacity: 0;
    }
}

.header {
    height: 45vh;
    background-image: url('../img/backimg.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 80px;
}

.couple-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 70px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20 60px;
}

.avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.avatar span {
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.heart {
    font-size: 40px;
    color: #ff4757;
    animation: heartbeat 1.5s ease-in-out infinite;
    margin: 0 30px;
}

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

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2px;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 导航栏样式 */
.top-nav {
    background: var(--top-nav-bg);
    border-radius: 25px;
    box-shadow: 0 4px 15px var(--top-nav-shadow);
    margin-bottom: 40px;
    padding: 10px;
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--nav-link-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-link:hover {
    background: var(--nav-link-hover-bg);
    color: var(--nav-link-hover-text);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--nav-link-active-bg);
    color: var(--nav-link-active-text);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(46, 213, 115, 0.3);
}

.love-time {
    text-align: center;
    margin-bottom: 30px;
}

.love-time h2 {
    color: var(--scroll-progress-text);
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 500;
}

.time-display {
    font-size: 30px;
    color: var(--text-primary);
    font-weight: bold;
    display: inline-block;
}

.modules {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    justify-content: center;
}

/* 5个模块在一行中均匀分布 */
.modules > * {
    grid-column: span 1;
    justify-self: center;
}

/* 确保模块链接占据整个网格单元格宽度 */
.module-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .modules {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .module {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 15px;
    }
    
    .module-icon {
        margin-bottom: 0;
        font-size: 28px;
    }
    
    .module-content {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .modules {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.module {
    background: var(--module-bg);
    padding: 20px 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--module-shadow);
    text-align: center;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.module-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--module-hover-shadow);
}

.module-icon {
    font-size: 45px;
    margin-bottom: 10px;
}

.module-title {
    font-size: 25px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.module-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer {
    text-align: center;
    margin-top: 20px;
}

.footer-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 5px 0;
}





/* 底部菜单样式 */
.bottom-menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: var(--bottom-menu-bg);
    border-radius: 35px;
    box-shadow: 0 4px 15px var(--bottom-menu-shadow);
    padding: 12px 20px;
    z-index: 999;
}

.bottom-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--bottom-menu-text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.bottom-menu-button:hover {
    background: var(--bottom-menu-hover-bg);
    color: var(--bottom-menu-hover-text);
    transform: translateY(-2px);
}

.bottom-menu-button.active {
    background: var(--accent-color);
    color: white;
}

/* 滚动进度按钮样式 */
.scroll-progress {
    min-width: 50px;
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
    background: var(--scroll-progress-bg);
    color: var(--scroll-progress-text);
    font-weight: bold;
    font-size: 14px;
}

/* 月亮图标样式 */
.moon-icon {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 6px 6px 0 0 currentColor;
}

/* 菜单弹窗样式 */
.menu-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.menu-popup.show {
    display: flex;
}

.popup-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px var(--card-shadow);
    position: relative;
    min-width: 300px;
    max-width: 90vw;
    animation: popupShow 0.3s ease-out;
}

@keyframes popupShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background: var(--bottom-menu-hover-bg);
    color: var(--bottom-menu-hover-text);
    transform: rotate(90deg);
}

.popup-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.popup-menu-button {
    width: 60px;
    height: 60px;
    border: none;
    background: var(--bottom-menu-hover-bg);
    border-radius: 15px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bottom-menu-text);
    box-shadow: 0 4px 10px var(--bottom-menu-shadow);
}

.popup-menu-button:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--bottom-menu-shadow);
}

.popup-menu-button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--bottom-menu-shadow);
}

/* 弹窗菜单按钮active状态 */
.popup-menu-button.active {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
}

/* 太阳图标样式 */
.sun-icon {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

/* 底部菜单响应式样式 */
@media (max-width: 768px) {
    .bottom-menu {
        padding: 8px 16px;
    }
    
    .bottom-menu-button {
        width: 42px;
        height: 42px;
        font-size: 16px;
        margin: 0 4px;
    }
    
    .scroll-progress {
        min-width: 55px;
        padding: 0 12px;
        font-size: 14px;
    }
    
    .moon-icon {
        width: 20px;
        height: 20px;
        box-shadow: 6px 6px 0 0 currentColor;
    }
    
    .sun-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .bottom-menu {
        padding: 7px 12px;
    }
    
    .bottom-menu-button {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin: 0 4px;
    }
    
    .scroll-progress {
        min-width: 45px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .moon-icon {
        width: 18px;
        height: 18px;
        box-shadow: 5px 5px 0 0 currentColor;
        top: -4px;
        left: -5px;
    }
    
    .sun-icon {
        width: 18px;
        height: 18px;
        top: 1px;
        left: 0px;
    }
}



@media (max-width: 768px) {
    .header {
    }
    
    .couple-avatar {
        padding: 15px 50px;
    }
    
    .avatar img {
        width: 60px;
        height: 60px;
    }
    
    .heart {
        font-size: 24px;
        margin: 0 30px;
    }
    
    .time-display {
        font-size: 30px;
        padding: 15px 5px;
    }
    
    .modules {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        padding: 0 70px;
    }
    
    /* 导航栏响应式样式 */
    .top-nav {
        margin-bottom: 30px;
        padding: 8px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .nav-list {
        gap: 3px;
    }
}

@media (max-width: 280px) {
    .couple-avatar {
        flex-direction: column;
        padding: 20px;
    }
    
    .heart {
        margin: 10px 0;
    }
    
    /* 导航栏极小屏幕样式 */
    .nav-link {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .nav-list {
        gap: 2px;
    }
    
    .top-nav {
        padding: 5px;
    }
}