/* ===== 泰康健康有约L款 利益演示器 样式 ===== */
/* PC + 手机端自适应 */

:root {
  --brand: #0a4d8f;          /* 泰康深蓝 */
  --brand-2: #0d63b4;
  --brand-light: #e8f1fb;
  --brand-lighter: #f4f8fd;
  --accent: #e8590c;         /* 强调橙 */
  --green: #12805c;
  --text: #1c2534;
  --text-2: #5a6b82;
  --text-3: #8a98ab;
  --border: #e2e8f0;
  --bg: #f2f5f9;
  --card: #ffffff;
  --shadow: 0 2px 10px rgba(16, 42, 77, 0.07), 0 10px 30px rgba(16, 42, 77, 0.05);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性优先于任何 display 设置 */
[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.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== 头部 ===== */
.hero {
  background: linear-gradient(135deg, #083b6e 0%, #0a4d8f 55%, #0d63b4 100%);
  color: #fff;
  padding: 44px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 260px; height: 260px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.hero::before {
  content: "";
  position: absolute;
  left: -60px; bottom: -100px;
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.hero-inner { max-width: 960px; margin: 0 auto; position: relative; z-index: 1; }
.brand-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  backdrop-filter: blur(4px);
}
.hero-title { font-size: clamp(22px, 4vw, 30px); font-weight: 700; letter-spacing: 1px; }
.hero-sub { margin-top: 8px; font-size: 14px; opacity: 0.9; }
.hero-plan {
  margin-top: 12px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #dbe9f8;
}

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-head h2 { font-size: 19px; font-weight: 700; color: var(--brand); }
.card-tag { font-size: 13px; color: var(--text-2); }

/* ===== 表单 ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(13, 99, 180, 0.12);
  background: #fff;
}
.input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 11px 14px;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}
.input-wrap .unit {
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-3);
  border-left: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.select-wrap select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 11px 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-3);
  pointer-events: none;
}

/* 分段选择 */
.segmented {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fbfcfe;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s;
}
.seg-btn.active {
  background: var(--brand);
  color: #fff;
}

.calc-hint {
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--brand-lighter);
  border-left: 3px solid var(--brand-2);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.calc-hint.error { background: #fdf0ec; border-left-color: var(--accent); color: #a13a0c; }

.btn-calc {
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 6px 16px rgba(10, 77, 143, 0.25);
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(10, 77, 143, 0.32); }
.btn-calc:active { transform: translateY(0); }
.btn-calc:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-reset {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  padding: 9px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-reset:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* ===== 结果 ===== */
.premium-box {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-lighter), #fff);
  border: 1px solid #dbe7f5;
  margin-bottom: 24px;
}
.premium-main { display: flex; flex-direction: column; justify-content: center; }
.premium-label { font-size: 14px; color: var(--text-2); }
.premium-value {
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 800;
  color: var(--brand);
  line-height: 1.15;
  letter-spacing: -1px;
}
.premium-value .cny { font-size: 0.55em; font-weight: 700; margin-right: 2px; color: var(--brand-2); }
.premium-note { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.premium-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border-left: 1px dashed #c8d8ea;
  padding-left: 20px;
}
.side-item { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.side-item span { color: var(--text-2); }
.side-item b { color: var(--text); font-weight: 700; }

.section { margin-bottom: 26px; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px; height: 18px;
  background: var(--brand);
  border-radius: 2px;
}
.section-note { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.section-note.small { font-size: 12px; color: var(--text-3); margin-top: 10px; margin-bottom: 0; }

/* 保险责任列表 */
.liab-list { display: flex; flex-direction: column; gap: 8px; }
.liab-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
}
.liab-item.optional { background: #fffdf6; border-color: #f0e3c8; }
.liab-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}
.liab-item.optional .liab-icon { background: #b8892e; }
.liab-body { flex: 1; min-width: 0; }
.liab-name { font-size: 15px; font-weight: 700; color: var(--text); }
.liab-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.liab-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.meta-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: #eef3f9;
  color: var(--text-2);
  white-space: nowrap;
}
.meta-chip.amount { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.meta-chip.warn { background: #fdf0ec; color: var(--accent); }

/* 现金价值表 */
.cv-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 420px;
}
.cv-table th, .cv-table td {
  padding: 11px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.cv-table th:first-child, .cv-table td:first-child { text-align: left; }
.cv-table thead th {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  position: sticky;
  top: 0;
}
.cv-table tbody tr:last-child td { border-bottom: none; }
.cv-table tbody tr:hover { background: var(--brand-lighter); }
.cv-table td.highlight { color: var(--green); font-weight: 700; }
.cv-table td.na { color: var(--text-3); }

.source-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.source-list li { padding-left: 16px; position: relative; }
.source-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
}

/* ===== 加载 / 错误 ===== */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; color: var(--text-2); }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-box {
  background: #fdf0ec;
  border: 1px solid #f2c9b8;
  color: #a13a0c;
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
}

.footer {
  text-align: center;
  padding: 20px 24px 30px;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: #fff;
}
.footer p { max-width: 800px; margin: 0 auto; }

/* ===== 响应式：手机端 ===== */
@media (max-width: 720px) {
  .hero { padding: 32px 16px 30px; }
  .hero-title { font-size: 21px; }
  .main { padding: 16px 12px 30px; gap: 16px; }
  .card { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .premium-box { grid-template-columns: 1fr; gap: 14px; }
  .premium-side { border-left: none; border-top: 1px dashed #c8d8ea; padding-left: 0; padding-top: 14px; }
  .premium-value { font-size: 36px; }
  .card-head { flex-direction: column; gap: 4px; }
  .card-head h2 { font-size: 17px; }
  .liab-item { flex-direction: row; }
  .liab-icon { width: 34px; height: 34px; font-size: 16px; }
  .cv-table { font-size: 13px; min-width: 360px; }
  .cv-table th, .cv-table td { padding: 9px 12px; }
  .input-wrap input, .select-wrap select, .seg-btn { padding: 12px 12px; font-size: 15px; }
}
@media (max-width: 380px) {
  .hero-title { font-size: 19px; }
  .premium-value { font-size: 32px; }
}
