/* ==========================================================================
   财务健康自测表
   ========================================================================== */

.finance-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
}

.finance-form {
  padding: 32px 30px 36px;
}

.finance-form .dim-block {
  border: none;
  border-top: 1px solid var(--line);
  padding: 44px 0 12px;
  margin: 0;
}
.finance-form .dim-block:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.finance-form legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  margin-bottom: 14px;
}
.finance-form legend .dim-num {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--life);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.finance-form legend h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}
.finance-form legend h3 .en {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.55;
  letter-spacing: 0.04em;
}
.finance-form legend .dim-tip {
  flex: 0 0 100%;
  display: block;
  max-width: 460px;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--ink-soft, #5a5a5a);
  opacity: 0.85;
  line-height: 1.5;
}

.finance-form .q-row {
  margin-bottom: 26px;
}
.finance-form .q-row:last-child {
  margin-bottom: 6px;
}

.finance-form .q-text {
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 10px;
  color: var(--ink);
}

/* 「可多选」小标记 */
.finance-form .q-multi {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.1);
  color: #2d6a4f;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  vertical-align: 2px;
}

/* 题目补充说明（如 Q18 的盘点/调回解释） */
.finance-form .q-hint {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-soft, #5a5a5a);
  opacity: 0.85;
  margin: -4px 0 10px;
  padding: 8px 12px;
  background: rgba(45, 106, 79, 0.05);
  border-left: 2px solid rgba(45, 106, 79, 0.35);
  border-radius: 0 6px 6px 0;
}

.finance-form .seg.scale {
  flex-wrap: wrap;
  gap: 8px;
}
.finance-form .seg.scale .seg-item {
  flex: 0 0 calc((100% - 16px) / 3);
  box-sizing: border-box;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
  word-break: break-word;
}

/* 选中态：绿色描边 + 浅绿底（多选时逐个高亮，一眼看清勾了哪些） */
.finance-form .seg-item input { accent-color: #2d6a4f; }
.finance-form .seg.scale .seg-item:has(input:checked) {
  border-color: #2d6a4f;
  background: rgba(45, 106, 79, 0.08);
}
.finance-form .seg.scale .seg-item input:checked + span {
  color: #1b4332;
  font-weight: 500;
}

/* ===== 结果区 ===== */
.finance-result {
  background: var(--life);
  color: #fff;
  padding: 32px 28px;
  border-radius: 16px;
  position: sticky;
  top: 96px;
  /* 面板独立滚动：内容超出视口时内部滚动，保证底部 CTA 始终可达 */
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.35) transparent;
}
.finance-result::-webkit-scrollbar { width: 6px; }
.finance-result::-webkit-scrollbar-track { background: transparent; }
.finance-result::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

.finance-result .result-hero {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  margin-bottom: 22px;
}

.finance-result .eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 8px;
}

.finance-result .big-number {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 4px 0 8px;
}

