/* ========== FloatingAiChat Q-Creature Pet Styles ==========
 * 全部动画使用 transform / opacity 走 GPU 合成层（will-change + translateZ(0)），
 * 避免重排重绘，CPU 占用 <5%，主流设备 60fps。
 */

/* ====== 容器定位 ====== */
.aipet-wrapper {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  /* 初始不写死 top/left ，由 React 态结合碰撞检测后应用 style */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .aipet-wrapper {
    right: 12px;
    bottom: 16px;
  }
}

/* ====== 收起按钮（hover / focus 时出现在宠物右上角） ====== */
.aipet-collapse-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(60, 130, 223, 0.35);
  background: rgba(255, 255, 255, 0.94);
  color: #3c82df;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 200ms ease, transform 200ms ease, background 200ms ease, color 200ms ease;
  box-shadow: 0 2px 8px rgba(60, 130, 223, 0.3);
  z-index: 3;
}

.aipet-wrapper:hover .aipet-collapse-btn,
.aipet-wrapper.aipet--focused .aipet-collapse-btn {
  opacity: 1;
  transform: scale(1);
}

.aipet-collapse-btn:hover,
.aipet-collapse-btn:focus-visible {
  background: #3c82df;
  color: #ffffff;
}

/* 触屏设备无 hover：常显收起按钮，保证仍可收起 */
@media (max-width: 768px) {
  .aipet-collapse-btn {
    opacity: 1;
    transform: scale(1);
  }
}

/* ====== 收起态：右下角小方块（低调、半透明，尽量不遮挡页面右下区域） ====== */
.aipet-mini {
  position: fixed;
  z-index: 1000;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  cursor: pointer;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92) 0%, rgba(214, 234, 255, 0.92) 100%);
  border: 1px solid rgba(60, 130, 223, 0.35);
  box-shadow: 0 2px 8px rgba(60, 130, 223, 0.26);
  /* 半透明：收起后不抢视觉，鼠标移上去才完全显现 */
  opacity: 0.55;
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}

.aipet-mini:hover,
.aipet-mini:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(60, 130, 223, 0.45);
}

.aipet-mini-svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ====== 外层 3D 场景 ====== */
.aipet-scene {
  position: relative;
  width: 72px;
  height: 72px;
  perspective: 600px;
  perspective-origin: 50% 50%;
  will-change: transform;
  cursor: pointer;
  transform: translateZ(0);
}

@media (max-width: 768px) {
  .aipet-scene {
    width: 58px;
    height: 58px;
  }
}

/* ====== 呼吸动画：scale 100%-105% + opacity 90%-100%，3s 周期 ====== */
@keyframes aipet-breathe {
  0%, 100% { transform: rotateX(0deg) rotateY(0deg) scale(1); opacity: 0.9; }
  50%      { transform: rotateX(0deg) rotateY(0deg) scale(1.05); opacity: 1; }
}

/* ====== 悬停上浮 6px ====== */
@keyframes aipet-hover-float {
  0%   { transform: translateY(0) rotateX(0deg) rotateY(0deg) scale(1.05); }
  50%  { transform: translateY(-3px) rotateX(-2deg) rotateY(1deg) scale(1.08); }
  100% { transform: translateY(-6px) rotateX(-3deg) rotateY(2deg) scale(1.08); }
}

/* ====== 毛玻璃光晕：hover & focus 生效（海鸥专属：天蓝 + 少量橙点缀） ====== */
.aipet-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(60, 130, 223, 0.32) 0%,
    rgba(255, 190, 100, 0.2) 55%,
    rgba(140, 200, 255, 0.35) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* 降级：不支持 backdrop-filter 的浏览器会显示半透明渐变蒙版，视觉仍可接受 */
  filter: blur(2px);
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  transform: scale(0.9) translateZ(0);
  pointer-events: none;
  box-shadow:
    0 0 44px 10px rgba(60, 130, 223, 0.35),
    0 0 88px 16px rgba(140, 200, 255, 0.18),
    0 0 14px 4px rgba(255, 170, 80, 0.15);
  will-change: transform, opacity;
}

.aipet-wrapper:hover .aipet-halo,
.aipet-wrapper.aipet--focused .aipet-halo {
  opacity: 1;
  transform: scale(1.05) translateZ(0);
}

/* ====== 角色 3D 本体（容器 + 呼吸） ====== */
.aipet-character {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: aipet-breathe 3s ease-in-out infinite;
  will-change: transform, opacity;
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: 50% 70%;
}

.aipet-wrapper:hover .aipet-character {
  animation: none;
  transform: translateY(-6px) rotateX(-3deg) rotateY(2deg) scale(1.08) translateZ(0);
}

.aipet-wrapper:active .aipet-character {
  animation: none;
  transform: translateY(-2px) scale(0.96) translateZ(0);
  transition-duration: 150ms;
}

/* ====== SVG 角色本体 ====== */
.aipet-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  /* 海鸥专属：天空蓝 + 深蓝羽阴影（更柔和，更有海运调性） */
  filter: drop-shadow(0 8px 14px rgba(60, 130, 223, 0.45))
          drop-shadow(0 2px 4px rgba(26, 90, 175, 0.32));
  will-change: filter;
  transition: filter 300ms ease;
}

.aipet-wrapper:hover .aipet-svg {
  /* hover 时加重阴影，配合上浮更有立体感 */
  filter: drop-shadow(0 16px 26px rgba(60, 130, 223, 0.55))
          drop-shadow(0 5px 12px rgba(26, 90, 175, 0.4))
          drop-shadow(0 0 10px rgba(255, 170, 80, 0.25));
}

/* ====== 左眼 & 右眼：眨眼 ====== */
.aipet-eye {
  transform-origin: 50% 50%;
  transition: transform 80ms linear;
}

@keyframes aipet-blink-left {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.08); }
}

@keyframes aipet-blink-right {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.08); }
}

