/**
 * @copyright © 2026 易企网ERP订货系统. 保留所有权利.
 * 本文件为系统源码之一，仅供授权使用，禁止未经授权的复制、修改与分发。
 */
/* ============================================================================

   车销版手机进销存系统 · H5 开单端样式基线（共享手机场景）

   ★ 色板沿用「校园缴费系统」campus-pay v2.5.0  h5/assets/app.css

   ★ 设计约束（原文）：

     1. 手机优先：单列、卡片、44px 以上的可点区域（车间手机屏幕小、戴手套操作）

     2. 与小程序同色系（主色 #e5361f），两端切换不违和

     3. 桌面浏览器打开时居中成「手机宽度」，不拉伸成长条

   ========================================================================== */



/* ------------------------------------------------------------------

   [hidden] 兜底 —— ★ 必需，不能删

   ★ 浏览器 UA 的 [hidden] 优先级极低，会被 .mask{display:flex} 盖掉，

     导致「隐藏的遮罩」照样铺满屏幕、按钮点不到。必须显式兜底。

   ------------------------------------------------------------------ */

[hidden] { display: none !important; }



:root {

  --primary: #e5361f;

  --primary-2: #ff7a5c;

  --primary-soft: #fdeceb;

  --green: #22a95c;      /* ★ 三端统一绿；campus-pay H5 原为 #12a150，此处已收敛 */

  --green-soft: #e6f6ef;

  --orange: #f59e0b;

  --orange-soft: #fef3e2;

  --red: #e5484d;

  --red-soft: #fdecec;



  --bg: #f4f6fa;

  --card: #ffffff;

  --txt: #1f2430;

  --txt-2: #6b7280;

  --txt-3: #9aa3b2;

  --line: #e9edf4;



  --radius: 14px;                       /* H5 圆角比后台(8px)大，更贴移动端手感 */

  --shadow: 0 2px 10px rgba(31, 36, 48, .06);

  --safe-b: env(safe-area-inset-bottom, 0px);

}



* { box-sizing: border-box; }



html, body {

  margin: 0;

  padding: 0;

  background: #eef1f7;

  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",

               "Helvetica Neue", Arial, sans-serif;

  font-size: 15px;

  line-height: 1.5;

  color: var(--txt);

  -webkit-font-smoothing: antialiased;

  -webkit-tap-highlight-color: transparent;

}



/* 桌面浏览器打开时居中成手机宽度 */

#app {

  position: relative;

  max-width: 560px;

  margin: 0 auto;

  min-height: 100vh;

  background: var(--bg);

  box-shadow: 0 0 24px rgba(31, 36, 48, .08);

  display: flex;

  flex-direction: column;

}



.app-bar {

  flex: none;

  height: 52px;

  background: var(--primary);

  color: #fff;

  display: flex;

  align-items: center;

  padding: 0 14px;

  position: sticky;

  top: 0;

  z-index: 50;

}

.app-bar .ttl { font-size: 16px; font-weight: 600; }

.app-bar .r { margin-left: auto; font-size: 13px; opacity: .92; }



/* 内容区：底部留出 tabbar + 安全区 */

.main { flex: 1; padding: 12px 14px calc(72px + var(--safe-b)); }



/* ---------- 卡片 ---------- */

.card {

  background: var(--card);

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  padding: 14px;

  margin-bottom: 12px;

}

.card-title { font-size: 15px; font-weight: 500; margin-bottom: 10px; }



/* ---------- 表单（H5 触控尺寸一律 44px 起） ---------- */

.fld { margin-bottom: 14px; }

.fld > label { display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 6px; }

.inp, .sel {

  width: 100%;

  height: 44px;                 /* ★ 触控友好，比后台 32px 大一圈 */

  padding: 0 12px;

  border: 1px solid var(--line);

  border-radius: 10px;

  font-size: 15px;

  color: var(--txt);

  background: #fff;

  outline: none;

  /* iOS 聚焦时自动放大页面，用 16px 以下的字号会触发，必须 ≥16px 或加这一行 */

  -webkit-appearance: none;

}

.inp:focus, .sel:focus { border-color: var(--primary); }

.tip { font-size: 12px; color: var(--txt-3); margin-top: 5px; }

.err { font-size: 12px; color: var(--red); margin-top: 5px; }



/* ---------- 按钮 ---------- */

