* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: white;
    color: #333;
    text-align: left;
    padding: 0.8rem 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    color: #333;
}

.menu-section {
    display: flex;
    align-items: center;
}

.menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.menu-item {
    margin: 0;
}

.menu-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.menu-link:hover {
    color: #ff9a9e;
    border-bottom-color: #ff9a9e;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 瀑布流容器 */
.waterfall-container {
    /* 使用CSS Grid实现瀑布流 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-gap: 1.5rem;
    grid-auto-flow: dense;
    /* 兼容旧浏览器 */
    column-count: 1;
    column-gap: 1.5rem;
}

/* 瀑布流卡片 */
.cat-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cat-card img {
    width: 100%;
    height: 200px; /* 固定图片高度，确保大小一致 */
    display: block;
    object-fit: cover; /* 保持图片比例，裁剪多余部分 */
    transition: transform 0.3s ease;
}

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

.cat-info {
    padding: 1rem;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
}

.cat-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.cat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.cat-location, .cat-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    background-color: #333;
    color: white;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (min-width: 600px) {
    .waterfall-container {
        column-count: 2;
    }
}

@media (min-width: 900px) {
    .waterfall-container {
        column-count: 3;
    }
}

@media (min-width: 1200px) {
    .waterfall-container {
        column-count: 4;
    }
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .logo-section {
        gap: 0.8rem;
    }
    
    .logo {
        width: 35px;
        height: 35px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .menu {
        gap: 1rem;
    }
    
    .menu-link {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.6rem 0.8rem;
    }
    
    .logo-section {
        gap: 0.6rem;
    }
    
    .logo {
        width: 30px;
        height: 30px;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
    
    .menu {
        gap: 0.8rem;
    }
    
    .menu-link {
        font-size: 0.9rem;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff9a9e;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* 模态框内容 */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

/* 模态框关闭按钮 */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    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); }
    to { transform: scale(1); }
}

/* 确保图片可以点击 */
.cat-card img {
    cursor: pointer;
}