:root {
  --paper: #f4f6f3;
  --surface: #ffffff;
  --ink: #14201f;
  --muted: #6a7a76;
  --soft: #93a19c;
  --line: #e2e8e3;
  --line-strong: #cfd9d2;
  --accent: #0f6f63;
  --accent-deep: #0a4f47;
  --accent-soft: #e2f2ee;
  --amber: #a9651c;
  --amber-soft: #fbf0e2;
  --danger: #ad3f3a;
  --shadow: 0 22px 60px rgba(16, 58, 49, .12);
  --serif: "STZhongsong", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 8% -10%, #dcece5 0%, rgba(220, 236, 229, 0) 62%),
    radial-gradient(700px 480px at 100% 110%, #e7eee8 0%, rgba(231, 238, 232, 0) 60%),
    #edf2ed;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }

.app {
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  box-shadow: 0 0 0 1px rgba(20, 60, 50, .05), 0 34px 90px rgba(15, 52, 44, .14);
  padding-bottom: 78px;
  overflow: hidden;
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px;
  background: rgba(244, 246, 243, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 217, 210, .55);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; display: block; flex: none;
  box-shadow: 0 6px 16px rgba(15, 111, 99, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; letter-spacing: .02em; }
.brand-text small { font-weight: 500; font-size: 10px; color: var(--muted); letter-spacing: .08em; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.city-chip { font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 9px; }
.pill {
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  transition: transform .15s ease, background .2s ease;
}
.pill:active { transform: scale(.97); }
.pill.is-user { background: var(--accent-soft); color: var(--accent-deep); }

.view { padding: 0 18px 24px; }
.view > * { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; margin: 0 -18px; height: 396px;
  color: #fff; overflow: hidden; display: flex; align-items: flex-end;
  background: #174f45;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: heroIn 1.6s ease forwards; }
@keyframes heroIn { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 32, 28, .05) 0%, rgba(8, 32, 28, .18) 40%, rgba(7, 30, 26, .78) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 0 22px 26px; width: 100%; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.82); }
.hero-kicker::before { content: ""; width: 24px; height: 1px; background: rgba(255,255,255,.55); }
.hero h1 { font-family: var(--serif); font-size: 38px; line-height: 1.08; margin: 10px 0 8px; letter-spacing: .03em; font-weight: 700; }
.hero p { margin: 0; font-size: 13px; line-height: 1.7; color: rgba(255,255,255,.82); max-width: 320px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.btn-primary {
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 13px 22px; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 12px 26px rgba(8, 52, 45, .35);
  transition: transform .16s ease, background .2s ease;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.btn-ghost {
  border: 1px solid rgba(255,255,255,.42); color: #fff; border-radius: 999px;
  padding: 12px 18px; font-size: 13px; background: rgba(255,255,255,.06);
}
.hero-foot {
  position: absolute; z-index: 2; top: 16px; right: 18px;
  font-size: 10.5px; letter-spacing: .06em; color: #fff;
  background: rgba(8, 32, 28, .42);
  border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 5px 10px;
  backdrop-filter: blur(6px);
}

/* ---------- Sections ---------- */
.section { padding: 26px 0 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-family: var(--serif); font-size: 21px; margin: 0; letter-spacing: .02em; }
.section-head span { font-size: 11px; color: var(--soft); letter-spacing: .04em; }
.sub { color: var(--muted); font-size: 12px; line-height: 1.7; }

.picker {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .16s ease;
}
.picker:hover { border-color: var(--accent); box-shadow: 0 10px 24px rgba(15, 111, 99, .08); }
.picker:active { transform: scale(.995); }
.picker-main { display: flex; flex-direction: column; gap: 4px; }
.picker-label { font-size: 11px; color: var(--soft); letter-spacing: .06em; }
.picker-value { font-size: 15px; font-weight: 650; }
.picker-value.empty { color: var(--soft); font-weight: 500; }
.picker-arrow { color: var(--accent); font-size: 18px; }

.fee-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fee-cell { padding: 16px 10px 17px; border-right: 1px solid var(--line); }
.fee-cell:last-child { border-right: 0; }
.fee-cell b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.fee-cell b em { font-style: normal; font-size: 12px; font-family: var(--sans); font-weight: 500; color: var(--muted); margin-left: 2px; }
.fee-cell span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.fee-cell.is-actual b { color: var(--amber); font-size: 18px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border-radius: 14px; padding: 13px 14px;
  font-size: 12px; line-height: 1.7; color: var(--accent-deep);
}
.notice .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }

.steps { display: grid; gap: 0; }
.step-row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-num { font-family: var(--serif); font-size: 15px; color: var(--accent); padding-top: 1px; }
.step-row b { font-size: 14px; }
.step-row p { margin: 4px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }

.recent { border-top: 1px solid var(--line); }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.recent-row .t { font-size: 13px; font-weight: 650; }
.recent-row .s { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- Tabs / nav ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 560px); z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; color: var(--soft); font-size: 10.5px; border-radius: 12px; transition: color .2s ease, background .2s ease; }
.tab-ico { font-size: 16px; line-height: 1; width: 30px; height: 24px; display: grid; place-items: center; border-radius: 9px; transition: background .2s ease, color .2s ease; }
.tab.active { color: var(--accent); font-weight: 700; background: transparent; }
.tab.active .tab-ico { background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- Page title ---------- */
.page-head { padding: 22px 0 8px; }
.page-head .eyebrow { font-size: 10.5px; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.page-head h1 { font-family: var(--serif); font-size: 29px; margin: 8px 0 6px; letter-spacing: .02em; }
.page-head p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- Form ---------- */
.form-block { border-bottom: 1px solid var(--line); padding: 20px 0; }
.form-block:first-of-type { border-top: 1px solid var(--line); }
.form-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.form-label b { font-size: 14px; letter-spacing: .01em; }
.form-label b i { font-style: normal; color: var(--accent); font-family: var(--serif); margin-right: 8px; }
.form-label span { font-size: 11px; color: var(--soft); }
.select-trigger {
  width: 100%; min-height: 50px; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px;
}
.select-trigger .ph { color: var(--soft); font-size: 13px; }
.select-trigger .arrow { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 999px; padding: 6px 10px; font-size: 11.5px; font-weight: 600;
}
.chip.soft { background: #eef1ee; color: var(--muted); font-weight: 500; }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  border: 1px solid var(--line); background: var(--surface); border-radius: 13px;
  padding: 13px 14px; text-align: left; transition: border-color .18s ease, background .18s ease;
}
.choice b { display: block; font-size: 14px; }
.choice span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.choice.active b { color: var(--accent-deep); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 11.5px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 12px 13px; font-size: 14px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 111, 99, .1); }
.field textarea { min-height: 76px; resize: vertical; line-height: 1.65; }
.field label em.req { font-style: normal; font-size: 10px; font-weight: 700; color: var(--amber); letter-spacing: .04em; margin-left: 2px; }

.avatar-pick { display: flex; gap: 11px; flex-wrap: wrap; }
.avatar-opt {
  width: 44px; height: 44px; border-radius: 50%; position: relative;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  transition: transform .15s ease, border-color .15s ease;
}
.avatar-opt:active { transform: scale(.94); }
.avatar-opt.on { border-color: var(--accent); transform: scale(1.05); }
.avatar-opt.on::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.phone-row { display: flex; gap: 8px; align-items: stretch; }
.phone-row input { flex: 1; min-width: 0; }
.phone-row .btn-sm { flex: none; white-space: nowrap; padding: 0 14px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.person { display: flex; align-items: center; gap: 9px; }

.drug-list { display: grid; gap: 0; }
.drug-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drug-row:last-child { border-bottom: 0; }
.drug-info b { display: block; font-size: 13px; }
.drug-info span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 30px; height: 30px; color: var(--accent); font-size: 15px; }
.qty span { min-width: 26px; text-align: center; font-size: 12.5px; font-weight: 700; }
.link-btn { color: var(--accent); font-size: 12px; font-weight: 650; padding: 4px 0; }
.empty-line { color: var(--soft); font-size: 12px; padding: 10px 0; }

.paybar {
  position: fixed; bottom: 66px; left: 50%; transform: translateX(-50%);
  width: min(100%, 560px); z-index: 35;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.paybar .fee b { font-family: var(--serif); font-size: 21px; }
.paybar .fee span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.paybar .btn-primary { padding: 12px 20px; font-size: 13px; }

/* ---------- Orders ---------- */
.order { padding: 18px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; display: block; }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-code { font-size: 11px; color: var(--soft); letter-spacing: .06em; }
.status { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 4px 9px; background: #eef1ee; color: var(--muted); }
.status.s-submitted { background: var(--amber-soft); color: var(--amber); }
.status.s-contacted { background: var(--accent-soft); color: var(--accent-deep); }
.status.s-registered { background: #e8eefb; color: #365fa8; }
.status.s-purchased { background: #dcf0ea; color: #0b6155; }
.status.s-completed { background: #e4f4e7; color: #2f7c3d; }
.order-title { margin-top: 8px; font-size: 16px; font-weight: 700; }
.order-meta { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.order-drugs { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.order-pay { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); }
.order-pay .amt { font-size: 12px; color: var(--muted); }
.order-pay .amt b { font-size: 17px; color: var(--ink); font-family: var(--serif); }
.order-pay .hint { display: block; font-size: 10.5px; color: var(--soft); margin-top: 3px; }
.btn-sm { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 700; background: #fff; }
.btn-sm.solid { background: var(--accent); color: #fff; }

.timeline { display: flex; gap: 0; margin-top: 14px; }
.tl-step { flex: 1; position: relative; font-size: 9.5px; color: var(--soft); text-align: center; padding-top: 12px; }
.tl-step::before { content: ""; position: absolute; top: 3px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #d6dfd8; transform: translateX(-50%); }
.tl-step::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: calc(100% - 16px); height: 1px; background: #e0e7e1; }
.tl-step:last-child::after { display: none; }
.tl-step.done { color: var(--accent); font-weight: 650; }
.tl-step.done::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-step.done::after { background: var(--accent-soft); }

/* 订单详情纵向流程 */
.flow { display: grid; }
.flow-row { position: relative; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; font-size: 12.5px; color: var(--soft); }
.flow-row::before { content: ""; position: absolute; left: 6px; top: 24px; bottom: -8px; width: 1px; background: var(--line); }
.flow-row:last-child::before { display: none; }
.flow-dot { width: 9px; height: 9px; border-radius: 50%; background: #d6dfd8; margin-left: 2px; }
.flow-row.done { color: var(--ink); font-weight: 600; }
.flow-row.done .flow-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.flow-time { font-size: 11px; color: var(--soft); font-weight: 400; }

/* ---------- Me ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; }
.profile b { display: block; font-size: 17px; }
.profile span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.profile .avatar {
  display: grid; place-items: center; flex: none;
  color: #fff; font-family: var(--serif); font-size: 22px; margin-top: 0;
}
.menu { border-top: 1px solid var(--line); }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.menu-row .m { display: block; font-size: 13.5px; font-weight: 600; }
.menu-row .d { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.menu-row .r { color: var(--soft); font-size: 12px; }

/* ---------- Sheet ---------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(10, 26, 22, .42); backdrop-filter: blur(3px); z-index: 60; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); max-height: 86svh; z-index: 61;
  background: var(--surface); border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(8, 34, 28, .22);
  display: flex; flex-direction: column;
  animation: sheetUp .32s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheetUp { from { transform: translate(-50%, 24px); opacity: .4; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.sheet-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.sheet-close { width: 30px; height: 30px; border-radius: 50%; background: #f0f3f0; color: var(--muted); font-size: 15px; }
.sheet-body { padding: 14px 18px; overflow: auto; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn-primary { flex: 1; text-align: center; }

.search { width: 100%; border: 1px solid var(--line); background: #f7f9f7; border-radius: 12px; padding: 11px 13px; font-size: 13px; outline: none; }
.search:focus { border-color: var(--accent); }
.option-group { margin-top: 14px; }
.option-group h4 { margin: 0 0 6px; font-size: 11px; color: var(--soft); letter-spacing: .08em; font-weight: 600; }
.option { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #eef1ee; width: 100%; text-align: left; }
.option:last-child { border-bottom: 0; }
.option .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; font-size: 12px; color: #fff; }
.option.on .box { background: var(--accent); border-color: var(--accent); }
.option .o-main { flex: 1; }
.option .o-main b { display: block; font-size: 13.5px; }
.option .o-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.option .o-side { font-size: 11px; color: var(--soft); }
.option.disabled { opacity: .45; }

.success { text-align: center; padding: 8px 4px 0; }
.success-mark { width: 58px; height: 58px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 26px; margin: 0 auto 14px; }
.success h3 { font-family: var(--serif); font-size: 23px; margin: 0 0 6px; }
.success p { margin: 0 auto; font-size: 12.5px; line-height: 1.8; color: var(--muted); max-width: 300px; }
.success .code { display: inline-block; margin: 16px 0 4px; padding: 8px 14px; border-radius: 10px; background: #f4f7f4; font-size: 12px; letter-spacing: .08em; }
.success .wechat { margin-top: 14px; background: var(--accent-soft); color: var(--accent-deep); border-radius: 13px; padding: 12px 14px; font-size: 12px; line-height: 1.7; text-align: left; }
.success .wechat b { display: block; margin-bottom: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(18, 40, 34, .94); color: #fff; font-size: 12.5px;
  padding: 11px 16px; border-radius: 999px; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.divider { height: 1px; background: var(--line); margin: 20px 0; }
.muted { color: var(--muted); }
.tiny { font-size: 10.5px; }
.mono { font-variant-numeric: tabular-nums; }

@media (min-width: 720px) {
  body { padding: 28px 0; }
  .app { border-radius: 26px; min-height: calc(100svh - 56px); padding-bottom: 84px; }
  .tabbar { position: sticky; left: auto; transform: none; bottom: 0; border-radius: 0 0 26px 26px; }
  .paybar { position: sticky; left: auto; transform: none; bottom: 66px; border-radius: 0; }
  .hero { height: 430px; }
  .hero h1 { font-size: 44px; }
}
