/* ==========================================================================
   收支平衡表 · income-expense.css（与 self-explore / life-goal 同源，前缀 ie-）
   ========================================================================== */

/* ---- 页首引言不换行（窄屏允许换行防溢出） ---- */
.page-hero .lead { white-space: nowrap; }
@media (max-width: 860px) { .page-hero .lead { white-space: normal; } }

/* ---- 使用建议：标题不换行 + 四卡一排（窄屏降级） ---- */
.ie-usage .section-head .h2 { white-space: nowrap; }
@media (max-width: 860px) { .ie-usage .section-head .h2 { white-space: normal; } }
.ie-usage .cards {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.ie-usage .card h3 { font-size: 0.98rem; }
.ie-usage .card p { font-size: 0.85rem; line-height: 1.65; }
@media (max-width: 1100px) { .ie-usage .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .ie-usage .cards { grid-template-columns: 1fr; } }

/* ---- hidden 兜底：防止全局 .btn 等 display 规则覆盖 hidden 属性 ---- */
[hidden] { display: none !important; }

/* 布局：填写区 + 报告侧栏 */
.ie-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .ie-grid { grid-template-columns: 1fr; }
  .ie-aside { order: -1; }
}

/* 分组块 */
.ie-form .dim-block {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 26px 0 10px;
  margin: 0 0 8px;
}
.ie-form .dim-block:first-child { border-top: 0; padding-top: 4px; }
.ie-form legend {
  padding: 0;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
}
.ie-form .dim-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 0.08em;
}
.ie-form legend h3 { margin: 0; font-size: 1.15rem; }
.ie-form .dim-tip {
  width: 100%;
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.6;
}

/* ---- 视角选择器（个人/家庭 · 孩子） ---- */
.ie-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 14px 16px;
  border: 1px solid rgba(10, 125, 102, 0.25);
  border-radius: 12px;
  background: rgba(10, 125, 102, 0.04);
  margin: 0 0 22px;
}
.ie-mode .ie-mode-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ie-mode .m-label {
  font-size: 0.88rem;
  opacity: 0.65;
  font-weight: 600;
}
.ie-mode .seg {
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.ie-mode .seg-btn {
  padding: 7px 18px;
  font: inherit;
  font-size: 0.85rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ie-mode .seg-btn.on {
  background: #0a7d66;
  color: #fff;
}
.ie-mode .ie-mode-tip {
  flex-basis: 100%;
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0.5;
}

/* 字段提示（如公积金抵扣、其他固定支出的举例） */
.f-hint {
  display: block;
  font-size: 0.8rem;
  line-height: 1.55;
  opacity: 0.55;
  margin: -2px 0 6px;
}

/* 数字输入行 */
.f-row {
  border-left: 3px solid transparent;
  padding: 8px 0 8px 14px;
  margin: 0 0 10px;
  transition: border-color 0.2s;
}
.f-row.filled { border-left-color: #0a7d66; }
.f-row .f-text {
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 6px;
  font-weight: 600;
}
.f-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.f-input-wrap .yen {
  font-size: 0.92rem;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}
.f-row input[type="number"] {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: inherit;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.f-row input[type="number"]:focus {
  outline: none;
  border-color: #0a7d66;
  background: #fff;
}
.f-row input[type="number"]::placeholder { color: rgba(0, 0, 0, 0.3); }
.f-row input[type="number"]::-webkit-outer-spin-button,
.f-row input[type="number"]::-webkit-inner-spin-button { opacity: 0.35; }

/* 小计行 */
.ie-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 6px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.9rem;
}
.ie-subtotal b { font-variant-numeric: tabular-nums; font-size: 1rem; }

/* 侧栏报告 */
.ie-aside .result-hero { text-align: center; margin-bottom: 18px; }
.ie-aside .big-number {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ie-aside .big-number.pos { color: #0a7d66; }
.ie-aside .big-number.neg { color: #c0392b; }
.ie-rate { font-size: 1rem; margin-top: 2px; }
.ie-rate #savingsRate { font-weight: 700; font-variant-numeric: tabular-nums; }
.ie-rate .of { font-size: 0.82rem; opacity: 0.5; }
.ie-aside .result-hero .en { font-size: 0.82rem; opacity: 0.55; display: block; margin-top: 6px; }

/* 指标行 */
.ie-metrics { display: flex; flex-direction: column; gap: 0; margin: 14px 0; }
.ie-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
}
.ie-metric:last-child { border-bottom: 0; }
.ie-metric .m-label { opacity: 0.65; }
.ie-metric .m-value { font-variant-numeric: tabular-nums; font-weight: 500; }
.ie-metric .m-value.pos { color: #0a7d66; }
.ie-metric .m-value.neg { color: #c0392b; }
.ie-metric .m-value.warn { color: #b26a00; }

/* 结论列表 */
.ie-conclusions h4 { margin: 0 0 10px; font-size: 1rem; }
.ie-conclusion {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 0 0 8px;
}
.ie-conclusion .dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
}
.ie-conclusion.good { background: #E1F5EE; }
.ie-conclusion.good .dot { background: #0a7d66; }
.ie-conclusion.warn { background: #FAEEDA; }
.ie-conclusion.warn .dot { background: #BA7517; }
.ie-conclusion.bad { background: #FCEBEB; }
.ie-conclusion.bad .dot { background: #c0392b; }
.ie-conclusion.info { background: rgba(0, 0, 0, 0.04); }
.ie-conclusion.info .dot { background: #888780; }

/* 操作按钮 */
.ie-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 10px; }
.quiet-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 9px 20px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.quiet-btn:hover { opacity: 1; }

.ie-privacy {
  font-size: 0.78rem;
  line-height: 1.7;
  opacity: 0.55;
  margin: 10px 0 22px;
}

/* 写完之后 CTA */
.ie-cta {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ie-cta h4 { margin: 0; font-size: 1rem; }
.ie-cta p { margin: 0; font-size: 0.85rem; opacity: 0.7; }
.ie-cta .btn { text-align: center; }
/* 描边次按钮：必须显式给深色文字——全局 .btn.life 是白字，
   若只把背景改透明，白字会「悬停才可见」 */
.ie-cta .ie-cta-2 {
  background: transparent;
  border: 1px solid rgba(10, 125, 102, 0.45);
  color: #0a7d66;
}
.ie-cta .ie-cta-2:hover { background: rgba(10, 125, 102, 0.08); }

/* 导出反馈提示 */
.ie-export-note {
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 4px 0 0;
  opacity: 0.75;
}

/* 窄屏允许 lead 换行：单行 nowrap 在移动端会横向溢出（2026-09-22 全站视觉打磨） */
@media (max-width: 680px) {
  .page-hero .lead,
  .lead { white-space: normal; }
}
