/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 语言切换器样式 */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4a90e2;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 80px;
}

.language-btn:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #4a90e2;
    border-radius: 15px;
    padding: 10px 0;
    margin-top: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 150px;
}

.language-switcher:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #2c3e50;
}

.lang-option:hover {
    background: #e3f2fd;
    color: #4a90e2;
}

.lang-option:first-child {
    border-radius: 13px 13px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 13px 13px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    margin-top: 60px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #4a90e2;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: linear-gradient(145deg, #f8fbff 0%, #e3f2fd 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #357abd;
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #2196f3;
    background: linear-gradient(145deg, #e1f5fe 0%, #b3e5fc 100%);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #4a90e2;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.upload-area p {
    color: #7f8c8d;
    font-size: 1rem;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 预览区域样式 */
.preview-section {
    margin-bottom: 30px;
}

.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.image-item:hover {
    transform: scale(1.05);
}

.image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 配置区域样式 */
.config-section {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 15px;
    border: 2px solid #4a90e2;
}

.config-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ratio-inputs {
    display: flex;
    gap: 20px;
    flex: 1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.ratio-input {
    padding: 12px 15px;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.ratio-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.process-btn {
    padding: 15px 30px;
    background: linear-gradient(145deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.process-btn:active {
    transform: translateY(0);
}

.process-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 下载区域样式 */
.download-section {
    text-align: center;
    padding: 30px;
    background: linear-gradient(145deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 15px;
    border: 2px solid #28a745;
}

.download-content h3 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.download-content p {
    color: #155724;
    margin-bottom: 20px;
    opacity: 0.8;
}

.download-btn {
    padding: 15px 30px;
    background: linear-gradient(145deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 进度条样式 */
.progress-container {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    color: #4a90e2;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .config-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ratio-inputs {
        flex-direction: column;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-section,
.download-section {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
.image-grid::-webkit-scrollbar {
    width: 8px;
}

.image-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.image-grid::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

.image-grid::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}
