/* ★ 全局样式重置 - 清除浏览器默认样式，保证所有设备显示一致，必写 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", "PingFang SC", "Helvetica Neue", sans-serif;
}
/* 全局变量：方便一键修改配色，改这里就可以换整个网页的色系 */
:root {
    --bg-color: #f9f7f5;
    --text-color: #33302e;
    --accent-color: #a87f68;
    --light-color: #e9e5e2;
    --white-color: #ffffff;
    --shadow-color: rgba(0,0,0,0.05);
    --transition: all 0.5s ease;
}
/* 暗黑模式变量 */
.dark-mode {
    --bg-color: #2d2b29;
    --text-color: #f1ebe8;
    --accent-color: #c9a895;
    --light-color: #4a4643;
    --white-color: #3d3a38;
    --shadow-color: rgba(0,0,0,0.2);
}
/* 页面基础样式 */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
    padding-top: 80px;
    transition: var(--transition);
}
/* 通用板块样式：所有板块统一间距和居中，保证风格一致 */
.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.section-header {
    text-align: center;
    margin-bottom: 60px;
}
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: "";
    width: 60px;
    height: 2px;
    background: var(--accent-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}
.section-desc {
    font-size: 16px;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 15px;
}
/* 通用按钮样式：所有按钮统一风格，hover变色+圆角+阴影 */
button {
    border: none;
    outline: none;
    cursor: pointer;
    background: var(--accent-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}
button:hover {
    background: #926c59;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 127, 104, 0.3);
}

/* ★★★ 核心样式1：顶部导航栏（固定悬浮+高亮+手机折叠，重中之重） */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--light-color);
    backdrop-filter: blur(8px);
    z-index: 9999;
    transition: var(--transition);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}
.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}
/* 导航链接hover下划线动画+变色 */
.nav-link:hover {
    color: var(--accent-color);
}
.nav-link::after {
    content: "";
    width: 0;
    height: 2px;
    background: var(--accent-color);
    position: absolute;
    bottom: -5px;
    left: 0;
    transition: var(--transition);
}
.nav-link:hover::after {
    width: 100%;
}
/* 导航当前板块高亮 */
.nav-link.active {
    color: var(--accent-color);
}
.nav-link.active::after {
    width: 100%;
}
.nav-buttons {
    display: flex;
    gap: 15px;
}
.mode-btn, .music-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
}
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border-bottom: 1px solid var(--light-color);
    padding: 20px;
    z-index: 9998;
}
.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--light-color);
}
.mobile-menu a.active {
    color: var(--accent-color);
}

/* ★★★ 核心样式2：首页轮播图封面（自动切换+渐变遮罩+文字居中） */
.banner {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 20px;
}
.banner-slider {
    width: 100%;
    height: 100%;
    position: relative;
}
.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: var(--transition);
}
.slider-item.active {
    opacity: 1;
}
.slider-item img {
    width: 100%;
	height: 100%;
    object-fit: cover;
}
.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white-color);
    z-index: 10;
    background: rgba(0,0,0,0.2);
    padding: 30px 50px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}
.banner-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}
.banner-subtitle {
    font-size: 18px;
    opacity: 0.9;
}

/* 照片墙整体容器：grid布局，每行3张，间距统一 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 自适应列数，最小300px */
    gap: 20px; /* 卡片之间的间距 */
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 每张照片+文字的卡片：垂直排列，圆角，溢出隐藏 */
.photo-item {
    display: flex;
    flex-direction: column; /* 照片在上，文字在下 */
    border-radius: 10px;
    overflow: hidden; /* 保证圆角不被内容撑破 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease; /* hover动画 */
}

/* 照片样式：铺满卡片宽度，固定高度，不变形 */
.photo-img {
    width: 100%;
    height: 250px; /* 照片高度固定，保证所有卡片一致 */
    object-fit: cover; /* 裁剪适配，不拉伸 */
}

/* 文字图例：紧贴照片底部，居中，背景浅灰 */
.photo-text {
    padding: 12px 0;
    font-size: 14px;
    color: #333;
    text-align: center;
    background-color: #f8f8f8;
}

