/* Auto-Quote H5 移动端样式 */
/* 电力主题：蓝绿色调，Card 式布局，移动端优先 */

:root {
  --primary: #0ea5e9;        /* 主色：电蓝 */
  --primary-dark: #0284c7;
  --secondary: #10b981;      /* 辅色：绿（能源/环保）*/
  --accent: #f59e0b;         /* 强调：琥珀（峰段）*/
  --danger: #ef4444;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

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;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;       /* 移动端宽度，桌面居中 */
  margin: 0 auto;
  min-height: 100vh;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}
.header h1 { font-size: 1.15rem; font-weight: 600; }
.header .sub { font-size: 0.75rem; opacity: 0.85; margin-top: 2px; }
.header nav { display: flex; gap: 1.25rem; margin-top: 0.6rem; font-size: 0.85rem; }
.header nav a { color: #fff; text-decoration: none; opacity: 0.8; }
.header nav a.active { opacity: 1; font-weight: 600; border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* 主体容器 */
.container { padding: 1rem 1rem 3rem; }

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 表单 */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.form-control {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
}

/* 行内组 */
.form-row { display: flex; gap: 0.6rem; }
.form-row .form-group { flex: 1; }

/* 滑块组（峰谷平比例）*/
.ratio-group { display: flex; gap: 0.5rem; }
.ratio-item { flex: 1; text-align: center; }
.ratio-item label { display: block; font-size: 0.75rem; margin-bottom: 0.25rem; }
.ratio-item .ratio-val { font-size: 0.85rem; font-weight: 600; color: var(--primary); }
.ratio-item input[type=range] { width: 100%; }
.ratio-item.peak input[type=range] { accent-color: var(--accent); }
.ratio-item.valley input[type=range] { accent-color: var(--secondary); }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 评分卡 */
.score-card { text-align: center; padding: 1.25rem; }
.score-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.score-label { font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }
.score-grade {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.grade-a { background: #dcfce7; color: #166534; }
.grade-b { background: #fef9c3; color: #854d0e; }
.grade-c { background: #fee2e2; color: #991b1b; }

/* 三档报价 */
.tier-card { border-left: 4px solid var(--border); }
.tier-card.recommended { border-left-color: var(--primary); background: #f0f9ff; }
.tier-card.conservative { border-left-color: var(--secondary); }
.tier-card.aggressive { border-left-color: var(--accent); }
.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.tier-name { font-weight: 600; font-size: 1rem; }
.tier-price { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.tier-price small { font-size: 0.7rem; color: var(--text-light); font-weight: 400; }
.tier-pkg { font-size: 0.75rem; color: var(--text-light); }
.compliant-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 0.75rem;
}
.compliant-badge.ok { background: #dcfce7; color: #166534; }
.compliant-badge.bad { background: #fee2e2; color: #991b1b; }

/* 成本明细 */
.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.cost-row:last-child { border-bottom: none; font-weight: 600; }
.cost-row .cost-val { color: var(--text); }

/* 图表容器 */
.chart-wrap { position: relative; height: 220px; margin: 0.5rem 0; }

/* 历史列表 */
.quote-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.quote-item:active { background: #f8fafc; }
.quote-item:last-child { border-bottom: none; }
.quote-item .qi-left { flex: 1; }
.quote-item .qi-name { font-weight: 500; font-size: 0.9rem; }
.quote-item .qi-meta { font-size: 0.75rem; color: var(--text-light); }
.quote-item .qi-right { text-align: right; }
.quote-item .qi-score { font-weight: 700; color: var(--primary); }

/* 空状态 */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* 加载 */
.loading { text-align: center; padding: 2rem; color: var(--text-light); }
.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 28px; height: 28px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 提示 */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,41,59,0.92);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

/* 底部留白 */
.footer-pad { height: 2rem; }

/* ===== M2 新增样式 ===== */

/* 客户标签 chip 行（评分卡下方） */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  justify-content: center;
}
/* 5 段分时滑块：尖峰/深谷配色 */
.ratio-item.sharp label { color: #ef4444; }
.ratio-item.sharp input[type=range] { accent-color: #ef4444; }
.ratio-item.deep_valley label { color: #0ea5e9; }
.ratio-item.deep_valley input[type=range] { accent-color: #0ea5e9; }
/* 分时占比合计提示 */
.ratio-sum {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.5rem;
}
.ratio-sum #ratio_sum { font-weight: 600; color: var(--text); }
.tag-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
}
.tag-green { background: #dcfce7; color: #166534; }
.tag-blue  { background: #dbeafe; color: #1e40af; }
.tag-amber { background: #fef3c7; color: #92400e; }
.tag-gray  { background: #f1f5f9; color: #475569; }

/* 图表说明小字（双轴图下方标题） */
.chart-hint {
  font-size: 0.72rem;
  color: var(--text-light);
  margin: -0.3rem 0 0.6rem;
  line-height: 1.5;
}

/* 信息提示卡（首页内测说明、结果页报价依据共用） */
.info-card {
  background: #f0f9ff;
  border-left: 3px solid var(--primary);
}
.info-card .card-title { color: var(--primary-dark); }
.info-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.7;
}
.info-card ul li { margin-bottom: 0.15rem; }
.info-card .info-formula {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.7rem;
  margin: 0.5rem 0;
  font-family: monospace;
  font-size: 0.76rem;
  color: var(--text);
  line-height: 1.6;
  word-break: break-all;
}
