:root {
  --primary: #2563eb;
  --bg: #f5f7fa;
  --side-bg: #1e293b;
  --side-text: #cbd5e1;
  --danger: #dc2626;
  --ok: #15803d;
}
[v-cloak] { display: none; }
* { box-sizing: border-box; }

/* 主窗口永不出现滚动条：内容区自行滚动（M11 反馈） */
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
.auth-wrap { height: 100vh; overflow-y: auto; }

/* ---- 登录 / 初始化 ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  padding: 16px;
}
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-card h2 { margin: 8px 0 4px; text-align: center; color: #1e293b; }
.auth-tip { text-align: center; color: #94a3b8; margin: 0 0 20px; font-size: 13px; }
.auth-logo { text-align: center; font-size: 40px; }
.auth-logo-img { max-width: 72px; max-height: 72px; object-fit: contain; }
.home-logo { max-height: 46px; max-width: 160px; object-fit: contain; }
.nowrap-line { white-space: nowrap; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-preview { max-height: 64px; max-width: 180px; object-fit: contain; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px; }
.logo-empty { color: #94a3b8; font-size: 13px; }

/* ---- 布局 ---- */
.layout { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }
.sidebar {
  width: 220px;
  height: 100%;
  background: var(--side-bg);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand { padding: 20px 16px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-flex; flex-shrink: 0; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: rgba(255,255,255,.9); }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 手风琴分组（M10：默认全收起，展开一项自动收起其他项） */
.nav-group.acc { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 5px; position: relative; }
.nav-group.acc:hover { color: #cbd5e1; }
.ng-arrow { display: inline-block; font-style: normal; font-size: 10px; transition: transform .15s; width: 10px; }
.ng-arrow.open { transform: rotate(90deg); }
.ng-dot { position: absolute; right: 16px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: #dc2626; }
.sidebar nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-group { padding: 12px 20px 6px; font-size: 14px; font-weight: 600; color: #f1f5f9; letter-spacing: 1px; }
.nav-item {
  padding: 11px 20px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  gap: 10px;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.me-line { font-size: 13px; color: #94a3b8; margin-bottom: 8px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; min-height: 0; }
.topbar {
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title { font-weight: 600; color: #1e293b; }
.topbar-user { color: #64748b; font-size: 13px; }

/* 全局搜索 */
.gs-box { position: relative; margin-left: auto; }
.gs-input {
  width: 300px; height: 32px; padding: 0 44px 0 12px;
  border: 1px solid #e2e8f0; border-radius: 16px; outline: none;
  background: #f8fafc; font-size: 13px; color: #1e293b;
}
.gs-input:focus { border-color: #94a3b8; background: #fff; }
.gs-input::placeholder { color: #94a3b8; }
.gs-spin { position: absolute; right: 34px; top: 8px; color: #94a3b8; font-size: 14px; }
.gs-close {
  position: absolute; right: 12px; top: 8px; width: 16px; height: 16px;
  color: #94a3b8; font-size: 12px; line-height: 16px; text-align: center;
  cursor: pointer; user-select: none;
}
.gs-close:hover { color: #475569; }
.gs-drop {
  position: absolute; right: 0; top: 38px; width: 360px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 6px 0; z-index: 60;
}
.gs-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.gs-glabel {
  padding: 6px 14px 2px; font-size: 12px; color: #94a3b8; font-weight: 600;
}
.gs-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; cursor: pointer;
}
.gs-item:hover { background: #f1f5f9; }
.gs-it-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1e293b; font-size: 13px; }
.gs-it-sub { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; font-size: 12px; }
.gs-it-meta { flex: none; color: #64748b; font-size: 12px; }
.burger { display: none; border: none; background: none; font-size: 20px; cursor: pointer; color: #475569; }
.content { padding: 20px; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.content::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 填满式页面：头部功能区固定，仅下方数据列表滚动 */
.content.page-fill { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.content.page-fill > .table-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.content.page-fill > .table-wrap > .el-table { height: 100%; }
.content.page-fill > .el-pagination { flex: none; margin-top: 12px; }
/* 双表并排（库存汇总 + 明细）：各自独立滚动 */
.content.page-fill .fill-cols { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; }
.content.page-fill .fill-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.content.page-fill .fill-col > .table-wrap { flex: 1 1 auto; min-height: 0; }
.content.page-fill .fill-col > .table-wrap > .el-table { height: 100%; }

/* ---- 通用小组件 ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary); word-break: break-all; }
.stat-num.danger { color: var(--danger); }
.stat-label { color: #94a3b8; font-size: 12px; margin-top: 4px; }

.toolbar { margin-bottom: 12px; }
.toolbar.wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: #94a3b8; font-size: 13px; }
.strong { font-weight: 500; color: #1e293b; }
.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.neg { color: var(--danger); font-weight: 600; }
.danger { color: var(--danger); font-weight: 600; }
.in { color: var(--ok); }
.out { color: #c2410c; }

.summary-line { color: #475569; font-size: 13px; margin-bottom: 10px; }
.summary-line b { color: #1e293b; }
.tag-warn { display: inline-block; background: #fef3c7; color: #b45309; border-radius: 4px; padding: 1px 7px; font-size: 12px; }
.tag-plain { display: inline-block; background: #f1f5f9; color: #475569; border-radius: 4px; padding: 2px 8px; font-size: 12px; margin-right: 6px; }

.panel-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 14px; }
.panel { border-radius: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.money-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.money-item { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.money-item b { font-size: 17px; color: #1e293b; }
.money-item b.in { color: var(--ok); }
.money-item b.out { color: #c2410c; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.mini-list li:last-child { border-bottom: none; }
.mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span2 { grid-column: span 2; }
.sub-title { margin: 16px 0 8px; font-size: 14px; color: #334155; }

/* ---- 单据编辑 ---- */
.bill-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bill-items { width: 100%; }
.bill-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.bill-foot .total { font-size: 20px; color: var(--primary); }
.drawer-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- 消息（M3）---- */
.nav-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  line-height: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  text-align: center;
}
.chat-content { padding: 0; display: flex; height: 100%; flex: 1 1 auto; overflow: hidden; }
.chat-side { width: 290px; flex-shrink: 0; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; min-height: 0; transition: width .18s; }
.chat-side.folded { width: 52px; }
.chat-side.folded .chat-side-head > .el-input,
.chat-side.folded .chat-conn,
.chat-side.folded .ci-body,
.chat-side.folded .chat-item-close,
.chat-side.folded .chat-side-foot { display: none; }
.chat-side.folded .chat-item { padding: 10px 7px; }
.chat-side.folded .chat-side-head { flex-direction: column; padding: 8px 6px; align-items: stretch; }
.chat-item-close {
  display: none; position: absolute; right: 10px; top: 10px; width: 18px; height: 18px;
  line-height: 16px; text-align: center; color: #cbd5e1; font-size: 12px;
  border-radius: 4px; background: #f1f5f9; text-decoration: none;
}
.chat-item:hover .chat-item-close { display: block; }
.chat-item:hover .online-dot { display: none; }
.chat-item-close:hover { color: #dc2626; background: #fee2e2; }
.pos-tag {
  display: inline-block; background: #eff6ff; color: #1d4ed8; border-radius: 3px;
  font-size: 10px; line-height: 14px; padding: 0 4px; margin-right: 4px; vertical-align: middle;
}
.chat-side-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid #f1f5f9; }
.chat-conn { font-size: 12px; color: #b45309; background: #fffbeb; padding: 6px 12px; display: flex; align-items: center; gap: 6px; }
.chat-conn.on { color: #15803d; background: #f0fdf4; }
.chat-conn i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.chat-list { flex: 1; overflow-y: auto; min-height: 0; }
.chat-item { display: flex; gap: 10px; padding: 10px 12px; cursor: pointer; position: relative; align-items: center; }
.chat-item:hover { background: #f8fafc; }
.chat-item.active { background: #eff6ff; }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: #dbeafe; color: #1d4ed8; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.avatar.group { background: #ede9fe; color: #6d28d9; }
.ci-body { flex: 1; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; gap: 6px; }
.ci-name { font-size: 14px; color: #1e293b; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.ci-bottom { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.ci-preview { font-size: 12px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ci-badge { background: #dc2626; color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; line-height: 16px; min-width: 16px; text-align: center; }
.online-dot { position: absolute; right: 12px; bottom: 12px; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.online-dot.small { position: static; display: inline-block; margin-right: 4px; vertical-align: middle; width: 6px; height: 6px; }
.online-dot.off { background: #cbd5e1; }
.chat-side-foot { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #f1f5f9; color: #94a3b8; font-size: 12px; }
.chat-main { flex: 1; display: flex; flex-direction: column; background: #f8fafc; min-width: 0; min-height: 0; }
.chat-placeholder { margin: auto; text-align: center; color: #94a3b8; }
.chat-placeholder .ph-icon { font-size: 44px; }
.chat-head { height: 52px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 10px; padding: 0 14px; flex-shrink: 0; }
.chat-back { display: none; border: none; background: none; font-size: 22px; line-height: 1; color: #475569; cursor: pointer; }
.ch-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ch-info b { font-size: 14px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-info .muted { font-size: 11px; }
.ch-typing { font-size: 12px; color: #2563eb; }
.ch-actions { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.chat-search { padding: 8px 12px; background: #fff; border-bottom: 1px solid #f1f5f9; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; min-height: 0; }
.chat-day { text-align: center; color: #94a3b8; font-size: 11px; margin: 12px 0 6px; }
.chat-time { text-align: center; color: #cbd5e1; font-size: 11px; margin: 6px 0; }
.msg-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
.msg-row.mine { flex-direction: row-reverse; }
.bubble-wrap { max-width: min(70%, 560px); display: flex; flex-direction: column; gap: 3px; }
.msg-row.mine .bubble-wrap { align-items: flex-end; }
.bubble-from { font-size: 11px; color: #94a3b8; margin-left: 2px; }
.bubble { background: #fff; border: 1px solid #e8eef6; border-radius: 10px; padding: 8px 11px; font-size: 14px; color: #1e293b; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.msg-row.mine .bubble { background: #2563eb; color: #fff; border-color: #2563eb; }
.bubble.revoked { background: #f1f5f9; color: #94a3b8; border-style: dashed; }
.bubble-img { padding: 3px; background: #fff; border-color: #e2e8f0; }
.msg-img { max-width: 240px; max-height: 220px; border-radius: 7px; display: block; cursor: zoom-in; object-fit: cover; }
.bubble-foot { display: flex; gap: 10px; font-size: 11px; color: #cbd5e1; align-items: center; flex-wrap: wrap; }
.bubble-foot a { color: #94a3b8; cursor: pointer; text-decoration: none; }
.bubble-foot a:hover { color: #2563eb; }
.bubble-foot .danger { color: #dc2626; }
.file-card { display: flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; min-width: 180px; }
.file-ic { font-size: 22px; }
.file-meta { display: flex; flex-direction: column; font-size: 12px; line-height: 1.4; }
.file-meta b { font-weight: 500; word-break: break-all; }
.file-meta small { opacity: .65; }
.card-msg p { margin: 4px 0; font-size: 12px; opacity: .8; }
/* 输入面板固定在主窗口底部，不随消息滚动 */
.chat-composer { flex: none; background: #fff; border-top: 1px solid #e2e8f0; padding: 8px 12px 10px; }
.composer-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.upload-btn { cursor: pointer; padding: 3px 6px; user-select: none; display: inline-flex; align-items: center; color: #475569; border-radius: 4px; }
.upload-btn:hover { background: #f1f5f9; color: #2563eb; }
.chat-upload { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: #fff; border-top: 1px solid #f1f5f9; font-size: 12px; color: #475569; }
.up-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-empty-sm { color: #94a3b8; font-size: 13px; padding: 16px 12px; }
.chat-empty-sm.center { text-align: center; padding: 36px 0; }
.group-members { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }

/* ---- 移动端（方案 14.1：断点 768px）---- */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .burger { display: block; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 21px; }
  .content { padding: 12px; }
  .auth-card { padding: 28px 22px; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .toolbar.wrap > .el-input, .toolbar.wrap > .el-select, .toolbar.wrap > .el-date-editor { width: 100% !important; }
  .el-drawer { width: 100% !important; }
  .el-dialog { width: 92% !important; }
  .el-message-box { width: 90% !important; }
  .chat-content { height: calc(100vh - 52px); }
  .chat-side { width: 100%; border-right: none; }
  .chat-main { background: #f8fafc; }
  .hideMobile { display: none !important; }
  .chat-back { display: block; }
  .bubble-wrap { max-width: 82%; }
  .msg-img { max-width: 200px; max-height: 180px; }
  .gs-box { flex: 1; min-width: 0; margin-left: 0; }
  .gs-input { width: 100%; padding-right: 30px; }
  .gs-drop { width: 100vw; right: auto; left: 50%; transform: translateX(-50%); }
  .topbar { gap: 8px; padding: 0 12px; }
}

/* ---- 合同/销货单（M4）---- */
.upper-line { margin: 10px 0 0; color: #1e293b; font-size: 13px; }
.upper-line b { color: #b45309; margin-left: 6px; }

/* ================= M5 发货看板 / 送货单打印 / 发货台账 ================= */

/* 送货单打印预览：全屏遮罩 + A4 纸面 */
#print-area {
  position: fixed; inset: 0; z-index: 2200;
  background: rgba(15, 23, 42, .55);
  overflow: auto; padding: 20px 12px 40px;
}
#print-area .print-toolbar {
  max-width: 210mm; margin: 0 auto 10px;
  display: flex; align-items: center; gap: 10px;
}
#print-area .print-tip { color: #e2e8f0; font-size: 13px; flex: 1; }
.delivery-sheet {
  width: 210mm; min-height: 285mm; margin: 0 auto;
  background: #fff; color: #111;
  padding: 14mm 14mm 12mm; box-sizing: border-box;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12.5px; line-height: 1.5;
}
.d-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 8px; }
.d-company { display: flex; align-items: center; gap: 8px; }
.d-name { font-size: 20px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.d-sub { color: #444; font-size: 11.5px; margin-top: 3px; }
.d-title { text-align: right; }
.d-title h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: 6px; font-weight: 700; }
.d-barcode svg { display: inline-block; height: 34px; width: auto; }
.d-barcode-no { font-size: 12px; font-family: monospace; letter-spacing: 1px; margin-top: 3px; line-height: 1.2; }
.d-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0; font-size: 12px; }
.d-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.d-table th, .d-table td { border: 1px solid #333; padding: 5px 6px; font-size: 12px; }
.d-table th { background: #f1f5f9; font-weight: 600; text-align: center; }
.d-table td.c, .d-table td.r { text-align: center; }
.d-table td.r { text-align: right; }
.d-table tr.d-pad td { height: 22px; border-bottom-color: #999; }
.d-total { display: flex; justify-content: flex-end; gap: 26px; padding: 10px 2px 0; font-size: 13px; }
.d-total b { font-size: 15px; }
.d-upper { margin: 8px 2px 0; font-size: 13px; }
.d-upper b { color: #b45309; margin-left: 6px; }
.d-sign { display: flex; justify-content: space-between; margin-top: 8mm; padding: 0 4mm; font-size: 12.5px; }
.d-footer { margin-top: 10mm; text-align: center; color: #555; font-size: 11px; }
.d-logo img { max-height: 40px; max-width: 120px; object-fit: contain; margin-bottom: 0; }
.d-notice { margin-top: 6mm; font-size: 11.5px; color: #333; border-top: 1px dashed #999; padding-top: 4px; }
.d-remark { margin-top: 3mm; font-size: 12px; color: #333; }
.d-remark .ct-input-inline { max-width: 78%; }

/* ---- 合同打印（M10）---- */
#contract-print-area {
  position: fixed; inset: 0; z-index: 2250;
  background: rgba(15, 23, 42, .55);
  overflow: auto; padding: 20px 12px 40px;
}
#contract-print-area .print-toolbar {
  max-width: 210mm; margin: 0 auto 10px;
  display: flex; align-items: center; gap: 10px;
}
#contract-print-area .print-tip { color: #e2e8f0; font-size: 13px; flex: 1; }
.contract-sheet {
  width: 210mm; min-height: 285mm; margin: 0 auto;
  background: #fff; color: #111;
  padding: 14mm 14mm 12mm; box-sizing: border-box;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12.5px; line-height: 1.55;
}
.ct-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #111; padding-bottom: 8px; }
.ct-logo-name { display: flex; align-items: center; gap: 8px; }
.ct-logo { max-height: 44px; max-width: 130px; object-fit: contain; }
.ct-company { font-size: 16px; }
.ct-title { margin: 0; font-size: 22px; letter-spacing: 4px; font-weight: 700; }
.ct-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 0; font-size: 12px; }
.ct-table { width: 100%; border-collapse: collapse; }
.ct-table th, .ct-table td { border: 1px solid #333; padding: 5px 6px; font-size: 12px; }
.ct-table th { background: #f1f5f9; font-weight: 600; text-align: center; }
.ct-table td.c, .ct-table td.r { text-align: center; }
.ct-table td.r { text-align: right; }
.d-table td.nw, .ct-table td.nw { text-align: center; white-space: nowrap; }
.ct-table tr.d-pad td { height: 22px; border-bottom-color: #999; }
.ct-total { display: flex; gap: 24px; justify-content: flex-end; align-items: baseline; padding: 8px 2px 0; font-size: 13px; }
.ct-notes { margin-top: 8px; font-size: 12px; }
.ct-notes-text { margin: 4px 0 0; white-space: pre-wrap; font-family: inherit; font-size: 11.5px; color: #222; }
.ct-parties { display: flex; gap: 10mm; margin-top: 10mm; }
.ct-party { flex: 1; border: 1px solid #333; border-radius: 4px; padding: 8px 10px; }
.ct-party h4 { margin: 0 0 6px; font-size: 13px; text-align: center; border-bottom: 1px solid #999; padding-bottom: 4px; }
.ct-field { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11.5px; }
.ct-field label { width: 74px; flex-shrink: 0; color: #333; }
.ct-input { flex: 1; min-width: 0; border: none; border-bottom: 1px solid #ccc; font-size: 11.5px; padding: 2px 3px; font-family: inherit; background: transparent; }
.ct-input:focus { outline: none; border-bottom-color: #2563eb; }
.ct-sign { display: flex; justify-content: space-between; margin-top: 14mm; padding: 0 4mm; font-size: 12.5px; }
@media (max-width: 768px) {
  .ct-parties { flex-direction: column; gap: 8px; }
}

/* 打印输出：只输出送货单/合同纸面 */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body.printing * { visibility: hidden !important; }
  body.printing #print-area, body.printing #print-area *,
  body.printing #contract-print-area, body.printing #contract-print-area * { visibility: visible !important; }
  body.printing #print-area, body.printing #contract-print-area {
    position: absolute; inset: 0 auto auto 0; width: 210mm;
    background: #fff; padding: 0; overflow: visible;
  }
  body.printing .no-print { display: none !important; }
  body.printing .delivery-sheet, body.printing .contract-sheet { margin: 0; box-shadow: none; width: 210mm; min-height: auto; }
}

/* 768px 以下：送货单预览横向滚动，打印工具条收紧 */
@media (max-width: 768px) {
  .delivery-sheet { transform-origin: top left; }
}

/* ================= M6 模板打印浮层 ================= */
#tpl-print-area {
  position: fixed; inset: 0; z-index: 2300;
  background: rgba(15, 23, 42, .6);
  display: flex; flex-direction: column;
}
#tpl-print-area .tpl-toolbar { max-width: none; margin: 0; padding: 8px 14px; background: rgba(15,23,42,.85); }
#tpl-print-area .tpl-cal-label { color: #cbd5e1; font-size: 12px; margin-left: 6px; }
.tpl-frame-wrap { flex: 1; overflow: auto; padding: 10px; }
#tpl-print-frame { width: 100%; height: 100%; border: none; background: transparent; }

/* ---- M7 文档库 ---- */
.doc-layout { display: flex; gap: 14px; align-items: flex-start; }
.doc-side {
  width: 220px; flex: 0 0 220px; background: #fff; border-radius: 10px; padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); max-height: 72vh; overflow: auto;
}
.doc-main { flex: 1; min-width: 0; background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.doc-cat-item { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #334155; }
.doc-cat-item:hover { background: #f1f5f9; }
.doc-cat-item.active { background: #e0edff; color: #1d4ed8; font-weight: 500; }
.doc-cat-node { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 13px; }
.doc-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-cat-count { font-size: 11px; }
.doc-cat-ops { display: none; gap: 6px; }
.doc-cat-node:hover .doc-cat-ops { display: inline-flex; }
.doc-cat-ops .link { font-size: 12px; }
.doc-preview-box { background: #f8fafc; border-radius: 8px; overflow: auto; }
.doc-preview-box.center { display: flex; align-items: center; justify-content: center; padding: 12px; }
.doc-preview-text {
  margin: 0; max-height: 70vh; overflow: auto; background: #0f172a; color: #e2e8f0;
  padding: 14px; border-radius: 8px; font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.ver-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f1f5f9; }

/* ---- M7 考勤 ---- */
.att-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.att-date { font-size: 20px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.att-hero-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stat-label { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 600; color: #1e293b; }
@media (max-width: 768px) {
  .doc-layout { flex-direction: column; }
  .doc-side { width: 100%; flex: none; max-height: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .att-hero { padding: 12px; }
  .att-date { font-size: 17px; }
}

/* ---- M8 双节点容灾：连接状态 ---- */
.conn-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3000;
  display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  font-size: 13px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.conn-bar.conn-warn { background: #d97706; }
.conn-bar.conn-bad { background: #dc2626; }
.conn-dot { font-size: 11px; }
.conn-label { font-weight: 600; white-space: nowrap; }
.conn-msg { flex: 1; min-width: 0; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 12px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}
.conn-chip.conn-warn { background: #fffbeb; color: #b45309; border-color: #fcd34d; }
.conn-chip.conn-bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.auth-conn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; margin: -4px 0 12px; padding: 6px 10px; border-radius: 8px;
  background: #f1f5f9; color: #475569;
}
.auth-conn.conn-warn { background: #fffbeb; color: #b45309; }
.auth-conn.conn-bad { background: #fef2f2; color: #b91c1c; }
.auth-conn a { color: inherit; text-decoration: underline; font-size: 12px; }
.srv-row { display: flex; gap: 8px; width: 100%; }
.srv-ret { font-size: 12px; margin-top: 4px; color: #64748b; }
.srv-ret.srv-ok { color: #047857; }
.srv-ret.srv-bad { color: #b91c1c; }
.srv-cur { font-size: 12px; color: #475569; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; }
@media (max-width: 768px) {
  .conn-bar { font-size: 12px; padding: 6px 10px; gap: 6px; flex-wrap: wrap; }
  .conn-msg { flex: 1 0 100%; order: 3; white-space: normal; }
  .conn-chip { display: none; }
}

.body-shift { padding-top: 36px; }
.layout.body-shift { height: calc(100vh - 36px); }

/* ---- M8 备份与迁移 ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head h3 { margin: 0 0 4px; font-size: 16px; color: #1e293b; }
.page-sub { margin: 0; font-size: 12px; color: #64748b; }
.page-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.bk-policy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.bk-policy-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; min-width: 0; }
.bk-k { display: block; font-size: 12px; color: #64748b; margin-bottom: 3px; }
.bk-v { font-size: 13px; color: #1e293b; word-break: break-all; }
.bk-name { font-size: 12px; color: #334155; word-break: break-all; }
.bk-note { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.bk-stats { font-size: 12px; color: #475569; }
.mig-wrap { display: flex; gap: 14px; align-items: flex-start; }
.mig-left { flex: 1; min-width: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; }
.mig-right { width: 300px; flex: 0 0 300px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; }
.mig-row { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; flex-wrap: wrap; }
.mig-cur { font-size: 13px; color: #334155; }
.mig-steps { margin: 0 0 12px; padding-left: 20px; font-size: 12px; color: #475569; line-height: 1.7; }
.mig-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mig-file { font-size: 12px; color: #1e293b; font-weight: 500; word-break: break-all; }
.mig-sum { font-size: 12px; color: #475569; line-height: 1.7; margin: 8px 0; }
.mig-issues { margin: 6px 0 10px; padding-left: 18px; font-size: 12px; line-height: 1.6; }
.mig-issues .bad { color: #b91c1c; }
.mig-issues .warn { color: #b45309; }
.mig-force { margin: 8px 0 12px; }
.mig-result { margin-top: 14px; }
.mig-tip-title { font-size: 12px; color: #64748b; margin: 6px 0 4px; }
.mig-tip { font-size: 12px; color: #64748b; line-height: 1.6; margin-top: 10px; }
.mig-code {
  margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 6px; padding: 9px 10px;
  font-size: 11px; line-height: 1.6; overflow-x: auto; white-space: pre;
}
.muted { color: #94a3b8; font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 900px) {
  .mig-wrap { flex-direction: column; }
  .mig-right { width: 100%; flex: none; }
  .bk-policy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-direction: column; }
}
.restore-box { margin: 12px 0; font-size: 13px; color: #334155; line-height: 1.8; background: #f8fafc; border-radius: 8px; padding: 10px 12px; }
.restore-confirm { margin-top: 12px; }
.bk-sub { display: block; font-size: 11px; color: #94a3b8; margin-top: 3px; }
.sync-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; }
.sync-row { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; flex-wrap: wrap; }
.sync-mode { font-size: 13px; color: #1e293b; font-weight: 500; }
.sync-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sync-item { background: #f8fafc; border-radius: 8px; padding: 10px 12px; min-width: 0; }
.sync-v { font-size: 13px; color: #334155; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sync-note { font-size: 11px; color: #94a3b8; margin-top: 4px; word-break: break-all; }
@media (max-width: 768px) { .sync-grid { grid-template-columns: 1fr; } }

/* M10 反馈：操作列等功能区按钮不换行，单行排开（列宽已同步加宽保证容纳） */
.op-col .cell { white-space: nowrap; overflow: visible; }
.el-table .cell .el-button { white-space: nowrap; flex: none; }

/* M10 反馈：产品资料列表名称/规格列限宽（约 20 个汉字），超出省略号截断，悬停看全文 */
.pname, .pspec { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* M11：填满式页面的卡片分栏（库存查询：汇总/明细各自滚动） */
.content.page-fill .fill-rows { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.content.page-fill .fill-card { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; margin: 0 !important; }
.content.page-fill .fill-card > .el-card__header { flex: none; padding: 10px 14px; }
.content.page-fill .fill-card > .el-card__body { flex: 1 1 auto; min-height: 0; padding: 10px 14px; overflow: hidden; }
.content.page-fill .fill-card > .el-card__body > .el-table { height: 100%; }
.content.page-fill .fill-card > .el-card__body > .el-empty { height: 100%; }
.msg-input { flex: none; }

/* M11：打印预览模式（隐藏编辑痕迹、纸张居中投影） */
.delivery-sheet.previewing, .contract-sheet.previewing { box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.ct-meta-edit { display: inline-flex; align-items: center; gap: 2px; }
.ct-input-inline { min-width: 160px; max-width: 260px; font-size: 12px; }
.ct-notes-input {
  display: block; width: 100%; margin-top: 4px; border: 1px dashed #cbd5e1; border-radius: 4px;
  padding: 4px 6px; font-family: inherit; font-size: 11.5px; color: #222; line-height: 1.6;
  background: transparent; resize: vertical;
}
.ct-notes-input:focus { outline: none; border-color: #2563eb; }
@media print {
  .ct-notes-input { border: none; padding: 0; resize: none; }
  .ct-input-inline { border-bottom: none; }
}

/* M11 反馈：打印工具栏提示单独一行；勾选项一行；编号输入框一行加宽 */
.print-toolbar { flex-wrap: wrap; }
.print-toolbar-col { flex-direction: column; align-items: stretch; gap: 8px; }
.print-toolbar-col .print-tip { flex: none; }
.print-toolbar-col .pt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.print-toolbar-col .pt-label { color: #cbd5e1; font-size: 13px; flex: none; }

/* ---- 常用网址导航 + 待办提醒（M11）---- */
.web-dot { font-style: normal; }
.todo-card .el-calendar { --el-calendar-cell-width: 52px; }
.todo-card .el-calendar-table .el-calendar-day { height: 52px; padding: 4px; }
.todo-card .el-calendar__header { padding: 8px 12px; }
.todo-cell { width: 100%; height: 100%; position: relative; text-align: center; padding-top: 4px; }
.todo-cell.has-todo { font-weight: 700; color: var(--el-color-primary); }
.todo-dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #e6a23c; }
.todo-add { display: flex; gap: 8px; margin-bottom: 10px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed var(--el-border-color-lighter); font-size: 13.5px; }
.todo-list li:last-child { border-bottom: none; }
.todo-list li.done .todo-content { text-decoration: line-through; color: var(--el-text-color-placeholder); }
.todo-list .todo-content { flex: 1; }

/* ---- 网址导航独立页（M11）---- */
.web-manage-list { display: flex; flex-direction: column; }
.web-row { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px dashed var(--el-border-color-lighter); font-size: 14px; }
.web-row:last-child { border-bottom: none; }
.web-row-link { display: inline-flex; align-items: center; gap: 8px; color: var(--el-text-color-primary); text-decoration: none; min-width: 220px; }
.web-row-link:hover { color: var(--el-color-primary); }
.web-row-link b { font-weight: 600; }
.web-row-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.web-row-ops { flex-shrink: 0; }

/* ---- 主窗口无滚动条：页面内部自适应（M11 反馈）---- */
.web-manage-list { max-height: calc(100vh - 200px); overflow-y: auto; scrollbar-width: thin; }
.todo-list { max-height: 40vh; overflow-y: auto; scrollbar-width: thin; }
.todo-card .el-calendar-table .el-calendar-day { height: 48px; padding: 3px; }

/* ---- 送货单赠品列输入（M11）---- */
.d-table input[type="number"]::-webkit-outer-spin-button,
.d-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.d-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ---- M11q：窗口显示效果统一优化 ---- */
.el-dialog {
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .08);
  overflow: hidden;
}
.el-dialog__header { padding: 14px 20px; margin-right: 0; border-bottom: 1px solid #eef2f7; background: #fafbfd; }
.el-dialog__title { font-size: 15px; font-weight: 600; color: #1e293b; }
.el-dialog__body { padding: 16px 20px; }
.el-dialog__footer { padding: 12px 20px 16px; border-top: 1px solid #f1f5f9; }
.el-table th.el-table__cell { background: #f8fafc; color: #475569; font-weight: 600; }
.el-table .el-table__cell { padding: 7px 0; }
.el-descriptions__label { color: #64748b; }
.el-drawer__header { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eef2f7; color: #1e293b; font-weight: 600; }
.toolbar.wrap .el-input__wrapper { background: #fff; }
.file-card { padding: 6px 8px; border-radius: 8px; transition: background .15s; }
.file-card:hover { background: #f1f5f9; }
.bubble { box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.doc-cat-item { border-radius: 6px; }
.link { cursor: pointer; }
.el-tabs__item { font-size: 14px; }
.el-message-box { border-radius: 10px; }
