/* 绩兴防水·渗漏诊通 - 样式（5步向导版） */

:root {
    --primary: #1F4E79;
    --primary-light: #2E75B6;
    --primary-dark: #0D3B66;
    --accent: #FF6B35;
    --success: #00B050;
    --warning: #FFC000;
    --danger: #E74C3C;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --border: #E8ECF0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

* { 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;
    -webkit-font-smoothing: antialiased;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.logo { display: flex; align-items: center; justify-content: center; gap: 8px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.subtitle { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.container { max-width: 480px; margin: 0 auto; padding: 16px; }

/* ========== 进度条 ========== */
.progress-bar {
    position: relative;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 24px;
}

.progress-fill {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
}

.progress-step {
    width: 28px;
    height: 28px;
    background: var(--border);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.progress-step.active {
    background: var(--primary);
    color: white;
}

.progress-step.done {
    background: var(--success);
    color: white;
}

/* ========== 步骤 ========== */
.step { display: none; }
.step.active { display: block; animation: fadeIn 0.3s ease; }

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

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.step-header h2 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.step-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.required { color: var(--danger); }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    background: var(--card-bg);
    color: var(--text);
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237F8C8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.form-row { display: flex; gap: 12px; }
.form-group.half { flex: 1; }

/* ========== 复选框/单选框 ========== */
.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover, .radio-item:hover {
    border-color: var(--primary-light);
    background: rgba(46, 117, 182, 0.05);
}

.checkbox-item input:checked + span,
.radio-item input:checked + span {
    color: var(--primary);
    font-weight: 600;
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    border-color: var(--primary);
    background: rgba(46, 117, 182, 0.1);
}

/* ========== 上传按钮 ========== */
.upload-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    border-color: var(--primary-light);
    background: rgba(46, 117, 182, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 78, 121, 0.15);
}

.btn-icon { font-size: 24px; }
.btn-label { font-size: 13px; font-weight: 600; color: var(--text); }

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
    background: var(--card-bg);
    min-height: 120px;
}

.upload-area.has-images {
    border-style: solid;
    border-color: var(--success);
}

.upload-placeholder {
    padding: 30px 20px;
    text-align: center;
}

.upload-icon { font-size: 40px; margin-bottom: 8px; }
.upload-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-light); }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
}

.preview-grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.preview-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-grid-item .btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-count {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

/* ========== 按钮 ========== */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(31, 78, 121, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 78, 121, 0.4);
}

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

.btn-secondary {
    flex: 1;
    padding: 14px;
    background: var(--card-bg);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover { background: var(--primary); color: white; }

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-group .btn-primary { flex: 1; }

/* ========== 诊断中 ========== */
.diagnosing { text-align: center; padding: 40px 20px; }

.diagnosing-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--primary-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.pulse-ring.delay-1 { animation-delay: 0.5s; }
.pulse-ring.delay-2 { animation-delay: 1s; }

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.diagnosing-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, -60%); }
}

.diagnosing h2 { font-size: 18px; margin-bottom: 24px; }

.diagnosing-steps { text-align: left; max-width: 280px; margin: 0 auto; }

.diag-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    font-size: 14px;
    opacity: 0.4;
    transition: all 0.3s;
}

.diag-step.active { opacity: 1; box-shadow: var(--shadow); transform: translateX(4px); }
.diag-step.done { opacity: 0.7; background: #E8F5E9; }
.diag-step.done .step-icon::after { content: "✓"; margin-left: 4px; color: var(--success); }
.step-icon { font-size: 20px; }

/* ========== 摘要卡片 ========== */
.summary-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.summary-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
}

.summary-content {
    font-size: 13px;
    line-height: 1.8;
}

.summary-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child { border-bottom: none; }

.summary-label {
    width: 100px;
    color: var(--text-light);
    flex-shrink: 0;
}

.summary-value {
    flex: 1;
    font-weight: 500;
}

/* ========== 法律告知 ========== */
.legal-notice {
    background: #FFF3E0;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.legal-notice h3 {
    font-size: 14px;
    font-weight: 600;
    color: #E65100;
    margin-bottom: 12px;
}

.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    color: #E65100;
    line-height: 1.6;
}

.legal-checkbox input {
    margin-top: 2px;
}

/* ========== 报告 ========== */
.report-header { text-align: center; margin-bottom: 20px; }

.report-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #E8F5E9;
    color: var(--success);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.report-header h2 { font-size: 20px; margin-bottom: 8px; }

.report-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
}

.report-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.report-section {
    margin-bottom: 24px;
}

.report-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.report-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 8px;
    color: var(--text);
}

.report-section p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.report-section ul, .report-section ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.report-section li {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 4px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.report-table th, .report-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.report-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
}

.report-table td {
    color: var(--text);
}

.ai-note {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.legal-disclaimer {
    background: #FFF3E0;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 12px;
    color: #E65100;
    line-height: 1.8;
    margin-top: 20px;
}

.report-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.report-actions .btn-primary { flex: 1; }

/* ========== 错误 ========== */
.error-container { text-align: center; padding: 60px 20px; }
.error-icon { font-size: 64px; margin-bottom: 16px; }
.error-container h2 { font-size: 20px; margin-bottom: 12px; }
.error-container p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

/* ========== Footer ========== */
.footer { text-align: center; padding: 24px 16px; font-size: 12px; color: var(--text-light); }
.footer-slogan { margin-top: 4px; font-style: italic; }

/* ========== 响应式 ========== */
@media (max-width: 360px) {
    .container { padding: 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .btn-group { flex-direction: column; }
    .upload-buttons { gap: 8px; }
    .upload-btn { padding: 12px 6px; }
    .btn-icon { font-size: 20px; }
    .btn-label { font-size: 12px; }
}