/* hover特效：上浮+阴影加深 */
.photo-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 暗黑模式适配 */
.dark-mode .photo-item {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.dark-mode .photo-text {
    background-color: #2a2a2a;
    color: #fff;
}

/* 手机端适配：每行1张，缩小间距 */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .photo-img {
        height: 200px; /* 手机端照片略矮 */
    }
}

/* ★★★ 时光轴样式（升级款，更精致的节点+阴影） */
.timeline-container {
    border-left: 2px solid var(--light-color);
    padding-left: 30px;
    max-width: 800px;
    margin: 0 auto;
}
.timeline-item {
    margin-bottom: 40px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}
.timeline-item::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    left: -37px;
    top: 5px;
}
.timeline-time {
    font-size: 18px;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
}
.timeline-content {
    font-size: 16px;
    background: var(--white-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* ★★★ 留言板样式（可输入+提交+展示，交互核心） */
.message-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.message-input {
    width: 100%;
    height: 150px;
    border: 1px solid var(--light-color);
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    background: var(--white-color);
    color: var(--text-color);
    resize: none;
    transition: var(--transition);
}
.message-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(168, 127, 104, 0.2);
}
.message-list {
    width: 100%;
    background: var(--white-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
}
.message-item {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-color);
}

/* ★★★ 友谊里程碑样式（卡片式排版+hover特效） */
.milestone-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.milestone-card {
    background: var(--white-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    text-align: center;
    transition: var(--transition);
}
.milestone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
    color: var(--accent-color);
}
/* ★ 新增：里程碑故事弹窗样式（和照片弹窗风格统一） */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
}
/* 弹窗显示时的类 */
.story-modal.show {
    display: flex;
}
.story-modal-content {
    background: var(--white-color);
    width: 90%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    position: relative;
}
.story-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    background: var(--light-color);
    color: var(--text-color);
}
.story-modal-close:hover {
    background: var(--accent-color);
    color: var(--white-color);
}
.story-modal-title {
    color: var(--accent-color);
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}
.story-modal-text {
    font-size: 17px;
    line-height: 2;
    color: var(--text-color);
    text-align: center;
}
/* 优化里程碑卡片：鼠标变成手型，强调可点击 */
.milestone-card {
    cursor: pointer; /* 新增：鼠标悬浮变成手型 */
}

/* ★★★ 关于我们板块样式 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 17px;
    line-height: 2;
    background: var(--white-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

/* ★★★ 回到顶部按钮样式（固定右下角+hover放大） */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
.back-to-top.show {
    display: flex;
}

/* ★★★ 照片放大弹窗样式（全屏遮罩+无失真大图） */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}
.photo-modal.show {
    display: flex;
}
.modal-content {
    max-width: 90%;
    max-height: 90%;
}
.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    background: rgba(255,255,255,0.2);
}
.modal-close:hover {
    background: rgba(255,255,255,0.5);
}

/* ★★★ 重中之重：完整手机响应式适配（768px以下自动触发） */
@media (max-width: 768px) {
    .navbar {
        height: 70px;
    }
    .nav-menu {
        display: none;
    }
    .hamburger-btn {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .mobile-menu {
        display: block;
    }
    .banner {
        height: 300px;
    }
    .banner-title {
        font-size: 24px;
    }
    .banner-subtitle {
        font-size: 16px;
    }
    .section {
        padding: 60px 20px;
    }
    .section-title {
        font-size: 24px;
    }
    .photo-img {
        height: 200px;
    }
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
    .modal-close {
        top: 20px;
        right: 20px;
    }
}

/* 文字渐入特效类，配合JS使用 */
.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
/* 我眼中的他 模块样式 */
.personality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.personality-card {
    background: var(--white-color);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: all 0.3s ease;
    text-align: center;
}

.personality-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.card-title {
    color: var(--accent-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-desc {
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.7;
    opacity: 0.8;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .personality-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
/* 友谊计时模块样式 */
.timer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.timer-card {
    background: var(--white-color);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    transition: all 0.3s ease;
}

.timer-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.timer-icon {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.timer-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.timer-label {
    font-size: 15px;
    color: var(--text-color);
    opacity: 0.8;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .timer-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .timer-value {
        font-size: 30px;
    }
}