:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --sidebar: #16233a;
  --sidebar-2: #1c2c48;
  --text: #1b2432;
  --muted: #6b7a90;
  --border: #e6ebf2;
  --danger: #dc2626;
  --success: #059669;
  --warn: #d97706;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- 登录页 ---------------- */
#login-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #21365a 0%, #13203a 45%, #0b1526 100%);
  overflow: hidden;
  z-index: 10;
}

#login-view::before,
#login-view::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

#login-view::before {
  width: 520px; height: 520px;
  left: -120px; bottom: -180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 68%);
}

#login-view::after {
  width: 420px; height: 420px;
  right: -90px; top: -140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25), transparent 70%);
}

.login-shell {
  position: relative;
  z-index: 2;
  display: flex;
  width: 900px;
  max-width: 94vw;
  min-height: 520px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(6, 14, 28, 0.55);
}

.login-intro {
  flex: 1.1;
  padding: 48px 44px;
  color: #e8eefc;
  background: linear-gradient(160deg, #1b2c4c 0%, #16233a 60%, #101b2e 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  letter-spacing: 1px;
  color: #9fb3d1;
}

.login-brand .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  color: #fff;
  font-weight: 700;
}

.login-intro h1 {
  font-size: 32px;
  line-height: 1.35;
  margin: 28px 0 14px;
  font-weight: 600;
  color: #fff;
}

.login-intro p {
  color: #93a7c4;
  line-height: 1.9;
  font-size: 13.5px;
  margin: 0;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
  font-size: 13px;
  color: #a8bcd8;
}

.login-features span { display: flex; align-items: center; gap: 9px; }
.login-features .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }

.login-form-wrap {
  flex: 0.9;
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.login-form-wrap h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
}

.login-form-wrap .hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  outline: none;
  background: #fbfcfe;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #93b4f8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}

.btn-primary:hover { box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }

.login-foot {
  margin-top: 18px;
  font-size: 12px;
  color: #9aa8bc;
  text-align: center;
  line-height: 1.8;
}

/* ---------------- 主体布局 ---------------- */
#main-view {
  display: none;
  height: 100%;
}

