* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  background: #eef1f7;
  color: #12233b;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- 聊天背景水印（客户 / 管理员 / 制单 / 超管统一） ----------
   直接引用公司水印原图，不做任何裁切、改色、压缩；只由 CSS 控制平铺尺寸，
   再用一层与气泡底色一致的半透明色压在图片上方，让水印呈现淡淡的浅灰效果。 */
:root {
  --wm-img: url("../assets/watermark-yuda.png");  /* 相对 css 文件定位，http 与 file:// 都能取到 */
  --wm-size-phone: 200px auto;   /* 客户微信（手机宽度） */
  --wm-size-panel: 300px auto;   /* 管理员 / 制单 / 超管后台对话区 */
}

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 262px minmax(0, 1fr); height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #08203c 0%, #0e3a6b 55%, #0a2b52 100%);
  color: #d8e6f8;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  gap: 14px;
  overflow: hidden;
}

.brand { display: flex; gap: 11px; align-items: center; padding: 2px 4px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-logo {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, #4db6ff, #00e0b8);
  display: grid; place-items: center;
  color: #04203f; font-weight: 800; font-size: 13px; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(0, 200, 180, .28);
}
.brand-name { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.35; }
.brand-sub { font-size: 11px; color: #8db6e2; letter-spacing: 1.5px; margin-top: 2px; }

.nav-group-title { font-size: 11px; color: #7ea6d2; letter-spacing: 1.4px; padding: 4px 8px 0; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #c3d8ef; text-align: left; font-size: 13.5px;
  transition: background .16s, color .16s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(61, 150, 255, .3), rgba(0, 224, 184, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(120, 200, 255, .28); }
.nav-item svg { opacity: .9; }
.nav-badge {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #ff5a5f; color: #fff; display: none; place-items: center;
}
.nav-badge.on { display: grid; }

.sidebar-card {
  margin-top: auto;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 14px;
}
.sc-title { font-size: 12px; color: #a9c9ea; letter-spacing: 1px; margin-bottom: 10px; }
.flow { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.75; color: #b9d2ec; }
.flow li::marker { color: #34d8b6; font-weight: 700; }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.ver { font-size: 11px; color: #7ea6d2; }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 26px; background: #fff; border-bottom: 1px solid #e5ebf4;
  flex: none;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.topbar p { margin: 4px 0 0; font-size: 12.5px; color: #7b8ca4; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-dot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7b8ca4; }
.live-dot span { width: 7px; height: 7px; border-radius: 50%; background: #17c48a; box-shadow: 0 0 0 3px rgba(23, 196, 138, .16); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot b { font-weight: 500; }
.live-dot.off span { background: #e8a33d; box-shadow: 0 0 0 3px rgba(232, 163, 61, .16); animation: none; }
.lang-btn {
  border: 1px solid #d9e6fb; border-radius: 8px; padding: 6px 10px;
  background: #f6f9ff; color: #14509e; font-size: 12px; font-weight: 700;
  transition: background .16s, border-color .16s;
}
.lang-btn:hover { background: #eaf2ff; border-color: #bcd4f5; }

.role-chip {
  font-size: 12.5px; padding: 7px 14px; border-radius: 20px;
  background: #eef4ff; color: #14509e; font-weight: 600;
  border: 1px solid #d9e6fb;
}

.view { display: none; padding: 20px 26px 26px; overflow: auto; flex: 1; min-height: 0; }
.view.active { display: block; }
.view.view--flex.active { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; }

/* ---------- generic ---------- */
.card { background: #fff; border-radius: 16px; border: 1px solid #e6ecf5; box-shadow: 0 6px 22px rgba(17, 45, 85, .05); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eef2f8; }
.card-title { font-size: 14px; font-weight: 700; }
.card-sub { font-size: 12px; color: #8494a8; margin-left: 8px; font-weight: 400; }
.card-body { padding: 16px 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: #eef2f8; color: #2a3f5c; transition: .16s; white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover { background: #e2e9f4; }
.btn.primary { background: linear-gradient(135deg, #1a6fe0, #0f9fd4); color: #fff; box-shadow: 0 6px 16px rgba(20, 110, 210, .26); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.success { background: linear-gradient(135deg, #0ba36b, #12c48a); color: #fff; box-shadow: 0 6px 16px rgba(11, 163, 107, .24); }
.btn.success:hover { filter: brightness(1.06); }
.btn.ghost { background: rgba(255, 255, 255, .1); color: #d8e6f8; border-color: rgba(255, 255, 255, .18); }
.btn.ghost:hover { background: rgba(255, 255, 255, .18); }
.btn.danger { background: rgba(214, 59, 59, .16); color: #ffb0b0; border-color: rgba(214, 59, 59, .5); }
.btn.danger:hover { background: rgba(214, 59, 59, .28); }
.btn.line { background: #fff; border-color: #d9e2ef; color: #2a3f5c; }
.btn.line:hover { background: #f4f8ff; border-color: #b7ceec; }
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.gray { background: #eef1f6; color: #64748b; }
.badge.orange { background: #fff2e3; color: #c9741a; }
.badge.blue { background: #e9f1ff; color: #1a68d4; }
.badge.purple { background: #f2ecff; color: #7b46e0; }
.badge.green { background: #e6f8f0; color: #0d9a68; }
.badge.teal { background: #e4f6fa; color: #0d7f96; }

.progress { height: 6px; border-radius: 6px; background: #eef2f8; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #35a0ff, #12c48a); transition: width .3s; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 46px 20px; color: #93a2b8; font-size: 13px; text-align: center; }
.empty .ring { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed #cfdcec; display: grid; place-items: center; color: #b6c6da; }

/* ---------- customer view ---------- */
.customer-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 374px; gap: 20px; align-items: start; max-width: 1140px; margin: 0 auto; }
.customer-side { display: flex; flex-direction: column; gap: 16px; }

.stepper { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step .dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: #eef2f8; color: #9aabc0; border: 2px solid #e3eaf4; z-index: 1;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: #e9eef6;
}
.step.done .dot { background: #12c48a; border-color: #12c48a; color: #fff; }
.step.done:not(:last-child)::after { background: #9ee8cf; }
.step.active .dot { background: #1a6fe0; border-color: #1a6fe0; color: #fff; box-shadow: 0 0 0 4px rgba(26, 111, 224, .14); }
.step .st-name { font-size: 13px; font-weight: 600; color: #33465f; line-height: 1.5; }
.step.done .st-name, .step.active .st-name { color: #12233b; }
.step .st-desc { font-size: 11.5px; color: #8d9db2; margin-top: 2px; }

.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  padding: 8px 10px; border-radius: 9px; background: #f7f9fd; color: #8296ae;
  border: 1px solid #eef2f8;
}
.check-item .tick { width: 14px; height: 14px; border-radius: 50%; background: #dfe7f1; flex: none; position: relative; }
.check-item.on { background: #eafaf4; border-color: #c9f0e0; color: #0b7a55; font-weight: 600; }
.check-item.on .tick { background: #12c48a; }
.check-item.on .tick::after {
  content: ""; position: absolute; left: 4px; top: 1.5px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg);
}

/* phone */
.phone-col { display: flex; justify-content: center; }
.phone {
  width: 358px; height: 704px; background: #111; border-radius: 42px; padding: 10px;
  box-shadow: 0 26px 60px rgba(14, 40, 76, .26), 0 0 0 1px rgba(0, 0, 0, .06);
  position: relative; flex: none;
}
.phone-screen {
  position: relative; width: 100%; height: 100%; background: #f2f3f5; border-radius: 32px; overflow: hidden;
  display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 108px; height: 26px; background: #111; border-radius: 14px; z-index: 6;
}
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 4px; font-size: 12px; font-weight: 600; color: #111; flex: none;
}
.statusbar .sb-right { display: flex; gap: 5px; align-items: center; }
.sb-bar { width: 15px; height: 9px; border: 1.5px solid #111; border-radius: 3px; position: relative; }
.sb-bar::after { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: 8px; background: #111; border-radius: 1px; }
.sb-dots { display: flex; gap: 2px; align-items: flex-end; }
.sb-dots i { width: 3px; background: #111; border-radius: 1px; display: block; }

.wx-nav {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 10px;
  background: #ededed; border-bottom: 1px solid #dedede; flex: none;
}
.wx-back { display: flex; align-items: center; gap: 2px; color: #333; font-size: 12px; }
.wx-avatar {
  width: 30px; height: 30px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, #1a6fe0, #0fb9a8); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.wx-title { font-size: 14.5px; font-weight: 600; color: #111; line-height: 1.25; }
.wx-sub { font-size: 10.5px; color: #8a8a8a; }
.wx-more { margin-left: auto; color: #555; letter-spacing: 1px; font-size: 15px; }

.chat {
  flex: 1; overflow-y: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 12px;
  /* 底色 + 公司水印原图平铺；半透明底色压在上方 → 极淡水印（约差 1~2 个灰阶，几乎不可见） */
  background-color: #f2f3f5;
  background-image: linear-gradient(rgba(242, 243, 245, .996), rgba(242, 243, 245, .996)), var(--wm-img);
  background-repeat: repeat;
  background-size: auto, var(--wm-size-phone);
  background-position: center, center;
}
.chat::-webkit-scrollbar { width: 0; }

.msg-day { text-align: center; font-size: 11px; color: #a2a2a2; margin: 2px 0; }
.msg-sys {
  align-self: center; max-width: 84%; text-align: center; font-size: 11.5px; color: #7a7a7a;
  background: rgba(0, 0, 0, .05); padding: 5px 12px; border-radius: 8px; line-height: 1.55;
}
.msg-sys.human {
  background: #fff7e6; color: #b9761a; border: 1px solid #ffe2ad;
  font-size: 12px; padding: 7px 14px; border-radius: 10px; font-weight: 600;
}
.msg-sys.human b { font-weight: 700; }

.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg .ava {
  width: 30px; height: 30px; border-radius: 6px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: #7c8aa0;
}
.msg .ava.bot { background: linear-gradient(135deg, #1a6fe0, #0fb9a8); }
.msg .ava.op { background: linear-gradient(135deg, #f59e0b, #f97316); }
.msg .bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg .who { font-size: 10.5px; color: #9a9a9a; padding-left: 2px; }
.msg .bubble {
  padding: 9px 12px; border-radius: 6px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-width: 232px;
}
.msg-in .bubble { background: #fff; color: #111; border: 1px solid #e6e6e6; }
.msg-out { flex-direction: row-reverse; }
.msg-out .bubble { background: #95ec69; color: #111; }
.msg-out .ava { background: #4b6a9b; }

/* staff chat bubbles */
.staff-chat .msg-in .bubble { background: #fff; border: 1px solid #e8eef6; color: #1b2c42; }
.staff-chat .msg-out .bubble { background: linear-gradient(135deg, #1a6fe0, #1084d8); color: #fff; border: none; }
.staff-chat .msg-sys { background: #f2f5fa; color: #7b8b9f; max-width: 90%; }
.msg-note {
  align-self: center; font-size: 11.5px; color: #8a6d3b; background: #fffbe8;
  border: 1px dashed #f0dfa8; border-radius: 8px; padding: 5px 12px; text-align: center; max-width: 90%;
}

.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #98a6b8; font-size: 12.5px; text-align: center; padding: 0 30px; }
.chat-empty .phone-ico { width: 62px; height: 62px; border-radius: 20px; background: linear-gradient(135deg, #dff0ff, #e7fbf4); display: grid; place-items: center; color: #1a6fe0; }

.typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; background: #fff; border-radius: 6px; border: 1px solid #e6e6e6; width: fit-content; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b9c3cf; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.quick-chips { display: flex; gap: 7px; padding: 0 12px 8px; flex-wrap: wrap; background: #f7f7f7; }
.quick-chips button {
  font-size: 12px; padding: 5px 11px; border-radius: 14px; background: #fff;
  color: #3f5a75; border: 1px solid #e2e6ec;
}
.quick-chips button:hover { border-color: #1a6fe0; color: #1a6fe0; }

.inputbar {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 14px;
  background: #f7f7f7; border-top: 1px solid #ededed; flex: none;
}
.inputbar input {
  flex: 1; border: none; outline: none; background: #fff; border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; border: 1px solid #e5e5e5;
}
.inputbar input:focus { border-color: #07c160; }
.send-btn {
  width: 60px; height: 38px; border-radius: 8px; background: #07c160; color: #fff;
  font-size: 13px; font-weight: 600; flex: none;
}
.send-btn:hover { filter: brightness(1.05); }

/* ---------- staff views ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; flex: none; }
.stat { background: #fff; border-radius: 14px; border: 1px solid #e6ecf5; padding: 15px 17px; box-shadow: 0 6px 22px rgba(17, 45, 85, .05); position: relative; overflow: hidden; }
.stat-label { font-size: 12.5px; color: #8494a8; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-foot { font-size: 11.5px; color: #9aa8bb; margin-top: 6px; }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 66px; height: 66px; border-radius: 50%; background: rgba(26, 111, 224, .07); }
.stat.s-orange::after { background: rgba(249, 158, 11, .12); }
.stat.s-green::after { background: rgba(18, 196, 138, .12); }
.stat.s-purple::after { background: rgba(123, 70, 224, .1); }
.stat.s-blue::after { background: rgba(26, 111, 224, .12); }
.stat.s-red::after { background: rgba(238, 78, 78, .12); }
.stat.s-gray::after { background: rgba(132, 148, 168, .12); }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #eef2f8; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search input { width: 100%; padding: 8px 12px 8px 32px; border-radius: 9px; border: 1px solid #e2e9f4; background: #f8fafd; outline: none; font-size: 13px; }
.search input:focus { border-color: #9dc2f0; background: #fff; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; fill: #a5b4c7; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 6px 13px; border-radius: 20px; background: #f4f7fb; color: #5a6d85; border: 1px solid transparent; }
.chip:hover { background: #eaf1fb; }
.chip.on { background: #e9f1ff; color: #1a68d4; border-color: #cfe1fb; font-weight: 600; }

.table-wrap { overflow: auto; flex: 1; min-height: 0; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl thead th {
  position: sticky; top: 0; z-index: 2; background: #f8fafd; text-align: left; font-weight: 600;
  font-size: 12px; color: #7d8ea4; padding: 10px 14px; border-bottom: 1px solid #eef2f8; white-space: nowrap;
}
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
table.tbl tbody tr { transition: background .14s; cursor: pointer; }
table.tbl tbody tr:hover { background: #f6faff; }
table.tbl tbody tr.sel { background: #eef5ff; }
.td-main { font-weight: 600; color: #16283f; }
.td-sub { font-size: 11.5px; color: #8b9bb0; margin-top: 2px; }
.td-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #46586f; }
.completeness { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.completeness .progress { flex: 1; }
.completeness span { font-size: 11.5px; color: #6d7f96; font-weight: 600; }

/* operator 3-column */
.operator-grid { display: grid; grid-template-columns: 268px minmax(320px, 1fr) 366px; gap: 14px; flex: 1; min-height: 0; }
.operator-grid > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.panel-head { padding: 13px 15px; border-bottom: 1px solid #eef2f8; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.panel-title { font-size: 13.5px; font-weight: 700; }
.panel-sub { font-size: 11.5px; color: #8494a8; }

.mini-tabs { display: flex; gap: 4px; padding: 10px 12px 6px; flex: none; }
.mini-tab { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; color: #6d7f96; }
.mini-tab.on { background: #eef5ff; color: #1a68d4; font-weight: 600; }

.conv-list { overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.conv-item { text-align: left; padding: 10px 11px; border-radius: 10px; border: 1px solid transparent; display: block; width: 100%; }
.conv-item:hover { background: #f6faff; }
.conv-item.on { background: #eef5ff; border-color: #d3e4fb; }
.ci-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ci-name { font-size: 13px; font-weight: 600; color: #16283f; display: flex; align-items: center; gap: 5px; }
.ci-time { font-size: 10.5px; color: #a3b1c4; }
.ci-sub { font-size: 11.5px; color: #8296ae; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5f; flex: none; }

.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.staff-chat {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  /* 与客户微信同一张水印原图（管理员 / 制单 / 超管后台对话区统一） */
  background-color: #f7f9fc;
  background-image: linear-gradient(rgba(247, 249, 252, .996), rgba(247, 249, 252, .996)), var(--wm-img);
  background-repeat: repeat;
  background-size: auto, var(--wm-size-panel);
  background-position: center, center;
}
.staff-chat .bubble { max-width: 74%; }
.staff-chat .msg-out { justify-content: flex-start; }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 15px; font-size: 12.5px; flex: none; }
.notice.warn { background: #fff8ec; color: #a8701a; border-bottom: 1px solid #f6e6c9; }
.notice.info { background: #eef5ff; color: #1a5cb8; border-bottom: 1px solid #dbe8fb; }
.notice.ok { background: #eafaf4; color: #0b7a55; border-bottom: 1px solid #cdefe2; }
.notice b { font-weight: 700; }

.form-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; }
.form-grid { display: flex; flex-direction: column; gap: 11px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; color: #6d7f96; display: flex; align-items: center; gap: 4px; }
.form-label .req { color: #ef4444; }
.form-input {
  padding: 9px 11px; border-radius: 9px; border: 1px solid #e2e9f4; background: #fbfcfe;
  outline: none; font-size: 13px; transition: .15s;
}
.form-input:focus { border-color: #8fbcf4; background: #fff; box-shadow: 0 0 0 3px rgba(26, 111, 224, .1); }
.form-input.miss { border-color: #f3c2c2; background: #fff8f8; }
.form-input.miss:focus { border-color: #ef8080; box-shadow: 0 0 0 3px rgba(239, 68, 68, .1); }
.form-hint { font-size: 11px; color: #f08a8a; }

.form-foot { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid #eef2f8; flex: none; flex-wrap: wrap; }
.form-foot .btn { flex: 1; }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.kv { border-bottom: 1px dashed #eef2f8; padding-bottom: 8px; }
.kv .k { font-size: 11.5px; color: #8b9bb0; }
.kv .v { font-size: 13.5px; font-weight: 600; margin-top: 3px; color: #16283f; word-break: break-all; }
.kv .v.none { color: #f08a8a; font-weight: 500; }

/* drawer */
.drawer-mask { position: fixed; inset: 0; background: rgba(11, 30, 55, .28); opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 40; }
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 580px; max-width: 92vw; background: #fff;
  z-index: 41; transform: translateX(102%); transition: transform .26s cubic-bezier(.32, .72, .3, 1);
  display: flex; flex-direction: column; box-shadow: -18px 0 48px rgba(12, 36, 70, .16);
}
.drawer.on { transform: translateX(0); }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid #eef2f8; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex: none; }
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-sub { font-size: 12px; color: #8494a8; margin-top: 4px; }
.drawer-body { overflow-y: auto; padding: 18px 20px 26px; display: flex; flex-direction: column; gap: 18px; flex: 1 1 auto; min-height: 0; }
/* 抽屉里只保留一层滚动：内部 staff-chat / table-wrap 不再独立滚动，避免滑拉条叠加 */
.drawer-body .staff-chat,
.drawer-body .table-wrap { overflow: visible !important; flex: none !important; max-height: none !important; }
.drawer-close { width: 30px; height: 30px; border-radius: 8px; background: #f2f5fa; color: #6d7f96; display: grid; place-items: center; font-size: 15px; }
.drawer-close:hover { background: #e8eef7; }
.section-title { font-size: 12.5px; font-weight: 700; color: #33465f; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(180deg, #35a0ff, #12c48a); }
.assign-row { display: flex; gap: 8px; }
.select { padding: 9px 11px; border-radius: 9px; border: 1px solid #e2e9f4; background: #fbfcfe; outline: none; font-size: 13px; flex: 1; }

/* toast */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(16, 34, 58, .94); color: #fff; padding: 10px 18px; border-radius: 11px; font-size: 13px;
  box-shadow: 0 12px 30px rgba(10, 30, 60, .3); animation: toastIn .26s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: rgba(9, 133, 91, .96); }
.toast.err { background: rgba(198, 42, 48, .96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfdaea; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b6c6da; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- mobile shell bits (desktop hidden) ---------- */
.topbar-brand { display: none; }
.brand-logo.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; box-shadow: 0 4px 10px rgba(0, 200, 180, .22); }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: none; width: 36px; height: 36px; border-radius: 10px; background: #f2f5fa; color: #5a6d85; place-items: center; flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.back-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; background: #f2f5fa; border: 1px solid #e6ecf5; color: #4a5c74;
  text-decoration: none; transition: background .16s, color .16s, border-color .16s; }
.back-btn:hover { background: #e9f1ff; border-color: #cfe1fb; color: #14509e; }
.back-btn svg { width: 18px; height: 18px; fill: currentColor; }

.tabbar { display: none; }
.op-mtabs { display: none; }

/* ---------- analytics ---------- */
.an-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin-top: 14px;
}
.an-card { display: flex; flex-direction: column; min-height: 0; }
.an-card .card-body { flex: 1; }
.an-card--donut .card-body { display: flex; align-items: center; gap: 18px; }

.an-donut-svg { width: 148px; height: 148px; flex: none; }
.an-donut-num { font-size: 22px; font-weight: 800; fill: #16283f; }
.an-donut-cap { font-size: 9px; fill: #93a3b8; }

.an-legend { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.an-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #4a5c74; }
.an-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.an-legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-legend-val { color: #16283f; }
.an-legend-pct { width: 42px; text-align: right; color: #93a3b8; font-size: 11.5px; }

.an-trend-svg { width: 100%; height: 148px; display: block; }
.an-trend-x { font-size: 8.5px; fill: #9aabc0; }

.an-bars { display: flex; flex-direction: column; gap: 11px; }
.an-bar-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: #4a5c74; margin-bottom: 5px; }
.an-bar-name { font-weight: 600; color: #16283f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-sub { font-size: 11px; color: #93a3b8; }
.an-bar-val { margin-left: auto; color: #16283f; font-variant-numeric: tabular-nums; }
.an-bar-track { height: 8px; border-radius: 6px; background: #f0f4fa; overflow: hidden; }
.an-bar-track i { display: block; height: 100%; border-radius: 6px; transition: width .35s ease; }
.an-empty { font-size: 12.5px; color: #93a3b8; padding: 14px 0; text-align: center; }

.an-card--wide { grid-column: 1 / -1; }
.an-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 9px; margin-bottom: 12px; }
.an-metric { background: #f7fafd; border: 1px solid #eef3fa; border-radius: 10px; padding: 9px 11px; }
.an-metric-label { font-size: 11px; color: #7c8ba1; }
.an-metric-value { font-size: 16.5px; font-weight: 800; color: #16283f; margin-top: 3px;
  font-variant-numeric: tabular-nums; }
.an-metric-sub { font-size: 10.5px; color: #93a3b8; margin-top: 2px; line-height: 1.45; }

.an-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.an-table th { font-size: 11px; font-weight: 600; color: #8b9bb0; padding: 6px 8px;
  border-bottom: 1px solid #eef2f8; white-space: nowrap; }
.an-table td { padding: 7px 8px; color: #33475f; border-bottom: 1px solid #f5f8fc;
  font-variant-numeric: tabular-nums; }
.an-table tr:last-child td { border-bottom: none; }
.an-spark { width: 96px; height: 26px; display: block; margin: 0 auto; }
.an-delta { font-size: 11px; font-weight: 700; white-space: nowrap; }
.an-delta.up { color: #0d9a68; }
.an-delta.down { color: #e05a5f; }
.an-delta.flat { color: #93a3b8; }
.an-legend-inline { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px;
  color: #7c8ba1; margin-bottom: 8px; }
.an-legend-inline i { width: 9px; height: 9px; border-radius: 3px; display: inline-block;
  margin-right: 5px; }
.an-note { font-size: 11px; color: #93a3b8; line-height: 1.7; margin-top: 10px;
  padding-top: 8px; border-top: 1px dashed #eef2f8; }
.an-flexrow { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.an-flexrow .an-donut-svg { width: 128px; height: 128px; }
.an-section-cap { font-size: 11.5px; color: #7c8ba1; margin: 14px 0 8px; font-weight: 600; }

@media (max-width: 1180px) {
  .an-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .an-grid { gap: 10px; margin-top: 10px; }
  .an-card--donut .card-body { flex-direction: column; align-items: stretch; gap: 12px; }
  .an-donut-svg { align-self: center; }
  .an-trend-svg { height: 132px; }
  #view-analytics .stat-grid .stat:last-child { grid-column: span 2; }
}

/* ---------- mobile tall list cards ---------- */
.m-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.m-card {
  display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left;
  background: #fff; border: 1px solid #e6ecf5; border-radius: 14px; padding: 13px;
  box-shadow: 0 3px 12px rgba(17, 45, 85, .04); transition: background .14s, transform .1s;
}
.m-card:active { background: #f4f9ff; transform: scale(.995); }
.m-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-name { font-size: 15px; font-weight: 700; color: #16283f; display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-name.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.m-card-sub { font-size: 12.5px; color: #6d7f96; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card-foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #97a6ba; margin-top: 3px; }
.m-card-foot .completeness { flex: 1; min-width: 0; max-width: 140px; }
.m-card-foot .sep { color: #dfe7f1; }
.m-card-call {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: #1a68d4; background: #eef5ff; border-radius: 20px; padding: 4px 11px;
}

@media (max-width: 1440px) {
  .operator-grid { grid-template-columns: 240px minmax(260px, 1fr) 336px; }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .customer-wrap { grid-template-columns: minmax(0, 1fr); }
  .phone-col { order: -1; }
  .operator-grid { grid-template-columns: 186px minmax(200px, 1fr) 286px; }
}

/* ================= mobile / phone layout ================= */
@media (max-width: 900px) {
  :root { --tabbar-h: 58px; }

  body {
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
    background: #eff3f9;
  }

  .app { display: block; height: 100vh; height: 100dvh; }
  .sidebar { display: none; }

  .main {
    height: calc(100vh - var(--tabbar-h) - env(safe-area-inset-bottom));
    height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom));
  }

  .topbar { padding: 8px 12px; gap: 9px; align-items: center; }
  .topbar-brand { display: block; }
  .topbar h1 { font-size: 16px; }
  .topbar p { display: none; }
  .topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .live-dot b { display: none; }
  .role-chip { display: none; }
  .icon-btn { display: grid; }
  /* 手机端：账号菜单（我的账户 / 切换角色 / 退出登录）必须可见 */
  .acct-drop { display: block; flex: none; }
  .acct-btn { padding: 3px; border-radius: 50%; min-width: 34px; min-height: 34px;
    justify-content: center; }
  .acct-menu { width: 250px; right: -4px; }

  .view { padding: 10px 10px 12px; }
  .view.view--flex.active { gap: 10px; padding: 10px; padding-bottom: 12px; }

  /* bottom tab bar：可左右滑动，避免菜单项过多被截断 */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid #e6ecf5;
    box-shadow: 0 -6px 20px rgba(17, 45, 85, .05);
    scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding-top: 5px; color: #93a3b8; font-size: 10.5px; font-weight: 500;
    flex: 0 0 auto; min-width: 70px; padding: 0 10px;
  }
  .tab svg { width: 21px; height: 21px; opacity: .85; }
  .tab.active { color: #1a6fe0; font-weight: 700; }
  .tab.active svg { opacity: 1; filter: drop-shadow(0 4px 8px rgba(26, 111, 224, .32)); }
  .tab-badge {
    position: absolute; top: 3px; left: 50%; margin-left: 4px;
    font-style: normal; font-size: 10px; font-weight: 700; line-height: 1;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
    background: #ff5a5f; color: #fff; display: none; place-items: center;
  }
  .tab-badge.on { display: grid; }

  /* stat cards: 2 x 2, compact */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 11px 12px; border-radius: 13px; }
  .stat-label { font-size: 11.5px; }
  .stat-value { font-size: 20px; margin-top: 2px; letter-spacing: -.3px; }
  .stat-foot { display: none; }
  .stat::after { width: 52px; height: 52px; right: -14px; top: -14px; }

  .card { border-radius: 14px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 13px 14px; }

  .toolbar { padding: 10px 12px; gap: 8px; }
  .search { flex: 1 1 100%; max-width: none; }
  .search input { padding: 10px 12px 10px 34px; font-size: 16px; border-radius: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 7px 14px; font-size: 13px; }
  .count-sub { display: none; }
  .table-wrap { overflow: auto; }

  /* generic buttons a bit bigger for thumbs */
  .btn { padding: 10px 15px; font-size: 14px; border-radius: 11px; }
  .btn.small { padding: 8px 13px; font-size: 13px; }

  /* bottom-sheet drawer */
  .drawer {
    width: 100%; max-width: none; top: 5%; right: 0; left: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(102%);
    box-shadow: 0 -18px 48px rgba(12, 36, 70, .2);
  }
  .drawer.on { transform: translateY(0); }
  .drawer-head { padding: 18px 16px 12px; position: relative; }
  .drawer-head::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px; background: #dbe3ee;
  }
  .drawer-title { font-size: 16px; }
  .drawer-body { padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); gap: 15px; }
  .kv-grid { grid-template-columns: 1fr; gap: 9px; }
  .assign-row { flex-direction: column; }
  .select { font-size: 16px; padding: 11px 12px; border-radius: 10px; }
  .drawer .btn { width: 100%; }
  .section-title { font-size: 13px; }

  .toast-wrap { top: auto; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); }
  .toast { font-size: 13.5px; padding: 11px 16px; max-width: 88vw; text-align: center; }

  /* ---------- customer (wechat) full screen ---------- */
  #view-customer.active {
    display: flex; flex-direction: column; gap: 8px;
    overflow: hidden; padding: 8px;
  }
  .customer-wrap { display: contents; }
  .customer-side { order: -1; flex: none; }
  .customer-side .card.side-flow, .customer-side .card.side-progress { display: none; }
  .customer-side .card-head { padding: 10px 12px; }
  .customer-side .card-body { padding: 10px 12px; }
  .customer-side .td-sub { display: none; }
  .phone-col { flex: 1; min-height: 0; display: flex; align-items: stretch; }
  .phone {
    width: 100%; height: 100%; padding: 0; flex: 1; min-height: 0;
    border-radius: 16px; background: #111;
    box-shadow: 0 8px 26px rgba(14, 40, 76, .14);
  }
  .phone-notch { display: none; }
  .phone-screen { border-radius: 16px; }
  .statusbar { display: none; }
  .wx-nav { padding: 10px 14px 11px; }
  .chat { padding: 12px 12px 16px; }
  .msg .bubble { max-width: 68vw; font-size: 14.5px; }
  .msg-sys, .msg-note { font-size: 12px; max-width: 88%; }
  .quick-chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; }
  .quick-chips::-webkit-scrollbar { display: none; }
  .quick-chips button { flex: none; padding: 7px 13px; font-size: 13px; }
  .inputbar { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .inputbar input { font-size: 16px; padding: 11px 12px; }
  .send-btn { width: 62px; height: 42px; font-size: 14px; }

  /* ---------- operator: list / chat / form 三段切换 ---------- */
  .op-mtabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; flex: none;
    background: #fff; border: 1px solid #e6ecf5; border-radius: 13px; padding: 5px;
    box-shadow: 0 3px 12px rgba(17, 45, 85, .04);
  }
  .op-mtab {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 9px 4px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #6d7f96;
  }
  .op-mtab.on { background: #eef5ff; color: #1a68d4; }
  .op-mtab em {
    font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 1;
    background: #ff5a5f; color: #fff; border-radius: 8px; padding: 3px 5px; min-width: 16px;
  }
  .op-mtab em.zero { background: #e6ecf5; color: #8fa0b6; }

  .operator-grid { display: block; flex: 1; min-height: 0; }
  .operator-grid > .card { display: none; height: 100%; min-height: 0; }
  .operator-grid[data-mtab="list"] > .op-pane-list,
  .operator-grid[data-mtab="chat"] > .op-pane-chat,
  .operator-grid[data-mtab="form"] > .op-pane-form { display: flex; }

  .conv-list { padding: 8px 10px 14px; gap: 7px; }
  .conv-item { padding: 12px; border-radius: 12px; background: #fbfcfe; border-color: #eef2f8; }
  .conv-item.on { background: #eef5ff; border-color: #cfe1fb; }
  .ci-name { font-size: 14px; }
  .staff-chat { padding: 12px; gap: 10px; }
  .staff-chat .bubble { max-width: 76%; }
  .panel-head { padding: 12px 13px; }
  .form-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 13px 16px; }
  .form-input { font-size: 16px; padding: 11px 12px; border-radius: 10px; }
  .form-label { font-size: 12.5px; }
  .form-foot {
    position: sticky; bottom: 0; background: #fff;
    padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 16px rgba(17, 45, 85, .05);
  }
  .form-foot .btn { padding: 12px 8px; font-size: 13.5px; }
  .notice { font-size: 12.5px; padding: 10px 13px; flex-wrap: wrap; }
  .notice .btn { width: auto; }
  .mini-tabs { padding: 8px 10px 4px; }

  /* ---------- tms ---------- */
  .m-card .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
  .tms-outbox-head { flex-wrap: wrap; gap: 8px; }
  .tms-outbox-head > div:last-child { margin-left: 0 !important; width: 100%; }
  .tms-outbox-head .btn { flex: 1; }
}

@media (max-width: 380px) {
  .stat-grid { gap: 7px; }
  .stat-value { font-size: 18px; }
  .m-card-sub { font-size: 12px; }
}

/* ================= v2.0 · 仓库派单与限时介入 ================= */
.deadline {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: #e9f1ff; color: #1a68d4; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.deadline::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.deadline.warn { background: #fff3e0; color: #c9741a; }
.deadline.over { background: #fdeaea; color: #d63b3b; animation: deadlinePulse 1.6s ease-in-out infinite; }
@keyframes deadlinePulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.wh-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 6px; background: #eef5ff; color: #1a68d4; vertical-align: 1px;
}
.wh-tag.none { background: #f2f5fa; color: #a3b1c4; font-weight: 500; }

.side-meta .meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.side-meta .meta-row span { color: #8494a8; }
.side-meta .meta-row b { color: #16283f; font-weight: 600; }

select.form-input { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #8b9bb0 50%), linear-gradient(135deg, #8b9bb0 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.form-input.form-ta { resize: vertical; min-height: 52px; line-height: 1.5; font-family: inherit; }
.op-switch { width: auto; max-width: 118px; flex: none; padding: 5px 26px 5px 9px; font-size: 12px; border-radius: 8px; }
.notice.over { background: #fdeaea; color: #b42323; border-bottom: 1px solid #f6c9c9; }
.notice.over .btn { background: #d63b3b; color: #fff; border-color: #d63b3b; }

@media (max-width: 900px) {
  .customer-side .card.side-meta { display: none; }
  .op-switch { max-width: 92px; }
  .deadline { font-size: 10.5px; padding: 1px 7px; }
}

/* ---------- TMS 状态与回单同步 ---------- */
.tms-sync { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.tms-sync-info { flex: 1 1 220px; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.tms-sync-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: #4a5c74; }
.tms-sync-row span { color: #8494a8; }
.tms-sync-row b { color: #16283f; font-variant-numeric: tabular-nums; }
.tms-sync-form { flex: 2 1 320px; min-width: 260px; display: flex; flex-direction: column; gap: 8px; }
.tms-sync-form textarea { width: 100%; min-height: 78px; resize: vertical; font-size: 12px;
  line-height: 1.6; padding: 9px 11px; border: 1px solid #e2e9f4; border-radius: 9px;
  background: #fbfcfe; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
.tms-sync-form textarea:focus { border-color: #9dc4f0; background: #fff; }
.tms-sync-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tms-sync-hint { font-size: 11px; color: #93a3b8; line-height: 1.7; }
.tms-cargo { display: inline-flex; flex-direction: column; gap: 2px; }
.tms-cargo .badge { align-self: flex-start; }
.tms-timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.tms-tl-row { position: relative; padding-left: 16px; border-left: 2px solid #e7eef8; }
.tms-tl-row:last-child { border-left-color: transparent; }
.tms-tl-row::before { content: ""; position: absolute; left: -6px; top: 3px; width: 9px;
  height: 9px; border-radius: 50%; background: #1a6fe0; box-shadow: 0 0 0 3px #eaf2fd; }
.tms-tl-main { font-size: 12.5px; color: #16283f; font-weight: 600; }
.tms-tl-sub { font-size: 11px; color: #93a3b8; margin-top: 2px; }
.tms-waybill { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: #f7fafd; border: 1px solid #eef3fa; border-radius: 10px; padding: 10px 12px; }
.tms-waybill .no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: #16283f; font-weight: 600; }

.shipdoc-upload { display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;
  border-top:1px solid #eef2f8;background:#fff }
.shipdoc-label { font-size:12px;color:#5a6b82;font-weight:600;white-space:nowrap }
.shipdoc-file { flex:1;min-width:140px;font-size:12px }

/* 制单页：一个运单 + 按货号的订单明细（参照 TMS 订单页） */
.waybill-bar { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px;
  padding:9px 12px;border-radius:11px;background:linear-gradient(92deg,#eef5ff,#f6fbff);
  border:1px solid #dbe8fb }
.waybill-bar-no { font-size:11.5px;color:#5a6b82;font-weight:600 }
.waybill-bar b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:13.5px;color:#16283f;letter-spacing:.2px }
.waybill-bar-sub { font-size:11.5px;color:#8494a8;margin-left:auto }
.waybill-total { font-size:12px;color:#3d5470;font-weight:600;padding:8px 12px;
  background:#f7fafd;border:1px solid #eef2f8;border-top:none;
  border-radius:0 0 12px 12px }

.doc-pick-list { display: flex; flex-direction: column; gap: 8px; }
.doc-pick { display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid #e2eaf5; border-radius: 10px; background: #fbfdff; cursor: pointer; }
.doc-pick:hover { border-color: #8eb7ed; background: #f3f8ff; }
.doc-pick input { accent-color: #1a6fe0; flex: none; }
.doc-pick-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.doc-pick-main b { color: #16283f; font-size: 13px; overflow-wrap: anywhere; }
.doc-pick-main em { color: #8a9bb0; font-size: 11px; font-style: normal; }

/* 统一使用浏览器原生滚动条，避免固定滑条与页面滚动条重叠出现“两个滑拉按钮” */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .03); }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .55); }
::-webkit-scrollbar-corner { background: transparent; }
.view--flex::-webkit-scrollbar { width: 0; height: 0; }
