/* =========================================================
   客户级别助手 · 样式
   移动优先，单列布局；桌面居中显示
   ========================================================= */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #16202f;
  --ink-2: #4a5a70;
  --ink-3: #8494a9;
  --line: #e7ebf2;
  --primary: #2b59ff;
  --primary-soft: #eaefff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 35, 60, .05), 0 8px 24px rgba(20, 35, 60, .06);
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 18px); min-height: 100vh; }
#app.nobar { padding-bottom: 24px; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; border: none; background: none; color: inherit; cursor: pointer; padding: 0; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }

/* ---------- 顶部 ---------- */
.hdr { padding: 18px 18px 10px; }
.hdr h1 { margin: 0; font-size: 23px; letter-spacing: -.4px; font-weight: 700; }
.hdr .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.hdr .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.nav-back { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; padding: 14px 18px 0; }
.nav-back svg { width: 18px; height: 18px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 12px 14px; padding: 16px; }
.card.tight { padding: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-h .t { font-weight: 650; font-size: 15px; }
.card-h .more { color: var(--ink-3); font-size: 12.5px; }
.sec-title { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: .06em; margin: 22px 18px 8px; text-transform: uppercase; }

/* ---------- 级别徽标 ---------- */
.lvl { --c: #8896ab; --s: #edf1f7; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 13px; background: var(--s); color: var(--c);
  font-weight: 800; font-size: 19px; flex: 0 0 auto; letter-spacing: -.5px; }
.lvl.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
.lvl.lg { width: 76px; height: 76px; border-radius: 24px; font-size: 36px; }
.lvl.ring { box-shadow: 0 0 0 4px rgba(255,255,255,.65), 0 8px 22px rgba(20,35,60,.13); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 600; font-size: 15px;
  background: #eef2f8; color: var(--ink); transition: transform .06s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(43,89,255,.28); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.line { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.btn.block { display: flex; width: 100%; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.danger { color: #d64545; background: #fdeeee; }
.btn:disabled { opacity: .45; }

/* ---------- 首页 ---------- */
.hero { margin: 6px 14px 0; border-radius: 22px; padding: 18px; color: #fff;
  background: linear-gradient(135deg, #1b2b52 0%, #2b4ad6 58%, #2b7cff 100%);
  box-shadow: 0 14px 30px rgba(28, 52, 120, .28); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -50px; top: -70px; width: 190px; height: 190px;
  border-radius: 50%; background: rgba(255,255,255,.1); }
.hero .hi { font-size: 12.5px; opacity: .78; }
.hero .big { font-size: 30px; font-weight: 750; letter-spacing: -.6px; margin-top: 2px; }
.hero .big span { font-size: 14px; font-weight: 500; opacity: .8; margin-left: 6px; letter-spacing: 0; }
.hero .acts { display: flex; gap: 10px; margin-top: 16px; }
.hero .acts .btn { flex: 1; background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); height: 42px; font-size: 14px; }
.hero .acts .btn.solid { background: #fff; color: #1b2b52; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 14px 0; }
.kpi { background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow); text-align: center; }
.kpi b { display: block; font-size: 21px; font-weight: 750; letter-spacing: -.5px; }
.kpi small { color: var(--ink-3); font-size: 11.5px; }
.kpi.warn b { color: #e05252; }

/* ---------- 客户行 ---------- */
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.row-item:first-child { padding-top: 2px; }
.row-item .main { flex: 1; min-width: 0; }
.row-item .nm { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.row-item .meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .rt { text-align: right; font-size: 12px; color: var(--ink-3); flex: 0 0 auto; }
.overdue { color: #e05252 !important; font-weight: 600; }
.today { color: #e8890c !important; font-weight: 600; }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px;
  background: #eef2f8; color: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 定级向导 ---------- */
.wiz { padding: 0 14px; }
.wiz-top { display: flex; align-items: center; gap: 10px; padding: 14px 4px 6px; }
.wiz-top .cnt { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bars { display: flex; gap: 5px; flex: 1; }
.bars i { height: 5px; flex: 1; border-radius: 3px; background: #e2e8f2; transition: background .2s; }
.bars i.on { background: var(--primary); }
.bars i.now { background: #9db4ff; }

.q { background: #fff; border-radius: 18px; padding: 16px 16px 8px; box-shadow: var(--shadow); margin: 8px 0 14px; }
.q .qt { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.q .qq { font-size: 19px; font-weight: 700; margin: 4px 0 14px; letter-spacing: -.3px; }
.q .qh { font-size: 12.5px; color: var(--ink-3); margin: -8px 0 12px; }
.opt { display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left;
  padding: 13px 12px; border-radius: 13px; background: #f7f9fc; margin-bottom: 9px;
  box-shadow: inset 0 0 0 1px #eef2f8; transition: background .12s, box-shadow .12s; }
.opt:active { background: #eef2fb; }
.opt.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.opt .k { width: 24px; height: 24px; border-radius: 8px; background: #fff; color: var(--ink-2);
  font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; box-shadow: inset 0 0 0 1px var(--line); }
.opt.on .k { background: var(--primary); color: #fff; box-shadow: none; }
.opt .tx { flex: 1; font-size: 14.5px; line-height: 1.45; padding-top: 1px; }
.opt .pts { font-size: 11px; color: var(--ink-3); margin-left: auto; padding-top: 4px; font-variant-numeric: tabular-nums; }
.skip { display: block; width: 100%; text-align: center; color: var(--ink-3); font-size: 13px; padding: 10px 0 6px; }

/* ---------- 结果 ---------- */
.res-hero { margin: 10px 14px 0; border-radius: 22px; padding: 22px 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #22304f, #37507f); }
.res-hero::after { content: ""; position: absolute; right: -40px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.res-hero .top { display: flex; align-items: center; gap: 14px; }
.res-hero .lvl.lg { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.res-hero .ttl { font-size: 26px; font-weight: 780; letter-spacing: -.6px; line-height: 1.2; }
.res-hero .ttl small { display: block; font-size: 12.5px; font-weight: 500; opacity: .8; letter-spacing: 0; margin-top: 3px; }
.res-hero .bar-wrap { margin-top: 16px; }
.res-hero .bar-t { display: flex; justify-content: space-between; font-size: 11.5px; opacity: .85; margin-bottom: 5px; }
.res-hero .bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
.res-hero .bar i { display: block; height: 100%; border-radius: 4px; background: #fff; }
.res-hero .note { font-size: 12px; opacity: .78; margin-top: 12px; line-height: 1.5; }

.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; }
.score-grid div { background: #fff; padding: 11px 8px; text-align: center; }
.score-grid b { display: block; font-size: 18px; font-weight: 750; letter-spacing: -.4px; }
.score-grid small { color: var(--ink-3); font-size: 11px; }

.dims { display: flex; flex-direction: column; gap: 9px; }
.dim { display: grid; grid-template-columns: 74px 1fr 40px; gap: 9px; align-items: center; font-size: 12.5px; }
.dim .n { color: var(--ink-2); }
.dim .t { height: 7px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.dim .t i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #9db4ff, #2b59ff); }
.dim .v { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.dim.miss .t { background: repeating-linear-gradient(45deg, #eef2f8, #eef2f8 5px, #e2e8f2 5px, #e2e8f2 10px); }
.dim.miss .n, .dim.miss .v { color: #b6c1d1; }

.notice { display: flex; gap: 9px; padding: 11px 12px; border-radius: 12px; font-size: 12.8px; line-height: 1.5;
  background: #fff8e8; color: #8a5a00; margin-top: 10px; }
.notice.blue { background: #eef3ff; color: #2b4fa8; }
.notice.gray { background: #f3f5f9; color: var(--ink-2); }
.notice b { font-weight: 650; }

.adv { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.adv:last-child { border-bottom: 0; }
.adv .ic { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.adv .b { flex: 1; font-size: 13px; }
.adv .b b { display: block; font-size: 13.5px; font-weight: 600; }
.adv .b span { color: var(--ink-3); font-size: 12px; }

/* ---------- 策略卡 ---------- */
.lvl-tabs { display: flex; gap: 6px; padding: 10px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.lvl-tabs::-webkit-scrollbar { display: none; }
.lvl-tabs button { flex: 0 0 auto; height: 34px; padding: 0 13px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.lvl-tabs button.on { background: var(--ink); color: #fff; box-shadow: none; }

.plan-hd { margin: 12px 14px 0; background: #fff; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.plan-hd .r1 { display: flex; align-items: center; gap: 12px; }
.plan-hd .tt { font-size: 21px; font-weight: 760; letter-spacing: -.4px; line-height: 1.25; }
.plan-hd .tt small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.plan-hd .goal { margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: #f6f8fc; font-size: 13px; color: var(--ink-2); }
.plan-hd .goal b { color: var(--ink); }

.step { display: flex; gap: 11px; padding: 10px 0; }
.step .d { flex: 0 0 62px; font-size: 12px; font-weight: 650; color: var(--primary); padding-top: 1px; }
.step .its { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.step .it { font-size: 13.5px; line-height: 1.5; }
.step .it em { font-style: normal; display: inline-block; font-size: 10.5px; color: var(--ink-3);
  background: #f0f3f8; border-radius: 5px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }

.todo { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; font-size: 13.5px; }
.todo .bx { width: 19px; height: 19px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px #cfd8e6; flex: 0 0 auto; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.todo.done .bx { background: var(--primary); box-shadow: none; }
.todo.done .tx { color: var(--ink-3); text-decoration: line-through; }

.script { background: #f7f9fc; border-radius: 13px; padding: 11px 12px; margin-bottom: 9px; position: relative; }
.script .sc { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 5px; }
.script .tx { font-size: 13.5px; line-height: 1.62; color: var(--ink); }
.script .cp { font-size: 11px; color: var(--ink-3); padding: 2px 7px; border-radius: 6px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line); flex: 0 0 auto; }

.ob { padding: 11px 0; border-bottom: 1px solid var(--line); }
.ob:last-child { border-bottom: 0; }
.ob .s { font-size: 13px; font-weight: 650; color: #b5563f; }
.ob .r { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

.list-dot { display: flex; gap: 8px; font-size: 13.5px; padding: 6px 0; }
.list-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #c3cddb; margin-top: 9px; flex: 0 0 auto; }
.list-dot.bad::before { background: #e8a0a0; }
.list-num { display: flex; gap: 9px; font-size: 13.5px; padding: 6px 0; align-items: baseline; }
.list-num .no { flex: 0 0 14px; color: #b6c1d1; font-weight: 700; font-size: 12px; }
.todo { cursor: pointer; }

/* ---------- 客户详情 ---------- */
.cust-hd { padding: 14px 18px 0; }
.cust-hd .r1 { display: flex; align-items: center; gap: 13px; }
.cust-hd .nm { font-size: 21px; font-weight: 730; letter-spacing: -.3px; }
.cust-hd .meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.cust-hd .r2 { display: flex; gap: 8px; margin-top: 12px; }
.cust-hd .r2 .btn { flex: 1; }

.tabs { display: flex; gap: 4px; margin: 14px 14px 0; background: #e9eef6; border-radius: 11px; padding: 3px; }
.tabs button { flex: 1; height: 32px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,35,60,.12); }

.tl { position: relative; padding-left: 18px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.tl-i { position: relative; padding: 8px 0; }
.tl-i::before { content: ""; position: absolute; left: -16.5px; top: 14px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 2px #c3cddb; }
.tl-i.hot::before { box-shadow: inset 0 0 0 2px var(--primary); }
.tl-i .d { font-size: 11.5px; color: var(--ink-3); }
.tl-i .x { font-size: 13.5px; margin-top: 1px; }
.tl-i .x b { font-weight: 600; }

/* ---------- 底部弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mask.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff;
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + var(--safe-b)); max-width: 560px; margin: 0 auto;
  transform: translateY(102%); transition: transform .26s cubic-bezier(.32,.72,0,1); max-height: 88vh; overflow-y: auto; }
.sheet.on { transform: translateY(0); }
.sheet .bar { width: 38px; height: 4px; border-radius: 2px; background: #e2e8f2; margin: 6px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.sheet .sub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--line);
  background: #f8fafd; padding: 0 12px; outline: none; }
.field textarea { height: 84px; padding: 10px 12px; resize: none; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: flex; background: #eef2f8; border-radius: 11px; padding: 3px; }
.seg button { flex: 1; height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,35,60,.12); }

/* ---------- 底部导航 ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: flex; max-width: 560px; margin: 0 auto; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.tabbar a svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tabbar a.on { color: var(--primary); }
.tabbar a.center { position: relative; }
.tabbar a.center .plus { width: 42px; height: 42px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-top: -16px; box-shadow: 0 8px 18px rgba(43,89,255,.36); }
.tabbar a.center .plus svg { width: 22px; height: 22px; stroke-width: 2.4; }
.tabbar a.center span { margin-top: 1px; }
.tabbar.hide { display: none; }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 26px 10px; }
.empty .big { font-size: 30px; margin-bottom: 6px; opacity: .5; }
.searchbar { margin: 4px 14px 0; display: flex; gap: 8px; }
.searchbar input { flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 12px; outline: none; }
.filter { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter button { flex: 0 0 auto; height: 30px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.filter button.on { background: var(--ink); color: #fff; box-shadow: none; }

.stat-bars { display: flex; flex-direction: column; gap: 9px; }
.stat-bars .sb { display: grid; grid-template-columns: 38px 1fr 42px; align-items: center; gap: 9px; font-size: 12.5px; }
.stat-bars .sb .t { height: 8px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.stat-bars .sb .t i { display: block; height: 100%; border-radius: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 28px); transform: translate(-50%, 12px);
  background: rgba(22,32,47,.92); color: #fff; font-size: 13px; padding: 9px 15px; border-radius: 11px;
  opacity: 0; pointer-events: none; transition: all .22s; z-index: 90; max-width: 84%; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.hr { height: 1px; background: var(--line); margin: 12px 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
