:root {
    --primary: #2c5f8a;
    --primary-light: #3a7cb8;
    --primary-dark: #1e4263;
    --success: #2d8a4e;
    --success-light: #e8f5ed;
    --warning: #c4792b;
    --warning-light: #fef5e7;
    --danger: #c0392b;
    --danger-light: #fdecea;
    --info: #2980b9;
    --info-light: #e8f4fd;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e8;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff;
    padding: 28px 20px;
    text-align: center;
}

.logo { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.subtitle { font-size: 14px; opacity: 0.85; margin-top: 6px; }
.subtitle-note { font-size: 12px; opacity: 0.75; display: inline-block; margin-top: 6px; line-height: 1.6; }

.tab-nav {
    display: flex;
    background: var(--card);
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover { color: var(--primary); background: rgba(44,95,138,0.04); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Wizard */
.wizard-container { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    gap: 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    transition: all 0.3s;
}

.step.active { color: var(--primary); font-weight: 600; }
.step.completed { color: var(--success); }

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--border);
    color: var(--text-light);
    transition: all 0.3s;
}

.step.active .step-num { background: var(--primary); color: #fff; }
.step.completed .step-num { background: var(--success); color: #fff; }

.step-line { width: 50px; height: 2px; background: var(--border); margin: 0 8px; }

.wizard-step { display: none; animation: fadeIn 0.3s ease; }
.wizard-step.active { display: block; }
.wizard-step h2 { font-size: 20px; margin-bottom: 24px; color: var(--primary-dark); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.form-group.half { flex: 1; }
.required { color: var(--danger); }

.form-row { display: flex; gap: 16px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input[type="date"],
select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fafbfc;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44,95,138,0.1);
}

textarea { resize: vertical; }

.radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.radio-label, .checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 400; font-size: 14px; }

/* Buttons */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { opacity: 0.9; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-group { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn-group.center { justify-content: center; }

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Preview */
.preview-box {
    background: #fafbfc;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    min-height: 200px;
    font-size: 14px;
    line-height: 2;
}

.preview-hint { color: var(--text-light); text-align: center; padding: 60px 0; }

.preview-table { width: 100%; border-collapse: collapse; }
.preview-table td { padding: 8px 12px; border: 1px solid var(--border); font-size: 13px; }
.preview-table .label-cell { background: #f5f7fa; font-weight: 500; width: 140px; white-space: nowrap; }

/* Description Generator */
.desc-container { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.desc-container h2 { font-size: 20px; margin-bottom: 8px; color: var(--primary-dark); }
.section-hint { color: var(--text-light); font-size: 13px; margin-bottom: 24px; }

.result-box {
    margin-top: 24px;
    background: #f8fafb;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.result-box h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary-dark); }
.result-content {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 2;
    color: var(--text);
}

/* Checklist */
.checklist-container { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.checklist-container h2 { font-size: 20px; margin-bottom: 8px; color: var(--primary-dark); }

.progress-bar-container {
    background: var(--border);
    border-radius: 20px;
    height: 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #4caf50);
    border-radius: 20px;
    transition: width 0.4s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.checklist-section { margin-bottom: 28px; }
.checklist-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary-dark); }

.checklist-items { display: flex; flex-direction: column; gap: 8px; }

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checklist-item:hover { background: #f0f4f8; border-color: var(--primary-light); }
.checklist-item input[type="checkbox"] { margin-top: 3px; accent-color: var(--success); }
.checklist-item.checked { background: var(--success-light); border-color: var(--success); }
.checklist-item.optional { opacity: 0.85; }

.item-name { font-weight: 500; font-size: 14px; }
.item-tip { font-size: 12px; color: var(--text-light); display: block; margin-top: 2px; }

.tips-list { display: flex; flex-direction: column; gap: 10px; }
.tip-item { padding: 10px 14px; background: #fafbfc; border-radius: 6px; font-size: 13px; border-left: 3px solid var(--primary); }

/* Validator */
.validator-container { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.validator-container h2 { font-size: 20px; margin-bottom: 8px; color: var(--primary-dark); }

.upload-area {
    border: 2.5px dashed var(--border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
    margin-bottom: 24px;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(44,95,138,0.04);
}

.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-hint { font-size: 12px; color: var(--text-light); margin-top: 8px; }

.validation-results { margin-bottom: 24px; }
.validation-results h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary-dark); }

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.result-item.pass { background: var(--success-light); color: var(--success); }
.result-item.fail { background: var(--danger-light); color: var(--danger); }
.result-item.warn { background: var(--warning-light); color: var(--warning); }

.result-icon { font-size: 18px; }

.format-spec { margin-top: 24px; }

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.spec-table th, .spec-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.spec-table th { background: #f5f7fa; font-weight: 600; }
.spec-table tr:hover td { background: #fafbfc; }
.link-text { font-size: 12px; color: var(--info); word-break: break-all; }

/* Guide */
.guide-container { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.guide-container h2 { font-size: 20px; margin-bottom: 24px; color: var(--primary-dark); }

.guide-section { margin-bottom: 32px; }
.guide-section h3 { font-size: 17px; margin-bottom: 12px; color: var(--primary); }

.guide-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.8;
}

.guide-box.info { background: var(--info-light); border-left: 4px solid var(--info); }
.guide-box.warning { background: var(--warning-light); border-left: 4px solid var(--warning); }
.guide-box.danger { background: var(--danger-light); border-left: 4px solid var(--danger); }
.guide-box.success { background: var(--success-light); border-left: 4px solid var(--success); }

.guide-box ul { padding-left: 20px; }
.guide-box li { margin-bottom: 6px; }

.flow-steps { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.flow-step { display: flex; align-items: center; gap: 10px; background: #f5f7fa; padding: 10px 16px; border-radius: 8px; font-size: 13px; }
.flow-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
    .step-indicator { flex-wrap: wrap; gap: 8px; }
    .step-line { display: none; }
    .flow-steps { flex-direction: column; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
    .wizard-container, .desc-container, .checklist-container, .validator-container, .guide-container { padding: 20px 16px; }
}