/* ===== 泰康幸福赢家C款 在线计划书 · 泰康绿主题 ===== */
:root {
  --brand: #00843d;          /* 泰康绿主色 */
  --brand-2: #0a9a4f;        /* 亮绿 */
  --brand-deep: #006b32;     /* 深绿 */
  --brand-dark: #005228;     /* 极深绿 */
  --brand-light: #e6f4ea;    /* 浅绿底 */
  --brand-lighter: #f2f8f3;  /* 更浅绿底 */
  --brand-border: #bfe0cb;   /* 绿描边 */
  --gold: #b8860b;           /* 分红/年金 金 */
  --gold-light: #fdf6e3;
  --text: #1c2b22;
  --text-2: #4d5f53;
  --text-3: #7a8a7f;
  --border: #dde7df;
  --bg: #eef2ee;
  --card: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶部标题栏 =====
 * 背景与下方内容区对齐：背景块左右边缘与 .strip 卡边缘完全对齐。
 * 对齐原理：.main 内容宽 = 1180 - 16*2 = 1148px；故背景块取 1148px 居中，
 *           窄屏取 100%-32px（与 .main 的 16px 左右内边距一致），实现任意宽度下对齐。 */
.titlebar {
  background: linear-gradient(135deg, #e2662a 0%, #ef8538 55%, #f5a95f 100%);
  color: #fff;
  padding: 22px 0;
  text-align: left;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(130, 55, 0, .18);
  max-width: 1148px; width: calc(100% - 32px); margin: 0 auto;
}
.titlebar-title {
  font-size: 16px; font-weight: 400; letter-spacing: 2px;
  position: relative; z-index: 1;
  padding: 0 16px;
}
.titlebar-sub {
  margin: 6px 0 0; font-size: 15px; opacity: .92; letter-spacing: 1px; font-weight: 700;
  position: relative; z-index: 1;
  text-align: left;
  padding: 0 16px;
}

/* ===== 主体 ===== */
.main {
  flex: 1; max-width: 1180px; width: 100%; margin: 0 auto;
  padding: 20px 16px 36px; display: flex; flex-direction: column; gap: 16px;
}

/* ===== 投保参数信息条（绿色） =====
 * 统一为 CSS Grid 固定列布局：标签 / 输入框 / 单位 各占固定列宽，
 * 输入框固定宽度不随内容伸缩，垂直方向逐列对齐，水平等间距。 */
.strip {
  /* 参数条容器：仅负责上下两张卡片之间的间距 */
  display: grid;
  gap: 16px;
}
/* 上下两张独立卡片：绿色渐变 + 圆角 + 阴影，中间页面背景透出形成清晰边界 */
.strip-top,
.strip-bottom {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 70%, var(--brand-2));
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0,102,50,.22);
}
/* 上半部分：年龄/性别/交费期间/年缴存金额 */
.strip-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 6px 10px;
}
/* 下半部分：第一行 分红水平/红利实现率/万能结算/万能开户；第二行 总保费/标保/实际万能利率 */
.strip-bottom {
  display: grid;
  gap: 6px;
}
.strip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 6px 10px;
}
.strip-cell {
  display: flex; align-items: center; gap: 4px; color: #fff; min-width: 0;
}
.strip-label {
  font-size: 15px; opacity: .92; white-space: nowrap; font-weight: 400;
  /* 固定标签列宽（容最长可见标签「实际万能利率」≈90px），保证各列值框垂直对齐 */
  flex: 0 0 94px; text-align: left; line-height: 1.4;
}
.strip-unit { font-size: 15px; opacity: .9; white-space: nowrap; flex: 0 0 auto; font-weight: 400; }
.strip-val {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 8px; padding: 2px 6px;
  width: 96px; flex: 0 0 96px; min-width: 96px;
  text-align: center; overflow: hidden;
}
.strip-val input, .strip-val select {
  width: 100%; border: none; outline: none; background: transparent;
  color: #fff; font-size: 15px; font-weight: 400; text-align: center;
  font-family: inherit; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.strip-val input { cursor: text; }
.strip-val select option { color: #1c2b22; background: #fff; font-size: 15px; font-weight: 400; }
.strip-val-ro {
  font-size: 15px; font-weight: 400; color: #fff; line-height: 1.5;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 8px; padding: 2px 6px;
  width: 96px; flex: 0 0 96px; min-width: 96px;
  text-align: center; overflow: hidden; white-space: nowrap;
}
.strip-seg {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.32);
  width: 96px; flex: 0 0 96px;
}
.strip-seg .seg-btn {
  flex: 1; border: none; background: transparent; padding: 4px 0; font-size: 15px;
  font-weight: 400; color: rgba(255,255,255,.85); cursor: pointer; transition: all .15s;
}
.strip-seg .seg-btn.active { background: #fff; color: var(--brand-deep); }

/* ===== 高级设置（版块内折叠输入区） ===== */
.advanced {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px;
}
.advanced-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 600; color: var(--brand-deep);
  background: var(--brand-lighter);
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-arrow { transition: transform .2s; color: var(--text-3); }
.advanced[open] .advanced-arrow { transform: rotate(180deg); }
.advanced-panel { padding: 16px 18px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.adv-block { min-width: 0; }
.adv-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
/* 规划块标题行：复选框 + 标题，水平排列（点击标题行可切换勾选） */
.adv-title-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px; cursor: pointer; user-select: none;
}
.adv-title-row .adv-title { margin-bottom: 0; }
.adv-enable { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--brand-2); cursor: pointer; }
/* 部分领取计划块（独立于高级面板，置于「规划领取」标题下方）：卡片式承载输入 */
.wd-plan-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--card); margin-bottom: 12px;
}
/* 规划块停用（勾选框取消）：整体灰显，输入禁用 */
.wd-plan-block.plan-off .adv-grid { display: none; }  /* 未勾选：隐藏复选框下方的输入框区域（标题行仍可见可操作） */
/* 单网格四列：列标题 span 与每行 3 输入框 + 删除按钮 共用同一组列轨道，水平严格对齐。
 * .adv-head / .adv-row 用 display:contents 让子项直接落入容器网格，保证表头与输入框同列。 */
