:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6eaf0;
  --brand: #0e7490;
  --brand-d: #0c5e72;
  --brand-bg: #ecfeff;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px -8px rgba(15,23,42,.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.app {
  max-width: 600px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 24px);
}
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 14px; margin-bottom: 12px; }

.row { display: flex; gap: 10px; }
.field { margin-bottom: 11px; min-width: 0; }
.field.grow { flex: 1; }
.meal-field { flex: 1; min-width: 0; }
.transfer-field { flex: 2; min-width: 0; }
.field-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field-head label { margin-bottom: 0; }

input[type=date], input[type=number] {
  width: 100%; height: 42px; padding: 0 12px; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 11px; appearance: none; -webkit-appearance: none;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,116,144,.13); }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; height: 42px; }
.stepper button { width: 40px; height: 100%; border: none; background: #f8fafc; color: var(--brand); font-size: 20px; cursor: pointer; }
.stepper button:active { background: #e2e8f0; }
.stepper input { height: 100%; width: 46px; text-align: center; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; padding: 0; }
.stepper input:focus { box-shadow: none; }
.stepper.sm { height: 42px; }
.stepper.sm button { width: 34px; font-size: 18px; }
.stepper.sm input { width: 40px; }
.stepper-field .stepper { width: 100%; }
.stepper-field .stepper input { flex: 1; }
.nights-box { flex: 0 0 84px; }
.nights-val { height: 42px; display: flex; align-items: center; justify-content: center; background: var(--brand-bg); color: var(--brand-d); border-radius: 11px; font-weight: 700; }

/* custom dropdown */
.dd { position: relative; }
.dd-toggle {
  width: 100%; height: 42px; padding: 0 34px 0 12px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; font-size: 15px; color: var(--ink);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-toggle::after { content: ""; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px; margin-top: -5px;
  border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg); }
.dd.open .dd-toggle { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,116,144,.13); }
.dd-panel {
  position: absolute; z-index: 1000; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.dd-search { width: 100%; height: 40px; border: none; border-bottom: 1px solid var(--line); padding: 0 12px; font-size: 15px; }
.dd-search:focus { outline: none; }
.dd-list { max-height: 246px; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0; padding: 4px; list-style: none; }
.dd-opt { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.dd-opt:hover, .dd-opt.active { background: var(--brand-bg); color: var(--brand-d); }
.dd-opt.sel { font-weight: 700; }
.dd-opt.disabled { color: var(--faint); cursor: not-allowed; opacity: .7; }
.dd-opt.disabled:hover { background: none; }
.dd-tag-maint { color: #c0392b; font-size: 13px; margin-left: 6px; }
.dd-empty { padding: 14px 12px; color: var(--faint); font-size: 14px; text-align: center; }

/* rooms */
.rooms-summary { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.5; word-break: break-word; }
.rooms-summary:empty { display: none; }
.room-row { position: relative; overflow: hidden; border-radius: 11px; margin-bottom: 8px; background: var(--card); }
.room-row-content { display: flex; gap: 6px; align-items: center; background: var(--card); position: relative; z-index: 1; transition: transform .22s ease; touch-action: pan-y; }
.room-row-content .grow { flex: 1; }
.room-select { min-width: 0; }      /* 固定份宽，长房型名截断不撑变布局 */
.nights-dd { flex: 0 0 86px; }
.nights-dd .dd-panel { right: auto; min-width: 104px; }
/* 左滑露出的删除键：左侧留 6px 间距，与房型/晚数下拉间距一致（滑动距离 W=76 = 6 间距 + 70 按钮）*/
.room-del { position: absolute; top: 0; right: 0; height: 100%; width: 70px; border: none; background: #ef4444; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; z-index: 0; border-radius: 11px; }

/* 镂空添加按钮（白底虚线边） */
.add-btn { width: 100%; height: 42px; margin-top: 2px; background: #fff; border: 1px dashed var(--brand); color: var(--brand); border-radius: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.add-btn:active { background: var(--brand-bg); }

/* children：2 列撑满；年龄下拉 0-18；“+儿童”是同尺寸的镂空格子 */
.renew-notice { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3d18a; border-radius: 12px; padding: 11px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; font-weight: 600; }
.renew-notice.expired { background: #fdecec; color: #c0392b; border-color: #f0b8a8; }
.form-disabled { pointer-events: none; opacity: .5; filter: grayscale(.2); }
.child-policy { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -2px 0 8px; }
.child-policy:empty { display: none; }
.child-policy .cp-warn { color: var(--warn); font-weight: 600; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 0; }
.chip { display: flex; align-items: center; gap: 2px; height: 42px; background: #f1f5f9; border-radius: 11px; padding: 0 4px 0 4px; }
.chip.over-age { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn); }
.chip.over-age .age-dd .dd-toggle { color: var(--warn); font-weight: 600; }
.chip .age-dd { flex: 1; min-width: 0; }
.chip .age-dd .dd-toggle { height: 38px; background: transparent; border: none; box-shadow: none; padding: 0 22px 0 8px; font-size: 14px; }
.chip .age-dd .dd-toggle::after { right: 8px; }
.chip .age-dd .dd-panel { right: auto; min-width: 92px; }
.chip-x { flex: 0 0 24px; width: 24px; height: 30px; border: none; background: none; color: var(--faint); cursor: pointer; font-size: 13px; }
.chip-x:active { color: #b91c1c; }
.chip-add { height: 42px; background: #fff; border: 1px dashed var(--brand); color: var(--brand); border-radius: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip-add:active { background: var(--brand-bg); }

.link-btn { border: none; background: none; color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }

.cap-warn { background: #fef2f2; color: #b91c1c; font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.primary { width: 100%; height: 48px; margin-top: 4px; border: none; border-radius: 13px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.primary:active { background: var(--brand-d); }
.primary:disabled { opacity: .6; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 4px; }  /* 各按钮严格等宽 */
.actions .primary { width: auto; margin-top: 0; }
.secondary { flex: 1; height: 48px; border: 1.5px solid var(--brand); border-radius: 13px; background: #fff; color: var(--brand); font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.secondary:active { background: #f0f9ff; }
.secondary:disabled { opacity: .4; cursor: not-allowed; }
.actions .ghost { flex: 1; height: 48px; padding: 0; border: 1.5px solid #d0d5dd; border-radius: 13px; background: #fff; color: #667085; font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.actions .ghost:active { background: #f4f5f7; }

.hidden { display: none; }

/* result */
.result .match { font-size: 13px; font-weight: 700; padding: 9px 11px; border-radius: 10px; margin-bottom: 10px; }
.result .match.pkg { background: var(--ok-bg); color: var(--ok); }
.result .match.contract { background: var(--warn-bg); color: var(--warn); }
.line { padding: 11px 0; border-bottom: 1px solid var(--line); }
.line-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.line-top .formula { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); flex: 1; word-break: break-word; }
.line-top .amt { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-name { font-size: 12px; color: var(--faint); margin-top: 3px; }
.prov { margin: 6px 0 0; padding: 0; list-style: none; }
.prov li { font-size: 12px; color: var(--muted); line-height: 1.55; padding-left: 13px; position: relative; }
.prov li::before { content: "·"; position: absolute; left: 3px; color: var(--brand); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 13px; }
.total .t-label { font-size: 14px; color: var(--muted); }
.total .t-amt { font-size: 24px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.warns { margin-top: 10px; }
.warns div { font-size: 12px; color: var(--warn); padding: 3px 0; }
.error { color: #b91c1c; font-size: 14px; }

/* ---------- 额外信息按钮条 ---------- */
/* 移动端：flex-basis 占 1/3 → 始终 3 列，6 个按钮正好 3+3 撑满两行；同行 flex-grow 均分。
   PC：一行均分。反馈错误去掉 margin-left:auto，间距与其它按钮一致。 */
.info-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.info-btn { flex: 1 1 calc(33.333% - 6px); display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 8px; background: var(--brand-bg); color: var(--brand-d); border: 1px solid #cdeef4;
  border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.info-btn:active { background: #d7f4f9; }
.info-btn.feedback { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.info-btn.feedback:active { background: #f8fafc; }
@media (min-width: 600px) { .info-btn { flex: 1 1 0; } }

/* ---------- 弹窗 ---------- */
html.modal-open, body.modal-open { overflow: hidden; }   /* 弹窗打开锁住背景上下滚动（视口滚动元素是 html） */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade .15s ease;
  overscroll-behavior: contain; touch-action: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 82vh; border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px -10px rgba(15,23,42,.4); display: flex; flex-direction: column; animation: slideup .2s ease; }
@keyframes slideup { from { transform: translateY(20px); } to { transform: translateY(0); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 800; color: var(--ink); }
.modal-x { width: 30px; height: 30px; border: none; background: #f1f5f9; color: var(--muted); border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.modal-body { padding: 14px 18px 22px; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.info-list { margin: 0; padding-left: 18px; }
.info-list li { font-size: 14px; line-height: 1.7; color: var(--ink); margin-bottom: 9px; }
.info-list .info-list { margin-top: 6px; }                 /* 子列表与父项稍留间距 */
.info-list .info-list li { margin-bottom: 4px; color: var(--muted, #555); }  /* 子项更紧凑、稍弱 */

/* 反馈表单 */
.fb-hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.fb-reason { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-size: 15px;
  font-family: inherit; color: var(--ink); resize: vertical; box-sizing: border-box; }
.fb-reason:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,116,144,.13); }
.fb-actions { display: flex; gap: 10px; margin-top: 14px; }
.fb-actions button { flex: 1; height: 44px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; border: none; }
.btn-cancel { background: #f1f5f9; color: var(--muted); }
.btn-submit { background: var(--brand); color: #fff; }
.btn-submit:disabled { opacity: .6; }
.fb-status { font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }
.fb-status.ok { color: var(--ok); }
.fb-status.err { color: #b91c1c; }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 18px; }
}
