:root{
  --brand:#0e64d2;      /* 安途蓝 */
  --brand-2:#1a8cff;
  --deep:#0a2a4e;
  --ok:#12a150; --warn:#f59e0b; --danger:#e5484d;
  --bg:#f2f5fa; --card:#ffffff; --line:#e3e9f2;
  --text:#10233c; --muted:#6b7c93;
  --radius:14px;
  --shadow:0 6px 24px rgba(12,38,72,.08);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit;font-size:14px;color:var(--text)}

/* ---------- 登录 ---------- */
.auth-wrap{min-height:100vh;min-height:100dvh;width:100%;display:flex;align-items:center;justify-content:center;padding:24px 20px;
  background:radial-gradient(1200px 600px at 50% -10%,#14508f 0%,#0a2a4e 55%,#061b33 100%)}
.auth-card{width:100%;max-width:420px;background:#fff;border-radius:20px;padding:28px 24px 24px;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.auth-logo{text-align:center;margin-bottom:6px}
.auth-logo img{height:52px}
.auth-sub{text-align:center;color:var(--muted);font-size:13px;margin:10px 0 18px;letter-spacing:.5px}
.field{margin-bottom:12px}
.field label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:6px}
.input,select,textarea{width:100%;border:1px solid var(--line);background:#fbfcfe;border-radius:10px;padding:11px 12px;outline:none;transition:.15s}
.input:focus,select:focus,textarea:focus{border-color:var(--brand);background:#fff;box-shadow:0 0 0 3px rgba(14,100,210,.10)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;border-radius:10px;padding:11px 16px;font-size:14px;font-weight:600;background:var(--brand);color:#fff;transition:.15s}
.btn:active{transform:scale(.98)}
.btn.block{width:100%;padding:13px}
.btn.ghost{background:#fff;color:var(--brand);border:1px solid #cfe0f7}
.btn.soft{background:#eaf1fc;color:var(--brand)}
.btn.gray{background:#eef2f8;color:#43536b}
.btn.danger{background:#fdeced;color:var(--danger)}
.btn.mini{padding:6px 10px;font-size:12.5px;border-radius:8px}
.btn.warnb{background:#fff7e8;color:#a4620a}
.auth-tabs{display:flex;gap:8px;margin-bottom:16px;background:#f1f5fb;padding:4px;border-radius:12px}
.auth-tabs button{flex:1;border:none;background:transparent;padding:9px;border-radius:9px;color:var(--muted);font-weight:600}
.auth-tabs button.on{background:#fff;color:var(--brand);box-shadow:0 2px 8px rgba(12,38,72,.08)}
.auth-note{font-size:12px;color:var(--muted);line-height:1.7;margin-top:12px}

/* ---------- 布局 ---------- */
.app{display:flex;min-height:100vh}
.side{width:216px;flex:0 0 216px;background:linear-gradient(180deg,#0a2a4e,#0e3f6f);color:#dfeaf7;padding:18px 14px;position:sticky;top:0;height:100vh}
.side .brand{display:flex;align-items:center;gap:10px;padding:4px 6px 18px}
.side .brand img{height:34px;filter:brightness(0) invert(1);opacity:.95}
.side nav{display:flex;flex-direction:column;gap:4px}
.side nav a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:10px;color:#c8d8ea;font-size:14px}
.side nav a .ico{width:18px;text-align:center;opacity:.85}
.side nav a.on{background:rgba(255,255,255,.13);color:#fff;font-weight:600}
.side .org{margin-top:auto}
.side .foot{position:absolute;bottom:18px;left:14px;right:14px;font-size:12px;color:#8fa9c4}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 18px;background:rgba(242,245,250,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.topbar .title{font-size:16px;font-weight:700}
.topbar .title small{display:block;font-weight:400;font-size:12px;color:var(--muted);margin-top:2px}
.topbar .user{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.avatar{width:30px;height:30px;border-radius:50%;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}
.content{padding:16px 18px 90px;max-width:1280px;width:100%;margin:0 auto}
.mobile-tab{display:none}

/* ---------- 通用组件 ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow)}
.card + .card{margin-top:12px}
.card h3{margin:0 0 12px;font-size:15px}
.card h3 .more{float:right;font-size:12.5px;font-weight:400;color:var(--brand)}
.grid{display:grid;gap:12px}
.stat-grid{display:grid;gap:10px;grid-template-columns:repeat(2,1fr)}
@media (min-width:980px){.stat-grid{grid-template-columns:repeat(4,1fr)}}
.g2{grid-template-columns:repeat(2,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;position:relative;overflow:hidden}
.stat .k{font-size:12.5px;color:var(--muted)}
.stat .v{font-size:26px;font-weight:800;margin-top:6px;letter-spacing:-.5px}
.stat .s{font-size:12px;color:var(--muted);margin-top:4px}
.stat.brand{background:linear-gradient(135deg,#0e64d2,#1a8cff);color:#fff;border:none}
.stat.brand .k,.stat.brand .s{color:rgba(255,255,255,.82)}
.stat.tone-violet{background:linear-gradient(135deg,#5847d6,#7d6bf0);color:#fff;border:none}
.stat.tone-green{background:linear-gradient(135deg,#0e9f63,#26c07f);color:#fff;border:none}
.stat.tone-amber{background:linear-gradient(135deg,#c97a0c,#efa018);color:#fff;border:none}
.stat.tone-violet .k,.stat.tone-violet .s,
.stat.tone-green .k,.stat.tone-green .s,
.stat.tone-amber .k,.stat.tone-amber .s{color:rgba(255,255,255,.85)}
.stat.tone-violet .v,.stat.tone-green .v,.stat.tone-amber .v{color:#fff}
.stat.brand,.stat.tone-violet,.stat.tone-green,.stat.tone-amber{box-shadow:0 6px 16px rgba(16,40,80,.10)}

/* 配送订单顶部三看板：浅色区分，不刺眼 */
.stat.soft-blue{background:linear-gradient(180deg,#f2f7ff,#e8f1ff);border:1px solid #d6e5ff}
.stat.soft-violet{background:linear-gradient(180deg,#f7f4ff,#efe9ff);border:1px solid #e0d6ff}
.stat.soft-amber{background:linear-gradient(180deg,#fffaf1,#fff3e0);border:1px solid #ffe4b8}
.stat.soft-blue .k,.stat.soft-violet .k,.stat.soft-amber .k{color:#5b6b83}
.stat.soft-blue .s,.stat.soft-violet .s,.stat.soft-amber .s{color:#7b8aa1}
.stat.soft-blue .v{color:#1f6fd0}
.stat.soft-violet .v{color:#6a4fd8}
.stat.soft-amber .v{color:#c9820c}
.stat.soft-blue,.stat.soft-violet,.stat.soft-amber{box-shadow:0 4px 12px rgba(16,40,80,.06)}
.stat.green .v{color:var(--ok)} .stat.orange .v{color:var(--warn)}
.sec-title{display:flex;align-items:center;justify-content:space-between;margin:18px 2px 10px}
.sec-title h2{margin:0;font-size:16px}
.sec-title .hint{font-size:12px;color:var(--muted)}
.badge{display:inline-block;padding:2px 8px;border-radius:20px;font-size:11.5px;background:#eef3fb;color:#3a6ea8}
.badge.green{background:#e8f7ee;color:#127a3d}
.badge.orange{background:#fff3e0;color:#a4620a}
.badge.red{background:#fdeced;color:#b3242a}
.badge.gray{background:#eef2f8;color:#5c6c84}
.row{display:flex;gap:10px;align-items:center}
.row.wrap{flex-wrap:wrap}
.spacer{flex:1}
.list{display:flex;flex-direction:column}
.list-item{display:flex;gap:12px;align-items:center;padding:12px 4px;border-bottom:1px solid #f0f4f9}
.list-item:last-child{border-bottom:none}
.thumb{width:42px;height:42px;border-radius:10px;background:#eef3fb;display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 42px}
.li-main{flex:1;min-width:0}
.li-main .t{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-main .d{font-size:12px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-val{text-align:right;font-size:13px;font-weight:700}
.empty{text-align:center;color:var(--muted);padding:32px 10px;font-size:13px}
.empty .ico{font-size:30px;display:block;margin-bottom:8px;opacity:.5}
.toolbar{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.toolbar .input{flex:1;min-width:160px}
.search{position:relative}
.search .input{padding-left:34px}
.search .sico{position:absolute;left:11px;top:50%;transform:translateY(-50%);font-size:14px;opacity:.5}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px}
.chip{white-space:nowrap;padding:7px 14px;border-radius:20px;background:#fff;border:1px solid var(--line);font-size:13px;color:var(--muted)}
.chip.on{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.bars{display:flex;flex-direction:column;gap:9px}
.bar-row{display:grid;grid-template-columns:105px 1fr 68px;gap:10px;align-items:center;font-size:12.5px}
.bar-row .n{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#33465e}
.bar-track{height:12px;border-radius:8px;background:#eef3fa;overflow:hidden}
.bar-fill{height:100%;border-radius:8px;background:linear-gradient(90deg,#0e64d2,#3fa0ff);transition:width .5s}
.bar-fill.green{background:linear-gradient(90deg,#12a150,#45c880)}
.bar-row .v{text-align:right;font-weight:700}
.trend{display:flex;align-items:flex-end;gap:8px;height:130px;padding-top:8px}
.trend .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end}
.trend .col .bub{width:100%;max-width:38px;border-radius:8px 8px 0 0;background:linear-gradient(180deg,#4aa3ff,#0e64d2);min-height:3px;transition:.4s}
.trend .col .lab{font-size:10.5px;color:var(--muted);white-space:nowrap}
.trend .col .val{font-size:10.5px;color:#33465e;font-weight:700}
table.tb{width:100%;border-collapse:collapse;font-size:13px}
table.tb th{text-align:left;padding:8px 8px;color:var(--muted);font-weight:600;font-size:12.5px;border-bottom:1px solid var(--line);white-space:nowrap}
table.tb td{padding:9px 8px;border-bottom:1px solid #f2f5fa;white-space:nowrap}
table.tb td.num,table.tb th.num{text-align:right}
.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.quick button{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 6px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:var(--shadow)}
.quick button .ico{width:38px;height:38px;border-radius:12px;background:#eaf1fc;color:var(--brand);display:flex;align-items:center;justify-content:center;font-size:19px}
.quick button span{font-size:12.5px;font-weight:600;color:#28394f}

/* ---------- 弹窗 ---------- */
.mask{position:fixed;inset:0;background:rgba(8,24,43,.45);backdrop-filter:blur(2px);z-index:100;display:flex;align-items:center;justify-content:center;padding:16px}
.modal{background:#fff;border-radius:16px;width:100%;max-width:560px;max-height:88vh;overflow:auto;box-shadow:0 24px 70px rgba(0,0,0,.3)}
.modal-h{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff;z-index:2}
.modal-h h3{margin:0;font-size:16px}
.modal-h .x{border:none;background:#f1f4f9;width:30px;height:30px;border-radius:9px;font-size:16px;color:#5c6c84}
.modal-b{padding:16px 18px}
.modal-f{padding:12px 18px 16px;display:flex;gap:10px;justify-content:flex-end;position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line)}

/* ---------- 开单 ---------- */
.cart-item{display:grid;grid-template-columns:1fr 84px 76px 30px;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid #f0f4f9}
.cart-item .nm{font-weight:600;font-size:13.5px}
.cart-item .sp{font-size:11.5px;color:var(--muted);margin-top:2px}
.cart-item input{width:100%;padding:7px 8px;border:1px solid var(--line);border-radius:8px;text-align:center;font-size:13px}
.cart-item .del{border:none;background:#fdeced;color:#b3242a;border-radius:8px;height:32px;font-size:14px}
.total-box{display:flex;justify-content:space-between;align-items:center;padding:14px 4px;margin-top:6px}
.total-box .lab{color:var(--muted);font-size:13px}
.total-box .amt{font-size:26px;font-weight:800;color:var(--brand)}
.picker{max-height:320px;overflow:auto;border:1px solid var(--line);border-radius:12px;margin-top:8px}
.picker .pi{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #f2f5fa}
.picker .pi:last-child{border-bottom:none}
.picker .pi:active{background:#f7fafe}

/* ---------- 浮动按钮 & 移动端 ---------- */
.fab{position:fixed;right:18px;bottom:82px;width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#0e64d2,#1a8cff);color:#fff;border:none;font-size:24px;box-shadow:0 10px 24px rgba(14,100,210,.35);z-index:50}
.toast{position:fixed;left:50%;top:66px;transform:translateX(-50%);background:rgba(10,42,78,.92);color:#fff;padding:9px 16px;border-radius:20px;font-size:13px;z-index:200;opacity:0;transition:.25s;pointer-events:none;max-width:90%}
.toast.show{opacity:1;transform:translateX(-50%) translateY(2px)}

@media (max-width:900px){
  .side{display:none}
  .stat-grid{gap:8px}
  .stat-grid .stat{padding:11px 12px}
  .stat-grid .stat .k{font-size:11.5px}
  .stat-grid .stat .v{font-size:19px;margin-top:4px}
  .stat-grid .stat .s{font-size:10.5px;line-height:1.35}
  .topbar .user{gap:6px;flex:0 0 auto;max-width:132px}
  .topbar .user span{font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .title{min-width:0;font-size:15px}
  .topbar .title small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:60vw}
  .list-item{gap:8px;padding:10px 2px}
  .list-item > .row{flex-direction:column;gap:4px;flex:0 0 auto}
  .list-item .thumb{width:36px;height:36px;flex:0 0 36px;font-size:16px}
  .list-item .btn.mini{padding:5px 9px;font-size:12px}
  .li-main .d{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .content{padding:12px 12px 96px}
  .topbar{padding:10px 14px}
  .g4{grid-template-columns:repeat(2,1fr)}
  .g3{grid-template-columns:repeat(2,1fr)}
  .stat .v{font-size:22px}
  .quick{grid-template-columns:repeat(4,1fr);gap:8px}
  .quick button{padding:12px 4px}
  .quick button .ico{width:34px;height:34px;font-size:17px}
  .quick button span{font-size:11.5px}
  .mobile-tab{display:flex;position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));z-index:60;box-shadow:0 -6px 18px rgba(12,38,72,.06)}
  .mobile-tab a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:5px 0;font-size:10.5px;color:#7a8b9f}
  .mobile-tab a .ico{font-size:19px;line-height:22px}
  .mobile-tab a.on{color:var(--brand);font-weight:700}
  .modal-b{padding:14px}
  .cart-item{grid-template-columns:1fr 66px 64px 28px;gap:6px}
}
@media (max-width:420px){
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .stat-grid .stat .v{font-size:18px}
}

/* ---------- 客户自助下单（公开页） ---------- */
.shop-page{min-height:100vh;background:#f2f5fa;padding-bottom:86px}
.shop-hd{background:linear-gradient(150deg,#0a2a4e,#0e64d2 70%,#1a8cff);color:#fff;padding:20px 18px 22px;border-radius:0 0 22px 22px}
.shop-hd .shop-logo{height:30px;filter:brightness(0) invert(1);opacity:.95}
.shop-hd .shop-org{font-size:19px;font-weight:800;margin-top:12px}
.shop-hd .shop-meta{font-size:12.5px;opacity:.85;margin-top:5px}
.shop-hd .shop-tip{display:inline-block;margin-top:12px;background:rgba(255,255,255,.16);padding:6px 12px;border-radius:20px;font-size:12px}
.shop-cust{margin:12px 14px 0;background:#fff;border:1px solid var(--line);border-radius:12px;padding:11px 14px;font-size:12.5px;color:#6b7c93;line-height:1.8}
.shop-body{padding:6px 14px 0}
.shop-cat{font-size:14px;font-weight:700;margin:14px 2px 8px}
.prod-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.prod-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:3px;box-shadow:0 4px 14px rgba(12,38,72,.05)}
.prod-card .pf{height:64px;border-radius:10px;background:linear-gradient(135deg,#eef5ff,#e2edfb);display:flex;align-items:center;justify-content:center;font-size:30px;overflow:hidden;margin-bottom:6px}
.prod-card .pf img{width:100%;height:100%;object-fit:cover}
.prod-card .pn{font-size:13.5px;font-weight:700;line-height:1.4}
.prod-card .ps{font-size:11.5px;color:#6b7c93}
.prod-card .pr{font-size:17px;font-weight:800;color:#0e64d2;margin-top:2px}
.prod-card .pstock{font-size:11px;color:#8fa0b5}
.prod-card .stepper{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:6px}
.stepper button{width:30px;height:30px;border-radius:9px;border:1px solid #cfe0f7;background:#fff;color:#0e64d2;font-size:16px;font-weight:700}
.stepper button.plus{background:#0e64d2;color:#fff;border-color:#0e64d2}
.stepper span{font-size:14px;font-weight:700;min-width:16px;text-align:center}
.shop-bar{position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  display:flex;align-items:center;gap:12px;box-shadow:0 -6px 20px rgba(12,38,72,.08);z-index:40}
.shop-bar .shop-sum{flex:1}
.shop-bar .shop-sum span{display:block;font-size:11.5px;color:#6b7c93}
.shop-bar .shop-sum b{font-size:21px;color:#0e64d2}
.shop-bar .btn{min-width:112px}
.shop-order-list{margin-top:6px;border-top:1px solid var(--line);padding-top:8px}
.shop-success{background:#fff;border-radius:20px;padding:34px 26px;text-align:center;width:100%;max-width:400px;box-shadow:0 16px 50px rgba(12,38,72,.12)}
@media (min-width:620px){.prod-grid{grid-template-columns:repeat(3,1fr)}}

/* ---------- 版本更新提醒 ---------- */
.upd-banner{position:fixed;left:0;right:0;top:0;z-index:9999;padding:10px 12px;background:linear-gradient(135deg,#0b62d6,#1e88ff);color:#fff;box-shadow:0 6px 18px rgba(11,98,214,.28)}
.upd-main{display:flex;align-items:center;gap:10px;max-width:760px;margin:0 auto}
.upd-ico{font-size:22px;flex:0 0 auto}
.upd-txt{flex:1;min-width:0}
.upd-txt b{display:block;font-size:14px;letter-spacing:.2px}
.upd-notes{margin-top:2px;font-size:12px;opacity:.92;line-height:1.4}
.upd-notes li{list-style:none;white-space:normal}
body.has-upd{padding-top:74px}
.upd-btn{flex:0 0 auto;padding:8px 16px;border:0;border-radius:999px;background:#fff;color:#0b62d6;font-size:13.5px;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.upd-x{flex:0 0 auto;background:transparent;border:0;color:#fff;font-size:15px;opacity:.85;padding:2px 4px}
@media (max-width:420px){
 .upd-banner{padding:8px 10px}
 .upd-btn{padding:7px 13px;font-size:13px}
 .upd-txt b{font-size:13.5px}
 .upd-notes{font-size:11.5px}
}

/* ---------- 到期提醒 / 平台组织管理 ---------- */
.exp-banner{display:flex;gap:8px;align-items:flex-start;background:#fff8e8;border:1px solid #ffe1ad;color:#8a5a00;border-radius:12px;padding:10px 12px;font-size:12.5px;line-height:1.65;margin-bottom:12px}
.exp-banner .eb-ico{font-size:16px;line-height:1.2}
.exp-banner button{margin-left:auto;flex:0 0 auto;border:0;background:#ffe9c2;color:#8a5a00;border-radius:8px;padding:5px 9px;font-size:12px}
.plat-item{border-bottom:1px solid #f1f5fa;padding:12px 2px}
.plat-item:last-child{border-bottom:0}
.pi-name{font-size:15px;font-weight:700;color:#15263c;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.pi-sub{font-size:12px;color:#6b7c93;margin-top:5px;line-height:1.6}

/* ---------- 配送订单三卡同排 ---------- */
.stat-grid3{display:grid;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}
.stat-grid3 .stat{padding:13px 12px}
.stat-grid3 .stat .k{font-size:12px}
.stat-grid3 .stat .v{font-size:22px;margin-top:4px}
.stat-grid3 .stat .s{font-size:11px;line-height:1.4}
@media (max-width:420px){
  .stat-grid3{gap:6px}
  .stat-grid3 .stat{padding:10px 9px}
  .stat-grid3 .stat .k{font-size:11px;line-height:1.3}
  .stat-grid3 .stat .v{font-size:19px}
  .stat-grid3 .stat .s{font-size:9.5px;line-height:1.3}
}
