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

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section, .preview-section {
    flex: 1;
    min-width: 300px;
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.controls {
    display: flex;
    gap: 10px;
}

.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2575fc;
    cursor: pointer;
}

#text-input {
    width: 100%;
    height: 300px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

#text-input:focus {
    outline: none;
    border-color: #2575fc;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #2575fc;
    color: white;
}

.btn-primary:hover {
    background-color: #1a68e8;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.preview-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background-color: #f8f9fa;
    margin-bottom: 20px;
}

#preview-image {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.preview-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 40px;
}

.preview-placeholder i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #adb5bd;
}

.preview-placeholder p {
    margin-bottom: 10px;
}

.hint {
    font-size: 0.9rem;
    color: #868e96;
}

.preview-info {
    color: #6c757d;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2575fc;
    z-index: 10;
    display: none;
}

footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
}

footer p {
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .input-section, .preview-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .action-buttons, .preview-actions {
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* 字体选择下拉框 */
.font-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.font-select:focus {
    outline: none;
    border-color: #2575fc;
    box-shadow: 0 0 0 0.2rem rgba(37, 117, 252, 0.25);
}

/* 字体上传区域 */
.font-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#font-upload-status {
    font-size: 12px;
    min-height: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .settings {
        grid-template-columns: 1fr;
    }
}