/* style.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.main-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

/* 游记容器布局 */
.travel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-gap: 2rem;
}

/* 卡片样式 */
.travel-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.travel-card:hover {
    transform: translateY(-5px);
}

.card-image {
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-image:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.meta-info {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9em;
    margin: 0.5rem 0;
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.excerpt {
    color: #555;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .travel-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .travel-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 城市详情页增强样式 */
.city-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(rgba(0,0,0,0.05), transparent);
}

.city-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #666;
    margin-top: 1rem;
}

/* 景点区块布局 */
.attraction-block {
    margin: 4rem 0;
    padding: 2rem 0;
    background: var(--light-bg);
}

.attraction-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.reverse-layout .attraction-content {
    direction: rtl;
}

.text-group, .image-group {
    direction: ltr;
}

.text-group {
    padding: 1.5rem;
}

.image-group {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.image-group img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-group:hover img {
    transform: scale(1.03);
}

.image-group figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 1.5rem;
    font-size: 0.9em;
}

/* 特色元素 */
.attraction-tips {
    background: rgba(255,255,255,0.9);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-top: 1.5rem;
}

.highlight-box {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3.5rem;
    margin: 1.5rem 0;
    row-gap: 1rem;
}

.gallery-grid img {
    width: 120%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .attraction-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .reverse-layout .attraction-content {
        direction: ltr;
    }
    
    .image-group img {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .city-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 添加以下CSS */
.year-divider {
    grid-column: 1 / -1;
    position: relative;
    height: 1px;
    margin: 2.5rem 0;
}

.year-divider::before {
    content: attr(data-year);
    position: absolute;
    left: 50%;
    top: -0.8em;
    transform: translateX(-50%);
    background: white;
    padding: 0 1.5rem;
    color: var(--primary-color);
    font-size: 0.95em;
    z-index: 1;
}

.year-divider::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: rgba(0,0,0,0.12);
}

/* 确保第一个分隔线前有间距 */
.year-divider:first-child {
    margin-top: 1rem;
}

/* 保持原有卡片布局不变 */
.travel-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 强制保持3列 */
    grid-gap: 2rem;
}

/* 分割线美化 */
.year-divider {
    margin: 3.5rem 0; /* 增加上下间距 */
}

.year-divider::after {
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,1) 0%,
        var(--secondary-color) 50%,
        rgba(255,255,255,1) 100%
    );
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.year-divider::before {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 0 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 2px solid var(--secondary-color);
    border-radius: 30px;
    top: -1.1em;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    background: linear-gradient(
        to bottom, 
        rgba(255,255,255,0.96) 0%,
        rgba(255,255,255,0.98) 100%
    );
}

/* 添加动画效果 */
.year-divider::before {
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 鼠标悬停互动 */
.year-divider:hover::after {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,1) 0%,
        var(--primary-color) 50%,
        rgba(255,255,255,1) 100%
    );
}

.year-divider:hover::before {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .year-divider::before {
        font-size: 0.95rem;
        padding: 0 1.5rem;
        border-width: 1.5px;
    }
    
    .year-divider::after {
        height: 1.5px;
    }
}
/* 添加至style.css */
.photo-wall {
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 20px;
}

.wall-header {
    text-align: center;
    margin-bottom: 3rem;
}

.wall-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem;
}

.wall-header p {
    color: #666;
    font-size: 0.98rem;
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 300px;
    gap: 1.5rem;
    padding: 1rem;
}

/* 图片基础样式 */
.wall-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

/* 横版特殊处理 */
.landscape {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

/* 竖版特殊处理 */
.portrait {
    grid-row: span 2;
    aspect-ratio: 3/4;
}

/* 悬停动效 */
.wall-grid img:hover {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .wall-grid {
        grid-auto-rows: 240px;
    }
    
    .landscape {
        grid-column: span 1;
        aspect-ratio: 4/3;
    }
}

@media (max-width: 768px) {
    .wall-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    
    .portrait {
        aspect-ratio: 3/4;
        grid-row: span 1;
    }
}
/* 添加至style.css */
.proportional-grid {
    --base-size: 240px; /* 基础尺寸，可自由调整 */
    --gap: 1.2rem;      /* 间距 */
    
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: calc(var(--base-size) * 0.75); /* 横版高度 */
    gap: var(--gap);
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

.horizontal {
    grid-column: span 1;
    aspect-ratio: 4/3; /* 横版比例 */
}

.vertical {
    grid-column: span 1;
    grid-row: span 2;  /* 竖版占两行 */
    aspect-ratio: 3/4; /* 竖版比例 */
}

/* 精确比例控制 */
.proportional-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 数学比例验证：
   2竖版高度 = 3横版宽度
   2*(3/4 * Wv) = 3*Wh
   其中 Wv = Wh（等宽列）
   2*(3/4 * W) = 3W → 1.5W = 3W → 需要特殊比例调整
*/

/* 比例修正 */
.proportional-grid {
    grid-template-columns: 1fr 1fr 0.8fr; /* 调整第三列宽度 */
}

.vertical {
    aspect-ratio: 2/3; /* 调整竖版比例 */
    grid-row: span 3;   /* 占三行 */
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .proportional-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .vertical {
        grid-column: span 2;
        grid-row: span 1;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .proportional-grid {
        grid-template-columns: 1fr;
    }
}