/* ===== 泰康幸福赢家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; }

/* ===== 顶部标题栏 ===== */
.titlebar {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 60%, var(--brand-2) 100%);
  color: #fff;
  padding: 22px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.titlebar::after {
  content: ""; position: absolute; right: -60px; top: -70px;
  width: 200px; height: 200px; background: rgba(255,255,255,.07); border-radius: 50%;
}
.titlebar::before {
  content: ""; position: absolute; left: -50px; bottom: -90px;
  width: 180px; height: 180px; background: rgba(255,255,255,.06); border-radius: 50%;
}
.titlebar-title {
  font-size: clamp(20px, 3.4vw, 28px); font-weight: 700; letter-spacing: 2px;
  position: relative; z-index: 1;
}
.titlebar-sub {
  margin-top: 6px; font-size: 14px; opacity: .9; letter-spacing: 1px;
  position: relative; z-index: 1;
}

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

/* ===== 投保参数信息条（绿色） ===== */
.strip {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 70%, var(--brand-2));
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 22px;
  box-shadow: 0 6px 18px rgba(0,102,50,.22);
}
.strip-cell {
  display: flex; align-items: center; gap: 6px; color: #fff;
}
.strip-label {
  font-size: 13px; opacity: .92; white-space: nowrap; font-weight: 500;
}
.strip-unit { font-size: 13px; opacity: .9; white-space: nowrap; }
.strip-val {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 8px; padding: 3px 10px; min-width: 64px; text-align: center;
}
.strip-val input, .strip-val select {
  width: 100%; border: none; outline: none; background: transparent;
  color: #fff; font-size: 16px; font-weight: 700; 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; }
.strip-val-ro { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.5; }
.strip-seg { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.32); }
.strip-seg .seg-btn {
  border: none; background: transparent; padding: 4px 14px; font-size: 15px;
  font-weight: 700; 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;
}
.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); }
.adv-block + .adv-block { margin-top: 16px; }
.adv-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.adv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.adv-head { display: contents; }
.adv-head span { font-size: 12px; color: var(--text-3); padding: 0 2px; }
.adv-grid input {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px;
  color: var(--text); outline: none; background: #fbfdfb; width: 100%;
}
.adv-grid input:focus { border-color: var(--brand-2); }
.adv-del {
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-3);
  cursor: pointer; font-size: 14px; height: 38px;
}
.adv-del:hover { border-color: #e5484d; color: #e5484d; }
.adv-add {
  margin-top: 10px; 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); }

/* ===== 按钮 ===== */
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.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 240px 260px; gap: 14px;
}
.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); }

/* 固定给付表 */
.fixed-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fixed-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); }
.fixed-table tr:last-child td { border-bottom: none; }
.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; }
.ft-cum { text-align: right; 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: center; 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: center; }
.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; }

/* ===== 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;
}
.section { margin-bottom: 4px; }
.section + .section { margin-top: 14px; }
.section-note { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }

/* ===== 表格 ===== */
.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: right; 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; }

/* 两表并排 */
.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;
}
.detail-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.detail-head h2 { font-size: 19px; font-weight: 700; color: var(--brand-deep); }
.card-tag { font-size: 14px; color: var(--text-2); }

/* ===== 风险提示 ===== */
.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); }

/* ===== 加载/错误 ===== */
.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; }

/* ===== 移动端 ===== */
@media (max-width: 900px) {
  .summary3 { grid-template-columns: 1fr; }
  .two-tables { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .titlebar { padding: 18px 14px; }
  .strip { padding: 12px; gap: 10px 14px; }
  .strip-cell { flex: 1 1 auto; }
  .actions { flex-direction: column; }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 7px 9px; }
  .adv-grid { grid-template-columns: 1fr 1fr; }
}
