/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #7f8c8d;
    --light-color: #f9f9f9;
    --dark-color: #34495e;
    --gray-color: #95a5a6;
    --background-color: #ffffff;
    --card-color: #f9f9f9;
    --font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--primary-color);
    background-color: var(--background-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 为相册页面添加滚动条 */
body.index-page {
    overflow: auto;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 头部样式 */
.hero {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 10px 0;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap;
}

/* 导航栏样式 */
.nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #2E004E;
}

.nav a.active {
    color: #2E004E;
    font-weight: 600;
}

/* 标题链接样式 */
.title-link {
    text-decoration: none;
    color: inherit;
}

.hero h1 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 2px;
    color: #2E004E;
    flex-shrink: 0;
}

/* 部分标题样式 */
.section-title {
    display: none;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 成长记录部分样式 */
.journal-section {
    padding: 30px 0;
    background-color: var(--background-color);
}

.journal-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.8rem;
}

/* 宽度过渡 */
.journal-item-wide-2 {
    grid-column: span 2;
}

.journal-item-wide-3 {
    grid-column: span 3;
}

.journal-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #f0f0f0;
}

.journal-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.journal-header {
    margin-bottom: 0.5rem;
    position: relative;
}

.journal-date {
    font-weight: 600;
    color: #666666;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    position: absolute;
    top: 0;
    left: 0;
}

.journal-content {
    margin-bottom: 0.1rem;
    line-height: 1.4;
    color: #333;
    flex: 1;
    padding-top: 1rem;
}

.journal-content p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

/* 日记中的照片画廊 */
.journal-gallery {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: 150px;
}

/* 1张照片 */
.journal-gallery:not(:has(.gallery-item:nth-child(2))) {
    grid-template-columns: 1fr;
}

/* 2张照片 */
.journal-gallery:has(.gallery-item:nth-child(2)):not(:has(.gallery-item:nth-child(3))) {
    grid-template-columns: 1fr 1fr;
}

/* 3张照片 */
.journal-gallery:has(.gallery-item:nth-child(3)):not(:has(.gallery-item:nth-child(4))) {
    grid-template-columns: 1fr 1fr 1fr;
}

/* 4张照片 */
.journal-gallery:has(.gallery-item:nth-child(4)) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.journal-gallery .gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    background-color: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 150px;
}

.journal-gallery .gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.journal-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s ease;
    opacity: 0;
    transform: scale(1.05);
}

.journal-gallery .gallery-item img.loaded {
    opacity: 1;
    transform: scale(1);
}

.journal-gallery .gallery-item:hover img {
    transform: scale(1.08);
}

/* 移除图片悬停时的文字覆盖层 */
.journal-gallery .gallery-overlay {
    display: none;
}

/* 地图部分样式 */
.map-section {
    margin-top: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 650px;
    padding: 20px 0;
}

/* 调整地图大小 */
#map-container {
    width: 100%;
    height: 650px;
}

/* 照片显示区域样式 */
.photo-display {
    position: absolute;
    top: 80px;
    right: 100px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 300px;
    display: none;
    z-index: 1000;
}

.photo-display img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.photo-display p {
    margin: 0;
    font-size: 14px;
    color: #333;
    text-align: center;
}

/* 页脚样式 */
footer {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 10px 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 0;
}

.footer-bottom {
    text-align: center;
    opacity: 0.6;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* 动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .journal-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.7rem;
    }
    
    .journal-item-wide-2 {
        grid-column: span 2;
    }
    
    .journal-item-wide-3 {
        grid-column: span 3;
    }
}

@media (max-width: 992px) {
    .journal-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }
    
    .journal-item-wide-2 {
        grid-column: span 2;
    }
    
    .journal-item-wide-3 {
        grid-column: span 3;
    }
    
    .journal-item {
        padding: 0.9rem;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 95%;
    }
    
    .hero h1 {
        font-size: 1.1rem;
    }
    
    .journal-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .journal-item-wide-2,
    .journal-item-wide-3 {
        grid-column: span 2;
    }
    
    .journal-item {
        padding: 0.8rem;
    }
    
    .journal-gallery {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 20px 0;
    }
    
    .hero h1 {
        font-size: 1.1rem;
    }
    
    .journal-section {
        padding: 20px 0;
    }
    
    .journal-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .journal-item-wide-2,
    .journal-item-wide-3 {
        grid-column: span 2;
    }
    
    .journal-item {
        padding: 0.7rem;
    }
    
    .journal-gallery {
        min-height: 100px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

/* 高级感提升 */
.journal-item {
    position: relative;
    overflow: hidden;
}

/* 移除左边边框条，统一整体风格 */

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: ''; 
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.02);
    opacity: 0;
    transition: all 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* 排版优化 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    letter-spacing: 1.5px;
    line-height: 1.2;
}

p {
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

/* 加载效果 */
img {
    transition: all 0.6s ease;
}

/* 全局过渡效果 */
* {
    transition: all 0.3s ease;
}

/* 照片放大模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    object-fit: contain;
}

.close {
    position: absolute;
    top: -50px;
    right: -50px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 点击图片效果 */
.journal-gallery .gallery-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.journal-gallery .gallery-item:hover {
    transform: scale(1.02);
}

.journal-gallery .gallery-item img {
    pointer-events: none;
}

/* 导航栏样式 */
.hero-content .nav {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.hero-content .nav ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}
