/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Lato:wght@300;400;700&display=swap');

:root {
    --bg-color: #f4f1ea;
    --paper-color: #fef5d4;
    --text-color: #2c3e50;
    --accent-color: #8b4513;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    background-color: var(--bg-color);
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    display: block; /* 取消之前的 flex 居中，改为流式布局 */
    color: var(--text-color);
    overflow-x: hidden;
}

/* 导航栏 */
.navbar {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
}

.logo {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

.nav-links a {
    margin-left: 2rem;
    text-decoration: none;
    color: #555;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Hero 区域 */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1518621736915-f3b1c41bfd00?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.5rem;
    margin-top: 10px;
    font-weight: 300;
}

/* 主容器 */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 信纸区域优化 */
.letter-section {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
}

.letter-container {
    background-color: var(--paper-color);
    width: 100%;
    max-width: 800px;
    padding: 60px 80px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    line-height: 2em;
    transform: rotate(-1deg); /* 稍微倾斜一点，更自然 */
    transition: transform 0.3s;
}

.letter-container:hover {
    transform: rotate(0deg);
}

/* 邮票装饰 */
.stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 100px;
    border: 4px dotted #d4c5b0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4c5b0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transform: rotate(10deg);
    opacity: 0.7;
}

.letter-header {
    height: 4em;
    margin-bottom: 1em;
    text-align: center;
}

.letter-header h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 3em;
    margin: 0;
    color: var(--accent-color);
    line-height: 1.5em;
}

.letter-content {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: var(--text-color);
}

.letter-content p {
    margin: 0;
    line-height: 2em;
}

.signature {
    margin-top: 3em;
    text-align: right;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8em;
    color: var(--accent-color);
}

/* 照片墙区域 */
.gallery-section {
    margin-bottom: 80px;
    text-align: center;
}

.section-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 40px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 20px;
}

/* 拍立得风格 */
.polaroid {
    background: white;
    padding: 15px 15px 50px 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.polaroid:nth-child(odd) {
    transform: rotate(2deg);
}

.polaroid:nth-child(even) {
    transform: rotate(-2deg);
}

.polaroid:hover {
    transform: scale(1.05) rotate(0deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 10;
}

.polaroid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    filter: sepia(20%); /* 复古滤镜 */
}

.caption {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 1.2rem;
    color: #555;
}

/* 底部 */
footer {
    background-color: #333;
    color: #aaa;
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .hero-content h1 { font-size: 2.5rem; }
    .letter-container { padding: 30px 20px; }
    .nav-links { display: none; } /* 简单隐藏导航链接 */
    .navbar { justify-content: center; }
}
