/* ============ 保费计算器 ============ */
.calculator-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #eef3ff 0%, #f7f9ff 40%, #ffffff 100%);
}

.calculator-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(30, 107, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(124, 92, 255, 0.14), transparent 55%);
}

.calculator-main {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 56px;
  box-sizing: border-box;
}

.calculator-inner {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  gap: 24px;
  align-items: start;
}

.calc-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(20, 50, 120, 0.08);
  border: 1px solid rgba(30, 107, 255, 0.06);
}

.calc-form-card {
  padding: 28px 30px 24px;
}

.calc-card-head {
  margin-bottom: 22px;
}

.calc-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #5a6a8a;
  text-decoration: none;
  margin-bottom: 14px;
  transition: color 0.15s;
}
.calc-back:hover { color: #1e6bff; }
.calc-back svg { width: 16px; height: 16px; }

.calc-title {
  font-size: 24px;
  font-weight: 700;
  color: #16233f;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.calc-subtitle {
  font-size: 13px;
  color: #8a96b3;
  margin: 0;
}

/* Form rows */
.calc-form { display: flex; flex-direction: column; gap: 20px; }

.form-row { display: flex; flex-direction: column; gap: 10px; }
.form-row.inline-row,
.form-row-switch {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.form-row-switch .form-label { margin-bottom: 0; }

.form-label {
  font-size: 15px;
  font-weight: 600;
  color: #2b3858;
  display: flex;
  align-items: center;
}
.form-label.required::before {
  content: "*";
  color: #f04438;
  margin-right: 6px;
  font-weight: 700;
}

.radio-group, .period-group, .surcharge-group, .inline-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.radio-item, .check-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  color: #465373;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}
.radio-item input, .check-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-item span {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
}
.radio-item span::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.6px solid #c5cde0;
  background: #fff;
  margin-right: 8px;
  transition: all 0.15s;
  box-sizing: border-box;
}
.radio-item input:checked + span { color: #1e6bff; font-weight: 600; }
.radio-item input:checked + span::before {
  border-color: #1e6bff;
  border-width: 5px;
  background: #fff;
}

.check-item span {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
}
.check-item span::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.6px solid #c5cde0;
  background: #fff;
  margin-right: 8px;
  transition: all 0.15s;
  box-sizing: border-box;
}
.check-item input:checked + span { color: #1e6bff; font-weight: 600; }
.check-item input:checked + span::before {
  background: #1e6bff;
  border-color: #1e6bff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Switch */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d4dae8;
  border-radius: 28px;
  transition: 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: 0.2s;
}
.switch input:checked + .switch-slider { background: #1e6bff; }
.switch input:checked + .switch-slider::before { transform: translateX(24px); }

/* Select */
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1.4px solid #dde3f0;
  border-radius: 10px;
  padding: 11px 42px 11px 14px;
  font-size: 15px;
  color: #2b3858;
  background: #fbfcff;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select-wrap select:focus {
  border-color: #1e6bff;
  box-shadow: 0 0 0 3px rgba(30,107,255,0.12);
}
.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8a96b3;
  pointer-events: none;
}

/* Period */
.period-custom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}
.period-custom input {
  width: 110px;
  border: 1.4px solid #dde3f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: #2b3858;
  background: #fbfcff;
  outline: none;
  box-sizing: border-box;
}
.period-custom input:focus { border-color: #1e6bff; box-shadow: 0 0 0 3px rgba(30,107,255,0.12); }
.period-suffix { font-size: 14px; color: #6b7898; }

/* Amount */
.amount-input {
  position: relative;
  display: flex;
  align-items: center;
}
.amount-input input {
  width: 100%;
  border: 1.4px solid #dde3f0;
  border-radius: 10px;
  padding: 11px 70px 11px 14px;
  font-size: 15px;
  color: #2b3858;
  background: #fbfcff;
  outline: none;
  box-sizing: border-box;
}
.amount-input input:focus { border-color: #1e6bff; box-shadow: 0 0 0 3px rgba(30,107,255,0.12); }
.amount-suffix {
  position: absolute;
  right: 16px;
  font-size: 15px;
  color: #8a96b3;
}

/* Surcharge */
.surcharge-extra {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}
.surcharge-label { font-size: 15px; color: #465373; }
.surcharge-extra input,
.inline-input input {
  border: 1.4px solid #dde3f0;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 14px;
  color: #2b3858;
  background: #fbfcff;
  outline: none;
  box-sizing: border-box;
  width: 96px;
}
.surcharge-extra input:focus,
.inline-input input:focus { border-color: #1e6bff; box-shadow: 0 0 0 3px rgba(30,107,255,0.12); }
.surcharge-sep { color: #a0abc2; font-size: 15px; }
.surcharge-unit { font-size: 15px; color: #465373; }

/* Inline groups */
.inline-group { display: inline-flex; align-items: center; gap: 14px; }
.inline-label { font-size: 15px; color: #465373; }
.inline-input { display: inline-flex; align-items: center; gap: 4px; }
.inline-input input { width: 110px; }
.inline-suffix { font-size: 14px; color: #6b7898; }

/* Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px dashed #e6ebf6;
}
.btn-reset, .btn-calculate {
  flex: 1;
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-reset {
  background: #f2f5fc;
  color: #5a6a8a;
}
.btn-reset:hover { background: #e7edfb; }
.btn-calculate {
  background: linear-gradient(135deg, #1e6bff 0%, #4a8bff 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30,107,255,0.28);
}
.btn-calculate:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(30,107,255,0.34); }
.btn-calculate:active { transform: translateY(0); }

/* ============ Result panel ============ */
.result-panel {
  background: linear-gradient(155deg, #2b63e8 0%, #3b56e0 40%, #5b3fd6 100%);
  border-radius: 18px;
  min-height: 620px;
  padding: 34px 36px;
  box-sizing: border-box;
  color: #fff;
  box-shadow: 0 16px 50px rgba(50, 70, 200, 0.32);
  position: relative;
  overflow: hidden;
}
.result-panel::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  border-radius: 50%;
}

.result-empty {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  text-align: center;
}
.result-empty-icon { color: rgba(255,255,255,0.55); }
.result-empty-icon svg { width: 88px; height: 88px; }
.result-empty-text {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.9;
  color: rgba(255,255,255,0.78);
}

.result-content { position: relative; z-index: 1; }

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.result-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
}
.result-format-tag {
  background: linear-gradient(135deg, #19c2ff 0%, #8a4dff 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px 8px 8px 0;
  white-space: nowrap;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}

.result-summary {
  background: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  color: #2b3858;
  margin-bottom: 22px;
}
.summary-tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: baseline;
}
.summary-item { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.summary-item-right { justify-content: flex-end; }
.summary-label { font-size: 18px; color: #465373; font-weight: 500; }
.summary-value {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e6bff 0%, #7c3cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.summary-value-dim { color: #6b7898; -webkit-text-fill-color: #6b7898; font-size: 24px; }
.summary-amount { font-size: 22px; font-weight: 600; color: #2b3858; }
.summary-tag {
  display: inline-block;
  background: linear-gradient(135deg, #1e6bff, #5b7cff);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
}
.summary-tag-min {
  background: linear-gradient(135deg, #5b7cff, #7c3cff);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #d4ddf2;
  color: #6b7898;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { border-color: #1e6bff; color: #1e6bff; }
.copy-btn svg { width: 15px; height: 15px; }

.result-detail {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 26px 22px;
  color: #2b3858;
}
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-title { font-size: 20px; font-weight: 700; margin: 0; }
.detail-meta { display: flex; gap: 28px; font-size: 14px; color: #6b7898; }
.detail-meta strong { color: #1e6bff; font-weight: 600; }

.detail-table-wrap { overflow-x: auto; }
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.detail-table th, .detail-table td {
  border: 1px solid #e4eaf7;
  padding: 14px 10px;
  text-align: center;
  vertical-align: middle;
}
.detail-table thead th {
  background: linear-gradient(180deg, #eef4ff 0%, #e3ecff 100%);
  color: #33446b;
  font-weight: 600;
  line-height: 1.4;
}
.detail-table .row-label {
  background: linear-gradient(180deg, #eef4ff 0%, #e3ecff 100%);
  font-weight: 600;
  color: #33446b;
  width: 90px;
}
.detail-table tbody tr.row-point td {
  background: linear-gradient(180deg, #eef3ff 0%, #e3eaff 100%);
  font-weight: 600;
  color: #2b3858;
}
.detail-table tbody tr.row-point.active td:last-child,
.detail-table tbody tr.row-min.active td:last-child {
  color: #1e6bff;
  font-size: 18px;
}
.detail-table tbody tr.row-min td {
  background: linear-gradient(180deg, #f4f1ff 0%, #ece8ff 100%);
  font-weight: 600;
  color: #2b3858;
}
.detail-table .cell-sep { color: #c2cbdf; }

.result-tip {
  margin: 16px 0 0;
  font-size: 13px;
  color: #8a96b3;
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1024px) {
  .calculator-inner { grid-template-columns: 1fr; }
  .result-panel { min-height: auto; }
  .result-empty { min-height: 320px; }
}
