:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --bg-color: #f9fafb;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 上传区域样式 */
.upload-section {
    margin: 2rem auto;
}

.upload-area {
    background-color: white;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #f8f9ff;
}

#imageInput {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 2rem;
    cursor: pointer;
}

.upload-icon {
    width: 64px;
    height: 64px;
    background-color: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.upload-icon .material-icons {
    font-size: 32px;
    color: var(--primary-color);
}

.upload-text {
    text-align: center;
}

.upload-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.upload-text p {
    margin: 0 0 1rem 0;
    color: #666;
}

.supported-formats {
    font-size: 0.85rem;
    color: #666;
    background-color: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* 内容区域样式 */
.content-area {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

/* 文件信息面板 */
.file-info {
    background-color: #f0f7ff;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.info-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.info-item .material-icons {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.info-item strong {
    color: var(--text-color);
    font-weight: 500;
}

/* 按钮样式 */
.action-btn,
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.action-btn {
    background-color: #f0f2f5;
    color: var(--text-color);
}

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

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.action-buttons,
.panel-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.panel-buttons {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.action-btn:disabled,
.primary-btn:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* 面板样式 */
.panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 1rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.panel-content {
    padding: 1.5rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.version {
    color: #888;
    font-family: monospace;
}

.divider {
    color: #ddd;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    .upload-label {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        width: 48px;
        height: 48px;
    }
    
    .upload-icon .material-icons {
        font-size: 24px;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .info-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .action-buttons,
    .panel-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-btn,
    .primary-btn {
        width: 100%;
    }
    
    .preview-container img {
        max-height: 400px;
    }
}

/* 图片预览样式 */
.preview-container {
    width: 100%;
    margin: 1rem 0;
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

/* 调整主要按钮尺寸 */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    background-color: var(--primary-color);
    color: white;
}

/* 调整按钮内图标大小 */
.primary-btn .material-icons {
    font-size: 1.1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .panel-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }
    
    .primary-btn {
        width: 200px;
    }
}

/* 关闭按钮样式 */
.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.close-btn .material-icons {
    font-size: 20px;
}

.close-btn:hover {
    background-color: #f0f2f5;
    color: var(--text-color);
}

/* 点击效果 */
.close-btn:active {
    transform: scale(0.95);
}

/* 新图片信息样式 */
.new-info {
    border: 1px dashed var(--border-color);
    background-color: #f0f7ff;
}

/* 面板子标题样式 */
.panel-subtitle {
    color: var(--primary-color);
}

/* 悬停效果（可选） */
.file-info:hover {
    background-color: #e6f0ff;
    transition: background-color 0.3s ease;
}

.new-info:hover {
    background-color: #e6f0ff;
    transition: background-color 0.3s ease;
}

/* 格式提示样式 */
.quality-tip {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
    display: none;  /* 默认隐藏 */
}

/* 格式选择区域样式 */
.format-selection {
    margin-bottom: 1rem;
}

.format-selection label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.format-selection select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.format-selection select:focus {
    border-color: var(--primary-color);
}

/* 格式和质量控制容器 */
.format-controls {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1rem;
}

/* 格式选择样式 */
.format-selection {
    min-width: 120px;
}

.format-selection select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    background-color: white;
}

.format-selection select:focus {
    border-color: var(--primary-color);
}

/* 质量控制样式 */
.quality-control {
    flex: 1;
    max-width: 300px;
}

.quality-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-slider input[type="range"] {
    flex: 1;
}

#qualityValue {
    min-width: 3em;
    text-align: right;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* 标签文字样式 */
.format-selection label span,
.quality-control label span {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* 格式提示样式 */
.quality-tip {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .format-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .format-selection,
    .quality-control {
        width: 100%;
        max-width: none;
    }
}