/* 两块规划网格（每年规划领取 / 万能账户灵活追加）共用同一固定列宽模板：
 * 起始/结束年龄 76px（容纳「请输入年龄」提示）、每年金额 104px（=表头小标题宽）、一共 76px、删除 44px —— 输入框宽贴近上方小标题，两卡片列严格对齐 */
/* R94：列宽改弹性（minmax(0,1fr)）撑满卡片内容区，消除 PC 右侧大片空白；
 * 第3列（每年金额）1.35fr 稍宽容纳「每年领取/追加金额（元）」长标题；第5列删除按钮固定 44px。
 * 两卡片共用同一模板 → 表头与输入框仍严格对齐。 */
.adv-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) 44px; gap: 8px; align-items: center; }
.adv-grid.cols-4 { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) 44px; }
.adv-head { display: contents; }
.adv-head span { font-size: 12px; color: var(--text-3); padding: 0 2px; white-space: normal; line-height: 1.25; }
.adv-row { display: contents; }
.adv-grid input {
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; font-size: 14px;
  color: var(--text); outline: none; background: #fbfdfb; width: 100%; height: 32px;
  text-align: center; /* R77：金额/年龄输入框文本强制居中 */
}
.adv-grid input:focus { border-color: var(--brand-2); }
/* 占位提示：浅灰色（明显浅于正式输入 #1c2b22），字号减小贴近表头小标题，聚焦平滑淡出、失焦空内容恢复 */
.adv-grid input::placeholder {
  color: #b6c2ba; opacity: 1; transition: opacity .25s ease; font-size: 10px;
}
.adv-grid input:focus::placeholder { opacity: 0; }
.adv-del {
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-3);
  cursor: pointer; font-size: 14px; height: 32px; width: 100%;
}
.adv-del:hover { border-color: #e5484d; color: #e5484d; }
/* 保底行（第一行）删除按钮：占位隐藏，保证所有行 grid item 数一致、与表头严格对齐 */
.adv-row-first .adv-del { visibility: hidden; }
/* R73：追加金额超限红框提示（clamp 自动修正时短暂显示） */
.adv-grid .adv-row.adv-over input.adv-amt { border-color: #e0533d; }
/* 一共领取/一共追加 展示单元格：与输入框同款外观（只读，不参与编辑） */
.adv-total {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 8px; font-size: 14px; color: var(--text);
  background: #fbfdfb; height: 32px; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 按钮置于表格最底部（跨越全部列），新增行后自动下移，始终位于最下方 */
.adv-add {
  grid-column: 1 / -1; justify-self: start; margin-top: 4px;
  border: 1px dashed var(--brand-2); border-radius: 8px; background: transparent;
  color: var(--brand-2); font-size: 14px; padding: 7px 14px; cursor: pointer;
}
.adv-add:hover { background: var(--brand-lighter); }
/* 规划块停用：输入/按钮禁用态 */
.adv-grid input:disabled,
.adv-del:disabled,
.adv-add:disabled {
  background: #eef2ee; color: var(--text-3); cursor: not-allowed; border-color: var(--border);
}
/* R88：规划领取 / 灵活追加卡片内文字统一居中（表头标签、输入值与占位提示、一共领取/追加、添加一行、删除） */
.wd-plan-block .adv-head span,
.wd-plan-block .adv-grid input,
.wd-plan-block .adv-grid input::placeholder,
.wd-plan-block .adv-total,
.wd-plan-block .adv-add,
.wd-plan-block .adv-del { text-align: center; }
/* R92：每年规划领取 + 万能账户灵活追加 并排各 50%（PC）；窄屏自动堆叠单列 */
.adv-pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  align-items: stretch; margin-bottom: 12px;
}
.adv-pair .wd-plan-block { margin-bottom: 0; }
@media (max-width: 760px) { .adv-pair { grid-template-columns: 1fr; } }

/* ===== 客群信息行（普客/高客） ===== */
.tier-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: var(--radius); padding: 10px 16px;
  font-size: 14px; color: var(--text-2); border: 1px solid var(--border);
  background: var(--card);
}
.tier-row.tier-high { border-color: #f0d9a8; background: #fdf8ec; }
.tier-row.tier-high .tier-tag { background: linear-gradient(135deg, #b8860b, #d4a017); color: #fff; }
.tier-row.tier-normal { border-color: var(--brand-border); background: var(--brand-lighter); }
.tier-row.tier-normal .tier-tag { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.tier-tag {
  flex: 0 0 auto; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
}
.tier-text { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.tier-links { flex: 0 0 auto; font-size: 13px; white-space: nowrap; }
.tier-links a { color: var(--brand-2); text-decoration: none; }
.tier-links a:hover { text-decoration: underline; }
.tier-sep { color: var(--text-3); margin: 0 4px; }

/* ===== 按钮 ===== */
/* R93：按钮行与下方三卡摘要区列宽精确对齐（左按钮=固定给付卡 1fr，右按钮=长期现金流+万能账户组 514px，gap 同 .summary3） */
.actions { display: grid; grid-template-columns: 1fr 514px; gap: 14px; }
.btn-calc {
  flex: 1; min-width: 220px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 17px; font-weight: 700; padding: 13px; cursor: pointer; letter-spacing: 2px;
  transition: transform .12s, box-shadow .2s, opacity .2s; box-shadow: 0 6px 16px rgba(0,132,61,.25);
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,132,61,.32); }
.btn-calc:active { transform: translateY(0); }
.btn-reset {
  flex: 1; min-width: 220px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text-2); font-size: 15px; padding: 9px; cursor: pointer; transition: all .18s;
}
.btn-reset:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* ===== 三栏摘要 ===== */
.summary3 {
  display: grid; grid-template-columns: 1fr 514px; gap: 14px;
}
/* 长期现金流 + 万能账户 成组：内部恒为两列并排，任何屏幕尺寸都不堆叠 */
.summary-pair {
  display: grid; grid-template-columns: 240px 260px; gap: 14px; min-width: 0;
}
.col {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; overflow: hidden;
}
.col-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.col-title { font-size: 16px; font-weight: 700; color: var(--brand-deep); }
.col-sub { font-size: 12px; color: var(--text-3); }

/* 固定给付表 */
.col-fixed { display: flex; flex-direction: column; }
.col-fixed .fixed-table { flex: 1; }
.fixed-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fixed-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.fixed-table tr:last-child td { border-bottom: none; }
/* 自动复利滚存表：可编辑年龄输入框 */
.data-table .age-cell {
  width: 60px; padding: 3px 4px; border: 1px solid var(--border); border-radius: 6px;
  text-align: center; font-size: 13px; color: var(--text-1); background: #fff;
  -moz-appearance: textfield; appearance: textfield;
}
.data-table .age-cell::-webkit-outer-spin-button,
.data-table .age-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.data-table .age-cell:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px rgba(0,122,83,.12); }
.data-table tr.age-invalid .age-cell { border-color: #e0533d; }
.ft-label {
  font-weight: 700; color: var(--brand-deep); white-space: nowrap;
  background: var(--brand-light); border-radius: 6px; text-align: center; width: 54px;
}
.ft-range { color: var(--text-2); white-space: nowrap; }
.ft-per { color: var(--text-2); white-space: nowrap; }
/* 可点击的保险责任文本（点击弹出对应条款责任） */
.fixed-table td[data-liab] {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(0,122,83,.35);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.fixed-table td[data-liab]:hover {
  color: var(--brand-deep);
  text-decoration-color: var(--brand-deep);
}
.fixed-table td[data-liab]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.ft-cum { text-align: center; color: var(--text-3); white-space: nowrap; }
.ft-cum b { color: var(--gold); font-size: 14px; }

/* 长期现金流 */
.cash-box { display: flex; flex-direction: column; height: 100%; justify-content: space-between; gap: 8px; }
.cash-title {
  text-align: center; font-size: 16px; font-weight: 700; color: var(--brand-deep);
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--brand-light);
}
.cash-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 6px 12px; background: var(--brand-lighter); border-radius: 8px;
}
.cash-name { font-size: 14px; color: var(--text-2); }
.cash-val { font-size: 20px; font-weight: 700; color: var(--brand); }
.cash-unit { font-size: 13px; color: var(--text-3); }
.cash-row.total {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  box-shadow: 0 4px 12px rgba(0,102,50,.22);
}
.cash-row.total .cash-name { color: rgba(255,255,255,.9); }
.cash-row.total .cash-val { color: #fff; }
.cash-row.total .cash-unit { color: rgba(255,255,255,.85); }

/* 万能账户 */
.univ-box { display: flex; flex-direction: column; height: 100%; }
.univ-title {
  text-align: center; font-size: 16px; font-weight: 700; color: var(--brand-deep);
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--brand-light);
}
.univ-body { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: space-between; }
.univ-desc { font-size: 13px; color: var(--text-2); text-align: center; line-height: 1.7; }
.univ-rows { display: flex; flex-direction: column; gap: 8px; }
.univ-row {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--gold-light); border: 1px solid #f0e2b8; border-radius: 8px; padding: 7px 12px;
}
.univ-name { font-size: 13px; color: #8a6d1f; }
.univ-row b { font-size: 17px; font-weight: 700; color: var(--gold); }
.univ-note { font-size: 11px; color: var(--text-3); text-align: right; }
.univ-note a { color: var(--brand-2); text-decoration: none; font-size: 13px; }
.univ-note a:hover { text-decoration: underline; }

/* ===== IRR 速览 ===== */
.irr-strip {
  background: var(--gold-light); border: 1px solid #f0e2b8; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; color: #8a6d1f;
}
.irr-title { font-weight: 700; color: var(--gold); }

/* ===== 区块标题（橙色横幅→绿色） ===== */
.banner {
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px;
  padding: 10px 16px; border-radius: 10px 10px 0 0; margin-bottom: 10px;
}
/* R76+R79：版块标题行（复选框 + 标题，绿色渐变背景）——勾选显示数据，不勾选仅显示标题 */
.section-head {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
  color: #fff; padding: 10px 16px; border-radius: 10px 10px 0 0;
  margin-bottom: 10px;
}
.section-head .section-title {
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px; flex: 1;
}
.section-toggle {
  width: 18px; height: 18px; flex: 0 0 auto;
  accent-color: var(--brand-2); cursor: pointer;
}
/* R76：折叠——不勾选时隐藏标题行之外的内容（仅显示版块标题） */
.section-collapsed > .table-wrap,
.section-collapsed > .section-note,
.section-collapsed > .adv-block,
.section-collapsed > .detail-interval { display: none !important; }
/* R86：完全隐藏版块（连标题栏一起）；DOM 与计算渲染逻辑保留，去掉 class 即可恢复 */
.section-hidden { display: none !important; }
.section { margin-bottom: 4px; }
.section + .section { margin-top: 14px; }
.section-note { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
/* R82：字段说明逐条分段换行（块级行）；条件行 display:none 时不留空行 */
.section-note .note-line { display: block; }
.section-note .note-head { margin-bottom: 2px; }
/* R85：「灵活追加」「规划领取」两条说明用页面协调的深砖红（同警示色系但加深，保证 13px 小字可读） */
.section-note .note-line[data-note] { color: #c0392b; font-weight: 500; }
.section-note .note-line[data-note] b { color: inherit; font-weight: 700; }
/* R87：仅 PC / 桌面端生效——字段说明左右两栏 + 中间的竖向分隔线（平板、手机、触屏设备不应用） */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .section-note {
    column-count: 2;
    column-gap: 36px;
    column-rule: 2px solid #8ab39b;
  }
  .section-note .note-head { column-span: all; margin-bottom: 6px; }
  .section-note .note-line { break-inside: avoid; }
}

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 10px;
  background: #fff;
}
.data-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.data-table th, .data-table td {
  padding: 8px 12px; text-align: center; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--brand-light); color: var(--brand-deep); font-weight: 600; text-align: center; font-size: 13px;
  position: sticky; top: 0;
}
.data-table td:first-child, .data-table th:first-child { text-align: center; }
.data-table tbody tr:nth-child(even) { background: #f7fbf8; }
.data-table tbody tr:hover { background: var(--brand-lighter); }
.data-table td.accent { color: var(--brand); font-weight: 600; }
.data-table td.gold { color: var(--gold); font-weight: 600; }
.data-table tr.sum-row td {
  background: var(--gold-light) !important; border-top: 2px solid #f0e2b8;
  font-weight: 700; color: var(--gold);
}
.data-table tr.sum-row td:first-child { text-align: center; }

/* 灵活利益演示表：勾选状态控制「灵活追加」「规划领取」列显隐 */
.data-table.hide-flex-add .col-flex-add,
.data-table.hide-plan-wd .col-plan-wd { display: none; }

/* 详细利益演示表：首列「年龄」与自动复利滚存表可编辑年龄列（.age-cell 60px）同宽，保证两表列对齐 */
#detailTable th:first-child,
#detailTable td:first-child { width: 60px; }

/* 两表并排 */
.two-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.half { min-width: 0; }

/* ===== 详细利益演示 ===== */
.detail-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
/* R79：详细利益演示标题行——负 margin 抵消 detail-card 的 padding，使其与自动复利滚存/灵活追加与领取标题行左边缘对齐（三版块复选框水平对齐一致） */
.detail-head.section-head {
  margin: -20px -20px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
}
/* R84：自动复利滚存 / 详细利益演示两个版块标题栏的标签，样式完全一致 */
.section-head .card-tag {
  margin-left: auto; flex: 0 0 auto; white-space: nowrap;
  color: rgba(255,255,255,.9); font-size: 13px;
}
/* 窄屏：标题较长，标签另起一行，避免被挤出屏幕（两个版块共用同一规则） */
@media (max-width: 760px) {
  .section-head { flex-wrap: wrap; gap: 8px 10px; }
  .section-head .card-tag {
    width: 100%; margin-left: 0; padding-left: 28px; box-sizing: border-box;
    text-align: left; white-space: normal;
  }
}

/* 演示间隔标签（标题下方、表格上方） */
.detail-interval {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.interval-label { font-size: 13px; color: var(--text-3); margin-right: 2px; }
.interval-btn {
  border: 1px solid var(--brand-border); background: #fff; color: var(--brand-deep);
  font-size: 13px; padding: 6px 18px; border-radius: 999px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.interval-btn:hover { background: var(--brand-lighter); }
.interval-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== 风险提示 ===== */
.risk {
  background: var(--brand-lighter); border: 1px solid var(--brand-border); border-radius: var(--radius);
  padding: 14px 18px; font-size: 13px; color: var(--text-2);
}
.risk-note { margin-bottom: 6px; font-weight: 500; }
.risk-desc { color: var(--text-3); font-size: 15px; font-weight: 700; }

/* ===== 加载/错误 ===== */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px; color: var(--text-2); }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-box {
  background: #fdecec; border: 1px solid #f5c2c2; color: #b3271d; padding: 14px 16px;
  border-radius: 10px; font-size: 14px;
}

.footer { text-align: center; padding: 18px 16px; color: var(--text-3); font-size: 13px; }

/* ===== 保险责任弹窗 ===== */
.liab-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
/* hidden 属性须显式覆盖 display:flex，否则弹窗常显 */
.liab-modal[hidden] { display: none; }
.liab-overlay {
  position: absolute; inset: 0;
  background: rgba(12, 24, 18, .55);
  backdrop-filter: blur(2px);
}
.liab-dialog {
  position: relative; width: 100%; max-width: 560px;
  max-height: min(78vh, 640px);
  background: #fff; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 40, 20, .28);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: liab-pop .18s ease-out;
}
@keyframes liab-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.liab-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.06); color: var(--text-2);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.liab-close:hover { background: rgba(0,0,0,.12); color: var(--text-1); }
.liab-head {
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 70%, var(--brand-2));
  color: #fff; flex: 0 0 auto;
}
.liab-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45);
  border-radius: 20px; padding: 2px 10px; margin-bottom: 8px;
}
.liab-title { font-size: 20px; font-weight: 700; margin: 0; }
.liab-body {
  padding: 18px 20px 22px; overflow-y: auto;
  font-size: 14px; line-height: 1.75; color: var(--text-1);
}
.liab-body p { margin: 0 0 12px; }
.liab-body p:last-child { margin-bottom: 0; }
.liab-body .liab-para { font-weight: 700; color: var(--brand-deep); margin-bottom: 6px; }
.liab-body ul { margin: 0 0 12px; padding-left: 18px; }
.liab-body ul:last-child { margin-bottom: 0; }
.liab-body li { margin-bottom: 6px; }
.liab-body li:last-child { margin-bottom: 0; }
.liab-body .liab-note {
  background: var(--brand-light); border-left: 3px solid var(--brand);
  border-radius: 6px; padding: 8px 12px; margin-top: 4px;
  color: var(--text-2); font-size: 13px;
}

