/* ============================================================
   繁露义齿 · 业务员移动端（H5）
   设计令牌与小程序 / 后台保持一致：深墨蓝 + 香槟金 + 暖白。
   布局按「手机单手操作」重排：顶栏 + 内容区 + 底部四 tab，
   所有可点区域 ≥ 44px，金额用衬线数字，信息密度低。
   ============================================================ */

:root {
  --ink:   #0E2340;
  --ink2:  #1C3A5E;
  --ink3:  #5E7080;
  --ink4:  #8496A6;
  --gold:  #B08D57;
  --gold-d:#82663A;
  --gold-l:#F2ECE1;
  --paper: #F6F4F0;
  --card:  #FFFFFF;
  --line:  rgba(14,35,64,.09);
  --price: #A6482F;
  --ok:    #2F7D5C;
  --warn:  #B4791F;
  --danger:#C0392B;
  --ok-bg:   #EAF4EF;
  --warn-bg: #FBF2E2;
  --red-bg:  #FBEFEC;
  --gray-bg: #EFF1F3;
  --sh1: 0 1px 2px rgba(14,35,64,.04), 0 6px 20px rgba(14,35,64,.06);
  --sh2: 0 18px 50px rgba(14,35,64,.22);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--paper); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { overflow: hidden; }

.hide { display: none !important; }
.mono { font-family: Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink3); }
.dim { color: var(--ink4); }
.right { text-align: right; }