/* 每只眼睛的眨眼周期略有差异，更自然 */
.aipet-eye-left  { animation: aipet-blink-left  4200ms linear infinite; }
.aipet-eye-right { animation: aipet-blink-right 3600ms linear infinite; }

/* hover 时眼睛睁大，暂停眨眼（更专注） */
.aipet-wrapper:hover .aipet-eye {
  animation-play-state: paused;
  transform: scaleY(1.08);
}

/* 瞳孔（眼球注视鼠标） */
.aipet-pupil {
  transition: transform 120ms cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

/* ====== 腮红 ====== */
.aipet-blush {
  opacity: 0;
  transition: opacity 350ms ease 50ms;
}

.aipet-wrapper:hover .aipet-blush {
  opacity: 0.85;
}

/* ====== 消息红点（Badge 覆盖） ====== */
.aipet-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 2;
}

/* ====== 展开过渡（点击小生物 -> Drawer 打开前的缩放反馈） ====== */
@keyframes aipet-expand-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.aipet-wrapper.aipet--expanding .aipet-character {
  animation: aipet-expand-pop 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ====== 收起过渡（Drawer 关闭后，小生物重新浮现） ====== */
@keyframes aipet-pop-in {
  0%   { transform: scale(0.3); opacity: 0; }
  70%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.aipet-wrapper.aipet--poppin .aipet-character {
  animation: aipet-pop-in 480ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* 3D 小提示文字（hover 时显示） */
.aipet-tip {
  position: absolute;
  right: 84px;
  bottom: 22px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1f1f1f;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
  .aipet-tip { display: none; }
}

.aipet-wrapper:hover .aipet-tip,
.aipet-wrapper.aipet--focused .aipet-tip {
  opacity: 1;
  transform: translateX(0);
}

/* ====== 无障碍：键盘 focus 可见 ====== */
.aipet-wrapper.aipet--focused .aipet-halo {
  opacity: 1;
  transform: scale(1.15) translateZ(0);
}

/* ================================================================== */
/* ========= 等离子球 (Plasma Sphere) 流光 + 磨砂玻璃聊天窗 ========= */
/* ================================================================== */

/* ---- 1. 浮动海鸥角色的流光描边等离子外圈 ---- */
@keyframes plasma-ring-rotate {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes plasma-glow-pulse {
  0%, 100% { filter: hue-rotate(0deg) blur(4px); opacity: 0.75; }
  50%      { filter: hue-rotate(45deg) blur(7px); opacity: 1; }
}

.aipet-plasma-ring {
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  padding: 3px; /* 3px 的描边厚度，由下面的 conic-gradient 生成彩色流光 */
  background: conic-gradient(
    from 0deg,
    #3c82df,
    #8fc8ff,
    #ffb555,
    #ff7a1a,
    #a17cff,
    #5eb7ff,
    #3c82df
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  background-size: 300% 300%;
  animation: plasma-ring-rotate 6s linear infinite, plasma-glow-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  box-shadow:
    0 0 14px 4px rgba(140, 200, 255, 0.55),
    0 0 26px 8px rgba(255, 170, 80, 0.22),
    0 0 40px 12px rgba(161, 124, 255, 0.18);
}

.aipet-wrapper:hover .aipet-plasma-ring {
  animation-duration: 2.5s, 2s; /* hover 加速流光 */
}

/* ---- 2. 聊天窗口：玻璃拟态背景（Drawer 整体） ---- */
.plasma-drawer-root .ant-drawer-content {
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(140, 200, 255, 0.35), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(255, 170, 80, 0.28), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(161, 124, 255, 0.22), transparent 65%),
    rgba(245, 250, 255, 0.78) !important;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: -16px 0 44px -14px rgba(60, 130, 223, 0.35);
  border-left: 1px solid rgba(255, 255, 255, 0.55);
}

/* 半透明遮罩：不要太黑，保持毛玻璃后的网页仍然模糊可见 */
.plasma-drawer-root .ant-drawer-mask {
  background: rgba(15, 28, 50, 0.18) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---- 3. 聊天窗动态等离子流光背景（流动的光斑，类似等离子球） ---- */
@keyframes plasma-float-1 {
  0%, 100% { transform: translate(-6%, 4%) scale(1); }
  33%      { transform: translate(6%, -3%) scale(1.08); }
  66%      { transform: translate(2%, 6%) scale(0.95); }
}
@keyframes plasma-float-2 {
  0%, 100% { transform: translate(4%, -4%) scale(1); }
  33%      { transform: translate(-4%, 5%) scale(1.1); }
  66%      { transform: translate(-7%, -2%) scale(0.92); }
}
@keyframes plasma-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-3%, -5%) scale(1.15); }
}
@keyframes hue-shift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.plasma-bg-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: 0;
}
.plasma-bg-layer::before,
.plasma-bg-layer::after,
.plasma-bg-layer .blob {
  content: "";
  position: absolute;
  border-radius: 9999px;
  mix-blend-mode: screen;
  opacity: 0.55;
  filter: blur(42px);
  will-change: transform, filter;
}
.plasma-bg-layer::before {
  width: 380px; height: 380px; left: -120px; top: -80px;
  background: radial-gradient(circle, #8fc8ff 0%, #3c82df 45%, transparent 70%);
  animation: plasma-float-1 14s ease-in-out infinite, hue-shift 28s linear infinite;
}
.plasma-bg-layer::after {
  width: 420px; height: 420px; right: -160px; bottom: 40px;
  background: radial-gradient(circle, #ffb555 0%, #ff7a1a 35%, transparent 70%);
  animation: plasma-float-2 17s ease-in-out infinite, hue-shift 32s linear infinite;
  opacity: 0.48;
}
.plasma-bg-layer .blob {
  width: 340px; height: 340px; left: 30%; top: 42%;
  background: radial-gradient(circle, #c7b0ff 0%, #722ed1 40%, transparent 72%);
  animation: plasma-float-3 20s ease-in-out infinite, hue-shift 40s linear infinite reverse;
  opacity: 0.35;
}

/* 聊天内容区滚动条美化 & 不被 plasma-bg 挡住 */
.aichat-body-wrapper {
  position: relative;
  z-index: 1;
}

/* ---- 4. 输入框（更大的显示区 + 流光边框 + 磨砂玻璃） ---- */
.plasma-input-panel {
  position: relative;
  border-radius: 18px;
  padding: 2px; /* 2px 流光彩色描边 */
  background: linear-gradient(
    135deg,
    #8fc8ff,
    #ffb555,
    #a17cff,
    #3c82df,
    #8fc8ff
  );
  background-size: 400% 400%;
  animation: plasma-ring-rotate 8s linear infinite;
  z-index: 2;
}
.plasma-input-panel-inner {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border-radius: 16px;
  padding: 10px 10px 8px;
  transition: box-shadow 250ms ease, background 250ms ease;
}
.aichat-input-wrap:focus-within .plasma-input-panel {
  animation-duration: 3s; /* 聚焦时流光加速 */
  box-shadow: 0 0 22px 6px rgba(140, 200, 255, 0.45),
              0 0 34px 10px rgba(255, 170, 80, 0.25),
              0 0 48px 14px rgba(161, 124, 255, 0.18);
}
.aichat-input-wrap:focus-within .plasma-input-panel-inner {
  background: rgba(255, 255, 255, 0.95);
}

/* 图片粘贴预览缩略图条 */
.plasma-img-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 2px 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(60, 130, 223, 0.25);
}
.plasma-img-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(60, 130, 223, 0.35);
  background: #fff;
  box-shadow: 0 2px 6px rgba(60, 130, 223, 0.18);
}
.plasma-img-item > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.plasma-img-item .remove-x {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  border: 0;
  padding: 0;
  backdrop-filter: blur(4px);
  transition: background 150ms ease;
}
.plasma-img-item .remove-x:hover { background: #ff4d4f; }

/* 发送按钮（等离子球风格，流光圆角 + 按下回弹） */
@keyframes plasma-btn-pulse {
  0%, 100% { box-shadow: 0 0 14px 2px rgba(60, 130, 223, 0.6),
                        0 0 24px 4px rgba(161, 124, 255, 0.3); }
  50%      { box-shadow: 0 0 20px 4px rgba(60, 130, 223, 0.85),
                        0 0 34px 6px rgba(255, 170, 80, 0.45),
                        0 0 46px 10px rgba(161, 124, 255, 0.4); }
}
.plasma-send-btn {
  position: relative;
  overflow: hidden;
  min-width: 88px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: linear-gradient(135deg, #3c82df 0%, #722ed1 55%, #ff7a1a 100%) !important;
  background-size: 260% 260% !important;
  animation: plasma-ring-rotate 6s linear infinite, plasma-btn-pulse 3.5s ease-in-out infinite !important;
  color: #fff !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.plasma-send-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.4), transparent 45%);
  pointer-events: none;
}
.plasma-send-btn:hover { transform: translateY(-1px) scale(1.03); }
.plasma-send-btn:active { transform: translateY(1px) scale(0.97); }
.plasma-send-btn:disabled {
  filter: grayscale(0.5) brightness(0.85);
  animation-play-state: paused !important;
}

/* 工具栏按钮（上传图片等） */
.plasma-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px !important;
  color: #3c82df !important;
  background: rgba(60, 130, 223, 0.08) !important;
  border: 0 !important;
  transition: transform 150ms ease, background 200ms ease;
}
.plasma-tool-btn:hover {
  background: rgba(60, 130, 223, 0.18) !important;
  transform: translateY(-1px);
}

/* 消息气泡等离子描边 */
.aichat-msg-bubble-user {
  border: 1.5px solid rgba(60, 130, 223, 0.35) !important;
  box-shadow: 0 8px 22px -10px rgba(60, 130, 223, 0.45),
              0 0 14px -4px rgba(161, 124, 255, 0.35) !important;
}
.aichat-msg-bubble-ai {
  border: 1.5px solid rgba(255, 170, 80, 0.35) !important;
  box-shadow: 0 8px 22px -10px rgba(255, 170, 80, 0.4),
              0 0 14px -4px rgba(140, 200, 255, 0.3) !important;
}

/* 用户发送的消息中图片显示 */
.aichat-user-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.aichat-user-imgs img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
  transition: transform 200ms ease;
}
.aichat-user-imgs img:hover { transform: scale(1.04); }
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  width: 100%;
}

/* 页面级禁止横向滚动（clip 不创建滚动容器，不影响 Sider/置顶块的 sticky 行为）：
   防止任何瞬时横向偏移导致 sticky 置顶块右侧露出底色 */
html {
  overflow-x: clip;
}

/* 费用分析置顶区：Tabs nav 去掉默认 16px 底部外边距，与上方标题栏紧贴（间距 0） */
.fee-analysis-sticky-tabs .ant-tabs-nav {
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #333;
}

.page-container {
  padding: 16px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-card {
  margin-bottom: 16px;
}

/* 运营数据客户综合利润看板：利润 TOP3 行淡金底高亮 */
.cockpit-top3-row > td {
  background-color: #fffbe6 !important;
}

/* 客户综合利润排名：底部汇总统计行（加粗 + 极浅近白灰底，弱对比不抢眼；2026-09-11 调浅） */
.cockpit-cust-summary-cell {
  font-weight: 700;
  background-color: #fafbfc !important;
  border-top: 1px solid #eef0f2 !important;
}

/* ===== 运营数据：sticky 置顶毛玻璃筛选栏（参考物流统计/仓库日报页形式） ===== */
.cockpit-filter-bar {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 20;
  margin: 0 -16px 16px;
  padding: 10px 20px 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(22, 119, 255, 0.12);
  box-shadow: 0 4px 16px rgba(22, 84, 169, 0.08);
}
.cockpit-filter-divider.ant-divider-vertical {
  border-color: rgba(22, 119, 255, 0.18);
  height: 20px;
}
/* Segmented 控件：淡蓝毛玻璃底 + 蓝色渐变选中块 + hover 柔和反馈（比默认略大一点） */
.cockpit-filter-bar .ant-segmented {
  padding: 3px;
  background: rgba(241, 246, 255, 0.78);
  border: 1px solid rgba(22, 119, 255, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(22, 84, 169, 0.06);
}
.cockpit-filter-bar .ant-segmented-thumb {
  background: transparent !important;
  box-shadow: none !important;
}
.cockpit-filter-bar .ant-segmented-item {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.22s ease;
}
.cockpit-filter-bar .ant-segmented-item-label {
  min-height: 34px;
  line-height: 34px;
  padding: 0 13px;
  font-size: 13.5px;
  color: #5a6478;
  transition: color 0.22s ease;
}
.cockpit-filter-bar .ant-segmented-item:not(.ant-segmented-item-selected):hover {
  background: rgba(22, 119, 255, 0.10) !important;
}
.cockpit-filter-bar .ant-segmented-item:not(.ant-segmented-item-selected):hover .ant-segmented-item-label {
  color: #1677ff !important;
}
.cockpit-filter-bar .ant-segmented-item-selected {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%) !important;
  box-shadow: 0 3px 10px rgba(22, 119, 255, 0.35);
}
.cockpit-filter-bar .ant-segmented-item-selected .ant-segmented-item-label {
  color: #fff !important;
  font-weight: 600;
}
/* 自定义日期 RangePicker：略放大、圆角、聚焦蓝色光晕 */
.cockpit-filter-bar .ant-picker {
  height: 36px;
  border-radius: 8px;
  border-color: rgba(22, 119, 255, 0.25);
  background: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(22, 84, 169, 0.06);
  transition: all 0.22s ease;
}
.cockpit-filter-bar .ant-picker:hover,
.cockpit-filter-bar .ant-picker-focused {
  border-color: #1677ff !important;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
/* 按钮统一圆角 + hover 主色反馈 */
.cockpit-filter-bar .ant-btn {
  border-radius: 8px;
  font-weight: 500;
}
.cockpit-filter-bar .ant-btn-default:hover,
.cockpit-filter-bar .ant-btn-default:focus {
  color: #1677ff !important;
  border-color: #1677ff !important;
}

/* 面单校对规则编辑器：无效规则行（缺渠道或字样）淡红底提示 */
.rule-row-invalid > td {
  background-color: #fff2f0 !important;
}

/* 易仓入库单列表：人工废弃行（易仓重复建单）淡灰底+文字弱化提示 */
.asn-discarded-row > td {
  background-color: #fafafa !important;
  color: #bfbfbf !important;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.stat-card {
  text-align: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.stat-card .stat-label {
  color: #8c8c8c;
  margin-top: 4px;
  font-size: 13px;
}

.dashboard-stat-card {
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ai-bubble-ai {
  background: #f0f5ff;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-bubble-user {
  background: #e6f4ff;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.kpi-tag {
  display: inline-block;
  margin-right: 6px;
}

/* ============================================================
   导航栏视觉优化（追加于 index.css 末尾）
   - erp-main-sider：MainLayout 暗色主题
   - erp-admin-sider：AdminLayout 亮色主题
   设计要点：
     1) 菜单字体增大到 15px、font-weight 600
     2) 悬停态背景亮度提升 15-20%，文字提亮/加深
     3) 选中态：左侧 3px 高亮色条 + 渐变背景 + 内阴影
     4) Sider 右侧投影增强立体层次
     5) 交互过渡 0.25s cubic-bezier 缓动 + 悬停轻微位移
     6) ≤768px 小屏字体回调、间距压缩
   ============================================================ */

/* ---------- 通用：Sider 立体层次与层级 ---------- */
.erp-main-sider,
.erp-admin-sider {
  z-index: 11;
}

.erp-main-sider {
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.28);
}

.erp-admin-sider {
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   主布局导航（暗色主题）
   ============================================================ */
.erp-main-sider .ant-menu {
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  letter-spacing: 0.2px;
}

.erp-main-sider .ant-menu-item {
  height: 46px;
  line-height: 46px;
  margin: 3px 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* 图标增大、与文字间距加宽 */
.erp-main-sider .ant-menu-item .ant-menu-item-icon,
.erp-main-sider .ant-menu-item .anticon {
  font-size: 17px;
  margin-inline-end: 12px;
}

/* 文字链接颜色继承菜单项 */
.erp-main-sider .ant-menu-item a {
  color: inherit;
}

/* 悬停：背景提亮 15-20%、文字提亮到纯白、轻微右移 */
.erp-main-sider .ant-menu-item:hover,
.erp-main-sider .ant-menu-item.ant-menu-item-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transform: translateX(2px);
}

/* 选中：渐变背景 + 左侧高亮色条 + 内阴影，与悬停明显区分 */
.erp-main-sider .ant-menu-item.ant-menu-item-selected {
  position: relative;
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.38) 0%, rgba(22, 119, 255, 0.12) 100%) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.erp-main-sider .ant-menu-item.ant-menu-item-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1677ff;
  box-shadow: 0 0 8px rgba(22, 119, 255, 0.6);
}

.erp-main-sider .ant-menu-item.ant-menu-item-selected:hover {
  transform: translateX(2px);
}

/* ---- 可展开主菜单（SubMenu 标题，2026-11-19 仓库管理组）----
   与普通菜单项完全同款视觉：同高/同字号/同颜色，解决不对齐与颜色不一致；
   右侧展开箭头收紧贴边、文字区禁止省略截断（180px 侧栏下 4 字名称完整显示） */
.erp-main-sider .ant-menu-submenu-title {
  height: 46px;
  line-height: 46px;
  margin: 3px 0;
  border-radius: 8px;
  padding-left: 20px !important;
  padding-right: 26px !important;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.erp-main-sider .ant-menu-submenu-title .ant-menu-title-content {
  overflow: visible !important;
  white-space: nowrap;
}

.erp-main-sider .ant-menu-submenu-title .ant-menu-submenu-arrow {
  right: 8px;
  width: 8px;
  --arrow-size: 4px;
}

.erp-main-sider .ant-menu-submenu-title .ant-menu-item-icon,
.erp-main-sider .ant-menu-submenu-title .anticon {
  font-size: 17px;
  margin-inline-end: 12px;
}

.erp-main-sider .ant-menu-submenu-title:hover,
.erp-main-sider .ant-menu-submenu.ant-menu-submenu-active > .ant-menu-submenu-title {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

.erp-main-sider .ant-menu-submenu.ant-menu-submenu-selected > .ant-menu-submenu-title {
  color: #fff;
}

/* ---- 子菜单（仓库日报/入库管理/库容分析）----
   去掉 antd 默认的深黑展开底色，保持侧栏原底色；缩小缩进让名称完整显示；
   字体颜色比主菜单浅一档做层级区分 */
.erp-main-sider .ant-menu .ant-menu-sub.ant-menu-inline {
  background: transparent !important;
}

.erp-main-sider .ant-menu-sub.ant-menu-inline > .ant-menu-item {
  height: 40px;
  line-height: 40px;
  margin: 2px 0;
  /* 左缩进 = 主菜单文字起点（20px 内边距 + 17px 图标 + 12px 间距），
     子菜单首字与主菜单首字垂直对齐（2026-11-19 用户需求） */
  padding-inline: 49px 10px !important;
  color: rgba(255, 255, 255, 0.6);
}

.erp-main-sider .ant-menu-sub.ant-menu-inline > .ant-menu-item:hover,
.erp-main-sider .ant-menu-sub.ant-menu-inline > .ant-menu-item.ant-menu-item-active {
  background: rgba(255, 255, 255, 0.10) !important;
  color: #fff !important;
  transform: none;
}

.erp-main-sider .ant-menu-sub.ant-menu-inline > .ant-menu-item.ant-menu-item-selected {
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.32) 0%, rgba(22, 119, 255, 0.10) 100%) !important;
  color: #fff !important;
  transform: none;
}

/* ============================================================
   管理后台导航（亮色主题）
   ============================================================ */
.erp-admin-sider .ant-menu {
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  letter-spacing: 0.2px;
}

.erp-admin-sider .ant-menu-item {
  height: 44px;
  line-height: 44px;
  margin: 3px 0;
  border-radius: 8px;
  color: #595959;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.erp-admin-sider .ant-menu-item .ant-menu-item-icon,
.erp-admin-sider .ant-menu-item .anticon {
  font-size: 16px;
  margin-inline-end: 12px;
}

.erp-admin-sider .ant-menu-item a {
  color: inherit;
}

/* 悬停：浅蓝背景、文字加深为主色、轻微右移 */
.erp-admin-sider .ant-menu-item:hover,
.erp-admin-sider .ant-menu-item.ant-menu-item-active {
  background: rgba(22, 119, 255, 0.08) !important;
  color: #1677ff !important;
  transform: translateX(2px);
}

/* 选中：浅蓝渐变背景 + 左侧色条 + 主色文字 */
.erp-admin-sider .ant-menu-item.ant-menu-item-selected {
  position: relative;
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.14) 0%, rgba(22, 119, 255, 0.04) 100%) !important;
  color: #1677ff !important;
  font-weight: 600;
}

.erp-admin-sider .ant-menu-item.ant-menu-item-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1677ff;
  box-shadow: 0 0 6px rgba(22, 119, 255, 0.45);
}

.erp-admin-sider .ant-menu-item.ant-menu-item-selected:hover {
  transform: translateX(2px);
}

/* ===== 分组子菜单（submenu）：与一级菜单统一字体/图标/悬停/选中样式 ===== */
.erp-admin-sider .ant-menu .ant-menu-submenu-title {
  height: 44px;
  line-height: 44px;
  margin: 3px 0;
  border-radius: 8px;
  color: #595959;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.erp-admin-sider .ant-menu .ant-menu-submenu-title .ant-menu-item-icon,
.erp-admin-sider .ant-menu .ant-menu-submenu-title .anticon {
  font-size: 16px;
  margin-inline-end: 12px;
}

.erp-admin-sider .ant-menu .ant-menu-submenu-title:hover {
  background: rgba(22, 119, 255, 0.08) !important;
  color: #1677ff !important;
}

.erp-admin-sider .ant-menu .ant-menu-submenu-selected > .ant-menu-submenu-title {
  color: #1677ff;
  font-weight: 600;
}

/* 子菜单项：字号 14 与一级统一为紧凑层级，图标统一 15px、间距一致 */
.erp-admin-sider .ant-menu.ant-menu-inline .ant-menu-sub.ant-menu-inline {
  background: transparent;
}

.erp-admin-sider .ant-menu .ant-menu-sub .ant-menu-item {
  height: 38px;
  line-height: 38px;
  margin: 2px 0;
  font-size: 14px;
}

.erp-admin-sider .ant-menu .ant-menu-sub .ant-menu-item .ant-menu-item-icon,
.erp-admin-sider .ant-menu .ant-menu-sub .ant-menu-item .anticon {
  font-size: 15px;
  margin-inline-end: 10px;
}

/* 子菜单项：压缩左缩进，保证长名称（如「易境通库存销毁同步」）完整展示、不出现省略号 */
.erp-admin-sider .ant-menu .ant-menu-sub .ant-menu-item {
  padding-inline-start: 38px !important;
  padding-inline-end: 10px !important;
}

/* 菜单文字一律完整展示，不做省略号截断 */
.erp-admin-sider .ant-menu .ant-menu-item .ant-menu-title-content,
.erp-admin-sider .ant-menu .ant-menu-submenu-title .ant-menu-title-content {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap;
}

/* ============================================================
   响应式：小屏（≤768px）字体回调、间距压缩、关闭位移微动效
   ============================================================ */
@media (max-width: 768px) {
  .erp-main-sider .ant-menu,
  .erp-admin-sider .ant-menu {
    font-size: 14px;
    padding: 4px 6px;
    letter-spacing: 0;
  }

  .erp-main-sider .ant-menu-item,
  .erp-admin-sider .ant-menu-item {
    height: 42px;
    line-height: 42px;
    margin: 2px 0;
    border-radius: 6px;
  }

  .erp-main-sider .ant-menu-item .ant-menu-item-icon,
  .erp-main-sider .ant-menu-item .anticon,
  .erp-admin-sider .ant-menu-item .ant-menu-item-icon,
  .erp-admin-sider .ant-menu-item .anticon {
    font-size: 15px;
    margin-inline-end: 10px;
  }

  /* 小屏关闭位移微动效，避免横向溢出 */
  .erp-main-sider .ant-menu-item:hover,
  .erp-admin-sider .ant-menu-item:hover,
  .erp-main-sider .ant-menu-item.ant-menu-item-selected,
  .erp-admin-sider .ant-menu-item.ant-menu-item-selected,
  .erp-main-sider .ant-menu-item.ant-menu-item-selected:hover,
  .erp-admin-sider .ant-menu-item.ant-menu-item-selected:hover {
    transform: none;
  }
}

/* ============================================================
   MainLayout 手机端 Drawer 菜单样式（与 erp-main-sider 等效）
   ============================================================ */
.erp-main-drawer .ant-drawer-body .ant-menu {
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  letter-spacing: 0.2px;
}
.erp-main-drawer .ant-drawer-body .ant-menu-item {
  height: 46px;
  line-height: 46px;
  margin: 3px 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.erp-main-drawer .ant-drawer-body .ant-menu-item .ant-menu-item-icon,
.erp-main-drawer .ant-drawer-body .ant-menu-item .anticon {
  font-size: 17px;
  margin-inline-end: 12px;
}
.erp-main-drawer .ant-drawer-body .ant-menu-item a {
  color: inherit;
}
.erp-main-drawer .ant-drawer-body .ant-menu-item:hover,
.erp-main-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transform: translateX(2px);
}
.erp-main-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected {
  position: relative;
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.38) 0%, rgba(22, 119, 255, 0.12) 100%) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.erp-main-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1677ff;
  box-shadow: 0 0 8px rgba(22, 119, 255, 0.6);
}
.erp-main-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected:hover {
  transform: translateX(2px);
}

