/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 上传区域样式 */
.upload-section {
    text-align: center;
    margin-bottom: 30px;
}

.upload-container {
    display: flex;
    justify-content: center;
}

.drop-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #fafafa;
}

.drop-area:hover,
.drop-area.dragover {
    border-color: #667eea;
    background-color: #f0f2ff;
    transform: translateY(-2px);
}

.upload-icon {
    margin-bottom: 20px;
    color: #667eea;
}

.drop-area h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.drop-area p {
    color: #666;
    margin-bottom: 15px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
    margin-top: 15px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #ddd;
    color: #333;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #ccc;
    transform: translateY(-2px);
}

/* 预览区域样式 */
.preview-section {
    margin-top: 30px;
}

.preview-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

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

.image-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.remove-image:hover {
    background-color: rgba(255, 0, 0, 1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 进度条样式 */
.progress-section {
    margin-top: 30px;
    text-align: center;
}

.progress-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 1rem;
    color: #666;
}

/* 结果区域样式 */
.result-section {
    margin-top: 30px;
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.result-section h2 {
    color: #28a745;
    margin-bottom: 20px;
}

.result-info p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* 选项面板样式 */
.options-panel {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.options-panel h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.option-group h4 {
    margin-bottom: 15px;
    color: #444;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #444;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.size-options {
    margin: 10px 0 20px 28px;
}

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

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* 结果按钮样式 */
.result-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

/* 保存状态样式 */
.save-status {
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

.save-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 已保存字体区域样式 */
.saved-fonts-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.saved-fonts-list {
    display: grid;
    gap: 15px;
}

.font-item {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.font-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.font-info {
    flex: 1;
}

.font-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.font-meta {
    font-size: 0.9rem;
    color: #666;
}

.font-actions {
    display: flex;
    gap: 10px;
}

.font-actions a,
.font-actions button {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.no-fonts {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* 隐藏类 */
.hidden {
    display: none;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .drop-area {
        padding: 30px 20px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* 选项面板响应式设计 */
    .options-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons button {
        width: 100%;
        max-width: 300px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .drop-area h3 {
        font-size: 1.2rem;
    }
    
    .image-preview-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .image-preview img {
        height: 150px;
    }
    
    .result-section {
        padding: 30px 15px;
    }
    
    .result-info p {
        font-size: 1rem;
    }
}