/* ===== 移动端 ===== */
@media (max-width: 900px) {
  .summary3 { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  /* 成组内部窄屏改为两等分，仍然并排、不堆叠 */
  .summary-pair { grid-template-columns: 1fr 1fr; }
  .two-tables { grid-template-columns: 1fr; }
  .strip-top, .strip-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .titlebar { padding: 18px 0; }
  .strip { gap: 12px; }
  .strip-top, .strip-bottom { padding: 6px 8px; }
  .strip-top, .strip-row { grid-template-columns: repeat(2, 1fr); gap: 5px 8px; }
  .strip-label { flex: 0 0 74px; font-size: 12px; }
  .strip-val, .strip-val-ro, .strip-seg { width: 88px; flex: 0 0 88px; min-width: 88px; }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 7px 9px; }
  .adv-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) 40px; gap: 6px; }
  .adv-grid.cols-4 { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr) minmax(0,1fr) 40px; }
  .adv-grid input { padding: 4px 8px; font-size: 13px; height: 30px; }
  .adv-del { height: 30px; }
  .adv-total { font-size: 13px; }
  .advanced-panel { grid-template-columns: 1fr; }
  .liab-modal { padding: 12px; }
  .liab-dialog { max-height: 82vh; }
  .liab-head { padding: 16px 16px 12px; }
  .liab-title { font-size: 18px; }
  .liab-body { padding: 14px 16px 18px; font-size: 13.5px; }
}
