:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #f72585;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary), #3a0ca3);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
}

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

.language-selector {
    position: relative;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: #c2c2c2;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 150px;
    overflow: hidden;
    display: none;
    z-index: 200;
}

.lang-options.active {
    display: block;
}

.lang-option {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: #ea00ff;
}

.lang-option.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 500;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

nav a:hover, nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 25px;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1fr 300px;
    }
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 350px;
    }
}

/* 上传区域 */
.upload-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    order: 2;
}

@media (min-width: 768px) {
    .upload-section {
        order: 1;
    }
}

.upload-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.upload-area {
    padding: 30px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 30px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.03);
}

.drop-zone i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.drop-zone h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.drop-zone p {
    color: var(--gray);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn i {
    font-size: 0.9rem;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

/* 图片预览区 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
}

@media (min-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

.image-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.image-preview {
    height: 130px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    padding: 10px;
    border-top: 1px solid var(--border);
    background: white;
}

.image-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.image-size {
    font-size: 0.7rem;
    color: var(--gray);
    display: flex;
    justify-content: space-between;
}

.image-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.action-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* 选项面板 */
.options-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    height: fit-content;
    order: 1;
}

@media (min-width: 768px) {
    .options-panel {
        position: sticky;
        top: 90px;
        order: 2;
    }
}

.options-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-group h4 i {
    color: var(--primary);
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.radio-option input {
    margin: 0;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--dark);
}

.input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.slider-container {
    padding: 5px 0;
}

.slider-value {
    text-align: right;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 3px;
}

.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 10px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.format-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 480px) {
    .format-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.format-option {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.format-option:hover {
    border-color: var(--primary);
}

.format-option.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
}

.format-option i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary);
}

/* 底部操作区 */
.action-footer {
    background: white;
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 15px;
}

.summary {
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.summary span {
    font-weight: 600;
    color: var(--primary);
}

.btn-lg {
    padding: 12px 25px;
    font-size: 1rem;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #0da271;
}

/* 处理状态 */
.processing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.processing-indicator.active {
    opacity: 1;
    pointer-events: auto;
}

.processing-content {
    text-align: center;
    padding: 15px;
    max-width: 90%;
}

.spinner {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移动设备优化 */
.mobile-tips {
    background: var(--warning);
    color: white;
    padding: 10px 15px;
    text-align: center;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
}

@media (max-width: 480px) {
    .mobile-tips {
        display: block;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--gray);
    opacity: 0.5;
}
