/* style.css - 完整修复版 */

/* --- 1. 全局变量与环境 --- */
:root {
    --bg-milky: #FDFBF7;   /* 乳白背景 */
    --text-soft: #555555;  /* 柔和文字 */
    --accent-pink: #FFB7C5; 
    --accent-blue: #AEC6CF;
    --polaroid-white: #ffffff;
    --nav-height: 80px;    /* 底部留白高度 */
    
    /* 字体定义 */
    --title-font: 'Fredoka', cursive;
    --body-font: 'Nunito', sans-serif;
    --cute-font: 'Patrick Hand', cursive;
}

body {
    background-color: var(--bg-milky);
    color: var(--text-soft);
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
    /* 关键：防止底部导航遮挡内容 */
    padding-bottom: var(--nav-height); 
    overflow-x: hidden; /* 防止横向滚动条 */
}

/* --- 2. 页面容器 --- */
.page-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    padding: 20px;
}

/* --- 3. 拍立得核心样式 (之前可能丢失的部分) --- */
.polaroid-wrapper {
    width: 280px;
    height: 360px;
    perspective: 1000px; /* 3D 效果必备 */
    cursor: pointer;
    position: relative;
    /* 默认给个过渡，让旋转更自然 */
    transition: transform 0.3s ease;
}

.polaroid-wrapper:hover {
    z-index: 100; /* 悬停时层级最高 */
    /* 悬停时稍微放大并扶正，模拟拿起来的效果 */
    transform: scale(1.05) rotate(0deg) !important; 
}

/* 内部翻转容器 */
.polaroid-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
    background-color: var(--polaroid-white);
    border-radius: 12px;
    border: 8px solid #fff; /* 加粗白边 */
}

/* 激活翻转状态 */
.polaroid-wrapper.flipped .polaroid-inner {
    transform: rotateY(180deg);
}

/* 正面与背面公共属性 */
.polaroid-front, .polaroid-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background-color: #fff;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
}

/* --- 正面样式 --- */
.photo-frame {
    background: #f0f0f0;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #eee;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.meta-info {
    margin-top: 15px;
}

.date-stamp {
    font-family: var(--body-font);
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: #edf5f7;
    padding: 2px 8px;
    border-radius: 10px;
}

.caption {
    font-family: var(--cute-font);
    font-size: 1.4rem;
    margin-top: 5px;
    line-height: 1.2;
}

.action-hint {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--accent-pink);
    font-family: var(--title-font);
}

/* --- 背面样式 --- */
.polaroid-back {
    transform: rotateY(180deg);
    background-color: #fffdf0;
    background-image: linear-gradient(#e8e8e8 1px, transparent 1px);
    background-size: 100% 25px;
    border: 4px solid var(--accent-blue);
    text-align: left;
    overflow-y: auto;
}

.back-title {
    font-family: var(--title-font);
    font-size: 1rem;
    color: var(--accent-blue);
    width: 100%;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px dashed #ddd;
}

/* --- 4. 底部导航栏 (Dock) --- */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 400px;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    border-radius: 35px;
    box-shadow: 0 10px 30px rgba(174, 198, 207, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border: 1px solid #fff