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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f3f0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d2a3e;
}

.header h1 span {
    font-size: 18px;
    font-weight: 400;
    color: #8c81aa;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #7c4dff;
    color: white;
}

.btn-primary:hover {
    background: #651fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.3);
}

.btn-secondary {
    background: white;
    color: #3d3566;
    border: 2px solid #e8deff;
}

.btn-secondary:hover {
    border-color: #7c4dff;
    color: #7c4dff;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #e55a5a;
    transform: translateY(-2px);
}

/* 统计信息 */
.stats {
    background: white;
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #5a4e7a;
}

.stats-item strong {
    color: #1f1a2e;
    font-size: 18px;
}

/* 视图切换 */
.view-controls {
    display: flex;
    gap: 4px;
    background: #f0ebff;
    border-radius: 30px;
    padding: 4px;
}

.view-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 26px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    font-family: inherit;
    color: #5a4e7a;
}

.view-btn.active {
    background: white;
    color: #7c4dff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.view-btn:hover:not(.active) {
    color: #3d3566;
}

/* 网格视图 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

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

/* 图片卡片 */
.image-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: 0.3s;
    cursor: pointer;
    position: relative;
}

.image-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.image-card .image-wrapper {
    position: relative;
    padding-top: 75%;
    background: #f0ebff;
    overflow: hidden;
}

.image-card .image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.02);
}

.image-card .image-info {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-card .image-name {
    font-size: 13px;
    color: #2d2a3e;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.image-card .image-size {
    font-size: 12px;
    color: #8c81aa;
    flex-shrink: 0;
}

.image-card .image-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.image-card .image-checkbox.checked {
    background: #7c4dff;
    border-color: #7c4dff;
}

.image-card .image-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
}

/* 列表视图样式 */
.gallery-grid.list-view .image-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
}

.gallery-grid.list-view .image-card .image-wrapper {
    padding-top: 0;
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 10px;
}

.gallery-grid.list-view .image-card .image-info {
    flex: 1;
    padding: 0 16px;
}

.gallery-grid.list-view .image-card .image-name {
    font-size: 15px;
    white-space: normal;
    overflow: visible;
}

/* 灯箱 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox .close-btn {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 36px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    background: none;
    border: none;
    font-family: inherit;
}

.lightbox .close-btn:hover {
    transform: rotate(90deg);
    color: #ff6b6b;
}

.lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: 0.2s;
    background: none;
    border: none;
    font-family: inherit;
    padding: 16px;
}

.lightbox .nav-btn:hover {
    color: white;
}

.lightbox .nav-btn.prev {
    left: 16px;
}

.lightbox .nav-btn.next {
    right: 16px;
}

.lightbox .image-counter {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 18px;
    border-radius: 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #8c81aa;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 18px;
}

/* 全选按钮样式 */
.select-all-btn {
    font-size: 13px;
    color: #7c4dff;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 500;
}

.select-all-btn:hover {
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .header-controls {
        flex-wrap: wrap;
    }

    .header-controls .btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .gallery-grid.list-view .image-card {
        flex-direction: column;
        padding: 12px;
    }

    .gallery-grid.list-view .image-card .image-wrapper {
        width: 100%;
        height: 150px;
        padding-top: 0;
    }

    .gallery-grid.list-view .image-card .image-info {
        padding: 12px 0 0;
        width: 100%;
    }

    .stats {
        gap: 16px;
        padding: 14px 18px;
    }

    .lightbox img {
        max-width: 95%;
        max-height: 70vh;
    }

    .lightbox .nav-btn {
        font-size: 32px;
        padding: 8px;
    }

    .lightbox .nav-btn.prev {
        left: 4px;
    }

    .lightbox .nav-btn.next {
        right: 4px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .header h1 {
        font-size: 20px;
    }

    .image-card .image-info {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .image-card .image-name {
        font-size: 12px;
        white-space: normal;
    }
}
