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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f5a623 0%, #e09420 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #f0f2f5;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-small:hover {
    background: #e8e8e8;
}

.icon {
    font-size: 16px;
}

.image-count {
    margin-left: auto;
    color: #666;
    font-size: 14px;
}

/* 拖放区域 */
.drop-zone {
    border: 2px dashed #d0d7de;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #fafbfc;
    transition: all 0.3s ease;
    margin-bottom: 16px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-zone.drag-over {
    border-color: #4a90d9;
    background: #f0f7ff;
}

.drop-zone.has-images {
    padding: 20px;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-icon {
    font-size: 32px;
    opacity: 0.5;
}

.drop-text {
    color: #8c959f;
    font-size: 14px;
}

.image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    width: 100%;
    display: none;
}

.drop-zone.has-images .image-preview-list {
    display: grid;
}

.drop-zone.has-images .drop-zone-content {
    display: none;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-preview-item:hover .remove-btn {
    opacity: 1;
}

.image-preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 区域样式 */
.section {
    margin-bottom: 16px;
}

.row-section {
    display: flex;
    gap: 16px;
}

.row-item {
    flex: 1;
}

.row-item .section-label {
    margin-bottom: 6px;
    font-size: 13px;
}

.section-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.size-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-checkbox {
    position: relative;
    cursor: pointer;
}

.size-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.size-checkbox .checkmark {
    display: inline-block;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.size-checkbox input:checked + .checkmark {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: white;
    border-color: #4a90d9;
}

.size-checkbox:hover .checkmark {
    border-color: #4a90d9;
}

.custom-size-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.custom-size-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.1);
}

.custom-size-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.color-mode-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.color-mode-select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.1);
}

/* 底部按钮 */
.bottom-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.bottom-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 14px 24px;
    font-size: 15px;
}

/* 对话框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #333;
}

.modal-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.result-actions .btn {
    flex: 1;
    justify-content: center;
}

.result-file-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.result-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.result-file-item:last-child {
    border-bottom: none;
}

.result-file-icon {
    font-size: 20px;
}

.result-file-info {
    flex: 1;
}

.result-file-name {
    font-weight: 500;
    color: #333;
}

.result-file-sizes {
    font-size: 12px;
    color: #666;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .image-count {
        margin-left: 0;
        text-align: center;
    }

    .bottom-actions {
        flex-direction: column;
    }
}
