:root {
    --primary: #ff7b6b;
    --primary-dark: #e76b5b;
    --secondary: #5d9cec;
    --accent: #4cd964;
    --light: #fff9f5;
    --dark: #4a3f35;
    --gray: #f8f5f0;
    --gray-dark: #e9e5de;
    --shadow: 0 8px 24px rgba(93, 64, 55, 0.08);
    --shadow-hover: 0 12px 32px rgba(93, 64, 55, 0.15);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--light);
    color: #333;
    line-height: 1.7;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.top-bar {
    background: var(--dark);
    color: white;
    padding: 8px 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.social-top {
    display: flex;
    gap: 12px;
}

.social-top a {
    color: white;
    transition: var(--transition);
}

.social-top a:hover {
    color: var(--primary);
}

/* 主导航栏 */
header {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--dark);
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.logo-text span {
    font-size: 0.9rem;
    color: #777;
    font-weight: 400;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-list a {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    border-radius: 25px;
    transition: var(--transition);
    position: relative;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--primary);
    background: rgba(255, 123, 107, 0.08);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.nav-list a:hover::after, .nav-list a.active::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-btn, .cart-btn, .user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray);
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.search-btn:hover, .cart-btn:hover, .user-btn:hover {
    background: var(--primary);
    color: white;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, rgba(255, 250, 245, 0.9), rgba(255, 245, 240, 0.9)),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100" opacity="0.05"><path d="M20,20 Q40,5 60,20 T100,20 L80,80 Q60,95 40,80 T0,80 Z" fill="%234a3f35"/></svg>');
    padding: 100px 0 60px;
    text-align: center;
}

.page-header h2 {
    font-size: 3rem;
    color: var(--dark);
    margin-bottom: 15px;
    font-weight: 800;
}

.page-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb span {
    color: #888;
}

/* 图库筛选 */
.section {
    padding: 60px 0;
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--gray-dark);
    border-radius: 30px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.gallery-search {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 8px 20px;
    box-shadow: var(--shadow);
}

.gallery-search input {
    border: none;
    outline: none;
    padding: 8px 12px;
    width: 250px;
    font-size: 1rem;
}

.gallery-search button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid var(--gray-dark);
    background: white;
    color: var(--dark);
    font-weight: 600;
    cursor: pointer;
}

/* 瀑布流图库 */
.masonry-gallery {
    column-count: 3;
    column-gap: 30px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 30px;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: white;
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.gallery-author {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
}

.gallery-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-tags {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-tag {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 图片模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.modal-header {
    padding: 20px;
    background: var(--dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    display: flex;
    max-height: calc(90vh - 80px);
}

.modal-image {
    flex: 2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-details {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.modal-details h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.modal-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray);
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.author-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.author-info p {
    font-size: 0.9rem;
    color: #666;
}

.modal-tags {
    margin: 20px 0;
}

.modal-tags h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--gray);
    color: var(--dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary);
    color: white;
}

.modal-description {
    margin: 20px 0;
}

.modal-description h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.modal-description p {
    color: #666;
    line-height: 1.6;
}

.modal-stats {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px solid var(--gray);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 123, 107, 0.3);
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

/* 热门作品 */
.featured-section {
    background: var(--gray);
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 50px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.featured-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.featured-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.featured-content {
    padding: 20px;
}

.featured-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.featured-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.author-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.featured-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.9rem;
}

/* 页脚 */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-links i {
    width: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* 加载更多 */
.load-more {
    text-align: center;
    margin-top: 50px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 123, 107, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .masonry-gallery {
        column-count: 2;
    }

    .modal-body {
        flex-direction: column;
        max-height: 80vh;
    }

    .modal-image {
        max-height: 50%;
    }

    .modal-details {
        max-height: 50%;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 100;
    }

    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        gap: 5px;
    }

    .page-header h2 {
        font-size: 2.3rem;
    }

    .section {
        padding: 40px 0;
    }

    .gallery-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-search input {
        width: 100%;
    }

    .sort-options {
        width: 100%;
        justify-content: space-between;
    }

    .masonry-gallery {
        column-count: 1;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 80px 0 40px;
    }

    .page-header h2 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}
