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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", -apple-system, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.8;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 20px;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    text-align: center;
    margin-bottom: 8px;
}

header h1 {
    font-size: 1.3em;
    color: #1a3a5c;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.subtitle {
    color: #6b7c93;
    font-size: 0.82em;
}

/* ========== Progress Bar ========== */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 0 10px;
    overflow-x: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
}

.step.active .step-circle {
    background: #2563eb;
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.step.done .step-circle {
    background: #16a34a;
    color: white;
}

.step-label {
    font-size: 0.7em;
    color: #94a3b8;
    white-space: nowrap;
    transition: color 0.3s;
}

.step.active .step-label {
    color: #2563eb;
    font-weight: 600;
}

.step.done .step-label {
    color: #16a34a;
}

.step-connector {
    width: 32px;
    height: 2px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 3px;
    margin-bottom: 20px;
}

.step-connector.done {
    background: #16a34a;
}

#stepContent {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#stepContent .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#stepContent .card .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#stepContent .card .form-group textarea {
    flex: 1;
}

/* ========== Cards ========== */
.card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card h2 {
    font-size: 1.05em;
    color: #1a3a5c;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f1f5f9;
    flex-shrink: 0;
}

/* ========== Form ========== */
.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.form-group .hint {
    font-size: 0.75em;
    color: #94a3b8;
    margin-bottom: 4px;
}

textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.92em;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    outline: none;
}

textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.92em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 110px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-copy {
    padding: 8px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 0.9em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-copy.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

/* ========== Title Cards ========== */
.title-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.title-card {
    padding: 16px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1em;
    line-height: 1.6;
}

.title-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.title-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.title-id {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-right: 10px;
}

.title-card.selected .title-id {
    background: #2563eb;
    color: white;
}

/* ========== Spinner ========== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #2563eb;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Section Content ========== */
.section-body h1, .section-body h2, .section-body h3, .section-body h4 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: #1e293b;
}

.section-body p {
    margin-bottom: 0.8em;
    text-indent: 2em;
}

.section-body ul, .section-body ol {
    padding-left: 2em;
    margin-bottom: 0.8em;
}

.section-body li {
    margin-bottom: 0.3em;
}

/* ========== HTML Code Block ========== */
.html-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.8em;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin-bottom: 16px;
}

/* ========== Error ========== */
.error-section {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dc2626;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

/* ========== References ========== */
.ref-list {
    list-style: none;
    padding: 0;
}

.ref-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9em;
    line-height: 1.6;
}

.ref-list li:last-child {
    border-bottom: none;
}

/* ========== Prompt Box ========== */
.prompt-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.prompt-box h4 {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #1a3a5c;
    margin-bottom: 8px;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
    .container { padding: 20px 12px; }
    header h1 { font-size: 1.3em; }
    .step-connector { width: 20px; }
    .step-circle { width: 30px; height: 30px; font-size: 12px; }
    .step-label { font-size: 0.65em; }
    .card { padding: 20px; }
}

/* Print */
@media print {
    .progress-bar, .nav-buttons, .btn { display: none !important; }
}
