/* 商品下单平台 H5 · 手机优先（max-width 640 桌面居中） */
:root {
  --brand: #1f6feb; --brand-dark: #1a5cd0; --brand-bg: #eef4ff;
  --bg: #f4f5f7; --card: #fff; --text: #1f2328; --muted: #8a919c;
  --line: #e8eaee; --price: #d54941; --ok: #1a7f37; --warn: #9a6700;
  --tab-h: 54px; --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--bg);
       position: relative; box-shadow: 0 0 24px rgba(0,0,0,.06); }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

/* ---------- 通用 ---------- */
.page { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); min-height: 100vh; }
.page-nobar { padding-bottom: 24px; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff;
          padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.topbar .back { font-size: 20px; line-height: 1; padding: 2px 6px; color: #fff; }
.topbar h1 { font-size: 16px; font-weight: 600; flex: 1; white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; }
.card { background: var(--card); border-radius: var(--radius); margin: 12px;
        padding: 14px; box-shadow: 0 1px 4px rgba(31,35,40,.05); }
.muted { color: var(--muted); }
.price { color: var(--price); font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
       background: var(--brand); color: #fff; border-radius: 10px; padding: 11px 16px;
       font-size: 15px; font-weight: 600; width: 100%; }
.btn:active { background: var(--brand-dark); }
.btn[disabled] { opacity: .55; }
.btn-plain { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-danger { background: #fff; color: var(--price); border: 1px solid var(--price); }
.btn-mini { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
  .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px;
         background: var(--brand-bg); color: var(--brand); margin-right: 4px; }
  .tag-grey { background: #f0f1f3; color: var(--muted); }
  .tag-warn { background: #fff8c5; color: var(--warn); }
  .tag-new { background: #ffebe0; color: #c2410c; font-weight: 600; }
  .tag-hot { background: #e2f7ec; color: #0e9f6e; font-weight: 600; }

  /* ---------- 膜法箱大目录横幅 ---------- */
  .box-banner { display: flex; align-items: center; gap: 10px; width: calc(100% - 28px);
         margin: 12px 14px 0; padding: 14px; border-radius: var(--radius); text-align: left;
         background: linear-gradient(135deg, #fff7e8, #ffe9c8); border: 1px solid #f5d9a8;
         box-shadow: 0 1px 4px rgba(31,35,40,.05); }
  .box-banner .ic { font-size: 26px; }
  .box-banner .tt { flex: 1; font-size: 15px; font-weight: 700; color: #7a4d0b; }
  .box-banner .tt em { display: block; font-style: normal; font-size: 11px;
         color: #a8792f; font-weight: 400; margin-top: 3px; }
  .box-banner .meta { font-size: 12px; color: #7a4d0b; }
  .box-banner .arrow { color: #a8792f; font-size: 16px; }

  /* ---------- 管理后台 ---------- */
  select { width: 100%; border: 1px solid var(--line); border-radius: 9px;
         padding: 10px 12px; background: #fafbfc; }
  .adm-row { display: flex; align-items: center; justify-content: space-between;
         padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 8px; }
  .adm-row:last-child { border-bottom: none; }
  .adm-img { width: 52px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
  .adm-ops { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .adm-row .k { flex: 1; font-size: 13px; line-height: 1.5; }
  .sw { flex-shrink: 0; padding: 5px 12px; border-radius: 14px; font-size: 12px;
         background: #e2f7ec; color: #0e9f6e; font-weight: 600; }
  .sw.off { background: #f0f1f3; color: var(--muted); }
  .tagbtn { padding: 5px 12px; border-radius: 14px; font-size: 12px; margin-right: 6px;
         border: 1px solid var(--line); background: #fff; color: var(--muted); }
  .tagbtn.on { background: var(--brand); border-color: var(--brand); color: #fff;
         font-weight: 600; }
  .erp-hits { margin-top: 6px; border: 1px solid var(--line); border-radius: 9px;
         overflow: hidden; }
  .erp-hit { display: block; width: 100%; text-align: left; padding: 8px 10px;
         font-size: 13px; border-bottom: 1px solid var(--line); background: #fff; }
  .erp-hit:last-child { border-bottom: none; }
  .erp-hit.picked { background: var(--brand-bg); color: var(--brand); font-weight: 600; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px;
       padding: 10px 12px; background: #fafbfc; }
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.empty { text-align: center; color: var(--muted); padding: 60px 0 80px; font-size: 13px; }
.empty .icon { font-size: 40px; display: block; margin-bottom: 10px; opacity: .4; }

/* ---------- 登录 ---------- */
.login-hero { background: linear-gradient(135deg, #1f6feb, #4098ff); color: #fff;
              padding: 54px 24px 60px; text-align: center; }
.login-hero h1 { font-size: 22px; letter-spacing: 1px; }
.login-hero p { margin-top: 8px; font-size: 13px; opacity: .85; }
.login-box { margin: -28px 16px 0; background: var(--card); border-radius: 14px;
             padding: 22px 18px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.login-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ---------- 首页品牌 ---------- */
.home-hero { background: linear-gradient(135deg, #1f6feb, #4098ff); padding: 22px 16px 54px;
             color: #fff; }
.home-hero h1 { font-size: 20px; }
.home-hero p { font-size: 12px; opacity: .85; margin-top: 4px; }
.search-wrap { margin: -30px 14px 0; position: relative; z-index: 5; }
.search-wrap input { width: 100%; border: none; border-radius: 11px; padding: 12px 16px;
             box-shadow: 0 3px 10px rgba(0,0,0,.08); background: #fff; font-size: 14px; }
.brand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
              padding: 14px 14px 4px; }
.brand-cell { background: var(--card); border-radius: var(--radius); padding: 18px 14px 14px;
              box-shadow: 0 1px 4px rgba(31,35,40,.05); position: relative; overflow: hidden; }
.brand-cell:active { background: var(--brand-bg); }
.brand-cell .logo { width: 42px; height: 42px; border-radius: 10px; color: #fff; font-size: 19px;
              font-weight: 700; display: flex; align-items: center; justify-content: center; }
.brand-cell .name { font-size: 16px; font-weight: 700; margin-top: 10px; }
.brand-cell .cnt { font-size: 12px; color: var(--muted); margin-top: 3px; }
.brand-cell .arrow { position: absolute; right: 12px; top: 16px; color: var(--muted); }
.home-sec-title { padding: 18px 16px 2px; font-size: 15px; font-weight: 600; }

/* ---------- 系列宫格 ---------- */
.series-filter { margin: 12px 14px 2px; position: relative; }
.series-filter input { width: 100%; border: 1px solid var(--line); border-radius: 10px;
               padding: 10px 14px; background: #fff; }
.series-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 14px; }
.series-cell { background: var(--card); border-radius: 11px; padding: 13px 13px 11px;
               box-shadow: 0 1px 3px rgba(31,35,40,.05); text-align: left; }
.series-cell:active { background: var(--brand-bg); }
.series-cell .nm { font-size: 14px; font-weight: 600; line-height: 1.4;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
               overflow: hidden; min-height: 39px; }
.series-cell .meta { margin-top: 7px; display: flex; justify-content: space-between;
               align-items: baseline; }
.series-cell .meta .c { font-size: 11px; color: var(--muted); }
.series-cell .meta .p { font-size: 13px; }
.link-line { text-align: center; padding: 4px 0 14px; }
.link-line button { color: var(--brand); font-size: 13px; }

/* ---------- 商品列表 ---------- */
.list-head { background: var(--card); padding: 10px 14px; position: sticky; top: 44px; z-index: 20;
             border-bottom: 1px solid var(--line); }
.list-head input { width: 100%; border: 1px solid var(--line); border-radius: 9px;
             padding: 9px 12px; background: #fafbfc; font-size: 13px; }
.prod-card { background: var(--card); border-radius: var(--radius); margin: 10px 12px;
             padding: 13px 14px; box-shadow: 0 1px 4px rgba(31,35,40,.05); }
.prod-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.prod-top .code { font-size: 12px; color: var(--brand); font-weight: 600; }
.prod-top .nm { font-size: 14px; font-weight: 600; line-height: 1.45; }
.prod-spec { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.prod-bottom { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.prod-bottom .pr { font-size: 17px; flex: 1; }
.prod-bottom .pr .u { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 3px; }
  .stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px;
           overflow: hidden; }
  .stepper button { width: 32px; height: 30px; font-size: 13px; color: var(--brand);
           background: #fafbfc; flex-shrink: 0; }
  .stepper button:disabled { color: #c8ccd2; }
  .stepper input.q { width: 46px; text-align: center; font-size: 14px; font-weight: 600;
           border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
           height: 30px; background: #fff; color: var(--text); -moz-appearance: textfield; }
  .stepper input.q::-webkit-outer-spin-button,
  .stepper input.q::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

  /* 系列卡图片 */
  .series-img { width: 100%; height: 74px; object-fit: cover; border-radius: 8px;
           margin-bottom: 8px; display: block; }
.btn-add { background: var(--brand); color: #fff; border-radius: 9px; padding: 7px 14px;
           font-size: 13px; font-weight: 600; }
.btn-add:disabled { background: #c8ccd2; }
.more-wrap { text-align: center; padding: 6px 0 10px; }
.more-wrap button { color: var(--brand); font-size: 13px; padding: 8px 20px; }

/* ---------- 底部购物车栏 ---------- */
.cart-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%;
            max-width: 640px; z-index: 40; background: #fff; display: flex; align-items: center;
            padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
            box-shadow: 0 -2px 12px rgba(31,35,40,.08); }
.cart-icon { position: relative; width: 44px; height: 44px; background: var(--brand);
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 20px; margin-top: -18px; box-shadow: 0 3px 8px rgba(31,111,235,.4); }
.cart-icon .badge { position: absolute; top: -5px; right: -7px; background: var(--price);
            color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px;
            display: flex; align-items: center; justify-content: center; padding: 0 4px;
            font-weight: 700; }
.cart-sum { flex: 1; margin-left: 12px; }
.cart-sum .amt { font-size: 17px; font-weight: 700; }
.cart-sum .tip { font-size: 11px; color: var(--muted); }
.go-btn { background: var(--price); color: #fff; border-radius: 22px; padding: 11px 22px;
          font-size: 15px; font-weight: 700; }
.go-btn:disabled { background: #c8ccd2; }

/* ---------- 购物车页 ---------- */
.cart-group-t { padding: 14px 16px 4px; font-size: 14px; font-weight: 700; }
.cart-item { background: var(--card); margin: 8px 12px; border-radius: 11px; padding: 12px 13px; }
.cart-item .row1 { display: flex; justify-content: space-between; gap: 10px; }
.cart-item .nm { font-size: 14px; font-weight: 600; line-height: 1.4; flex: 1; }
.cart-item .del { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.cart-item .spec { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cart-item .row2 { margin-top: 9px; display: flex; justify-content: space-between;
                   align-items: center; }
.settle-card { margin: 12px; }
.addr-tip { font-size: 12px; color: var(--muted); line-height: 1.7; }
.sum-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.sum-line.total { font-size: 15px; font-weight: 700; }

/* ---------- 订单 ---------- */
.chips { display: flex; gap: 8px; padding: 11px 14px; overflow-x: auto; background: var(--bg);
         position: sticky; top: 44px; z-index: 20; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 6px 14px; border-radius: 16px; background: #fff;
        color: var(--muted); font-size: 13px; border: 1px solid var(--line); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.order-card { background: var(--card); border-radius: var(--radius); margin: 10px 12px;
              padding: 13px 14px; box-shadow: 0 1px 4px rgba(31,35,40,.05); }
.order-card .head { display: flex; justify-content: space-between; align-items: center; }
.order-card .no { font-size: 12px; color: var(--muted); }
.order-card .st { font-size: 13px; font-weight: 700; }
.order-card .body { margin-top: 8px; font-size: 13px; line-height: 1.7; }
.order-card .foot { margin-top: 9px; display: flex; justify-content: space-between;
                    align-items: center; border-top: 1px dashed var(--line); padding-top: 9px; }
.timeline { margin-top: 10px; }
.tl-item { position: relative; padding: 0 0 16px 20px; }
.tl-item:before { content: ''; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px;
                  border-radius: 50%; background: var(--brand); }
.tl-item:after { content: ''; position: absolute; left: 8.5px; top: 16px; bottom: 2px;
                 width: 1.5px; background: var(--line); }
.tl-item:last-child:after { display: none; }
.tl-item .t { font-size: 11px; color: var(--muted); }
.tl-item .d { font-size: 13px; margin-top: 1px; }

/* ---------- 我的 ---------- */
.me-head { background: linear-gradient(135deg, #1f6feb, #4098ff); color: #fff;
           padding: 30px 20px 26px; }
.me-head .co { font-size: 17px; font-weight: 700; }
.me-head .sub { font-size: 12px; opacity: .85; margin-top: 6px; line-height: 1.7; }
.me-cell { background: var(--card); margin: 12px; border-radius: var(--radius); overflow: hidden; }
.me-row { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line);
          font-size: 14px; }
.me-row:last-child { border-bottom: none; }
.me-row .k { flex: 1; }
.me-row .v { color: var(--muted); font-size: 13px; margin-right: 6px; max-width: 60%;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-row .chev { color: #c8ccd2; }

/* ---------- Tab 栏 ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%;
          max-width: 640px; z-index: 40; background: #fff; display: flex;
          padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; padding: 8px 0 7px; font-size: 11px; color: var(--muted);
                 display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar button .ic { font-size: 21px; line-height: 1; }
.tabbar button.on { color: var(--brand); font-weight: 600; }
.tabbar .tab-badge { position: relative; }
.tabbar .tab-badge i { position: absolute; top: -3px; right: 14px; background: var(--price);
                 color: #fff; font-style: normal; font-size: 10px; min-width: 16px; height: 16px;
                 border-radius: 8px; display: flex; align-items: center; justify-content: center;
                 padding: 0 4px; font-weight: 700; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: flex;
        align-items: flex-end; justify-content: center; }
.mask.center { align-items: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; border-radius: 16px 16px 0 0;
         padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 86vh;
         overflow-y: auto; }
.sheet.center { border-radius: 16px; width: 86%; max-width: 360px; }
.sheet h3 { font-size: 16px; margin-bottom: 14px; text-align: center; }
.sheet .x { position: absolute; }
.toast { position: fixed; top: 45%; left: 50%; transform: translate(-50%,-50%); z-index: 99;
         background: rgba(0,0,0,.75); color: #fff; padding: 10px 18px; border-radius: 10px;
         font-size: 13px; max-width: 76%; text-align: center; line-height: 1.5; }
.fade-enter-active, .fade-leave-active { transition: opacity .18s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* 桌面端字体微调 */
@media (min-width: 641px) { body { font-size: 14px; } }