/* ---------------- 启动占位 ---------------- */
.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 82% 0%, #1E4478 0%, #14325C 34%, #0E2340 64%, #0A1B33 100%); }
.boot-mark { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(203,170,121,.4); color: #D8BC8E; font-family: Georgia, serif; font-size: 22px; letter-spacing: 1px; }

/* ---------------- 登录 ---------------- */
.login { position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(120% 120% at 82% 0%, #1E4478 0%, #14325C 34%, #0E2340 64%, #0A1B33 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .arc { position: absolute; border: 1px solid rgba(203,170,121,.13); border-radius: 50%; }
.login .arc.a1 { width: 300px; height: 300px; right: -110px; top: -90px; }
.login .arc.a2 { width: 460px; height: 460px; right: -190px; top: -170px; border-color: rgba(203,170,121,.08); }
.login .arc.a3 { width: 620px; height: 620px; right: -270px; top: -250px; border-color: rgba(203,170,121,.05); }

.login-box { position: relative; width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 30px; }
.brand .mark { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(203,170,121,.45); color: #D8BC8E;
  font-family: Georgia, serif; font-size: 21px; letter-spacing: 1px; }
.brand .ttl { color: #fff; font-size: 21px; letter-spacing: 6px; font-weight: 500; text-indent: 6px; }
.brand .sub { color: rgba(216,188,142,.75); font-size: 12px; letter-spacing: 3px; margin-top: 6px; text-indent: 3px; }

.login-form { background: rgba(255,255,255,.05); border: 1px solid rgba(203,170,121,.16);
  border-radius: 18px; padding: 22px 20px; backdrop-filter: blur(6px); }
.fld { display: block; margin-bottom: 14px; }
.fld span { display: block; color: rgba(255,255,255,.62); font-size: 12px; letter-spacing: 1px; margin-bottom: 7px; }
.fld input { width: 100%; height: 48px; border-radius: 12px; border: 1px solid rgba(203,170,121,.22);
  background: rgba(255,255,255,.06); color: #fff; font-size: 17px; padding: 0 14px; outline: none;
  letter-spacing: 1px; }
.fld input::placeholder { color: rgba(255,255,255,.34); letter-spacing: 0; font-size: 15px; }
.fld input:focus { border-color: rgba(203,170,121,.6); background: rgba(255,255,255,.1); }
#lg-code { text-transform: uppercase; letter-spacing: 5px; font-family: Georgia, serif; }

.btn-primary { width: 100%; height: 50px; margin-top: 8px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg,#CBA979,#B08D57); color: #23180A; font-size: 16px;
  font-weight: 600; letter-spacing: 4px; text-indent: 4px; }
.btn-primary:active { opacity: .85; }
.btn-primary[disabled] { opacity: .5; }
.login-hint { color: rgba(255,255,255,.42); font-size: 12px; margin: 14px 0 0; text-align: center; line-height: 1.7; }

/* ---------------- 主框架 ---------------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }

.topbar { flex: none; background: var(--ink); color: #fff; padding-top: var(--safe-t);
  display: flex; align-items: center; min-height: 56px; position: relative; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(176,141,87,.55), transparent); }
.tb-back { width: 52px; height: 56px; border: 0; background: transparent; color: #E7D5B8;
  font-size: 30px; line-height: 1; margin-top: -4px; }
.tb-title { flex: 1; min-width: 0; padding: 6px 4px; }
.tb-title h1 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title p { margin: 1px 0 0; font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .5px; }
.tb-action { height: 34px; padding: 0 14px; margin-right: 12px; border-radius: 17px;
  border: 1px solid rgba(203,170,121,.45); background: transparent; color: #D8BC8E; font-size: 13px; }

.page { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 28px; }

.tabbar { flex: none; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 7px; color: var(--ink4); text-decoration: none;
  font-size: 11px; letter-spacing: .5px; position: relative; }
.tabbar a i { display: block; font-style: normal; font-size: 19px; line-height: 1.25; margin-bottom: 1px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on i { color: var(--gold-d); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2px; border-radius: 0 0 2px 2px; background: var(--gold); }

/* ---------------- 通用块 ---------------- */
.card { background: var(--card); border-radius: 16px; box-shadow: var(--sh1); padding: 16px;
  margin-bottom: 12px; }
.card.tight { padding: 12px 14px; }
.card-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-hd .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--gold); }
.card-hd .tx { font-size: 14px; font-weight: 600; letter-spacing: .5px; }
.card-hd .more { margin-left: auto; font-size: 12px; color: var(--gold-d); }

.sec-title { font-size: 12px; color: var(--ink4); letter-spacing: 1.5px; margin: 18px 4px 8px; }

/* 待办四件套 */
.todos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.todo { background: var(--card); border-radius: 14px; padding: 13px 14px; box-shadow: var(--sh1);
  position: relative; overflow: hidden; }
.todo.hot { background: linear-gradient(160deg, #FBEFEC, #FFF8F6); }
.todo .k { font-size: 12px; color: var(--ink3); letter-spacing: .5px; }
.todo .v { font-size: 26px; line-height: 1.25; margin-top: 2px; font-family: Georgia, serif; }
.todo .u { font-size: 12px; color: var(--ink4); margin-left: 2px; font-family: inherit; }
.todo .sub { font-size: 11px; color: var(--ink4); margin-top: 1px; }
.todo.hot .v { color: var(--price); }

/* 本月三条数 */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card);
  border-radius: 16px; box-shadow: var(--sh1); overflow: hidden; }
.metric { padding: 15px 10px; text-align: center; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric .v { font-size: 19px; font-family: Georgia, serif; }
.metric .k { font-size: 11px; color: var(--ink4); margin-top: 3px; letter-spacing: .5px; }
.metric .v.accent { color: var(--price); }

/* 快捷入口 */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick button { height: 62px; border: 0; border-radius: 14px; background: var(--card);
  box-shadow: var(--sh1); color: var(--ink2); font-size: 13px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; }
.quick button i { font-style: normal; font-size: 18px; color: var(--gold-d); }

/* 列表行 */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 15px; font-weight: 500; letter-spacing: .3px; }
.row .s { font-size: 12px; color: var(--ink4); margin-top: 2px; }
.row .r { text-align: right; flex: none; }
.row .amt { font-family: Georgia, serif; font-size: 16px; }
.row .amt.red { color: var(--price); }

/* 诊所卡片 */
.clinic-card { background: var(--card); border-radius: 16px; box-shadow: var(--sh1);
  padding: 15px 16px; margin-bottom: 10px; }
.clinic-card .hd { display: flex; align-items: baseline; gap: 8px; }
.clinic-card .nm { font-size: 16px; font-weight: 600; letter-spacing: .3px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clinic-card .due { font-family: Georgia, serif; font-size: 17px; color: var(--price); }
.clinic-card .due.zero { color: var(--ink4); font-size: 14px; }
.clinic-card .ft { display: flex; align-items: center; gap: 10px; margin-top: 9px;
  font-size: 12px; color: var(--ink4); }

/* 徽章 */
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px;
  background: var(--gray-bg); color: var(--ink3); letter-spacing: .3px; }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.amber { background: var(--warn-bg); color: var(--warn); }
.pill.red   { background: var(--red-bg); color: var(--danger); }
.pill.gold  { background: var(--gold-l); color: var(--gold-d); }
.pill.blue  { background: #E8EFF8; color: var(--ink2); }

/* 表单 */
.fld2 { margin-bottom: 12px; }
.fld2 label { display: block; font-size: 12px; color: var(--ink3); margin-bottom: 6px; letter-spacing: .5px; }
.fld2 input, .fld2 select, .fld2 textarea {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 16px; padding: 0 13px; outline: none;
  font-family: inherit; }
.fld2 textarea { height: auto; padding: 11px 13px; line-height: 1.5; resize: none; }
.fld2 input:focus, .fld2 select:focus, .fld2 textarea:focus { border-color: var(--gold); }

.btn { height: 46px; border: 0; border-radius: 12px; font-size: 15px; letter-spacing: 1px;
  font-family: inherit; }
.btn.gold { background: linear-gradient(180deg,#CBA979,#B08D57); color: #23180A; font-weight: 600; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink2); }
.btn.danger { background: var(--red-bg); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; font-size: 13px; padding: 0 14px; border-radius: 18px; }
.btn[disabled] { opacity: .45; }

/* 订单行 */
.oline { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.oline:last-child { border-bottom: 0; }
.oline .m { flex: 1; min-width: 0; }
.oline .m .t { font-size: 14px; }
.oline .m .s { font-size: 11px; color: var(--ink4); margin-top: 2px; }

/* 空态 */
.empty { text-align: center; padding: 46px 20px; color: var(--ink4); }
.empty .ic { font-size: 34px; color: rgba(14,35,64,.14); }
.empty p { margin: 10px 0 0; font-size: 13px; }

/* 搜索 */
.search { width: 100%; height: 44px; border-radius: 22px; border: 1px solid var(--line);
  background: #fff; padding: 0 16px; font-size: 15px; outline: none; font-family: inherit; }

/* 底部抽屉 */
.sheet-mask { position: fixed; inset: 0; background: rgba(10,22,40,.42); z-index: 60;
  display: flex; align-items: flex-end; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet { width: 100%; max-height: 86vh; background: var(--paper); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; animation: up .22s cubic-bezier(.2,.8,.3,1); }
@keyframes up { from { transform: translateY(100%) } to { transform: translateY(0) } }
.sheet-hd { flex: none; display: flex; align-items: center; padding: 16px 18px 10px; }
.sheet-hd b { font-size: 16px; letter-spacing: .5px; }
.sheet-hd button { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 16px;
  background: var(--gray-bg); color: var(--ink3); font-size: 20px; line-height: 1; }
.sheet-bd { flex: 1; overflow-y: auto; padding: 0 16px calc(20px + var(--safe-b)); }

/* 悬浮底栏（下单提交） */
.footbar { position: fixed; left: 0; right: 0; bottom: var(--safe-b); z-index: 40;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  padding: 10px 16px 12px; display: flex; align-items: center; gap: 12px; }
.footbar .sum { flex: 1; }
.footbar .sum .k { font-size: 11px; color: var(--ink4); }
.footbar .sum .v { font-family: Georgia, serif; font-size: 21px; color: var(--price); line-height: 1.2; }
.footbar .btn { width: 150px; }

/* 寄件卡 */
.slip { background: #fff; border-radius: 16px; border: 1px dashed rgba(176,141,87,.5);
  padding: 18px; position: relative; }
.slip .slip-hd { text-align: center; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.slip .slip-no { font-family: Georgia, serif; font-size: 26px; letter-spacing: 2px; color: var(--ink); }
.slip .slip-k { font-size: 11px; color: var(--ink4); letter-spacing: 2px; }
.slip .slip-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.slip .slip-row:last-child { border-bottom: 0; }
.slip .slip-row .k { width: 78px; flex: none; color: var(--ink4); font-size: 13px; }
.slip .slip-row .v { flex: 1; }
.slip .tip { margin-top: 12px; background: var(--gold-l); border-radius: 10px; padding: 11px 13px;
  font-size: 13px; color: var(--gold-d); line-height: 1.7; }
.slip .tip b { color: #6B5024; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(14,35,64,.92); color: #fff; padding: 10px 20px; border-radius: 22px;
  font-size: 14px; z-index: 90; max-width: 84vw; text-align: center; animation: fade .16s ease; }

/* 大数字金额 */
.big-amt { font-family: Georgia, serif; }

/* 加载 */
.loading { text-align: center; padding: 50px 0; color: var(--ink4); font-size: 13px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(14,35,64,.15);
  border-top-color: var(--gold); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg) } }
