:root {
  --brand: #16456e;
  --brand-2: #1f5d8f;
  --accent: #e07b34;
  --bg: #f4f6f9;
  --line: #e3e8ef;
  --txt: #1f2d3d;
  --txt-2: #5a6b7d;
  --el-color-primary: #1f5d8f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

#app { height: 100%; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  height: 100%;
  display: flex;
  background: linear-gradient(135deg, #0f3355 0%, #16456e 45%, #1f5d8f 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::after {
  content: "";
  position: absolute;
  right: -180px;
  top: -160px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.login-wrap::before {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(224, 123, 52, .12);
}
.login-left {
  flex: 1;
  color: #fff;
  padding: 0 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}
.login-left h1 { font-size: 34px; margin: 0 0 14px; letter-spacing: 1px; font-weight: 600; }
.login-left p { font-size: 15px; line-height: 2; color: rgba(255,255,255,.82); margin: 0; max-width: 460px; }
.login-tags { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; }
.login-tags span {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 20px;
  font-size: 12.5px;
  color: rgba(255,255,255,.9);
}
.login-right {
  width: 420px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: -10px 0 40px rgba(0,0,0,.12);
}
.login-card { width: 320px; }
.login-card h2 { margin: 0 0 6px; font-size: 21px; color: var(--brand); }
.login-card .sub { color: var(--txt-2); font-size: 13px; margin-bottom: 26px; }
.login-card .el-input { margin-bottom: 16px; }
.login-card .el-button { width: 100%; height: 42px; font-size: 15px; letter-spacing: 2px; }
.login-foot { margin-top: 26px; color: #9aa8b8; font-size: 12px; line-height: 1.8; }
/* 登录卡片底部的技术支持 / 微信 */
.login-contact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8ef;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: #7b8a9b;
  font-size: 12.5px;
  line-height: 1.7;
}
.login-contact a, .login-contact em { color: var(--brand); font-style: normal; text-decoration: none; }
.login-contact a:hover { text-decoration: underline; }

/* ---------------- 主框架 ---------------- */
.layout { height: 100%; display: flex; }
.side {
  width: 216px;
  flex: 0 0 216px;
  background: linear-gradient(180deg, #123a5d 0%, #16456e 60%, #123a5d 100%);
  color: #cfe0ee;
  display: flex;
  flex-direction: column;
  transition: width .18s ease, flex-basis .18s ease;
  overflow: hidden;
}
.side.collapsed { width: 64px; flex-basis: 64px; }
.logo {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex: 0 0 58px;
}
.logo .mark {
  width: 28px; height: 28px; border-radius: 7px; flex: 0 0 28px;
  background: linear-gradient(135deg, #e07b34, #f0a35e);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.logo .txt { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; }
.side.collapsed .logo .txt { display: none; }

.menu-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 20px; }
.menu-scroll::-webkit-scrollbar { width: 5px; }
.menu-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }

.mgroup {
  color: #a9c7df; font-size: 14px; font-weight: 700; letter-spacing: .8px;
  padding: 15px 9px 7px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  border-radius: 7px; border-top: 1px solid rgba(255, 255, 255, .10);
  transition: color .15s, background .15s;
}
/* 第一组上方不画分隔线，避免和 logo 的分隔重复 */
.menu-scroll > .mgroup:first-child { border-top: none; padding-top: 8px; }
.mgroup:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.mgroup .caret { font-size: 11px; transition: transform .18s; opacity: .8; }
.mgroup.open .caret { transform: rotate(90deg); }
.mgroup .mcount {
  margin-left: auto; font-size: 10.5px; font-weight: 400; color: #8fb0c9;
  background: rgba(255, 255, 255, .08); border-radius: 9px; padding: 0 7px; line-height: 16px;
}
.side.collapsed .mgroup .caret,
.side.collapsed .mgroup .mcount { display: none; }
.side.collapsed .mgroup { cursor: default; pointer-events: none; }
/* 折叠时分组标题变成一条分隔线，既不占宽也不会被裁成半个字 */
.side.collapsed .mgroup {
  font-size: 0; line-height: 0; height: 1px; padding: 0; margin: 12px 14px;
  border-top: none; background: rgba(255, 255, 255, .14); border-radius: 1px; overflow: hidden;
}

.mitem {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  height: 34px;
  padding: 0 12px 0 24px;          /* 比分组标题缩进，体现「挂在下面」的层级 */
  margin: 1px 0;
  border-radius: 8px;
  color: #b7cde0;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12.5px;               /* 比分组标题小一号 */
  letter-spacing: .2px;
  transition: background .15s, color .15s;
}
/* 子项前的小圆点，和分组标题的加粗大字形成明显区分 */
.mitem::before {
  content: ""; position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  transition: background .15s, box-shadow .15s;
}
.mitem:hover { background: rgba(255,255,255,.08); color: #fff; }
.mitem:hover::before { background: #f0a35e; }
.mitem.active { background: linear-gradient(90deg, rgba(224,123,52,.95), rgba(224,123,52,.72)); color: #fff; font-weight: 600; }
.mitem.active::before { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.mitem .el-icon { font-size: 14px; flex: 0 0 15px; }
/* 没有分组的顶级菜单（如工作台）：不缩进、不带圆点、字号略大 */
.mitem.top { padding: 0 12px; height: 36px; font-size: 13.5px; }
.mitem.top::before { display: none; }
.side.collapsed .mitem { justify-content: center; padding: 0; }
.side.collapsed .mitem::before { display: none; }
.side.collapsed .mitem span.label { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px;
  flex: 0 0 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 14px;
}
.topbar .crumb { color: var(--txt-2); font-size: 13px; }
.topbar .crumb b { color: var(--txt); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .act { display: flex; align-items: center; gap: 8px; }

.content { flex: 1; overflow: auto; padding: 18px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16, 40, 66, .04);
}
.card + .card { margin-top: 14px; }

.pg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pg-head h2 { margin: 0; font-size: 19px; color: var(--brand); font-weight: 600; }
.pg-head .sub { color: var(--txt-2); font-size: 12.5px; }
.pg-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -26px; top: -26px;
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(31, 93, 143, .06);
}
.stat .k { color: var(--txt-2); font-size: 12.5px; }
.stat .v { font-size: 25px; font-weight: 600; color: var(--brand); margin-top: 6px; }
.stat .u { font-size: 12px; color: #9aa8b8; margin-left: 4px; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.quick .q {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.quick .q:hover { border-color: var(--brand-2); box-shadow: 0 3px 12px rgba(22,69,110,.1); transform: translateY(-1px); }
.quick .q .t { font-weight: 600; color: var(--brand); font-size: 14px; }
.quick .q .d { color: var(--txt-2); font-size: 12px; margin-top: 5px; line-height: 1.6; }

.el-table th.el-table__cell { background: #f7f9fc !important; color: #33475b; font-weight: 600; }
.el-table { border-radius: 8px; }
.el-table .cell { line-height: 1.5; }
.pager { display: flex; justify-content: flex-end; margin-top: 12px; }

.locked-tag { color: #c07a2c; font-size: 11px; margin-left: 4px; }

/* ---------------- 多页签 ---------------- */
.tabbar {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 7px 16px 0;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
}
.tabbar::-webkit-scrollbar { height: 4px; }
.tabbar::-webkit-scrollbar-thumb { background: #cfdae6; border-radius: 4px; }
.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  max-width: 220px;
  height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #eef3f9;
  color: var(--txt-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}
.tab-item:hover { background: #e4edf7; color: var(--brand-2); }
.tab-item.on {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--brand);
}
.tab-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-x {
  border: 0;
  background: none;
  cursor: pointer;
  color: #9aa9b8;
  font-size: 15px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 4px;
}
.tab-x:hover { background: #dbe4ee; color: #c0392b; }
.tab-tools { margin-left: auto; padding-bottom: 6px; }
.tab-more { cursor: pointer; color: #7d8fa3; padding: 0 8px; font-size: 16px; line-height: 1; }
.tab-pane { min-height: 100%; }
.tab-pane > * { min-width: 0; }

/* ---------------- 首页 ---------------- */
.home { display: flex; flex-direction: column; gap: 14px; }
.home-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(120deg, #123a5d, #1f5d8f 55%, #2f7fb8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(18, 58, 93, .18);
}
.hero-hi { font-size: 20px; font-weight: 600; letter-spacing: .5px; }
.hero-sub { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .8); display: flex; gap: 8px; flex-wrap: wrap; }
.hero-dot { opacity: .55; }
.hero-tools { margin-left: auto; }
.hero-tools .el-button {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}
.hero-tools .el-button:hover { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .45); color: #fff; }

.kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.kpi[title]:not([title=""]) { cursor: pointer; }
.kpi:hover { box-shadow: 0 4px 14px rgba(22, 69, 110, .1); transform: translateY(-1px); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-2); opacity: .75; }
.kpi-blue::after { background: #1f5d8f; }
.kpi-teal::after { background: #2f9e8f; }
.kpi-indigo::after { background: #5566c9; }
.kpi-orange::after { background: #e07b34; }
.kpi-rose::after { background: #d9536f; }
.kpi-amber::after { background: #d8a132; }
.kpi-label { color: var(--txt-2); font-size: 12.5px; }
.kpi-value { font-size: 22px; font-weight: 600; color: var(--brand); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-foot { color: #9aa8b8; font-size: 11.5px; margin-top: 4px; }

.home-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--brand); font-size: 13.5px; }
.card-head b { font-size: 13.5px; }
.card-head .lg { color: var(--txt-2); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.card-head .hint { color: #9aa8b8; font-size: 12px; }
.card-head .more { color: var(--brand-2); font-size: 12.5px; text-decoration: none; }
.card-head .grow { flex: 1; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg-sale { background: #1f5d8f; }
.lg-pur { background: #e07b34; }

.chart-wrap { width: 100%; }
.chart { width: 100%; height: 230px; display: block; }
.chart .grid line { stroke: #eef2f7; stroke-width: 1; }
.chart .grid text { fill: #9aa8b8; font-size: 10.5px; }
.chart .xtick { fill: #8a99aa; font-size: 11px; }
.chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-sale { stroke: #1f5d8f; }
.chart .ln-pur { stroke: #e07b34; stroke-dasharray: 5 3; }
.chart .pt { stroke: #fff; stroke-width: 1.5; }
.chart .pt-sale { fill: #1f5d8f; }
.chart .pt-pur { fill: #e07b34; }

.warn-list { display: flex; flex-direction: column; gap: 6px; }
.warn-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; background: #fbfcfe; border: 1px solid #eef2f7; }
.warn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.warn-main b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-code { color: #9aa8b8; font-size: 11px; }
.warn-num { text-align: right; font-size: 12px; color: var(--txt-2); }
.warn-num b { color: #d9536f; font-size: 15px; margin-right: 2px; }
.warn-num em { display: block; font-style: normal; color: #9aa8b8; font-size: 11px; }

.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed #eef2f7; cursor: pointer; font-size: 12.5px; }
.mini-item:last-child { border-bottom: 0; }
.mini-item:hover { background: #f7fafd; }
.mini-no { color: var(--brand); font-family: Consolas, monospace; font-size: 12px; }
.mini-party { flex: 1; color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-amt { font-variant-numeric: tabular-nums; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.quick-item { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; cursor: pointer; background: #fff; transition: all .15s; }
.quick-item:hover { border-color: var(--brand-2); box-shadow: 0 3px 12px rgba(22, 69, 110, .1); transform: translateY(-1px); }
.quick-t { font-weight: 600; color: var(--brand); font-size: 13.5px; }
.quick-d { color: var(--txt-2); font-size: 12px; margin-top: 4px; }

.empty-mini { color: #9aa8b8; font-size: 12.5px; padding: 18px 0; text-align: center; }

/* ---------------- 数据初始化 ---------------- */
.init-tip { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.init-tip b { color: var(--brand); font-size: 13px; }
.init-tip ul { margin: 8px 0 0; padding-left: 20px; color: var(--txt-2); font-size: 12.5px; line-height: 1.9; }
.init-toolbar { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; }
.init-sum { color: var(--txt-2); font-size: 12.5px; }
.init-toolbar .grow, .init-run .grow { flex: 1; }
.init-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.init-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; transition: all .15s; }
.init-item:hover { border-color: #c9d8e6; }
.init-item.on { border-color: #e07b34; background: #fff9f4; box-shadow: inset 0 0 0 2px rgba(224, 123, 52, .1); }
.init-body { flex: 1; min-width: 0; }
.init-title { display: flex; align-items: center; gap: 8px; }
.init-title b { font-size: 13.5px; }
.init-count { margin-left: auto; color: #9aa8b8; font-size: 11.5px; }
.init-desc { color: var(--txt-2); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.init-req { color: #c07a2c; font-size: 11.5px; margin-top: 5px; }
.init-run { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.init-confirm { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt-2); }
.init-result { margin-top: 14px; }
.init-result-grid { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; margin-top: 6px; }
.init-result-grid b { color: #c0392b; }

@media (max-width: 1500px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
  .home-row { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- 弹窗 / 抽屉嵌入内容区 ----------------
   1) 遮罩只覆盖右侧内容区（--frame-left / --frame-top 由 app.js 实时测量），
      不压住左侧菜单、顶栏、页签条；
   2) 遮罩不拦鼠标（pointer-events:none），只做一层淡淡的压暗，
      弹窗开着也能点菜单 / 页签 / 后面的页面，切回来弹窗和已填内容还在；
      确认框（el-message-box）例外，仍然必须回答；
   3) 遮罩里的滚动层原本是 fixed 全屏，透明但会盖住页签条，一并收进内容区。*/
body > .el-overlay,
.content .el-overlay,
.layout > .el-overlay {
  position: fixed;  /* 页面里「直接子元素都 relative」这类样式别把弹窗拽回内容流 */
  top: var(--frame-top, 58px);
  left: var(--frame-left, 216px);
  height: auto;   /* 让 bottom:0 重新生效，否则遮罩按 100% 高度溢出屏幕下沿 */
}
body > .el-overlay .el-overlay-dialog,
.content .el-overlay .el-overlay-dialog,
.layout > .el-overlay .el-overlay-dialog {
  position: absolute;
  inset: 0;
}
body > .el-overlay:not(.is-message-box),
.content .el-overlay:not(.is-message-box),
.layout > .el-overlay:not(.is-message-box) {
  background: rgba(23, 43, 63, .10);
  pointer-events: none;
}
/* 弹窗、抽屉本体照常可点（父级 none 后子级要显式打开） */
.el-overlay .el-dialog,
.el-overlay .el-drawer { pointer-events: auto; }
/* 宽弹窗（1100px+）别顶破内容区左右边界 */
.el-overlay .el-dialog { max-width: calc(100% - 48px); }
/* 抽屉相对遮罩定位，高度跟着内容区，不再从屏幕底沿冒出去 */
body > .el-overlay .el-drawer,
.content .el-overlay .el-drawer,
.layout > .el-overlay .el-drawer { position: absolute; }

/* 收起来不做淡出动画：点空白关掉后立刻再点数字，弹窗不会卡在「关到一半」出不来 */
.el-overlay.dialog-fade-leave-active,
.el-overlay.dialog-fade-leave-active .el-overlay-dialog { animation-duration: 0s !important; }

body.el-popup-parent--hidden { padding-right: 0 !important; }

/* 打印模板页：左侧单据类型 */
.tpl-group { color: var(--txt-2); font-size: 11.5px; padding: 4px 8px 6px; letter-spacing: .5px; }
.tpl-item { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border-radius: 7px; color: #33475b; cursor: pointer; font-size: 13px; white-space: nowrap; }
.tpl-item:hover { background: #f2f6fa; }
.tpl-item.active { background: #eaf3fb; color: #1f5d8f; font-weight: 600; }
.tpl-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tpl-tip { padding: 10px 8px; color: var(--txt-2); font-size: 12px; line-height: 1.7;
  border-top: 1px solid var(--line); margin-top: 6px; }

/* 打印 */
@media print {
  .side, .topbar, .tabbar, .no-print { display: none !important; }
  .content { padding: 0; overflow: visible; }
  .card { border: none; box-shadow: none; }
}

/* ---------------- AI 需求助手 ---------------- */
/* 悬浮入口：可拖动（位置按登录人存本地），可收起为小图标 */
/* 圆圈在页面最上层（含加载遮罩之上），但助手面板打开时自动让开，免得盖住面板底部的按钮 */
/* 层级压到抽屉/对话框（2000+）之下：弹窗打开时被遮罩盖住，不再挡住「保存」按钮 */
.ai-fab-wrap { position: fixed; right: 22px; bottom: 26px; z-index: 1100;
  user-select: none; -webkit-user-select: none; touch-action: none;
  transition: opacity .18s ease, transform .18s ease; }
.ai-fab-wrap.is-open { opacity: 0; transform: scale(.9); pointer-events: none; }
.ai-fab-wrap.dragging { cursor: grabbing; }
.ai-fab { position: relative; display: block; width: 54px; height: 54px; border: none; border-radius: 50%;
  background: linear-gradient(135deg, #1f5d8f, #2f86c9); color: #fff; font-size: 15px;
  font-weight: 700; letter-spacing: .5px; cursor: grab; touch-action: none;
  box-shadow: 0 8px 22px rgba(31, 93, 143, .35);
  transition: transform .15s ease, box-shadow .15s ease, width .15s ease, height .15s ease; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 93, 143, .45); }
.ai-fab-wrap.dragging .ai-fab { transform: none; cursor: grabbing;
  box-shadow: 0 14px 30px rgba(31, 93, 143, .5); }
.ai-fab-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: #48d597; box-shadow: 0 0 0 2px #fff; }
/* 收起后的小图标 */
.ai-fab-mini { width: 38px; height: 38px; font-size: 12px; letter-spacing: 0; opacity: .92; }
.ai-fab-mini:hover { opacity: 1; }
.ai-fab-mini .ai-fab-dot { top: 5px; right: 6px; width: 7px; height: 7px; }
/* 收起按钮：悬停圆圈时出现在右上角 */
.ai-fab-collapse { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0;
  border: 1px solid #cfe0ee; border-radius: 50%; background: #fff; color: #5b7c96; font-size: 13px;
  line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 93, 143, .18); opacity: 0; transition: opacity .15s ease; }
.ai-fab-wrap:hover .ai-fab-collapse { opacity: 1; }
.ai-drawer .el-drawer__body { padding: 0; }
.ai-panel { display: flex; flex-direction: column; height: 100%; background: #fff; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--line); }
.ai-head b { color: #16456e; font-size: 15px; }
.ai-sub { color: var(--txt-2); font-size: 12px; margin-left: 6px; }
.ai-warn { margin: 10px 14px 0; padding: 8px 10px; border-radius: 6px; background: #fff8e8;
  color: #a06a00; font-size: 12.5px; line-height: 1.7; border: 1px solid #ffe2a8; }
.ai-box { flex: 1; overflow-y: auto; padding: 14px; background: #f6f9fc; }
.ai-empty { text-align: center; padding: 46px 18px; }
.ai-empty-t { color: #16456e; font-weight: 600; margin-bottom: 8px; }
.ai-empty-s { color: var(--txt-2); font-size: 12.5px; line-height: 1.9; text-align: left; }
.ai-msg { display: flex; margin-bottom: 12px; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble { max-width: 86%; padding: 9px 12px; border-radius: 10px; font-size: 13px;
  line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.ai-msg.assistant .ai-bubble { background: #fff; border: 1px solid var(--line); color: #23425c; }
.ai-msg.user .ai-bubble { background: #1f5d8f; color: #fff; }
.ai-typing { display: flex; gap: 4px; align-items: center; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9fb6c9; display: inline-block;
  animation: ai-blink 1.1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .18s; }
.ai-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
/* 两个入口：提需求 / 问怎么用 */
.ai-choose { padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-choose-item { display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 14px; border: 1px solid #dbe7f2; border-radius: 10px; background: #fff; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.ai-choose-item:hover { border-color: #7fb2d8; box-shadow: 0 6px 18px rgba(31, 93, 143, .12);
  transform: translateY(-1px); }
.ai-choose-tag { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #1f5d8f, #2f86c9); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.ai-choose-tag.help { background: linear-gradient(135deg, #2e7d5b, #48b487); }
.ai-choose-tag.dev { background: linear-gradient(135deg, #6b4df0, #9b7bff); }
/* 直接改软件：进度、改动卡片 */
.ai-warn.dev { background: #f4f0ff; color: #5a44a8; border-color: #ddd2ff; }
.ai-tool { display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 10px; border-radius: 12px; background: #eef3f8; color: #4a6b85;
  font-size: 12px; line-height: 1.6; word-break: break-all; }
.ai-tool.running { background: #e8f1fb; color: #1f5d8f; margin-bottom: 8px; }
.ai-tool.bad { background: #fdeeee; color: #c0392b; }
.ai-tool-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ai-patch { margin: 0 14px 10px; padding: 10px 12px; border: 1px solid #d8e6f3;
  border-radius: 10px; background: #f8fcff; }
.ai-patch-t { color: #16456e; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.ai-patch-files { display: flex; flex-direction: column; gap: 2px; max-height: 120px; overflow-y: auto; }
.ai-patch-f { color: #3d6f96; font-size: 12px; word-break: break-all; }
.ai-patch-flag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px;
  background: #e6f6ec; color: #1f7a45; font-size: 12px; font-weight: 600; }
.ai-patch-flag.warn { background: #fff3e0; color: #b26a00; }
.ai-patch-sum { color: #5c7590; font-size: 12px; line-height: 1.7; margin-bottom: 6px; }
.ai-patch-d { font-style: normal; color: #8aa0b6; margin-left: 6px; font-size: 11px; }
/* 结尾结论条：跟工具行区分开，一眼能看出「这轮改完的结论」 */
.ai-summary { margin: 2px 0 8px; padding: 8px 12px; border-left: 3px solid #2f80ed;
  border-radius: 0 8px 8px 0; background: #f2f8ff; color: #1c4d78; font-size: 12.5px;
  line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.ai-patch-act { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ai-tool-meta { color: #7a90a8; font-size: 11px; margin-left: 2px; white-space: nowrap; }
.ai-tool-stop { margin-left: auto; }
/* 改造日志弹窗 */
.ai-log-tip { color: #6b7f92; font-size: 12px; line-height: 1.7; margin-bottom: 8px; }
.ai-log-body { display: flex; gap: 10px; height: 56vh; min-height: 320px; }
.ai-log-list { width: 220px; flex: 0 0 auto; overflow-y: auto; border: 1px solid #e4edf5;
  border-radius: 8px; background: #fbfdff; }
.ai-log-item { padding: 7px 10px; border-bottom: 1px solid #eef4f9; cursor: pointer; }
.ai-log-item:hover { background: #f1f7fd; }
.ai-log-item.on { background: #e8f3fd; box-shadow: inset 3px 0 0 #2f80ed; }
.ai-log-item.bad b { color: #c0392b; }
.ai-log-item b { display: block; font-size: 12px; color: #24405c; font-weight: 600; }
.ai-log-item em { font-style: normal; font-size: 11px; color: #7b8fa3; }
.ai-log-view { flex: 1; margin: 0; padding: 10px 12px; overflow: auto; background: #10202f;
  color: #cfe3f3; border-radius: 8px; font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; font-family: Consolas, Menlo, monospace; }
.ai-choose-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ai-choose-body b { color: #16456e; font-size: 14.5px; }
.ai-choose-body em { font-style: normal; color: var(--txt-2); font-size: 12.5px; line-height: 1.7; }
.ai-choose-tip { padding: 0 16px 16px; color: #9aa8b8; font-size: 12px; line-height: 1.8; }
/* 068 专用：「直接改软件」入口开关 */
.ai-dev-switch { margin: 0 14px 10px; padding: 10px 12px; border: 1px solid #ddd2ff;
  border-radius: 10px; background: #f8f6ff; }
.ai-dev-switch-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-dev-switch-h b { color: #4c3a99; font-size: 13px; }
.ai-dev-switch-t { margin-top: 4px; color: #7b6fa8; font-size: 12px; line-height: 1.7; }
.ai-dev-switch-t.on { color: #1f7a45; }
/* 问用法：答案卡片 */
.ai-answer { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px 10px; margin-bottom: 12px; }
.ai-answer-q { color: #16456e; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.ai-bubble.answer { max-width: 100%; background: #f7fafd; border: 1px solid #eaf1f8;
  color: #23425c; padding: 10px 12px; }
.ai-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ai-links-t { color: var(--txt-2); font-size: 12.5px; }
.ai-answer-meta { color: #9aa8b8; font-size: 11.5px; margin-top: 8px; }
.ai-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.ai-help-none { text-align: center; padding: 40px 18px 22px; }
.ai-hot { border-top: 1px dashed #e4ecf4; margin-top: 6px; padding-top: 10px; }
.ai-hot-t { color: #16456e; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.ai-hot-list { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ai-input { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.ai-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ai-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ai-counts { color: var(--txt-2); font-size: 12.5px; }
.ai-hint { color: var(--txt-2); font-size: 12px; margin-left: 8px; }
.ai-detail-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  color: var(--txt-2); font-size: 12.5px; margin-bottom: 10px; }
.ai-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-detail-sec { margin: 16px 0 8px; color: #16456e; font-weight: 600; font-size: 13px; }
.ai-md { background: #f6f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 12px;
  font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow-y: auto; }
/* 需求单对话记录：左边 AI、右边提需求的人 */
.ai-chatlog { max-height: 60vh; overflow-y: auto; padding: 14px;
  background: #f6f9fc; border: 1px solid var(--line); border-radius: 8px; }
.ai-msg-col { display: flex; flex-direction: column; max-width: 86%; }
.ai-msg.user .ai-msg-col { align-items: flex-end; }
.ai-msg-col .ai-bubble { max-width: 100%; }
.ai-chat-time { margin-top: 4px; font-size: 11.5px; color: var(--txt-2); }
.ai-impact { font-size: 12.5px; line-height: 2; }
.ai-impact code { background: #eef4fa; padding: 1px 6px; border-radius: 4px; color: #1f5d8f; }
@media print { .ai-fab-wrap { display: none !important; } }

/* 明细列表头：按住可左右拖动换列顺序（拖列边框则是调整列宽） */
.col-drag { display: inline-block; width: 100%; cursor: move; user-select: none; white-space: nowrap; }
.col-drag:hover { color: #1f6fb2; }
.col-drag.dragging { opacity: 0.45; }

/* ================= 零售收银台（POS）：复刻 cpeac/340零售销售 收银台 =================
   大字、大按钮、高对比；整页不滚动，清单与结账各自内部滚动 */
/* 负 margin 抵掉内容区的 18px 内边距，让收银台像参考页面那样铺满整块内容区 */
.rpos {
  display: flex; flex-direction: column;
  margin: -18px; height: calc(100vh - 98px); min-height: 540px;
  font-size: 17px; color: #222;
}
/* 收银台右下角的「确认结账」会被 AI 悬浮球压住，这一页把它收起来 */
.layout:has(.rpos) .ai-fab-wrap { display: none; }

/* ---------- 顶栏 ---------- */
.rpos-top {
  flex: 0 0 64px; height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border-radius: 10px; background: #2f3d5c; color: #fff;
  box-shadow: 0 2px 10px rgba(16, 40, 66, .16);
}
.rpos-brand {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 21px; font-weight: 700;
}
.rpos-brand .el-icon { font-size: 24px; color: #8ec9ff; }

.rpos-scan {
  position: relative; flex: 1; min-width: 220px; height: 48px; display: flex; align-items: center;
  gap: 10px; padding: 0 14px; background: #fff; border-radius: 8px;
}
.rpos-scan > .el-icon { font-size: 22px; color: #1E9FFF; }
.rpos-scan input {
  flex: 1; height: 44px; border: 0; outline: 0; background: transparent;
  font-size: 19px; color: #222;
}
.rpos-list {
  position: absolute; top: 54px; left: 0; right: 0; z-index: 2100; padding: 4px;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
  max-height: 440px; overflow: auto;
}
.rpos-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; color: #222; font-size: 17px;
}
.rpos-item.on, .rpos-item:hover { background: #f2f8ff; }
.ri-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-name b { font-size: 19px; }
.ri-name i { font-style: normal; color: #8894a8; font-size: 15px; margin-left: 6px; }
.ri-name em { font-style: normal; color: #b0b8c6; font-size: 14px; margin-left: 8px; }
.ri-stock { flex: 0 0 76px; text-align: right; color: #4a5568; font-size: 16px; }
.ri-price { flex: 0 0 100px; text-align: right; color: #FF5722; font-weight: 700; font-size: 17px; }
.ri-add {
  flex: 0 0 76px; height: 38px; border: 0; border-radius: 8px; background: #1E9FFF;
  color: #fff; font-size: 16px; cursor: pointer;
}
.rpos-empty { padding: 16px; text-align: center; color: #8894a8; font-size: 16px; }

.rpos-field {
  display: flex; flex: 0 0 auto; align-items: center; gap: 8px;
  font-size: 17px; white-space: nowrap;
}
.rpos-field select {
  height: 44px; min-width: 118px; padding: 0 10px; border: 0; border-radius: 8px;
  background: #fff; color: #222; font-size: 17px; cursor: pointer; outline: none;
}
.rpos-topbtn {
  height: 44px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 17px; cursor: pointer; white-space: nowrap;
}
.rpos-topbtn:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 主体 ---------- */
.rpos-main { flex: 1; display: flex; gap: 10px; margin-top: 10px; min-height: 0; }
.rpos-panel {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}
.rpos-cart { flex: 1; min-width: 0; }
.rpos-pay { flex: 0 0 350px; width: 350px; }
.rpos-phead {
  flex: 0 0 54px; height: 54px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid #eef1f6;
  font-size: 19px; font-weight: 700; color: #2f3d5c;
}
.rpos-phead .sub { font-size: 15px; font-weight: 400; color: #8894a8; }
.rpos-phead .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rpos-badge {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  background: #1E9FFF; color: #fff; font-size: 15px;
}
.rpos-badge.green { background: #5FB878; }
.rpos-hbtn {
  height: 38px; padding: 0 14px; border: 1px solid #ffd6c9; border-radius: 8px;
  background: #fff8f5; color: #FF5722; font-size: 16px; cursor: pointer;
}
.rpos-hbtn:hover:not(:disabled) { background: #fff0eb; }
.rpos-hbtn:disabled { opacity: .5; cursor: not-allowed; }

.rpos-cbody { flex: 1; min-height: 0; }
.rpos-cbody .el-table {
  --el-table-border-color: #e6e6e6;
  --el-table-header-bg-color: #f7f9fc;
  --el-table-row-hover-bg-color: #f7fbff;
  height: 100%; font-size: 17px; color: #222;
}
.rpos-cbody .el-table th.el-table__cell { background: #f7f9fc; padding: 6px 0; }
.rpos-cbody .el-table th.el-table__cell .cell { font-size: 17px; font-weight: 700; color: #4a5568; }
.rpos-cbody .el-table td.el-table__cell { padding: 4px 0; }
.rpos-cbody .el-table td.el-table__cell .cell { padding: 0 10px; font-size: 17px; line-height: 1.4; }
.rpos-cbody .el-table__inner-wrapper::before { display: none; }

.rpos-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 19px; font-weight: 700; color: #1f2d3d; line-height: 1.35;
}
.rpos-sub { font-size: 15px; color: #8894a8; line-height: 1.3; }
.rpos-mny { color: #FF5722; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.rpos-mny-b { color: #FF5722; font-weight: 700; font-size: 21px; font-variant-numeric: tabular-nums; }

.rpos-qty { display: flex; align-items: center; justify-content: center; gap: 6px; }
.rpos-qb {
  width: 38px; height: 38px; padding: 0; border: 1px solid #dfe4ec; border-radius: 8px;
  background: #f7f9fc; color: #2f3d5c; font-size: 24px; line-height: 1;
  font-weight: 700; cursor: pointer;
}
.rpos-qb:hover { border-color: #1E9FFF; color: #1E9FFF; }
.rpos-qty input,
.rpos-price {
  height: 38px; border: 1px solid #dfe4ec; border-radius: 8px; outline: none;
  background: #fff; color: #222; font-size: 20px; font-weight: 700;
}
.rpos-qty input { width: 56px; text-align: center; }
.rpos-price { width: 100%; padding: 0 8px; text-align: right; font-size: 18px; font-weight: 400; }
.rpos-qty input:focus, .rpos-price:focus { border-color: #1E9FFF; }

.rpos-cfoot {
  flex: 0 0 66px; height: 66px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-top: 1px solid #eef1f6; background: #fafbfe;
  font-size: 18px; color: #4a5568;
}
.rpos-cfoot b { color: #1E9FFF; font-size: 23px; }
.rpos-cfoot .big { font-size: 30px; font-weight: 700; color: #FF5722; }

/* ---------- 右：结账 ---------- */
.rpos-paybody { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px 4px; }
.rpos-sec { margin-bottom: 8px; }
.rpos-sectitle {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 17px; font-weight: 700; color: #2f3d5c;
}
.rpos-sectitle .link { margin-left: auto; color: #1E9FFF; font-weight: 400; font-size: 15px; cursor: pointer; }

.rpos-disc { display: flex; gap: 8px; align-items: center; }
.rpos-disc input {
  flex: 1; min-width: 0; height: 50px; padding: 0 12px; border: 1px solid #dfe4ec;
  border-radius: 8px; outline: none; font-size: 24px; font-weight: 700; color: #FF5722;
}
.rpos-disc input:focus { border-color: #FF5722; }
.rpos-disc button {
  flex: 0 0 64px; height: 50px; border: 1px solid #ffd6c9; border-radius: 8px;
  background: #fff4f0; color: #FF5722; font-size: 17px; cursor: pointer;
}
.rpos-disc button:hover { background: #ffe8e0; }

.rpos-due {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px; padding: 6px 14px 10px; border: 1px solid #dbe6ff;
  border-radius: 10px; background: #f5f8ff;
}
.rpos-due .lab { font-size: 18px; color: #4a5568; }
.rpos-due .num { font-size: 38px; font-weight: 700; color: #FF5722; line-height: 1.15; }

.rpos-pms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rpos-pm {
  height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 2px solid #e6ebf4; border-radius: 10px; background: #fff;
  font-size: 16px; color: #2f3d5c; cursor: pointer;
}
.rpos-pm:hover { border-color: #bcd6ff; }
.rpos-pm.on { border-color: #FF5722; background: #fff4f0; color: #FF5722; font-weight: 700; }
.rpos-pm .ico {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; color: #fff;
  font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.rpos-tip { margin-top: 8px; font-size: 15px; color: #8894a8; }

.rpos-money { display: flex; gap: 6px; align-items: center; }
.rpos-money input {
  flex: 1; min-width: 0; height: 52px; padding: 0 12px; border: 1px solid #dfe4ec;
  border-radius: 8px; outline: none; font-size: 24px; font-weight: 700; color: #1E9FFF;
}
.rpos-money input:focus { border-color: #1E9FFF; }
.rpos-quick { display: flex; flex: 0 0 auto; gap: 6px; }
.rpos-quick button {
  width: 46px; height: 52px; padding: 0; border: 1px solid #dfe4ec; border-radius: 8px;
  background: #f7f9fc; color: #4a5568; font-size: 16px; cursor: pointer;
}
.rpos-quick button:hover { border-color: #1E9FFF; color: #1E9FFF; }

.rpos-extra { display: flex; flex-direction: column; gap: 8px; }
.rpos-extra input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #e9edf5;
  border-radius: 8px; outline: none; font-size: 16px; color: #4a5568;
}
.rpos-extra input:focus { border-color: #1E9FFF; }

.rpos-payfoot { flex: 0 0 auto; padding: 0 14px 14px; background: #fff; }
.rpos-change {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px; padding: 6px 14px; border: 1px solid #cfead9;
  border-radius: 10px; background: #f3fbf6;
}
.rpos-change .lab { font-size: 17px; color: #4a5568; }
.rpos-change .num { font-size: 30px; font-weight: 700; color: #5FB878; }
.rpos-checkout {
  width: 100%; height: 70px; border: 0; border-radius: 12px; background: #FF5722;
  color: #fff; font-size: 27px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 87, 34, .35);
}
.rpos-checkout:hover:not(:disabled) { background: #F4511E; }
.rpos-checkout:disabled { background: #d7dee8; box-shadow: none; cursor: not-allowed; }
.rpos-last { margin-top: 8px; text-align: center; font-size: 15px; color: #8894a8; }
.rpos-last a { color: #1E9FFF; cursor: pointer; margin-left: 6px; }

/* ---------- 收银台内的原生控件 ---------- */
.rpos input, .rpos select, .rpos button { box-sizing: border-box; font-family: inherit; }
.rpos-field select { max-width: 150px; }
.rpos input[type="number"] { -moz-appearance: textfield; }
.rpos input[type="number"]::-webkit-outer-spin-button,
.rpos input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rpos-del {
  height: 30px; padding: 0 10px; border: 0; border-radius: 6px;
  background: #FF5722; color: #fff; font-size: 14px; cursor: pointer;
}
.rpos-del:hover { background: #F4511E; }

/* 屏幕不够高时（本系统上方还有顶栏+页签条）把结账区收紧一档，保证「单据信息」展开也不被压住 */
@media (max-height: 940px) {
  .rpos-sec { margin-bottom: 6px; }
  .rpos-disc input, .rpos-disc button { height: 44px; }
  .rpos-due { margin-bottom: 8px; padding: 4px 14px 6px; }
  .rpos-due .num { font-size: 32px; }
  .rpos-pm { height: 50px; }
  .rpos-money input, .rpos-quick button { height: 44px; }
  .rpos-quick button { width: 42px; }
  .rpos-change { margin-bottom: 8px; }
  .rpos-change .num { font-size: 26px; }
  .rpos-checkout { height: 60px; font-size: 24px; }
}

/* ================= 工作台数据看板（复刻 cpeac/000首页 的浅色看板） ================= */
.db-wrap {
  position: relative; margin: -18px; min-height: calc(100vh - 98px); padding: 16px 18px 26px;
  font-size: 13px; color: #1e293b; overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 8% -6%, #e2edfd 0%, rgba(226, 237, 253, 0) 60%),
    radial-gradient(760px 380px at 98% 0%, #e4f4fd 0%, rgba(228, 244, 253, 0) 58%),
    linear-gradient(170deg, #f8fbff 0%, #eef4fc 50%, #e9f1fb 100%);
}
.db-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: linear-gradient(rgba(37, 99, 235, .055) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(37, 99, 235, .055) 1px, transparent 1px);
  background-size: 56px 56px;
}
.db-wrap > *:not(.el-overlay) { position: relative; z-index: 1; }

/* ---------- 顶部 ---------- */
.db-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.db-brand { display: flex; align-items: center; gap: 14px; }
.db-brand .lg {
  width: 52px; height: 52px; border-radius: 15px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #3b82f6, #22d3ee);
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .62);
}
.db-brand .lg svg { width: 28px; height: 28px; fill: #fff; }
.db-brand h1 {
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(90deg, #0f2a56, #2563eb);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.db-brand p { font-size: 12px; color: #7b8aa1; margin-top: 3px; letter-spacing: 2px; }
.db-topr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-chip {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 11px;
  font-size: 13px; background: #fff; border: 1px solid #e3ebf6; color: #43536b;
  box-shadow: 0 8px 18px -14px rgba(15, 42, 86, .5);
}
.db-chip b { font-size: 15px; font-weight: 700; color: #0f2a56; }
.db-chip.warn { border-color: #fbd9a0; background: linear-gradient(180deg, #fff8ec, #fff); color: #b45309; }
.db-chip.warn b { color: #b45309; }
.db-chip.ok { border-color: #b8e8d3; background: linear-gradient(180deg, #f0faf5, #fff); color: #0f7a56; }
.db-chip.ok b { color: #0f7a56; }
.db-chip.clock { font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* ---------- KPI ---------- */
.db-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-kpi {
  padding: 15px 16px; border-radius: 16px; background: #fff; border: 1px solid #e7eef8;
  box-shadow: 0 14px 30px -24px rgba(15, 42, 86, .45);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.db-kpi.clickable { cursor: pointer; }
.db-kpi:hover { transform: translateY(-4px); border-color: #bcd6f7; box-shadow: 0 22px 38px -20px rgba(37, 99, 235, .32); }
.db-kpi .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.db-kpi .ic svg { width: 19px; height: 19px; fill: #fff; }
.db-kpi .lb { font-size: 12.5px; color: #6b7c93; margin-bottom: 6px; }
.db-kpi .vl {
  font-size: 26px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #0f2a56, #1b4b96);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.db-kpi .vl small { font-size: 12px; font-weight: 400; margin-left: 3px; -webkit-text-fill-color: #8a9ab0; }
.db-kpi .ft { font-size: 11.5px; color: #7b8aa1; margin-top: 7px; }
.db-kpi .ft em { font-style: normal; color: #2563eb; font-weight: 600; }
.db-ic-blue { background: linear-gradient(140deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 22px -10px rgba(59, 130, 246, .9); }
.db-ic-cyan { background: linear-gradient(140deg, #22d3ee, #0891b2); box-shadow: 0 10px 22px -10px rgba(34, 211, 238, .9); }
.db-ic-green { background: linear-gradient(140deg, #34d399, #059669); box-shadow: 0 10px 22px -10px rgba(52, 211, 153, .9); }
.db-ic-amber { background: linear-gradient(140deg, #fbbf24, #d97706); box-shadow: 0 10px 22px -10px rgba(251, 191, 36, .9); }
.db-ic-violet { background: linear-gradient(140deg, #a78bfa, #7c3aed); box-shadow: 0 10px 22px -10px rgba(167, 139, 250, .9); }
.db-ic-rose { background: linear-gradient(140deg, #fb7185, #e11d48); box-shadow: 0 10px 22px -10px rgba(251, 113, 133, .9); }

/* ---------- 栅格与卡片 ---------- */
.db-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.db-c3 { grid-column: span 3; } .db-c4 { grid-column: span 4; } .db-c5 { grid-column: span 5; }
.db-c6 { grid-column: span 6; } .db-c8 { grid-column: span 8; } .db-c12 { grid-column: span 12; }
.db-card {
  position: relative; padding: 16px 18px; border-radius: 18px; overflow: hidden;
  background: #fff; border: 1px solid #e7eef8;
  box-shadow: 0 14px 34px -24px rgba(15, 42, 86, .4);
}
.db-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; opacity: .65;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, .5), rgba(37, 99, 235, 0));
}
.db-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.db-card-h h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: #16273d; }
.db-card-h h3 i {
  display: inline-block; width: 6px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.db-card-h .sub { font-size: 12px; color: #8a9ab0; }
.db-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #64748b; }
.db-legend span { display: flex; align-items: center; gap: 6px; }
.db-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- 图表 ---------- */
.db-chart { width: 100%; height: 230px; position: relative; }
.db-chart svg { display: block; width: 100%; height: 100%; }
.db-chart .axis { fill: #94a3b8; font-size: 10.5px; }
.db-chart .grid-line { stroke: #e9eef6; stroke-width: 1; }
.db-chart .ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.db-chart .pt { fill: #fff; stroke-width: 2; }
.db-donut-wrap { display: flex; align-items: center; gap: 16px; height: 230px; }
.db-donut-wrap .db-chart { height: 190px; flex: 0 0 190px; }
.db-donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; max-height: 210px; overflow-y: auto; }
.db-dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px;
  border-radius: 10px; font-size: 13px; color: #43536b; background: #f8fbff; border: 1px solid #eaf1f8;
}
.db-dl-item span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-dl-item i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: 0 0 9px; }
.db-dl-item b { font-variant-numeric: tabular-nums; color: #16273d; white-space: nowrap; }
.db-dl-item em { font-style: normal; color: #8a9ab0; font-size: 11px; }

/* ---------- 横向条 ---------- */
.db-bar-row { margin-bottom: 9px; }
.db-bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: #64748b; margin-bottom: 4px; }
.db-bar-top span { max-width: 72%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-bar-top b { color: #16273d; font-variant-numeric: tabular-nums; }
.db-bar-trk { height: 9px; border-radius: 6px; background: rgba(15, 23, 42, .08); overflow: hidden; }
.db-bar-fill { height: 100%; border-radius: 6px; width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }

/* ---------- 预警 / 待办 / 动态 ---------- */
.db-row-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 8px;
  border-radius: 12px; background: #f9fbff; border: 1px solid #ecf2f9; transition: .18s;
}
.db-row-item:hover { background: #eef5ff; border-color: #c9defb; transform: translateX(3px); box-shadow: 0 10px 22px -18px rgba(37, 99, 235, .45); }
.db-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.db-row-main b { font-size: 13.5px; font-weight: 600; color: #16273d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-row-main span { font-size: 11.5px; color: #8a9ab0; }
.db-w-tag { font-size: 11px; padding: 3px 9px; border-radius: 8px; white-space: nowrap; font-weight: 600; background: #fffbeb; color: #b45309; border: 1px solid #fbd9a0; }
.db-w-tag.danger { background: #fef2f2; color: #c02b2b; border-color: #fbcfcf; }
.db-w-tag.info { background: #eef5ff; color: #1d4ed8; border-color: #cfe0fb; }
.db-row-right { text-align: right; }
.db-row-right b { font-size: 17px; color: #d97706; font-variant-numeric: tabular-nums; }
.db-row-right.danger b { color: #dc2626; }
.db-row-right span { display: block; font-size: 11px; color: #8a9ab0; margin-top: 2px; }
.db-todo-strip {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed #e9eff7; font-size: 11.5px; color: #8a9ab0;
}
.db-todo-strip b { color: #1b3a6b; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.db-log-item { align-items: flex-start; }
.db-dot { width: 8px; height: 8px; border-radius: 50%; background: #0891b2; margin-top: 7px; flex: 0 0 8px;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .14); }
.db-log-time { font-size: 11.5px; color: #8a9ab0; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.6; white-space: nowrap; }
.db-empty { font-size: 13px; color: #8a9ab0; text-align: center; padding: 26px 0; }

/* ---------- 快捷入口 ---------- */
.db-short { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.db-short a {
  display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 8px;
  border-radius: 14px; text-decoration: none; font-size: 12.5px; color: #334155; cursor: pointer;
  background: #fff; border: 1px solid #e7eef8; box-shadow: 0 10px 24px -20px rgba(15, 42, 86, .45);
  transition: .2s;
}
.db-short a:hover {
  transform: translateY(-4px); border-color: #bcd6f7;
  background: linear-gradient(160deg, #f3f8ff, #fff);
  box-shadow: 0 18px 32px -18px rgba(37, 99, 235, .38);
}
.db-short .si { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.db-short .si svg { width: 20px; height: 20px; fill: #fff; }

/* ---------- 页脚 ---------- */
.db-foot {
  margin-top: 8px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #7b8aa1; flex-wrap: wrap; gap: 8px;
}
.db-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; display: inline-block;
  margin-right: 6px; box-shadow: 0 0 0 4px rgba(16, 185, 129, .16); }
.db-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.db-switch .trk { width: 40px; height: 20px; border-radius: 20px; background: rgba(15, 23, 42, .14); position: relative; transition: .2s; }
.db-switch .trk b { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(15, 42, 86, .35); transition: .2s; }
.db-switch.on .trk { background: rgba(16, 185, 129, .5); }
.db-switch.on .trk b { left: 22px; }

/* 图表数值提示框：fixed 定位跟随鼠标（选择器加重，压过 .db-wrap > * 的 relative） */
.db-wrap .db-tip {
  position: fixed; z-index: 3000; max-width: 260px; padding: 7px 10px; border-radius: 9px;
  font-size: 12px; line-height: 1.65; color: #dbeaff; pointer-events: none;
  background: rgba(6, 18, 38, .95); border: 1px solid rgba(120, 190, 255, .4);
  box-shadow: 0 10px 24px -10px #000; transform: translate(14px, -8px);
  opacity: 0; transition: opacity .12s;
}
.db-wrap .db-tip.on { opacity: 1; }
.db-wrap .db-tip b { color: #bfe0ff; }

@media (max-width: 1400px) {
  .db-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .db-c3, .db-c4, .db-c5, .db-c6, .db-c8, .db-c12 { grid-column: span 12; }
  .db-short { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-short { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 打印版式设计（新版 A4 自由画布） */
.pcd { display: flex; flex-direction: column; height: calc(100vh - 108px); background: #eef1f5; }
.pcd-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e3e8ef; flex: none; }
.pcd-title { font-weight: 700; color: #1f2d3d; }
.pcd-name { color: #5b6b7f; font-size: 13px; margin-right: auto; }
.pcd-zoom { display: flex; align-items: center; gap: 6px; color: #5b6b7f; font-size: 13px; }
.pcd-main { flex: 1; display: flex; min-height: 0; }
.pcd-left, .pcd-right { background: #fff; overflow: auto; padding: 10px; flex: none; }
.pcd-left { width: 236px; border-right: 1px solid #e3e8ef; }
.pcd-right { width: 258px; border-left: 1px solid #e3e8ef; }
.pcd-stage { flex: 1; overflow: auto; padding: 18px; display: flex; justify-content: center; align-items: flex-start; }
.pcd-page { width: 210mm; min-height: 297mm; padding: 12mm; background: #fff; flex: none; position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
  background-image: linear-gradient(#f5f7fa 1px, transparent 1px), linear-gradient(90deg, #f5f7fa 1px, transparent 1px);
  background-size: 10mm 10mm; }
.pcd-el { position: absolute; box-sizing: border-box; cursor: move; outline: 1px dashed transparent; }
.pcd-el:hover { outline-color: #9ec2ff; }
.pcd-el.sel { outline: 2px solid #2b6de5; z-index: 5; }
.pcd-el.off { opacity: .35; }
.pcd-el.fl { outline-style: dotted; }
.pcd-el .pcd-txt { white-space: pre-line; line-height: 1.6; color: #222; }
.pcd-grip { position: absolute; right: -3px; bottom: -3px; width: 8px; height: 8px; background: #2b6de5;
  border-radius: 2px; cursor: nwse-resize; opacity: 0; }
.pcd-el.sel .pcd-grip { opacity: 1; }
.pcd-ph { color: #b6c0cc; font-size: 12px; }
.pcd-tb { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pcd-tb th, .pcd-tb td { border: 1px solid #333; font-size: 10px; padding: 1mm; text-align: center; color: #555; }
.pcd-line { border-top: 1px solid #333; }
.pcd-b { margin-bottom: 14px; }
.pcd-b-h { font-weight: 700; font-size: 13px; color: #1f2d3d; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.pcd-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pcd-btns .el-button { margin: 0; padding: 5px 9px; }
.pcd-b-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: #5b6b7f; }
.pcd-thumb { display: block; width: 100%; max-height: 70px; object-fit: contain; border: 1px solid #e3e8ef;
  border-radius: 6px; padding: 4px; margin-bottom: 6px; }
.pcd-hint { color: #9aa8b8; font-size: 12px; line-height: 1.6; margin-top: 6px; }
.pcd-col { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.pcd-col .el-checkbox__label { font-size: 12px; }
.pcd-drag { cursor: grab; color: #a9b6c6; font-size: 13px; line-height: 1; padding: 0 2px; user-select: none; }
.pcd-drag:active { cursor: grabbing; }
.pcd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; font-size: 12px; color: #5b6b7f; }
.pcd-grid2 label { display: flex; align-items: center; gap: 4px; }
.pcd-grid2 .el-input-number { width: 84px; }
.pcd-tip { color: #7a8797; font-size: 13px; line-height: 1.8; background: #f7f9fc;
  border: 1px dashed #dbe3ec; border-radius: 8px; padding: 12px; }
.pcd-pv { height: 70vh; }
.pcd-pv iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pcd-pv-tip { color: #9aa8b8; font-size: 12px; margin-right: auto; }
.pcd-unit { color: #9aa8b8; font-size: 12px; }

/* ===== 角色权限抽屉：分组卡片 + 页面行 + 动作标签 ===== */
.perm-role-form .el-form-item { margin-bottom: 8px; }
.perm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
.perm-toolbar-btns { margin-left: auto; display: flex; gap: 8px; }
.perm-stat { font-size: 12.5px; color: #64748b; white-space: nowrap; }
.perm-stat b { color: #1f6fd0; font-size: 14px; }
.perm-hint { font-size: 12px; color: #9aa8b8; margin-bottom: 10px; }
.perm-scroll { max-height: 54vh; overflow: auto; padding: 2px 8px 2px 2px; }
.perm-group { border: 1px solid #e6edf5; border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.perm-group-hd { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: linear-gradient(90deg, #f4f9ff, #fbfdff); border-bottom: 1px solid #eef3f9; }
.perm-group-hd .el-checkbox { margin-right: 0; height: auto; }
.perm-gname { font-weight: 600; color: #16456e; font-size: 13.5px; cursor: pointer; user-select: none; }
.perm-gcount { margin-left: auto; font-size: 12px; color: #8a99aa; }
.perm-fold { color: #8a99aa; }
.perm-mod { display: flex; align-items: flex-start; gap: 8px; padding: 6px 12px; border-top: 1px dashed #f0f4f9; }
.perm-mod:first-child { border-top: none; }
.perm-mod:hover { background: #fafcff; }
.perm-mod-name { flex: 0 0 170px; padding-top: 4px; }
.perm-mod-name .el-checkbox { height: auto; margin-right: 0; }
.perm-mod-txt { font-size: 13px; color: #2b3a4a; }
.perm-mod-pages { display: block; margin-left: 22px; font-size: 11px; color: #a6b2c1; line-height: 1.5; }
.perm-acts { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { margin-right: 0 !important; height: 26px; padding: 0 10px 0 7px; border: 1px solid #e3eaf3;
  border-radius: 13px; background: #fbfdff; transition: all .15s; }
.perm-chip:hover { border-color: #b9d4f2; background: #f4f9ff; }
.perm-chip.is-checked { border-color: #bcd9f7; background: #eaf4ff; }
.perm-chip .el-checkbox__label { font-size: 12.5px; padding-left: 6px; color: #5b6b7f; }
.perm-chip.is-checked .el-checkbox__label { color: #1f6fd0; }
.perm-chip .el-checkbox__inner { border-radius: 4px; }
.perm-empty { color: #8a99aa; padding: 18px 4px; font-size: 13px; }

/* ===== 打印版式设计：模板套装工具栏 ===== */
.pcd-bar { flex-wrap: wrap; row-gap: 6px; }
.pcd-bar2 { border-top: 1px solid #f2f5f9; padding-top: 6px; }
.pcd-name-tip { color: #a6b2c1; font-size: 11.5px; margin-left: 8px; }
.pcd-tpl-btn { margin-left: 2px; }