/* ============================================================
   AdminLayout 手机端 Drawer 菜单样式（与 erp-admin-sider 等效）
   ============================================================ */
.erp-admin-drawer .ant-drawer-body .ant-menu {
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 10px;
  letter-spacing: 0.2px;
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item {
  height: 44px;
  line-height: 44px;
  margin: 3px 0;
  border-radius: 8px;
  color: #595959;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item .ant-menu-item-icon,
.erp-admin-drawer .ant-drawer-body .ant-menu-item .anticon {
  font-size: 16px;
  margin-inline-end: 12px;
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item a {
  color: inherit;
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item:hover,
.erp-admin-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-active {
  background: rgba(22, 119, 255, 0.08) !important;
  color: #1677ff !important;
  transform: translateX(2px);
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected {
  position: relative;
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.14) 0%, rgba(22, 119, 255, 0.04) 100%) !important;
  color: #1677ff !important;
  font-weight: 600;
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1677ff;
  box-shadow: 0 0 6px rgba(22, 119, 255, 0.45);
}
.erp-admin-drawer .ant-drawer-body .ant-menu-item.ant-menu-item-selected:hover {
  transform: translateX(2px);
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-title {
  height: 44px;
  line-height: 44px;
  margin: 3px 0;
  border-radius: 8px;
  color: #595959;
  transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-title .ant-menu-item-icon,
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-title .anticon {
  font-size: 16px;
  margin-inline-end: 12px;
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-title:hover {
  background: rgba(22, 119, 255, 0.08) !important;
  color: #1677ff !important;
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-selected > .ant-menu-submenu-title {
  color: #1677ff;
  font-weight: 600;
}
.erp-admin-drawer .ant-drawer-body .ant-menu.ant-menu-inline .ant-menu-sub.ant-menu-inline {
  background: transparent;
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-sub .ant-menu-item {
  height: 38px;
  line-height: 38px;
  margin: 2px 0;
  font-size: 14px;
  padding-inline-start: 38px !important;
  padding-inline-end: 10px !important;
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-sub .ant-menu-item .ant-menu-item-icon,
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-sub .ant-menu-item .anticon {
  font-size: 15px;
  margin-inline-end: 10px;
}
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-item .ant-menu-title-content,
.erp-admin-drawer .ant-drawer-body .ant-menu .ant-menu-submenu-title .ant-menu-title-content {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap;
}

/* ============================================================
   全局响应式 · 手机端（<768px）覆盖（2026-09-29 全站响应式改造）
   ============================================================ */
@media (max-width: 767.98px) {
  .page-container {
    padding: 10px 8px;
  }
  .cockpit-filter-bar {
    margin: 0 -8px 12px;
    padding: 8px 10px;
  }
  .ant-card .ant-card-body {
    padding: 12px;
  }
  .ant-table-cell {
    padding: 8px 6px !important;
  }
  .ant-statistic-content {
    font-size: clamp(16px, 4vw, 24px);
  }
  .ant-card-head {
    padding: 0 12px;
  }
  .ant-card-head-title {
    font-size: 14px;
  }
}

/* ============================================================
   渠道利润看板 & 异常待办列表：独立板块布局
   - 两个 Card 组件独立存在，各占 50% 宽度
   - 小屏（<lg，即 <992px）：两栏堆叠为单列
   ============================================================ */

/* 让 Row 内的 Col 子项等高，并让内部 Card 撑满宽度 */
.channel-split-row > .ant-col {
  display: flex;
}

.channel-split-row > .ant-col > .ant-card {
  width: 100%;
}

/* ============================================================
   多标签栏（TabsBar）样式
   - 双主题：dark (MainLayout) / light (AdminLayout)
   - 设计要点：过渡 0.2s、激活态底部指示条、自定义滚动条
   ============================================================ */

/* ---------- 容器：嵌入 Header 内部，tab 底边与 Header 底边齐平（消除下方深色条） ---------- */
.erp-tabs-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-top: 0;
}

/* Dark 主题（工作台）：继承 Header 背景 */
.erp-tabs-bar-dark {
  background: transparent;
}

/* Light 主题（后台）：继承 Header 背景 */
.erp-tabs-bar-light {
  background: transparent;
}

/* ---------- 滚动容器：宽度填满，tab 底部对齐 ---------- */
.erp-tabs-scroll-container {
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 0;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

/* 自定义滚动条：窄而薄 */
.erp-tabs-scroll-container::-webkit-scrollbar {
  height: 3px;
}
.erp-tabs-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}
.erp-tabs-bar-dark .erp-tabs-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.erp-tabs-bar-dark .erp-tabs-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
.erp-tabs-bar-light .erp-tabs-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}
.erp-tabs-bar-light .erp-tabs-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Firefox 滚动条 */
.erp-tabs-scroll-container {
  scrollbar-width: thin;
}
.erp-tabs-bar-dark .erp-tabs-scroll-container {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.erp-tabs-bar-light .erp-tabs-scroll-container {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* ---------- 单个 Tab：底边与 Header 齐平，顶部圆角与内容区衔接 ---------- */
.erp-tabs-item {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  padding: 6px 24px 8px;
  border-radius: 8px 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
  height: 40px;
  letter-spacing: 0.1px;
  margin-bottom: 0;
}

.erp-tabs-bar-dark .erp-tabs-item {
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
}
.erp-tabs-bar-light .erp-tabs-item {
  color: #595959;
  background: transparent;
}

/* 悬停态：仅对"非激活"tab应用，已激活tab保持不变 */
.erp-tabs-bar-dark .erp-tabs-item:not(.erp-tabs-item-active):hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.erp-tabs-bar-light .erp-tabs-item:not(.erp-tabs-item-active):hover {
  background: rgba(22, 119, 255, 0.12);
  color: #1677ff;
}

/* 激活态：底色 == 页面 Content 底色（#f5f7fa），tab 底边与 Header 齐平，向下延伸遮住底边框与投影，两侧内凹圆角与内容区无缝衔接 */
/* Dark 主题：激活 tab 切换为浅底色 + 深色文字 + 下延伸遮罩 + 两侧内凹圆角（fillet） */
.erp-tabs-bar-dark .erp-tabs-item-active {
  background: #f5f7fa;
  color: #1f1f1f;
  font-weight: 700;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 5px 0 0 #f5f7fa, 0 -2px 6px rgba(0, 0, 0, 0.06);
  z-index: 2;
}
/* 内凹圆角：页签两侧 10×10 方块伸入内容区顶部，径向渐变挖出圆弧缺口；
   浅色部分与下方内容区连成一体，弧形缺口透出 Header 深色，形成自然的上翘过渡 */
.erp-tabs-bar-dark .erp-tabs-item-active::after {
  content: '';
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: -10px;
  height: 10px;
  background:
    radial-gradient(circle at 100% 0, transparent 9px, rgba(245, 247, 250, 0.5) 9.5px, #f5f7fa 10px) 0 0 / 10px 10px no-repeat,
    radial-gradient(circle at 0 0, transparent 9px, rgba(245, 247, 250, 0.5) 9.5px, #f5f7fa 10px) 100% 0 / 10px 10px no-repeat;
  pointer-events: none;
}

/* Light 主题：激活 tab 渐变浅蓝 + 深蓝字 + 内阴影 + 下延伸遮罩 + 两侧内凹圆角，与内容区无缝衔接 */
.erp-tabs-bar-light .erp-tabs-item-active {
  background: linear-gradient(180deg, #eaf2ff 0%, #f5f7fa 100%);
  color: #0958d9;
  font-weight: 700;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 5px 0 0 #f5f7fa, inset 0 1px 0 rgba(22, 119, 255, 0.15), 0 -2px 6px rgba(22, 119, 255, 0.08);
  border-left: 1px solid rgba(22, 119, 255, 0.2);
  border-right: 1px solid rgba(22, 119, 255, 0.2);
  z-index: 2;
}
.erp-tabs-bar-light .erp-tabs-item-active::after {
  content: '';
  position: absolute;
  left: -11px;
  right: -11px;
  bottom: -10px;
  height: 10px;
  background:
    radial-gradient(circle at 100% 0, transparent 9px, rgba(245, 247, 250, 0.5) 9.5px, #f5f7fa 10px) 0 0 / 10px 10px no-repeat,
    radial-gradient(circle at 0 0, transparent 9px, rgba(245, 247, 250, 0.5) 9.5px, #f5f7fa 10px) 100% 0 / 10px 10px no-repeat;
  pointer-events: none;
}

/* 激活态：顶部 3px 鲜艳渐变边框（指示当前活跃 tab），圆角随 tab 顶部 8px */
.erp-tabs-bar-dark .erp-tabs-item-active::before,
.erp-tabs-bar-light .erp-tabs-item-active::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #1677ff 0%, #722ed1 100%);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 8px rgba(22, 119, 255, 0.45);
  transition: all 0.2s ease;
}

/* 激活态 ::after 改为底部连接器（已在上方定义），此处清理旧规则 */

/* ---------- 图标 ---------- */
.erp-tabs-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- 标签文字：max-width 加大确保完整显示 ---------- */
.erp-tabs-label {
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}
.erp-tabs-label-short {
  display: none;
  line-height: 1;
}

/* ---------- 关闭按钮 ---------- */
.erp-tabs-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-left: 4px;
  opacity: 0.6;
}
.erp-tabs-item:hover .erp-tabs-close-btn,
.erp-tabs-item-active .erp-tabs-close-btn {
  opacity: 1;
}

/* Dark 关闭按钮 hover */
.erp-tabs-bar-dark .erp-tabs-close-btn:hover {
  background: rgba(255, 77, 79, 0.25);
  color: #fff;
  border-radius: 4px;
}

/* Light 关闭按钮 hover */
.erp-tabs-bar-light .erp-tabs-close-btn:hover {
  background: rgba(255, 77, 79, 0.1);
  color: #ff4d4f;
  border-radius: 4px;
}

/* ============================================================
   TabsBar 响应式：小屏（≤768px）
   - 始终显示文字（不隐藏 label）
   - 允许横向滚动
   - 尺寸略缩，保持对齐
   ============================================================ */
@media (max-width: 768px) {
  .erp-tabs-bar {
    padding-top: 10px;
  }
  .erp-tabs-scroll-container {
    padding: 0;
    gap: 0;
  }
  .erp-tabs-bar-dark .erp-tabs-item,
  .erp-tabs-bar-light .erp-tabs-item {
    padding: 6px 14px 7px;
    font-size: 13px;
    height: 36px;
    margin-bottom: 0;
  }

  /* 小屏也始终显示完整 label，只截断宽度 */
  .erp-tabs-label {
    max-width: 140px;
  }

  /* 小屏激活态内凹圆角沿用全局规则（tab 已与 Header 底边齐平），无需额外覆盖 */

  /* 小屏关闭按钮略缩小 */
  .erp-tabs-close-btn {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }
}

/* ===== 费用分析 · 服务工单费：人工匹配中心选中行高亮（2026-09-03 交互优化；2026-09-04 加深底色强化选中视觉） ===== */
.wo-sel-row td {
  background: #cfe6ff !important;
  transition: background .15s ease;
}
/* 左（易境通）选中：蓝色左侧色条 */
.wo-sel-row.wo-sel-yjt td:first-child {
  box-shadow: inset 4px 0 0 #1677ff;
}
/* 右（易仓）选中：紫色左侧色条 */
.wo-sel-row.wo-sel-yc td:first-child {
  box-shadow: inset 4px 0 0 #722ed1;
  background: #e5d1fa !important;
}
/* 匹配表格行 hover 效果 */
.wo-match-table .ant-table-tbody > tr > td {
  transition: background .15s ease;
  cursor: pointer;
}
.wo-match-table .ant-table-tbody > tr:hover > td {
  background: #f5f8ff !important;
}
.wo-match-table-yc .ant-table-tbody > tr:hover > td {
  background: #f9f5ff !important;
}
/* 关联匹配按钮就绪态呼吸效果 */
.wo-match-btn-ready {
  animation: wo-btn-pulse 1.6s ease-in-out infinite;
}
@keyframes wo-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(22, 119, 255, 0); }
}

/* 自动匹配草稿：合配组交替底色（同组行连续渲染，按组视觉分隔） */
.wo-draft-alt-row > td {
  background: #f5faff !important;
}
.wo-draft-alt-row:hover > td {
  background: #e6f4ff !important;
}

/* ===== 出库照片页 · 未存储出库照片订单明细（展开行内嵌表，2026-09-19） ===== */
/* tableLayout=fixed + 列宽配比，铺满展开行宽度，不出现横向滚动条；长内容单行省略（悬停看全文） */
.missing-detail-table .ant-table-thead > tr > th,
.missing-detail-table .ant-table-tbody > tr > td {
  padding: 6px 8px;
}
/* 表头单行不换行，列头完整可读 */
.missing-detail-table .ant-table-thead > tr > th {
  white-space: nowrap;
}

/* ===== 出库照片 · 未存储订单分析悬停弹窗（2026-09-19） ===== */
.miss-ana-block {
  border: 1px solid #eef1f6;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fafbfd;
  min-width: 0;
}
.miss-ana-block h4 {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3a4456;
  display: flex;
  align-items: center;
  gap: 6px;
}
.miss-ana-block h4::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, #1677ff, #69b1ff);
}
.miss-ana-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.miss-ana-table th {
  text-align: left;
  font-weight: 600;
  color: #8a94a6;
  padding: 3px 6px;
  border-bottom: 1px solid #e8ecf2;
  white-space: nowrap;
}
.miss-ana-table th.n,
.miss-ana-table td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.miss-ana-table td {
  padding: 4px 6px;
  border-bottom: 1px dashed #f0f2f7;
  color: #3a4456;
  white-space: nowrap;
}
.miss-ana-table tr:last-child td {
  border-bottom: none;
}
.miss-ana-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 分析弹窗：底部总结分析块 */
.miss-ana-summary {
  margin-top: 10px;
  border: 1px dashed #cfdcee;
  background: #f6f9fd;
  border-radius: 8px;
  padding: 8px 12px 9px;
  font-size: 12px;
  color: #5a6478;
  line-height: 1.75;
}
.miss-ana-summary-title {
  font-weight: 700;
  color: #2c3a52;
  margin-bottom: 2px;
}
.miss-ana-summary ul {
  margin: 0;
  padding-left: 17px;
}
.miss-ana-summary li {
  margin: 1px 0;
}
.miss-ana-summary b {
  color: #2c3a52;
  font-weight: 600;
}