.finance-result .result-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.finance-result .result-tag.tier-healthy   { background: #2d6a4f; }
.finance-result .result-tag.tier-good      { background: #52b788; }
.finance-result .result-tag.tier-subhealthy{ background: #f4a261; color: #fff; }
.finance-result .result-tag.tier-risk      { background: #e76f51; }

.finance-result .en {
  display: block;
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

/* 雷达图 */
.radar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 8px;
  margin-bottom: 22px;
}
.radar-wrap svg {
  width: 100%;
  height: auto;
  max-width: 360px;
  display: block;
  margin: 0 auto;
}
.radar-wrap .axis-line { stroke: rgba(255,255,255,0.18); stroke-width: 1; }
.radar-wrap .grid-poly { fill: none; stroke: rgba(255,255,255,0.16); stroke-width: 1; }
.radar-wrap .grid-label { fill: rgba(255,255,255,0.55); font-size: 10px; font-family: var(--sans); }
.radar-wrap .axis-label { fill: #fff; font-size: 12px; font-family: var(--sans); font-weight: 500; }
.radar-wrap .user-poly { fill: rgba(82,183,136,0.35); stroke: #b7e4c7; stroke-width: 2; }
.radar-wrap .user-vertex { fill: #b7e4c7; }

/* 维度明细 */
.dim-grid {
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 16px;
}

.dim-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
  font-size: 0.92rem;
}
.dim-row:last-child { border-bottom: none; }
.dim-row .dim-name {
  font-weight: 500;
}
.dim-row .dim-name .dim-en {
  display: block;
  font-size: 0.7rem;
  opacity: 0.6;
  font-weight: 400;
  margin-top: 2px;
}
.dim-row .dim-bar-wrap {
  width: 100px;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.dim-row .dim-bar {
  height: 100%;
  background: #b7e4c7;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.dim-row .dim-bar.tier-good      { background: #b7e4c7; }
.dim-row .dim-bar.tier-subhealthy{ background: #f4a261; }
.dim-row .dim-bar.tier-risk      { background: #e76f51; }
.dim-row .dim-score {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}
.dim-row.placeholder {
  opacity: 0.45;
}
.dim-row.placeholder .dim-score::after {
  content: '—';
}

/* 维度建议卡 */
.dim-advice {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.55;
  opacity: 0.85;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  display: none;
}
.dim-row.has-advice .dim-advice {
  display: block;
}

/* 收入结构判定卡（独立于六维总分） */
.structure-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  border-left: 3px solid rgba(255,255,255,0.35);
}
.structure-card[hidden] { display: none; }
.structure-card.lv-risk  { background: rgba(231,111,81,0.18);  border-left-color: #e76f51; }
.structure-card.lv-watch { background: rgba(244,162,97,0.15);  border-left-color: #f4a261; }
.structure-card.lv-ok    { background: rgba(82,183,136,0.15);  border-left-color: #52b783; }

.structure-card .sc-head { margin-bottom: 8px; }
.structure-card .sc-tag {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.62;
}
.structure-card .sc-flag {
  float: right;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.3);
  opacity: 0.9;
}
.structure-card.lv-risk  .sc-flag { border-color: rgba(231,111,81,0.75); color: #ffc9bb; }
.structure-card.lv-watch .sc-flag { border-color: rgba(244,162,97,0.75); color: #ffd9b3; }
.structure-card.lv-ok    .sc-flag { border-color: rgba(82,183,136,0.75);  color: #c8f0d8; }
.structure-card h4 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
}
.structure-card .sc-body {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.68;
  opacity: 0.92;
}
.structure-card .sc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.72rem;
  opacity: 0.75;
}
.structure-card .sc-meta b { font-weight: 600; opacity: 1; }
.structure-card .sc-src {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.55;
  opacity: 0.6;
}
.structure-card .sc-advice {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.8rem;
  line-height: 1.66;
}
.structure-card .sc-note {
  margin: 8px 0 0;
  font-size: 0.68rem;
  line-height: 1.5;
  opacity: 0.5;
}

.finance-result .result-note {
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0.65;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

/* CTA 按钮：绿底面板上用白底深绿字，形成强对比 */
.finance-result .btn.life {
  background: #fff;
  color: #1b4332;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.finance-result .btn.life:hover {
  background: #eef9f2;
  color: #1b4332;
}

/* CTA 停靠区：钉在结果面板可视区底部——面板内容滚动时按钮始终可见 */
.finance-result .cta-dock {
  position: sticky;
  bottom: 0;
  margin: 14px -28px -32px;   /* 抵消面板内边距，铺满面板底部 */
  padding: 22px 28px 32px;
  background: linear-gradient(to top, var(--life) 62%, rgba(8, 80, 65, 0));
  text-align: center;
}

/* 响应式 */
@media (max-width: 860px) {
  .finance-grid { grid-template-columns: 1fr; }
  .finance-result {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .finance-form .seg.scale .seg-item {
    flex: 0 0 calc((100% - 8px) / 2);
  }
  .dim-row { grid-template-columns: 1fr; gap: 6px; }
  .dim-row .dim-bar-wrap { width: 100%; }
  .dim-row .dim-score { text-align: left; }
}
/* ---- CTA 两态：刚答满弱化，下滑看报告后恢复醒目 ---- */
.finance-result .cta-dock {
  transition: background 0.35s ease, padding 0.25s ease;
}
.finance-result .cta-dock.quiet {
  background: linear-gradient(to top, rgba(8, 80, 65, 0.28) 55%, rgba(8, 80, 65, 0));
  padding: 12px 28px 18px;
}
.finance-result .cta-dock.quiet .dock-hint {
  display: block;
  margin: 0 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  opacity: 0.8;
}
.finance-result .cta-dock.quiet .btn.life {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: none;
  font-weight: 500;
}
.finance-result .cta-dock.quiet .btn.life:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.cta-dock .dock-hint { display: none; }

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

/* ---- 咨询师预约留存的说明小字 ---- */
.cta-dock .dock-consent {
  font-size: 0.62rem;
  opacity: 0.6;
  margin: 8px 0 0;
}

/* ---- 咨询师视图（?admin=1 / #admin 时显示） ---- */
.admin-panel { max-width: 1080px; margin: 0 auto; padding: 26px 24px 0; }
.admin-panel .admin-box {
  border: 2px dashed #b4443c;
  border-radius: 12px;
  padding: 22px 24px 26px;
  background: #fffaf8;
}
.admin-panel h3 { margin: 0 0 6px; font-size: 1rem; }
.admin-panel .admin-meta { font-size: 0.8rem; opacity: 0.8; margin: 0 0 14px; }
.admin-panel .admin-empty { font-size: 0.8rem; opacity: 0.7; margin: 0; }
.admin-panel .admin-dims { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.admin-panel .admin-structure {
  padding: 10px 12px;
  background: #f4f9f7;
  border-left: 3px solid #0a7d66;
  border-radius: 0 8px 8px 0;
}
.admin-panel .admin-structure b { font-size: 0.82rem; }
.admin-panel .admin-src { font-size: 0.72rem; opacity: 0.62; }
.admin-panel .admin-dim {
  font-size: 0.74rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 4px 10px;
}
.admin-panel .admin-dim b { font-family: var(--serif, serif); }
.admin-panel .admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-panel .admin-actions .btn { font-size: 0.78rem; padding: 8px 14px; cursor: pointer; }
.admin-panel .admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.admin-table th, .admin-table td { border: 1px solid rgba(0,0,0,0.1); padding: 6px 8px; text-align: left; vertical-align: top; }
.admin-table th { background: #f6f1ef; font-weight: 600; white-space: nowrap; }

/* 从《收支平衡表》《资产负债表》带入的建议条（2026-11-05） */
.fh-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--life);
  background: rgba(8, 80, 65, 0.05);
  border-left: 2px solid var(--life);
  border-radius: 6px;
}
.fh-hint .fh-apply {
  flex: none;
  padding: 3px 11px;
  font-size: 0.75rem;
  color: #fff;
  background: var(--life);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.fh-hint .fh-apply:hover { opacity: 0.88; }

/* 与上一次的对比（2026-11-05） */
.fh-compare {
  margin: 10px 0 4px;
  padding: 7px 10px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}
