* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --hover-color: #2980b9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --icon-color: #666;
}

[data-theme="dark"] {
    --primary-color: #4fa3d1;
    --secondary-color: #1a1a2e;
    --background-color: #0f172a;
    --card-background: #0f172a;
    --text-color: #ffffff;
    --text-muted: #aaa;
    --border-color: #333;
    --hover-color: #3d8eb9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
    --icon-color: #ccc;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    min-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.3s;
}

.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.search-box button {
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.theme-icon {
    transition: transform 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
}

.user-name {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    padding: 6px 16px;
    background-color: rgba(231, 76, 60, 0.8);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: rgba(231, 76, 60, 1);
    transform: translateY(-1px);
}

/* Category Navigation */
.category-nav {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.category-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 快捷筛选按钮 */
.quick-filters {
    display: flex;
    gap: 8px;
}

.quick-filter-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quick-filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 相册分组下拉框 */
.category-select-wrapper {
    min-width: 200px;
    margin-left: 20px;
}

.category-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s;
}

.select-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.select-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.category-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-select.open .select-dropdown {
    display: flex;
    flex-direction: column;
}

.dropdown-section {
    padding: 8px 0;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.08);
}

.dropdown-item.active {
    background-color: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

.category-group-header {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-group-header:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.category-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Main Content */
.main {
    padding: 40px 0;
}

/* 相册卡片样式 */
.album-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.album-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.album-card h3 {
    padding: 15px 15px 5px;
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
}

.album-card p {
    padding: 0 15px 15px;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* 返回按钮 */
.back-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 1rem;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #2980b9;
}

/* 当前相册标题 */
.current-album {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* 图片网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 图片卡片 */
.image-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 4 / 3;
    position: relative;
}

.image-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.image-card:hover img {
    transform: scale(1.05);
}

.image-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0.0   ;
    transition: opacity 0.3s ease;
}

.image-card:hover .card-info {
    opacity: 0.3;
}

.image-card .card-info:hover {
    opacity: 0.8;
}

.image-card .card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: #666;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
}

.lightbox-info {
    padding: 20px;
    text-align: center;
}

.lightbox-info h3 {
    margin-bottom: 5px;
}

.lightbox-info p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.lightbox-download {
    padding: 10px 30px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.lightbox-download:hover {
    background-color: var(--hover-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .album-view, .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .current-album {
        font-size: 1.3rem;
    }

    .lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 1.2rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .album-view, .gallery-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: var(--card-background);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3498db 0%, #1268a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.cancel-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.cancel-btn:hover {
    background: var(--background-color);
    border-color: var(--text-muted);
}

.login-error {
    display: none;
    color: #e74c3c;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.login-hint {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-hint p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.login-hint p:last-child {
    margin-bottom: 0;
}