* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }

:root {
  --blue: #2E6BF6;
  --blue-soft: #EDF3FF;
  --ink: #14181F;
  --ink2: #5C6675;
  --ink3: #9BA4B2;
  --line: #EFF1F5;
  --bg: #F4F5F7;
  --card: #fff;
  --gold: #D98B20;
  --gold-soft: #FDF3E3;
  --green: #0FA968;
  --red: #E5484D;
}

html, body {
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
}

body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
#app { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- shell ---------- */
.appbar {
  flex: none; padding: 14px 18px 10px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
}
.appbar .t { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.appbar .u { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(140deg, #7FA8FF, #2E6BF6);
  color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none;
}
.notice {
  flex: none; margin: 0 14px 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--gold-soft); color: #9A6415; font-size: 12px; line-height: 1.45; display: flex; gap: 6px;
}
.notice:empty { display: none; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.submitbar { flex: none; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }

.tabbar {
  flex: none; background: #fff; border-top: 1px solid var(--line);
  display: flex; align-items: center; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--ink3); background: none; border: 0; padding: 0; font-family: inherit;
}
.tabbar .tab.on { color: var(--blue); font-weight: 600; }
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab .badge {
  position: absolute; transform: translate(14px, -4px); background: var(--red); color: #fff;
  border-radius: 8px; font-size: 9px; padding: 1px 4px; min-width: 14px; text-align: center;
}

/* ---------- primitives ---------- */
.card { background: var(--card); border-radius: 14px; padding: 13px 14px; }
.label { font-size: 13.5px; font-weight: 600; }
.hint { font-size: 11.5px; color: var(--ink3); font-weight: 400; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.divider { height: 1px; background: var(--line); margin: 11px 0; }
.link { font-size: 12.5px; color: var(--ink2); }
.muted { color: var(--ink3); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
  background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 600;
  padding: 7px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; border: 0; font-family: inherit;
}
.chip b { font-weight: 400; color: #7E9DE0; font-size: 14px; }
.chip-add { background: #fff; border: 1px dashed #C6D2E4; color: var(--ink2); font-weight: 500; }

.opts { display: flex; gap: 8px; margin-top: 10px; }
.opts.grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.opts.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.opt {
  position: relative; flex: 1; text-align: center; padding: 10px 4px; border-radius: 9px;
  border: 1px solid #E3E7EE; font-size: 12.5px; color: var(--ink2); background: #fff;
  white-space: nowrap; font-family: inherit;
}
.opt.on { border-color: var(--blue); color: var(--blue); font-weight: 600; background: #F7FAFF; }
.opt em {
  position: absolute; right: -1px; bottom: -1px; width: 15px; height: 15px; background: var(--blue);
  color: #fff; font-size: 9px; border-radius: 8px 0 8px 0; display: flex; align-items: center;
  justify-content: center; font-style: normal;
}
.rule-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.rule-row .rule-name { width: 62px; flex: none; font-size: 12.5px; color: var(--ink2); }
.rule-row .opt { padding: 9px 4px; }

textarea, input[type="text"], input[type="tel"], input[type="password"], input[type="number"] {
  width: 100%; border: 1px solid #E9ECF2; border-radius: 9px; padding: 10px 11px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #FAFBFC; outline: none;
}
textarea:focus, input:focus { border-color: #B9CDF7; background: #fff; }
textarea { resize: none; min-height: 62px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
.field { margin-top: 10px; }
.field-label { font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; }

.btn {
  width: 100%; height: 48px; border-radius: 12px; border: 0; font-size: 16px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #4C82FF, #2E6BF6); font-family: inherit;
  box-shadow: 0 6px 16px rgba(46, 107, 246, .26);
}
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid #C9DAFB; box-shadow: none; }
.btn.sm { height: 34px; width: auto; padding: 0 16px; font-size: 13px; border-radius: 9px; }
.btn.block-sm { width: 100%; height: 34px; font-size: 13px; border-radius: 9px; }

/* ---------- quote cards ---------- */
.quote-head { background: #fff; border-radius: 14px; padding: 13px 14px; }
.ticker { display: flex; align-items: center; gap: 7px; }
.mkt { font-size: 10px; padding: 1.5px 5px; border-radius: 4px; border: 1px solid #E2B4B4; color: #C04747; background: #FDF3F3; }
.mkt.sh { color: #3E7BB6; border-color: #B4CDE2; background: #F1F7FD; }
.name { font-size: 15.5px; font-weight: 700; }
.code { font-size: 12px; color: var(--ink3); }
.tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2.5px 7px; border-radius: 5px; background: #F2F4F8; color: var(--ink2); }
.tag.blue { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.tag.green { background: #EAF7F0; color: var(--green); font-weight: 600; }
.tag.red { background: #FDEDED; color: var(--red); font-weight: 600; }
.tag.gold { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

.grp-title { display: flex; align-items: center; gap: 8px; margin: 4px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.grp-title .line { flex: 1; height: 1px; background: #E4E8EF; }

.q { background: #fff; border-radius: 14px; padding: 12px 14px; }
.q.expired { opacity: .55; }
.q .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.q .rate { font-size: 26px; font-weight: 700; color: var(--blue); letter-spacing: -.5px; line-height: 1.05; }
.q .rate small { font-size: 15px; font-weight: 600; }
.q .pill { font-size: 10px; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 6px; font-weight: 600; display: inline-block; }
.q .pill.best { background: #FFF0E6; color: #E0642B; }
.q .pill.strong { background: #F1F8F3; color: #12A05E; }
.q .cap { font-size: 11.5px; color: var(--ink3); margin-top: 4px; }
.q .right { text-align: right; flex: none; width: 128px; }
.q .amt { font-size: 17px; font-weight: 700; }
.q .amt span { font-size: 11.5px; color: var(--ink3); font-weight: 400; }
.q .rules { margin-top: 11px; background: #F7F8FA; border-radius: 9px; padding: 8px 10px; font-size: 11.5px; color: var(--ink2); line-height: 1.5; }
.q .valid { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #C07A18; margin-top: 9px; }
.q .valid.expired { color: var(--ink3); }
.q .quote-remark { margin-top: 8px; font-size: 11.5px; color: var(--ink2); background: #FFFBF3; border-radius: 8px; padding: 7px 9px; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink3); font-size: 13px; line-height: 1.7; }
.empty svg { width: 46px; height: 46px; opacity: .3; margin-bottom: 10px; }

/* ---------- sheet ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 20, 28, .45); z-index: 50;
  display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .18s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; background: #fff; border-radius: 18px 18px 0 0; max-height: 78dvh;
  display: flex; flex-direction: column; transform: translateY(12px); transition: transform .18s;
}
.mask.show .sheet { transform: none; }
.sheet-head { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.sheet-head .st { font-size: 16px; font-weight: 700; }
.sheet-head button { background: none; border: 0; font-size: 14px; color: var(--ink2); font-family: inherit; }
.sheet-body { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; flex: 1; }

/* ---------- 下单后联系工作人员 ---------- */
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 16px 18px; text-align: center; }
.qr-img { width: 220px; height: 220px; display: block; margin: 0 auto; }
.qr-title { margin-top: 16px; font-size: 16.5px; font-weight: 700; letter-spacing: .3px; }
.qr-sub { margin-top: 9px; font-size: 12.5px; color: var(--ink2); line-height: 1.75; }
.sr { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid #F5F6F9; }
.sr:last-child { border-bottom: 0; }
.sr .srn { font-size: 14.5px; font-weight: 600; }
.sr .src { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.sr .add { font-size: 12.5px; color: var(--blue); font-weight: 600; }
.sr .add.done { color: var(--ink3); font-weight: 400; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(20, 24, 31, .9); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 10px; z-index: 90; opacity: 0; transition: all .2s; pointer-events: none; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.risk-box { font-size: 12px; color: var(--ink2); line-height: 1.65; max-height: 150px; overflow-y: auto; background: #FAFBFC; border: 1px solid #EEF0F4; border-radius: 10px; padding: 11px 12px; }
.check-line { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.check-line input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--blue); }