.layout {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 216px;
  flex: none;
  background: linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: #dbe5f5;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  padding: 18px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar .brand .mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}

.sidebar .brand .name { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.sidebar .brand .sub { font-size: 11px; color: #7c90ae; margin-top: 2px; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  color: #b8c7de;
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 3px;
  transition: background .16s, color .16s;
  user-select: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.75));
  color: #fff;
  box-shadow: 0 6px 16px rgba(13, 42, 100, 0.4);
}
.nav-item .ico { width: 17px; opacity: .85; display: grid; place-items: center; }
.nav-item .label { flex: 1; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  animation: badgePulse 1.6s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.sidebar .foot {
  padding: 14px 18px 18px;
  font-size: 11.5px;
  color: #63799a;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 62px;
  flex: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar .page-title { font-size: 17px; font-weight: 600; }
.topbar .page-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.user-box {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.user-box:hover { background: #f3f6fc; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; font-weight: 600; font-size: 14px;
}

.user-box .who { line-height: 1.35; }
.user-box .who b { font-size: 13.5px; font-weight: 600; display: block; }
.user-box .who span { font-size: 11.5px; color: var(--muted); }

.content { flex: 1; overflow: auto; padding: 22px 24px 34px; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(17, 34, 68, 0.04);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .desc { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all .16s;
  font-size: 13px;
  white-space: nowrap;
}
.btn:hover { border-color: #c3d4f0; color: var(--primary); background: #f8fbff; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3d0d0; }
.btn.danger:hover { background: #fff4f4; border-color: #e8b0b0; color: #b91c1c; }
.btn.ghost { border-color: transparent; background: transparent; padding: 6px 8px; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.copy-mini { padding: 1px 8px; font-size: 11.5px; border-radius: 6px; line-height: 1.6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.toolbar .grow { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid #dbe3ee; border-radius: 9px;
  background: #fbfcfe; padding: 7px 12px; min-width: 230px;
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: #93b4f8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); background: #fff; }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; }

.select {
  padding: 8px 10px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fbfcfe;
  outline: none; color: #334155; min-width: 120px;
}
.select:focus { border-color: #93b4f8; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12.5px; color: #64748b; font-weight: 600;
  padding: 12px 16px; background: #f8fafd; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid #f1f4f9; font-size: 13.5px; white-space: nowrap; }
tbody tr:hover { background: #fafcff; }
tbody tr:last-child td { border-bottom: 0; }
/* 客户表里短字段只按内容占宽，地址超长省略 */
th.c-fit, td.c-fit { width: 1%; }
th.c-addr { width: 250px; }
td.c-addr { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
/* 1开客户表：以「客户名字」宽度为基准定列宽，避免日期等列被拉开 */
.cust-main { table-layout: fixed; }
.cust-main th.c-date, .cust-main td.c-date { width: 104px; }
.cust-main th.c-open, .cust-main td.c-open { width: 96px; }
.cust-main th.c-own, .cust-main td.c-own { width: 104px; }
.cust-main th.c-name, .cust-main td.c-name { width: 104px; }
.cust-main th.c-phone, .cust-main td.c-phone { width: 118px; }
.cust-main th.c-addr, .cust-main td.c-addr { width: 210px; max-width: none; }
.cust-main th.c-money, .cust-main td.c-money { width: 90px; }
.cust-main th.c-remark, .cust-main td.c-remark { width: 64px; }
/* 2次复购客户表：以「客户电话」宽度为基准定列宽 */
.rep-main { table-layout: fixed; }
.rep-main th.c-own, .rep-main td.c-own { width: 96px; }
.rep-main th.c-date, .rep-main td.c-date { width: 150px; }
.rep-main th.c-seq, .rep-main td.c-seq { width: 88px; }
.rep-main th.c-name, .rep-main td.c-name { width: 104px; }
.rep-main th.c-phone, .rep-main td.c-phone { width: 118px; }
.rep-main th.c-addr, .rep-main td.c-addr { width: 200px; max-width: none; }
.rep-main th.c-prod, .rep-main td.c-prod { width: 100px; }
.rep-main th.c-money, .rep-main td.c-money { width: 90px; }
.rep-main th.c-ship, .rep-main td.c-ship { width: 100px; }
.rep-main th.c-remark, .rep-main td.c-remark { width: 120px; }
.rep-main th.c-hist, .rep-main td.c-hist { width: 84px; }
.rep-main th.c-op, .rep-main td.c-op { width: 170px; }
.empty { padding: 44px; text-align: center; color: #9aa8bc; font-size: 13px; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; line-height: 1.7; background: #f1f5f9; color: #475569;
}
.tag.green { background: #e8f7f0; color: #0f766e; }
.tag.red { background: #fdeeee; color: #b91c1c; }
.tag.blue { background: #eaf1ff; color: #1d4ed8; }
.tag.amber { background: #fff5e6; color: #b45309; }
.tag.gray { background: #f1f5f9; color: #64748b; }

.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--border);
}
.pager .btn { padding: 5px 10px; }

/* ---------------- 工作台 ---------------- */
.welcome {
  background: linear-gradient(120deg, #1e3a67 0%, #2563eb 62%, #3b82f6 100%);
  border-radius: 14px;
  padding: 26px 28px;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  box-shadow: 0 14px 34px rgba(29, 78, 216, .25);
  margin-bottom: 18px;
}
.welcome h2 { margin: 0 0 8px; font-size: 21px; font-weight: 600; }
.welcome p { margin: 0; color: rgba(255, 255, 255, .82); font-size: 13px; line-height: 1.8; }
.welcome .badge {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  padding: 8px 14px; border-radius: 9px; font-size: 12.5px; white-space: nowrap;
}

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 1px 2px rgba(17, 34, 68, .04);
}
.stat .ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); flex: none;
}
.stat .num { font-size: 24px; font-weight: 650; line-height: 1.2; }
.stat .lab { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.two-col { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }

.bars { padding: 16px 18px 20px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; font-size: 13px; }
.bar-row .nm { width: 96px; flex: none; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; background: #f0f4fa; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 6px; }
.bar-row .val { width: 42px; text-align: right; color: var(--muted); }

/* ---------------- 组织架构 ---------------- */
.org-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; }
@media (max-width: 1000px) { .org-layout { grid-template-columns: 1fr; } }

.tree { padding: 10px 8px 16px; }
.tree-node {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
  transition: background .14s;
}
.tree-node:hover { background: #f6f9ff; }
.tree-node.selected { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tree-node .caret {
  width: 14px; font-size: 10px; color: #94a3b8; display: grid; place-items: center; flex: none;
}
.tree-node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node .cnt { font-size: 11.5px; color: #94a3b8; }
.tree-node .acts { display: none; gap: 2px; }
.tree-node:hover .acts { display: flex; }
.tree-node .mini {
  border: 0; background: transparent; cursor: pointer; padding: 2px 4px;
  border-radius: 5px; color: #64748b; font-size: 12px;
}
.tree-node .mini:hover { background: #e8f0fe; color: var(--primary); }
.tree-node .mini.del:hover { background: #fdeeee; color: var(--danger); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 18px; }
.detail-grid .k { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.detail-grid .v { font-size: 14px; font-weight: 500; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .48);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(2px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.dialog { 
  background: #fff; border-radius: 14px; width: 560px; max-width: 94vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .32);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }

.dialog.wide { width: min(1200px, 96vw); }
.dialog-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  font-size: 15.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
.dialog-head .x { cursor: pointer; color: #94a3b8; font-size: 18px; line-height: 1; padding: 4px; }
.dialog-head .x:hover { color: #334155; }
.dialog-body { padding: 20px 22px; overflow-y: auto; overflow-x: auto; }
.dialog-body table { min-width: 100%; }
.dialog-foot {
  padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* 授权树 */
.perm-list { display: flex; flex-direction: column; gap: 10px; }
.perm-module {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff;
}
.perm-module .top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: #f8fafd; border-bottom: 1px solid var(--border);
}
.perm-module .top .nm { font-size: 13.5px; font-weight: 600; flex: 1; }
.perm-module .acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.check {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #475569;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  background: #fff; user-select: none;
}
.check:hover { border-color: #c3d4f0; }
.check.on { background: var(--primary-soft); border-color: #bcd3fb; color: var(--primary-dark); }
.check input { accent-color: var(--primary); margin: 0; }
.perm-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.7; }

/* toast */
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 90; align-items: center;
}
.toast-item {
  padding: 10px 18px; border-radius: 9px; font-size: 13px; color: #fff;
  background: rgba(30, 41, 59, .92); box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
  animation: slide .2s ease;
}
.toast-item.err { background: rgba(185, 28, 28, .94); }
.toast-item.ok { background: rgba(4, 120, 87, .94); }
@keyframes slide { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

.loading {
  position: fixed; inset: 0; background: rgba(255, 255, 255, .55);
  display: none; align-items: center; justify-content: center; z-index: 70;
}
.spinner {
  width: 34px; height: 34px; border: 3px solid #dbe7ff; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

@media (max-width: 760px) {
  .login-shell { flex-direction: column; min-height: auto; }
  .login-intro { display: none; }
  .login-form-wrap { padding: 34px 24px; }
  .sidebar { width: 62px; }
  .sidebar .brand .name, .sidebar .brand .sub, .nav-item span.label, .sidebar .foot { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .content { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------------- 工作台双面板 ---------------- */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 2px 0 18px; }
.dash-head h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.dash-head p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.dash-date { font-size: 12.5px; color: #64748b; background: #fff; border: 1px solid var(--border); padding: 7px 12px; border-radius: 9px; white-space: nowrap; }

.panel { cursor: pointer; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.panel:hover { box-shadow: 0 12px 30px rgba(23, 43, 77, .10); transform: translateY(-2px); border-color: #cfdcf5; }
.panel:active { transform: translateY(0); }
.open-hint { font-size: 12px; color: var(--primary); display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px 12px; margin: 4px 0 2px;
  background: #f8fafd; border: 1px solid var(--border); border-radius: 10px;
}
.filter-bar .fl { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.filter-bar input[type="date"] {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; color: #334155; background: #fff; font-family: inherit;
}
.filter-bar input[type="text"] {
  flex: 1; min-width: 190px; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; color: #334155; background: #fff; font-family: inherit;
}
.filter-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.filter-bar .flt-count { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.filter-bar .flt-status { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.auto-box { background: #f8fafd; border: 1px dashed #c7d5f2; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.auto-box .auto-head { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.auto-box .auto-head b { color: var(--primary); }
.auto-box .auto-paste { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; font-family: inherit; resize: vertical; background: #fff; }
.auto-box .auto-paste:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.auto-box .auto-acts { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.auto-box .auto-tip { font-size: 11.5px; color: #94a3b8; }

.panel-stats { display: flex; gap: 10px; padding: 18px 18px 4px; flex-wrap: wrap; }
.panel-stats > div { min-width: 70px; }
.panel-stats .lab { white-space: nowrap; }
.panel-stats > div { flex: 1; background: #f8fafd; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.panel-stats .num { font-size: 20px; font-weight: 650; line-height: 1.2; }
.panel-stats .lab { font-size: 12px; color: var(--muted); margin-top: 2px; }



/* 登录页「上次登录」快捷进入 */
.quick-entry{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #d7e6ff;background:#f6faff;border-radius:10px;margin-bottom:14px}
.quick-entry .qe-who{font-size:13px;color:#64748b}
.quick-entry .qe-who b{color:#0f172a;font-weight:600}
.quick-entry .btn{white-space:nowrap}

/* ---------------- 流量工作台（手机优先） ---------------- */
.traffic-page .card { margin-bottom: 12px; }
.traffic-form { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; padding:2px 18px 16px; }
.traffic-form .tf-field { display:flex; flex-direction:column; gap:5px; min-width:0; }
.traffic-form label { font-size:12.5px; color:#64748b; }
.traffic-form input { width:100%; box-sizing:border-box; }
.traffic-form .tf-date, .traffic-form .tf-remark { grid-column:span 2; }
.traffic-form .tf-actions { display:flex; align-items:flex-end; justify-content:flex-end; }
.traffic-form .tf-actions .btn { height:40px; padding:0 18px; }
.traffic-form .tf-auto-val { height:40px; display:flex; align-items:center; padding:0 12px; border:1px dashed #cbd5e1; border-radius:9px; background:#f8fafd; color:#64748b; font-weight:650; }
.traffic-more { margin-top:4px; }
.traffic-more > summary { cursor:pointer; font-size:13.5px; color:#2563eb; background:#fff; border:1px solid var(--border); border-radius:10px; padding:11px 14px; list-style:none; }
.traffic-more > summary::-webkit-details-marker { display:none; }
.traffic-more > summary::after { content:"▾"; float:right; color:#94a3b8; }
.traffic-more[open] > summary { margin-bottom:12px; }
@media (max-width: 900px) {
  .traffic-form { grid-template-columns:1fr 1fr; padding:2px 14px 14px; }
  .traffic-form .tf-date, .traffic-form .tf-remark { grid-column:1 / -1; }
  .traffic-form .tf-actions { grid-column:1 / -1; justify-content:stretch; }
  .traffic-form .tf-actions .btn { width:100%; }
}
@media (max-width: 760px) {
  .traffic-page .card-head .desc { display:none; }
  .traffic-page .m-hide { display:none; }
  .traffic-page .card-head { padding:14px 14px 8px; }
  .traffic-page .panel-stats > div { flex:1 1 42%; }
}
.traffic-form .tf-auto-tip { font-size:12px; color:#64748b; line-height:1.4; }
.traffic-form .tf-auto-tip b { color:#dc2626; font-weight:700; }
.traffic-page .traffic-op { white-space:nowrap; }

/* 工作台系统入口 */
.sys-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin:0 0 16px; }
.sys-card { display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px 16px; cursor:pointer; transition:box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.sys-card:hover { box-shadow:0 10px 24px rgba(23,43,77,.10); transform:translateY(-2px); border-color:#cfdcf5; }
.sys-card.off { cursor:default; opacity:.62; }
.sys-card.off:hover { box-shadow:none; transform:none; border-color:var(--border); }
.sys-ico { width:38px; height:38px; flex:none; border-radius:10px; background:#eef5ff; color:#2563eb; display:flex; align-items:center; justify-content:center; }
.sys-main { flex:1; min-width:0; }
.sys-name { font-size:15px; font-weight:650; color:#0f172a; margin-bottom:2px; }
.sys-desc { font-size:12px; color:#64748b; line-height:1.5; }
.sys-go { flex:none; font-size:12.5px; color:#2563eb; white-space:nowrap; }
@media (max-width: 900px) { .sys-grid { grid-template-columns:1fr; gap:8px; } .sys-card { padding:12px 14px; } }

/* 独立系统模块 */
.dropship-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:0 18px 12px; }
.dropship-bar .seg { display:flex; gap:8px; flex-wrap:wrap; }
.dropship-search { display:flex; gap:8px; align-items:center; }
.dropship-search input { width:230px; max-width:52vw; }
.table-wrap { width:100%; }
@media (max-width: 900px) {
  .dropship-search { width:100%; }
  .dropship-search input { width:100%; max-width:none; }
  .dropship-search .btn { flex:none; }
}
/* 新独立系统页面 */
.sys-page .dropship-bar { padding-top:0; }
@media (max-width: 900px) { .sys-page .m-hide { display:none; } }

/* 代发系统：从产品系统多选产品 */
.drop-pick-box { border:1px solid #e2e8f0; border-radius:10px; padding:10px; background:#f8fafc; }
.drop-pick-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; color:#475569; font-size:13px; }
.drop-item-list { display:flex; flex-direction:column; gap:8px; margin-top:9px; }
.drop-item-empty { color:#94a3b8; font-size:12.5px; padding:8px 2px 2px; }
.drop-item { display:flex; align-items:center; gap:9px; padding:9px 10px; border:1px solid #e2e8f0; border-radius:9px; background:#fff; min-width:0; }
.drop-item-main { flex:1; min-width:0; }
.drop-item-main b { display:block; color:#0f172a; font-size:13.5px; font-weight:600; line-height:1.4; word-break:break-word; }
.drop-item-spec { color:#64748b; font-size:12px; line-height:1.45; margin-top:2px; word-break:break-word; }
.drop-item-price { color:#2563eb; font-size:12px; line-height:1.45; margin-top:3px; }
.drop-item-price span { color:#0f172a; margin-left:6px; }
.drop-item-qty { flex:none; display:flex; align-items:center; gap:5px; color:#64748b; font-size:12px; white-space:nowrap; }
.drop-item-qty input { width:62px; padding:5px 7px; font-size:13px; }
.drop-item > .btn { flex:none; }
.drop-cell-item { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 6px; padding:2px 0; }
.drop-cell-item b { font-weight:600; color:#0f172a; word-break:break-word; }
.drop-cell-spec { color:#64748b; font-size:12px; word-break:break-word; }
.drop-cell-qty { color:#64748b; font-size:12px; white-space:nowrap; }
.drop-ship-btn { display:block; margin-top:6px; padding:4px 9px; font-size:12px; font-weight:600; color:#0f766e; border-color:#b9e6d7; background:#f0fdf7; white-space:nowrap; }
.drop-ship-btn:hover { color:#0b5f58; border-color:#8fd4bf; background:#e6fbf2; }
.drop-ship-line { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:6px; }
.drop-return-reason { margin-top:5px; color:#b91c1c; font-size:11.5px; line-height:1.5; word-break:break-word; }
.drop-confirm { display:flex; flex-direction:column; gap:14px; }
.drop-confirm-tip { padding:11px 14px; border:1px solid #fed7aa; border-radius:10px; background:#fff7ed; color:#9a3412; font-size:15px; font-weight:700; line-height:1.7; }
.drop-confirm-grid { border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; background:#fff; }
.drop-confirm-row { display:grid; grid-template-columns:96px minmax(0,1fr); gap:10px; padding:9px 12px; border-bottom:1px solid #f1f5f9; }
.drop-confirm-row:last-child { border-bottom:0; }
.drop-confirm-label { color:#64748b; font-size:12.5px; line-height:1.6; }
.drop-confirm-value { color:#0f172a; font-size:13px; line-height:1.6; word-break:break-word; }
.drop-confirm-value b { font-weight:600; }
.drop-confirm-spec { color:#64748b; font-size:12px; margin-left:5px; }
.drop-confirm-qty { color:#0f766e; font-size:12px; }
.drop-confirm-warn { color:#b45309; background:#fffbeb; border:1px solid #fde68a; border-radius:9px; padding:9px 12px; font-size:12.5px; line-height:1.65; }
.drop-confirm-actions { display:flex; justify-content:flex-end; gap:9px; }
@media (max-width: 520px) {
  .drop-confirm-row { grid-template-columns:76px minmax(0,1fr); }
  .drop-confirm-actions .btn { flex:1; justify-content:center; }
}
.drop-picker { display:flex; flex-direction:column; gap:9px; min-height:0; }
.drop-picker-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.drop-picker-top input { flex:1; min-width:160px; }
.drop-picker-top span { flex:none; color:#64748b; font-size:12.5px; }
.drop-picker-list { max-height:52vh; overflow-y:auto; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
.drop-pick-row { display:flex; align-items:flex-start; gap:9px; padding:10px 11px; border-bottom:1px solid #f1f5f9; cursor:pointer; }
.drop-pick-row:last-child { border-bottom:0; }
.drop-pick-row input { margin-top:2px; flex:none; }
.drop-pick-main { flex:1; min-width:0; }
.drop-pick-main b { display:block; color:#0f172a; font-size:13px; font-weight:600; line-height:1.4; word-break:break-word; }
.drop-pick-main small { display:block; color:#64748b; font-size:11.5px; line-height:1.4; margin-top:2px; word-break:break-word; }
.drop-pick-price { flex:none; color:#2563eb; font-size:12.5px; white-space:nowrap; }
.drop-pick-price small { color:#94a3b8; font-size:11px; }
@media (max-width: 900px) {
  .drop-item { align-items:flex-start; flex-wrap:wrap; }
  .drop-item-main { flex:1 1 100%; }
  .drop-item-qty { margin-left:auto; }
  .drop-picker-top input { flex:1 1 100%; width:100%; }
}

