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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 30px;
    color: #333;
}

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

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

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background: #0056b3;
}

.hidden {
    display: none;
}

/* 加载动画 */
#loading {
    margin-top: 20px;
    padding: 30px;
    background: #e7f3ff;
    border-radius: 4px;
    text-align: center;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* 结果区域 */
#result {
    margin-top: 30px;
    padding: 0;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.result-header {
    padding: 25px;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.result-header h2 {
    margin: 0 0 15px 0;
    color: #28a745;
    font-size: 1.5em;
}

.result-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    color: #666;
    font-size: 14px;
}

.stat-item strong {
    color: #333;
    margin-right: 5px;
}

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

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

/* 文章信息 */
.article-info {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.info-item {
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item label {
    display: inline-block;
    min-width: 60px;
    font-weight: 600;
    color: #495057;
}

.info-item span {
    color: #212529;
}

/* 文章预览容器 */
.article-preview-container {
    background: white;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #495057;
}

.btn-toggle {
    padding: 5px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-toggle:hover {
    background: #5a6268;
}

.article-preview {
    padding: 30px;
    max-height: 600px;
    overflow-y: auto;
    background: white;
}

.article-preview.collapsed {
    display: none;
}

/* 文章预览内样式（确保生成的HTML样式正常显示） */
.article-preview iframe {
    width: 100%;
    border: none;
    min-height: 800px;
}

/* 错误提示 */
.error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-top: 20px;
}