/* 基础样式重置与变量定义 */
:root {
    --primary: #ff6b8b; /* 主色调：粉色 */
    --primary-light: #ffcce0; /* 浅粉色 */
    --text-color: #333; /* 主要文字色 */
    --text-light: #666; /* 次要文字色 */
    --white: #fff; /* 白色 */
    --snow-color: rgba(173, 216, 230, 0.95); /* 淡蓝色雪花 */
    --bg-color: #fef7f9; /* 背景色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--bg-color);
    /* 淡粉色方格背景装饰 */
    background-image:
        linear-gradient(rgba(255, 183, 197, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 183, 197, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 70px; /* 为移动端导航预留空间 */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式（仅PC端） */
.header {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(255, 107, 139, 0.1);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none; /* 移动端隐藏整个header */
}

/* PC端显示header */
@media (min-width: 769px) {
    .header {
        display: block;
    }
    .header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* PC端导航（仅PC端显示） */
.pc-nav {
    display: flex;
    gap: 30px;
}

.pc-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.pc-nav a:hover, .pc-nav a.active {
    color: var(--primary);
}

/* 移动端导航（默认隐藏，移动端显示） */
.mobile-nav {
    display: none;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff; /* 微信式纯白背景 */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
    z-index: 999;
    margin-bottom: 20px;
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
}

.mobile-nav a::before {
    content: attr(data-icon);
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.mobile-nav a.active {
    color: var(--primary);
}

/* 首页样式 */
.home-section {
    padding: 60px 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.couple-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.person-card {
    text-align: center;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    margin-bottom: 10px;
}

.person-name {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.person-slogan {
    font-size: 0.9rem;
    color: var(--text-light);
}

.heart-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* 计时模块（毛玻璃版） */
.time-display {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    padding: 30px 40px;
    margin-bottom: 60px;
    box-shadow: 0 8px 30px rgba(255, 107, 139, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: fit-content;
    max-width: 90%;
}

.time-display h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.time-numbers {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.time-item {
    background-color: var(--white);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.time-item span:first-child {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    display: block;
}

.time-unit {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 功能卡片样式（仅PC端显示） */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
    padding: 0 20px;
    display: none; /* 移动端隐藏 */
}

@media (min-width: 769px) {
    .features {
        display: grid;
    }
}

.feature-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(255, 107, 139, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.feature-card h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 相册样式 */
.album-section {
    padding: 60px 0;
    display: none;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 40px;
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--primary-light);
    margin: 10px auto;
    border-radius: 3px;
}

.album-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 20px;
}

.album-date-title {
    color: var(--text-color);
    font-size: 1.3rem;
    padding-left: 15px;
    border-left: 4px solid var(--primary);
    margin-bottom: 15px;
}

.album-date-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.album-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.album-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.album-item:hover {
    transform: scale(1.03);
}

.album-item img:hover {
    transform: scale(1.05);
}

/* 留言板样式 */
.message-section {
    padding: 60px 0;
    display: none;
    position: relative;
    z-index: 1;
}

.message-form {
    max-width: 600px;
    margin: 0 auto 50px;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #ff5278;
}

.messages-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-item {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
}

.message-author {
    font-weight: bold;
    color: var(--primary);
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.message-content {
    color: var(--text-color);
    line-height: 1.8;
}

/* 关于我们样式 - 修复情侣头像横向排列 */
.about-section {
    padding: 60px 0;
    display: none;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* 情侣信息容器：默认/PC端横向排列 */
.couple-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
    flex-wrap: nowrap; /* 禁止换行 */
}

.person {
    text-align: center;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-light);
    margin-bottom: 20px;
}

.couple-info h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.couple-info p {
    color: var(--text-light);
    margin-bottom: 5px;
}

.love-story {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

.love-story h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
}

.love-story p {
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
}

/* 雪花效果样式 */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.snowflake {
    position: absolute;
    background-color: var(--snow-color);
    border-radius: 50%;
    animation: snowfall linear infinite;
    opacity: 0.9;
    width: calc(var(--size) * 1px);
    height: calc(var(--size) * 1px);
}

@keyframes snowfall {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* 图片预览弹窗样式 */
.image-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 2rem;
    box-sizing: border-box;
}

.preview-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: var(--white);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-close:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.preview-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* 页脚样式（仅PC端显示） */
.footer {
    background-color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: 15px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    box-shadow: 0 -2px 8px rgba(255, 183, 197, 0.1);
    position: fixed;
    bottom: 0;
    width: 100%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    display: none; /* 移动端隐藏 */
}

@media (min-width: 769px) {
    .footer {
        display: block;
        body {
            padding-bottom: 60px;
        }
    }
}

/* 页面切换动画样式 */
section {
    transition: opacity 0.3s ease-in-out;
}

section.active {
    display: block !important;
    opacity: 1;
}

#home.active {
    display: flex !important;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===================== 移动端响应式样式 ===================== */
@media (max-width: 768px) {
    /* 显示移动端导航 */
    .mobile-nav {
        display: flex;
    }

    /* 调整body内边距 */
    body {
        padding-bottom: 70px;
        background-size: 15px 15px;
    }

    /* 计时部分排成一行 */
    .time-display {
        padding: 20px 15px;
        margin-bottom: 40px;
    }

    .time-display h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .time-numbers {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding: 0 5px;
        width: 100%;
    }

    .time-item {
        min-width: 60px;
        padding: 8px 10px;
    }

    .time-item span:first-child {
        font-size: 1.2rem;
    }

    .time-unit {
        font-size: 0.7rem;
    }

    /* 首页情侣头像适配（强制横向一行排列） */
    .couple-avatar-section {
        display: flex; /* 强制弹性布局 */
        flex-direction: row; /* 横向排列 */
        flex-wrap: nowrap; /* 禁止换行 */
        align-items: center; /* 垂直居中 */
        justify-content: center; /* 水平居中 */
        gap: 10px; /* 元素间距 */
        margin-bottom: 30px;
        width: 100%; /* 占满宽度 */
        padding: 0 10px; /* 左右内边距 */
        overflow-x: auto; /* 极端小屏时允许横向滚动 */
        scrollbar-width: none; /* 隐藏滚动条（Firefox） */
    }

    .couple-avatar-section::-webkit-scrollbar {
        display: none; /* 隐藏滚动条（Chrome/Safari） */
    }

    .avatar-img {
        width: 80px;
        height: 80px;
        flex-shrink: 0; /* 禁止头像缩小 */
    }

    .heart-icon {
        font-size: 1.2rem;
        flex-shrink: 0; /* 禁止爱心缩小 */
    }

    .person-card {
        flex-shrink: 0; /* 禁止卡片缩小 */
        width: fit-content; /* 宽度自适应内容 */
    }

    .person-name {
        font-size: 1rem;
        white-space: nowrap; /* 名字不换行 */
    }

    .person-slogan {
        font-size: 0.8rem;
        white-space: nowrap; /* 标语不换行 */
    }

    /* 关于我们页面 - 情侣头像横向排列修复 */
    .couple-info {
        flex-direction: row; /* 改为横向（之前是column） */
        flex-wrap: nowrap; /* 禁止换行 */
        gap: 15px; /* 缩小移动端间距 */
        width: 100%;
        padding: 0 10px;
        overflow-x: auto; /* 小屏允许横向滚动 */
        scrollbar-width: none; /* 隐藏滚动条（Firefox） */
        align-items: center;
        justify-content: center;
    }

    .couple-info::-webkit-scrollbar {
        display: none; /* 隐藏滚动条（Chrome/Safari） */
    }

    .avatar {
        width: 100px; /* 移动端缩小头像 */
        height: 100px;
        flex-shrink: 0; /* 禁止头像缩小 */
        margin-bottom: 15px;
    }

    .person {
        flex-shrink: 0; /* 禁止信息卡片缩小 */
        width: fit-content;
    }

    .couple-info h3 {
        font-size: 1rem;
        white-space: nowrap; /* 名字不换行 */
    }

    .couple-info p {
        font-size: 0.7rem;
        white-space: nowrap; /* 信息不换行 */
    }

    .love-icon {
        font-size: 1.2rem;
        flex-shrink: 0; /* 禁止爱心缩小 */
    }

    /* 其他页面适配 */
    .album-section, .message-section, .about-section {
        padding: 40px 0;
    }

    .album-date-photos {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .album-item img {
        height: 150px;
    }
}