/* Base Styles */
:root {
    --primary-color: #f7a4c5;
    --accent-color: #ff69b4;
    --text-color: #2c2c2c;
    --bg-color: #fff;
    --max-width: 1200px;
    --accent-color-rgb: 255, 105, 180;
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3rem;
}

.logo a {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

/* Hero Section */
.hero {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 2rem;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.hero-image {
    flex: 1;
}

.hero-image picture {
    display: block;
    width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* Gallery Section */
.gallery-section {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: block;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

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

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    opacity: 0;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
    opacity: 1;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(var(--accent-color-rgb), 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

.gallery-caption {
    z-index: 2;
}

/* Footer */
.footer {
    background: #fdf0f5;
    padding: 3rem 2rem;    /* 增加上下内边距 */
    margin-top: 4rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-info {
    text-align: center;
    font-size: 1.1rem;
    line-height: 2;        /* 增加行高 */
}

.contact-link {
    display: block;
    margin-top: 1rem;      /* 添加上边距 */
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Gallery Page Specific Styles */
.gallery-header {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0rem 0 1rem;
    text-align: center;
}

.gallery-header h1 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;  /* 减小按钮之间的间距 */
    margin: 1rem 0;  /* 调整上下边距 */
}

.filter-btn {
    padding: 0.35rem 0.8rem;
    border: 1.5px solid var(--accent-color);
    border-radius: 20px;
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    background: none;
    display: inline-flex;
    align-items: center;
}

.filter-btn .category-count {
    font-size: 0.85em;
    opacity: 0.8;
    margin-left: 0.2rem;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-color);
    color: white;
}

.category-count {
    font-size: 0.85em;  /* 调整计数的字体大小 */
    opacity: 0.8;
}

.load-more {
    text-align: center;
    margin: 3rem 0;
}

.load-more-btn {
    padding: 1rem 2.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.load-more-btn:hover {
    background: var(--primary-color);
}

/* Responsive adjustments for gallery page */
@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: 2rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .gallery-filters {
        flex-wrap: wrap;
    }

    .gallery-grid {
        padding: 0 1rem;
        gap: 1rem;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 4rem 0 2rem 0;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background-color: var(--accent-color);
    color: white;
}

.page-nav {
    font-weight: 500;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Section Header Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-top: 3rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.view-more {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.view-more:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Breadcrumb Styles */
.breadcrumb {
    padding: 1rem 0;  /* 移除左右内边距保留上下内边距 */
    margin-bottom: 2rem;
    /* 删除背景色 */
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin: 0 0.5rem;
    color: #6c757d;
}

.breadcrumb-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #495057;
}

/* Gallery Header Styles */
.gallery-header {
    margin-bottom: 2rem;
}

.gallery-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* 改为顶部对齐 */
    margin-bottom: 1rem;
    flex-wrap: wrap;  /* 在小屏幕上允许换行 */
    gap: 1rem;  /* 添加间距 */
}

.gallery-header-top h1 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin: 0;  /* 移除默认边距 */
    flex-shrink: 0;  /* 防止标题被压缩 */
}

.gallery-filters {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .gallery-header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-filters {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Gallery Filters - 使用更具体的选择器 */
.gallery-section .gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
}

.gallery-section .filter-btn {
    padding: 0.35rem 0.8rem;
    border: 1.5px solid var(--accent-color);
    border-radius: 20px;
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    background: none;  /* 确保没有背景色 */
}

.gallery-section .category-count {
    font-size: 0.85em;
    opacity: 0.8;
}

.gallery-section .filter-btn:hover,
.gallery-section .filter-btn.active {
    background-color: var(--accent-color);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1400px;
    margin: auto;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 1010;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-body {
    display: flex;
    align-items: center;
    height: 90vh;
}

.modal-image-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

#modalImage {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #eee;
}

.modal-info {
    flex: 0 0 25%;
    padding: 0 1rem;
}

.modal-info h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-color);
}

@media (max-width: 768px) {
    .modal-image-container {
        flex-direction: column;
        padding: 1rem;
    }

    #modalImage {
        max-width: 100%;
    }

    .modal-info {
        padding: 1rem;
    }
}

/* 添加导航栏样式 */
.modal-nav {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    padding: 0 2rem;
}

.action-btn.nav-btn-prev,
.action-btn.nav-btn-next {
    flex: 1;
    justify-content: center;
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 200px;
}

.action-btn.nav-btn-prev:hover,
.action-btn.nav-btn-next:hover {
    background-color: var(--primary-color);
    transform: translateY(-1px);
}

.action-btn .arrow {
    font-weight: bold;
}

/* 当到达第一张或最后一张时隐藏对应按钮 */
.action-btn.nav-btn-prev.hidden,
.action-btn.nav-btn-next.hidden {
    display: none;
}

/* 修改图片包装器样式 */
.modal-image-wrapper {
    flex: 1;
    max-width: 65%;  /* 调整为65% */
    display: flex;
    flex-direction: column;
    align-items: center;  /* 居中对齐 */
    gap: 1rem;
}

/* 修改图片样式 */
#modalImage {
    width: 90%;  /* 调整为70% */
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #eee;
    display: block;  /* 确保图片作为块级元素 */
    margin: 0 auto;  /* 水平居中 */
}

/* 修改信息区域样式 */
.modal-info {
    flex: 0 0 35%;  /* 调整右侧信息区域宽度 */
    padding: 0 1rem;
}

/* 确保导航按钮也居中对齐 */
.modal-nav {
    width: 70%;  /* 与图片宽度一致 */
    margin: 1rem auto 0;  /* 上下间距，水平居中 */
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Image Detail Styles */
.image-detail {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 2rem;
}

.image-detail-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.image-wrapper {
    text-align: center;
}

.detail-image {
    max-width: 85%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-info {
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.image-info h1 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.image-meta {
    margin: 1.5rem 0;
    display: flex;
    gap: 2rem;
}

.meta-item {
    display: flex;
    gap: 0.5rem;
}

.meta-item .label {
    color: #666;
}

/* Comments Section Styles */
.comments-section {
    max-width: var(--max-width);
    margin: 4rem auto;
    padding: 0 2rem;
}

.comment-form {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #444;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--primary-color);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.comment {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 500;
    color: var(--accent-color);
}

.comment-date {
    color: #666;
    font-size: 0.9rem;
}

.comment-content {
    line-height: 1.6;
    color: #444;
}

/* Image Navigation Styles */
.image-nav {
    display: flex;
    justify-content: center;
    gap: 3rem;  /* 增加按钮之间的间距 */
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;  /* 增加内边距 */
    border: 2px solid var(--accent-color);
    border-radius: 30px;
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 140px;  /* 确保按钮有最小宽度 */
    justify-content: center;  /* 内容居中 */
}

.nav-btn .arrow {
    font-size: 1.2rem;  /* 增大箭头大小 */
}

.prev-btn .arrow {
    margin-right: 0.75rem;  /* 增加箭头和文字的间距 */
}

.next-btn .arrow {
    margin-left: 0.75rem;  /* 增加箭头和文字的间距 */
}

.nav-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Action Buttons Styles */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 25px;
    background: none;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.like-count {
    margin-left: 0.25rem;
}

/* 在现有的导航按钮样式中添加 */
.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 全局容器样式 */
.container {
    max-width: 1200px;  /* 与 hero-content 相同的最大宽度 */
    margin: 0 auto;
    padding: 0 2rem;
}

/* Contact Form Styles */
.content-section {
    padding: 0 2rem;
}

.contact-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .contact-container {
        padding: 1.5rem;
    }
}

/* 点赞按钮样式 */
.like-btn {
    transition: all 0.3s ease;
}

.like-btn.liked {
    color: #ff4b4b;
}

.like-btn.liked i {
    color: #ff4b4b;
}

.like-btn:hover {
    transform: scale(1.05);
}

/* 点赞动画 */
.like-btn.pulse {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 提示消息样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

/* Hero Section */
.hero-image {
    flex: 1;
}

.hero-image picture {
    display: block;
    width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block; /* 消除图片底部间隙 */
}

/* 移动端优化 */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        gap: 2rem;
    }

    .hero-image {
        order: -1; /* 在移动端将图片放在文字上方 */
    }

    .hero-image img {
        max-height: 300px; /* 限制移动端图片高度 */
        object-fit: cover; /* 确保图片填充容器 */
    }
}