.btn {

  height: 42px;

  padding: 0 18px;

  border: none;

  border-radius: 10px;

  background: #fff;

  color: var(--txt);

  font-size: 15px;

  cursor: pointer;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

}

.btn-lg { height: 46px; font-size: 16px; }

.btn-sm { height: 32px; font-size: 13px; padding: 0 12px; }

.btn-primary { background: var(--primary); color: #fff; }

.btn-block { width: 100%; }

.btn[disabled] { opacity: .5; }



/* ---------- 选车卡片（共享手机开单的核心交互） ---------- */

.v-card {

  background: #fff;

  border-radius: var(--radius);

  box-shadow: var(--shadow);

  padding: 12px 14px;

  margin-bottom: 10px;

  display: flex;

  gap: 12px;

  align-items: center;

}

.v-card.sel { border: 2px solid var(--primary); padding: 11px 13px; }

.v-card.locked { opacity: .72; }         /* 已被别人锁车 */

.v-card .nm { font-size: 15px; font-weight: 500; }

.v-card .meta { font-size: 12px; color: var(--txt-3); margin-top: 3px; }

.v-card .price { margin-left: auto; font-size: 16px; font-weight: 600; color: var(--primary); }



/* ---------- 金额条（常驻底部，主操作） ---------- */

.amount-bar {

  position: fixed;

  left: 0;

  right: 0;

  bottom: calc(64px + var(--safe-b));

  max-width: 560px;

  margin: 0 auto;

  background: #fff;

  border-top: 1px solid var(--line);

  padding: 10px 14px;

  display: flex;

  align-items: center;

  gap: 10px;

  z-index: 40;

}

.amount-bar .amt { font-size: 20px; font-weight: 700; color: var(--red); }



/* ---------- 底部 tabbar ---------- */

.tabbar {

  position: fixed;

  left: 0;

  right: 0;

  bottom: 0;

  max-width: 560px;

  margin: 0 auto;

  height: 64px;

  background: #fff;

  border-top: 1px solid var(--line);

  display: flex;

  padding-bottom: var(--safe-b);

  z-index: 45;

}

.tabbar a {

  flex: 1;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 3px;

  font-size: 11px;

  color: var(--txt-3);

}

.tabbar a.on { color: var(--primary); }



/* ---------- 弹层 / 底部抽屉 ---------- */

.mask {

  position: fixed;

  inset: 0;

  z-index: 100;

  background: rgba(24, 30, 44, .5);

  display: flex;

  align-items: flex-end;

  justify-content: center;

}

.sheet {

  width: 100%;

  max-width: 560px;

  background: #fff;

  border-radius: 18px 18px 0 0;

  padding: 16px 16px calc(16px + var(--safe-b));

  max-height: 80vh;

  overflow-y: auto;

}

.sheet .s-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }



/* ---------- Toast ---------- */

.toast {

  position: fixed;

  left: 50%;

  top: 40%;

  transform: translate(-50%, -50%);

  background: rgba(24, 30, 44, .9);

  color: #fff;

  padding: 12px 20px;

  border-radius: 10px;

  font-size: 14px;

  z-index: 500;

  max-width: 70%;

  text-align: center;

}



/* ---------- 标签 ---------- */

.tag {

  display: inline-block;

  padding: 2px 8px;

  border-radius: 6px;

  font-size: 11px;

  background: #f1f4f8;

  color: var(--txt-2);

}

.tag.ok { background: var(--green-soft); color: var(--green); }

.tag.warn { background: var(--orange-soft); color: var(--orange); }

.tag.err { background: var(--red-soft); color: var(--red); }

.tag.info { background: var(--primary-soft); color: var(--primary); }



/* ============================================================================

   ★ 共享手机专有：坐席锁提示条

   顶部常驻一行「当前坐席：张三 · 30 分钟无操作自动释放」，

   换人点它。目的是让任何拿起手机的人都知道现在单子会记到谁头上。

   ========================================================================== */

.desk-bar {

  flex: none;

  background: var(--primary-soft);

  color: var(--primary);

  font-size: 12px;

  padding: 7px 14px;

  display: flex;

  align-items: center;

  gap: 8px;

  border-bottom: 1px solid #d5e3ff;

}

.desk-bar .who { font-weight: 600; }

