/* house-value 自定义样式 */

:root {
  --primary: #1a56db;
  --primary-light: #dbeafe;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

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

/* 头部 */
.header {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: white;
  padding: 24px 16px;
  text-align: center;
  border-radius: 0 0 16px 16px;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 24px;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.header p {
  font-size: 13px;
  opacity: 0.85;
  margin: 0;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 6px;
  font-size: 14px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.form-checkbox-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.form-checkbox-item input {
  margin: 0;
}

.form-checkbox-item.checked {
  border-color: var(--danger);
  background: #fef2f2;
}

/* 按钮 */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #1e40af;
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* 结果区域 */
.result-section {
  display: none;
}

.result-section.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 估值结果卡片 */
.valuation-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.valuation-card .label {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.valuation-card .value {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 4px;
}

.valuation-card .unit {
  font-size: 14px;
  opacity: 0.8;
}

.valuation-card .range {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 8px;
}

/* 评分条 */
.score-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 评分项 */
.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.score-item:last-child {
  border-bottom: none;
}

.score-item-label {
  font-size: 14px;
  color: var(--text);
}

.score-item-value {
  font-size: 14px;
  font-weight: 600;
}

/* 系数明细 */
.factor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.factor-row .label {
  color: var(--text-secondary);
}

.factor-row .value {
  font-weight: 600;
}

.factor-row .value.positive {
  color: var(--success);
}

.factor-row .value.negative {
  color: var(--danger);
}

.factor-row .value.neutral {
  color: var(--text-secondary);
}

/* 三把尺子对比 */
.method-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.method-card {
  text-align: center;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.method-card .method-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.method-card .method-value {
  font-size: 18px;
  font-weight: 700;
}

.method-card .method-weight {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 硬伤列表 */
.defect-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.defect-item:last-child {
  border-bottom: none;
}

.defect-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 1px;
}

.defect-icon.warning {
  background: #fef3c7;
  color: #92400e;
}

.defect-icon.danger {
  background: #fee2e2;
  color: #991b1b;
}

.defect-content {
  flex: 1;
}

.defect-title {
  font-size: 14px;
  font-weight: 500;
}

.defect-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 免责声明 */
.disclaimer {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.6;
}

/* 响应式 */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-checkbox-group {
    grid-template-columns: 1fr;
  }
  .method-comparison {
    grid-template-columns: 1fr;
  }
  .valuation-card .value {
    font-size: 28px;
  }
}

/* Tab */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--card);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
}

.tab-item {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-item.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.visible {
  display: block;
}

/* loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* 置信度 */
.confidence-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.confidence-high {
  background: #d1fae5;
  color: #065f46;
}

.confidence-medium {
  background: #fef3c7;
  color: #92400e;
}

.confidence-low {
  background: #fee2e2;
  color: #991b1b;
}
