/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b8b;
    --secondary-color: #6a5af9;
    --accent-color: #00d4aa;
    --dark-color: #2d3047;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fefefe;
    background-image: radial-gradient(#ffd6e0 1.5px, transparent 1.5px), radial-gradient(#c2e9fb 1.5px, transparent 1.5px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.stats {
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 0.5rem;
}

.header-content::-webkit-scrollbar {
    height: 4px;
}

.header-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.header-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.header-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.header-content h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-content .subtitle {
    font-size: 1rem;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.9;
}

.header-content .stats {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 主要内容区域 */
main {
    padding-bottom: 3rem;
}

.intro {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--accent-color);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.search-box {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 139, 0.2);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.sort-options select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.sort-options select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* 分类网格 */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.category-card.disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.category-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.card-image {
    height: 180px;
    width: 100%;
    object-fit: cover;
    border-bottom: 3px solid var(--primary-color);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.card-content p {
    color: var(--gray-color);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.card-stats i {
    margin-right: 0.3rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--accent-color);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.disabled {
    background: var(--gray-color);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--gray-color);
    font-size: 1.2rem;
}

.loading i {
    margin-right: 0.5rem;
    font-size: 1.5rem;
}

/* 分类详情 */
.category-detail {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.back-btn {
    background: var(--light-gray);
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: #ddd;
}

.detail-header h2 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.detail-info {
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-bottom: 1.5rem;
}

.download-all {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.download-all-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-all-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(106, 90, 249, 0.4);
}

.download-all-btn.disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hint {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.warning i {
    font-size: 1.2rem;
}

/* 图片网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}

.image-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.image-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

.image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.8rem;
    transform: translateY(100%);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-item:hover .image-overlay {
    transform: translateY(0);
}

.image-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.image-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.image-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-actions button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 页脚 */
footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.6;
}

.friend-links {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
    display: block;
}

.friend-links li {
    margin-bottom: 0.8rem;
    padding-left: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.friend-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
    border-bottom: 1px solid transparent;
}

.friend-links a:hover {
    color: white;
    border-bottom: 1px solid var(--accent-color);
}



.footer-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 100%;
    justify-content: center;
}

.footer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
}

.small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.9rem;
}

.credits {
    margin-top: 0.5rem;
    color: var(--accent-color);
}

.credits i {
    color: var(--primary-color);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-body img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: #f5f5f5;
    padding: 1rem;
}

.modal-info {
    padding: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.modal-info p {
    margin-bottom: 0.5rem;
    color: var(--gray-color);
}

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

.modal-btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn:first-child {
    background: var(--primary-color);
    color: white;
}

.modal-btn:last-child {
    background: var(--light-gray);
    color: var(--dark-color);
}

.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.modal-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}



/* 辅助类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        gap: 1rem;
        padding-bottom: 0.3rem;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content .subtitle {
        font-size: 0.9rem;
    }
    
    .stats {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .categories {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-body img {
        max-height: 50vh;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        gap: 0.8rem;
        padding-bottom: 0.2rem;
    }
    
    .header-content h1 {
        font-size: 1.3rem;
    }
    
    .header-content .subtitle {
        font-size: 0.8rem;
    }
    
    .header-content .stats {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}