.desk-bar .sw { margin-left: auto; text-decoration: underline; }
/* ==========================================================================
   开单端组件（共享手机）
   ★ 触控一律 44px 起；圆角 14px（与后台 8px 有意区分）
   ========================================================================== */

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex; align-items: center; height: 52px;
  background: #e5361f; color: #fff; padding: 0 8px;
  position: sticky; top: 0; z-index: 20;
}
.tb-back {
  width: 40px; height: 40px; border: 0; background: transparent;
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.tb-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.tb-seat {
  display: flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px; border: 0; border-radius: 17px;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px; cursor: pointer;
}
.tb-seat i { font-style: normal; opacity: .8; font-size: 12px; }

/* ---------- 坐席提示条（共享手机的命门）---------- */
.seat-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #fef3e2; color: #b7791f;
  font-size: 13px; border-bottom: 1px solid #f6e3c4;
}
.seat-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; flex: none;
}
.seat-bar b { color: #8a5a12; }
.seat-tip { margin-left: auto; font-size: 11px; opacity: .75; }

/* ---------- 弱网提示条 ---------- */
.offline-bar {
  padding: 8px 14px; background: #fdecec; color: #d93b3b;
  font-size: 13px; text-align: center; border-bottom: 1px solid #f5c6c6;
}

/* ---------- 区块 ---------- */
.blk {
  background: #fff; margin: 10px 12px 0; border-radius: 14px; overflow: hidden;
}
.blk-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; font-size: 14px; font-weight: 600; color: #1f2430;
  border-bottom: 1px solid #e9edf4;
}
.blk-add {
  height: 30px; padding: 0 12px; border: 0; border-radius: 15px;
  background: #fdeceb; color: #e5361f; font-size: 13px; cursor: pointer;
}
.blk-bd { padding: 12px 14px; }
.blk-ft {
  display: flex; justify-content: space-between; padding: 10px 14px;
  border-top: 1px solid #e9edf4; font-size: 13px; color: #6b7280;
}
.blk-ft b { color: #1f2430; }

/* ---------- 客户选择 ---------- */
.cust-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; cursor: pointer;
}
.cust-info { flex: 1; min-width: 0; }
.cust-name { font-size: 15px; font-weight: 600; color: #1f2430; }
.cust-meta { font-size: 12px; color: #9aa3b2; margin-top: 3px; }
.cust-arrow { color: #c8d2df; font-size: 20px; }

.credit-bar { margin-top: 6px; font-size: 12px; color: #6b7280; }
.credit-bar b { color: #1f2430; }
.credit-track {
  height: 5px; background: #eef1f6; border-radius: 3px; margin-top: 5px; overflow: hidden;
}
.credit-fill { height: 100%; background: #22a95c; border-radius: 3px; transition: width .2s; }
.credit-fill.over { background: #e5484d; }

/* ---------- 明细行 ---------- */
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f0f3f7;
}
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-size: 14px; color: #1f2430; }
.item-meta { font-size: 12px; color: #9aa3b2; margin-top: 3px; }
.item-empty { text-align: center; color: #9aa3b2; font-size: 13px; padding: 22px 0; }
.item-ctl { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 30px; height: 30px; border: 1px solid #dde3ec; border-radius: 8px;
  background: #fff; color: #1f2430; font-size: 17px; cursor: pointer;
}
.qty-btn:active { background: #f2f5fa; }
.qty-num { min-width: 30px; text-align: center; font-size: 14px; font-weight: 600; }
.item-del {
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: #fdecec; color: #d93b3b; font-size: 16px; cursor: pointer; margin-left: 4px;
}

/* ---------- 表单行 ---------- */
.fld-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.fld-row label { width: 52px; font-size: 13px; color: #6b7280; flex: none; }
.fld-row .inp { flex: 1; }
.fld-unit { font-size: 13px; color: #9aa3b2; width: 18px; }

/* ---------- 算价汇总 ---------- */
.sum-box {
  margin-top: 14px; padding: 12px; background: #f7f9fc;
  border-radius: 10px;
}
.sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px; color: #6b7280;
}
.sum-row b { color: #1f2430; font-weight: 600; }
.sum-row .minus { color: #d93b3b; }
.sum-row.total {
  border-top: 1px dashed #dde3ec; margin-top: 5px; padding-top: 9px;
}
.sum-row.total span { color: #1f2430; font-weight: 600; }
.sum-row.total b { color: #d85a30; font-size: 18px; }

.warn {
  margin-top: 10px; padding: 9px 12px; background: #fdecec;
  color: #d93b3b; border-radius: 8px; font-size: 12px; line-height: 1.6;
}

/* ---------- 底部操作条 ---------- */
.bottom-bar {
  position: sticky; bottom: 0; display: flex; gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid #e9edf4; margin-top: 14px;
}
.btn-draft {
  flex: 1; height: 46px; border: 1px solid #dde3ec; border-radius: 12px;
  background: #fff; color: #5c6b7f; font-size: 15px; cursor: pointer;
}
.btn-submit {
  flex: 2; height: 46px; border: 0; border-radius: 12px;
  background: #e5361f; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-submit:disabled { background: #b9c6da; }

/* ---------- 底部弹层（商品/客户/坐席）---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(23,38,60,.45);
  display: flex; align-items: flex-end; z-index: 50;
}
.sheet {
  width: 100%; max-height: 74vh; background: #fff;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  animation: sheetUp .2s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid #e9edf4;
}
.sheet-hd .inp { flex: 1; }
.sheet-t { flex: 1; font-size: 15px; font-weight: 600; color: #1f2430; }
.sheet-x {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: #f2f5fa; color: #6b7280; font-size: 19px; cursor: pointer;
}
.sheet-bd { flex: 1; overflow-y: auto; padding: 6px 14px 20px; }
.sheet-empty { text-align: center; color: #9aa3b2; font-size: 13px; padding: 34px 0; }

/* 商品行 */
.pd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #f0f3f7; cursor: pointer;
}
.pd-main { flex: 1; min-width: 0; }
.pd-name { font-size: 14px; color: #1f2430; }
.pd-meta { font-size: 12px; color: #9aa3b2; margin-top: 3px; }
.pd-price { font-size: 15px; font-weight: 600; color: #d85a30; }

/* 客户行 */
.cu-item {
  padding: 12px 0; border-bottom: 1px solid #f0f3f7; cursor: pointer;
}
.cu-name { font-size: 14px; color: #1f2430; }
.cu-meta { font-size: 12px; color: #9aa3b2; margin-top: 3px; }
.cu-owe { font-size: 12px; color: #d93b3b; margin-top: 3px; }

/* 坐席行 */
.seat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f0f3f7; cursor: pointer;
}
.seat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #e5361f, #ff7a5c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; flex: none;
}
.seat-info { flex: 1; }
.seat-nm { font-size: 14px; color: #1f2430; }
.seat-sub { font-size: 12px; color: #9aa3b2; margin-top: 2px; }
.seat-check { color: #22a95c; font-size: 18px; opacity: 0; }
.seat-item:active .seat-check { opacity: 1; }

/* ---------- 登录页 ---------- */
.login-page { background: linear-gradient(160deg, #e5361f 0%, #c52a16 46%, #180705 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.brand-mark {
  /* ★ 品牌标从「车销」改成「易企网ERP订货」，两字方块放不下 → 改成自适应胶囊 */
  display: inline-block; width: auto; height: 34px; line-height: 34px;
  padding: 0 16px; margin: 0 auto 14px;
  border-radius: 17px; background: rgba(255,255,255,.18);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .5px;
}
.login-brand h1 { margin: 0 0 6px; font-size: 21px; color: #fff; font-weight: 600; }
.login-brand p { margin: 0; font-size: 13px; color: rgba(255,255,255,.72); }
.login-card {
  background: #fff; border-radius: 16px; padding: 22px 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}
.login-card .fld { margin-bottom: 14px; }
.login-card .fld label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.login-card .inp { width: 100%; height: 44px; }
.btn-primary {
  width: 100%; height: 46px; border: 0; border-radius: 12px;
  background: #e5361f; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary:disabled { background: #b9c6da; }
.login-foot { text-align: center; margin-top: 22px; font-size: 13px; }
.login-foot a { color: rgba(255,255,255,.85); text-decoration: none; margin: 0 6px; }
.login-foot span { color: rgba(255,255,255,.45); }
.login-card .err {
  margin: -4px 0 12px; padding: 9px 12px; background: #fdecec;
  color: #d93b3b; border-radius: 8px; font-size: 13px;
}
