/* ===== 书法展厅主题样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f7f3eb;
    font-family: 'Microsoft YaHei', '微软雅黑', 'Segoe UI', 'Noto Sans CJK TC','PingFang TC',Roboto, sans-serif;
    color: #3e2e23;
    line-height: 1.5;
    padding: 2rem 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.container {
    max-width: 1210px;
    margin: 0 auto;
    background: rgba(255, 250, 240, 0.9);
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 页眉 — 左对齐 + 错落字号 */
.header {
    background: #2c2418;
    color: #e9dbbd;
    padding: 2rem 2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #d9c8a9;
}

.header h1 {
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    font-weight: 550;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.75rem;
    color: #7f6a51;
    border-top: 1px solid #ece2d0;
    background: #fefaf4;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #d9c8a9;
    text-decoration: none;
    font-size: 0.85rem;
}

/* 导航栏 */
.nav-bar {
    background: #fffcf5;
    padding: 0.8rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    border-bottom: 1px solid #ece2d0;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 6px 14px;
    border-radius: 30px;
    color: #5b4b34;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #2c2418;
    color: #f7efdf;
}

.page-info {
    font-size: 0.85rem;
    background: #f0e7da;
    padding: 5px 12px;
    border-radius: 30px;
    color: #5b4b34;
}

/* 作者简介区（仅首页使用） */
.author-profile {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    background: #fefaf4;
    border-bottom: 1px solid #ece2d0;
}

.author-avatar {
    flex: 0 0 100px;
    text-align: center;
}

.author-avatar img {
    width: 100%;
    border-radius: 50%;
    border: 3px solid #d9c8a9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.author-bio {
    flex: 1;
}

.author-bio h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #b87c4f;
    padding-left: 12px;
}

.author-bio p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ========== 网格布局：根据页面类型区分 ========== */
/* 封面页：3列 */
.home .image-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 专辑页：4列 */
.album .image-grid {
    grid-template-columns: repeat(4, 1fr);
}

.image-grid {
    display: grid;
    gap: 28px;
    padding: 2rem;
}

/* 卡片样式 */
.image-card {
    background: #fffdf9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9dfcf;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ===== 固定图片容器尺寸 ===== */
.image-grid .image-card .image-wrapper {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf5ea;
    padding: 12px;
    box-sizing: border-box;
}

.image-grid .image-card .image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 统一卡片文字区域最小高度，防止因描述长短不同导致高度参差 */
.image-caption {
    min-height: 60px;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #f0e6d8;
}

.image-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #6b4e2e;
}

.image-desc {
    font-size: 0.8rem;
    color: #7f6a51;
    line-height: 1.4;
    text-align: left;
}

/* 分页控件 */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 1rem 2rem 2rem;
}

.page-btn {
    background: #f0e7da;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    color: #3e2e23;
}

.page-btn:hover {
    background: #e0cfbc;
}

.page-btn.active {
    background: #2c2418;
    color: #f7efdf;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: default;
}

.page-info-text {
    font-size: 0.8rem;
    background: #f0e7da;
    padding: 6px 12px;
    border-radius: 30px;
}

/* 模态框（大图查看 + 缩放） */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.modal-content {
    background: #fffef7;
    max-width: 90%;
    max-height: 90%;
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    cursor: default;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
    overflow: auto;
    position: relative;
}

.modal-img-container {
    overflow: auto;
    text-align: center;
    max-height: 70vh;
    margin-bottom: 12px;
}

.modal-img-container img {
    max-width: 100%;
    max-height: 70vh;
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.modal-controls {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.modal-controls button {
    background: #f0e7da;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
}

.modal-details {
    text-align: left;
    font-size: 0.9rem;
    color: #4a3a2a;
    border-top: 1px solid #e9dfcf;
    padding-top: 12px;
}

.modal-details p {
    margin: 6px 0;
}

/* 响应式 */
@media (max-width: 1024px) {
    .album .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem;
    }
    .header h1 {
        font-size: 1.4rem;
        line-height: 1.2;
        word-break: break-word;
        white-space: normal;
    }
    .header p {
        font-size: 0.75rem;
        word-break: break-word;
        white-space: normal;
    }
    .back-link {
        font-size: 0.75rem;
    }

    .home .image-grid,
    .album .image-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 1.0rem;
    }

    .nav-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .nav-links {
        flex: 1;
        gap: 4px;
    }
    .nav-links a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    .author-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-bio h2 {
        border-left: none;
        text-align: center;
    }

    /* 响应式缩小图片容器高度 */
    .image-grid .image-card .image-wrapper {
        height: 400px;
    }
}