/* ==========================================================================
   Bespoke Design System for OzonAI ERP (Built under frontend-design skill)
   Principles: Quiet precision, deliberate contrast, 8pt scale, zero AI clichés
   ========================================================================== */

:root {
  /* 1. Core Color System (Strict 6-Token Architecture) */
  --bg-canvas: #f8f9fb;          /* Clean workspace foundation; eliminates messy blue gradients */
  --surface-card: #ffffff;       /* Pure white work surface with crisp 1px borders */
  --surface-subtle: #f1f3f7;     /* 2% contrast secondary tone for headers & toolbars */
  --text-primary: #0f172a;       /* Slate 900 ink, high legibility, no mushy contrast */
  --text-secondary: #526077;     /* Neutral steel gray for metadata, labels, secondary info */
  --accent-brand: #0f52ba;       /* Sapphire Blue: The single highest-contrast visual anchor */
  --accent-brand-hover: #0d469f; /* Controlled optical deepen on hover */
  --accent-subtle: #eef3fc;      /* Soft tint for active menu pill / selected row */

  /* Structural Dividers */
  --line-border: #e2e6ee;        /* 1px structural baseline */
  --line-subtle: #edf0f6;        /* Micro table divider */

  /* Status Accents (Functional Only, Non-Decorative) */
  --status-emerald: #059669;
  --status-emerald-bg: #ecfdf5;
  --status-amber: #d97706;
  --status-amber-bg: #fffbeb;
  --status-rose: #e11d48;
  --status-rose-bg: #fff1f2;

  /* Geometry & 8pt Rhythm */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Restrained Depth (Single subtle shadow layer, zero diffuse glow) */
  --shadow-flat: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-pop: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 20px 48px -12px rgba(15, 23, 42, 0.22);

  /* Precise Focus Ring (Web Interface Guidelines Compliance) */
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px var(--accent-brand);

  /* Micro Transitions (Compositor-friendly opacity & transform only) */
  --trans-fast: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  --trans-transform: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Accessible reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 全局布局与基线 */
body {
  background-color: var(--bg-canvas) !important;
  color: var(--text-primary) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 矢量 SVG 图标基类 */
.ui-icon {
  display: inline-block;
  vertical-align: -0.16em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.15s ease;
}

/* 顶部栏：克制无反光，1px 精确边框分割 */
.topbar {
  height: 56px !important;
  background: var(--surface-card) !important;
  border-bottom: 1px solid var(--line-border) !important;
  padding: 0 24px !important;
  box-shadow: var(--shadow-flat) !important;
}

.topbar h1 {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.01em !important;
}

/* 顶部状态 Chip 胶囊：低调、功能性 */
.chip {
  padding: 4px 10px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--line-border) !important;
  background: var(--surface-subtle) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  transition: var(--trans-fast) !important;
}
.chip.ok {
  background: var(--status-emerald-bg) !important;
  border-color: rgba(5, 150, 105, 0.25) !important;
  color: var(--status-emerald) !important;
}
.chip.ok .dot {
  background: var(--status-emerald) !important;
  box-shadow: none !important;
}

/* 侧边栏：沉稳优雅的纯深靛青背景，摒弃刺眼高饱和渐变与光晕 */
.sidebar {
  width: 228px !important;
  background: #0b1323 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}
.sidebar::before {
  display: none !important; /* 彻底剔除伪元素径向渐变散斑 */
}

.brand {
  padding: 16px 16px 14px !important;
  gap: 10px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.brand img {
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-sm) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}
.brand b {
  font-size: 14.5px !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}
.brand small {
  display: none !important; /* 移除无意义的全大写拉宽英文标签 */
}

.menu {
  padding: 12px 8px 24px !important;
}
.menu .grp {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.45) !important;
  font-weight: 500 !important;
  padding: 14px 10px 6px !important;
  letter-spacing: 0.02em !important;
}
.menu a {
  border-radius: var(--radius-sm) !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  gap: 10px !important;
  margin-bottom: 2px !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
}
.menu a:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  transform: none !important; /* 消除侧边栏摇晃 */
}
.menu a:hover .ui-icon {
  transform: none !important;
}
.menu a.on {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.menu a.on::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 2px 2px 0;
  background: #3b82f6;
}
.menu a .ic {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
}

/* 按钮：高定去模板化设计，严禁彩色厚投影与渐变 */
.btn {
  border-radius: var(--radius-sm) !important;
  padding: 7px 14px !important;
  font-weight: 500 !important;
  font-size: 12.5px !important;
  border: 1px solid var(--line-border) !important;
  background: var(--surface-card) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-flat) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  user-select: none !important;
  outline: none;
}
.btn:hover {
  background: var(--surface-subtle) !important;
  border-color: #cbd5e1 !important;
  color: var(--text-primary) !important;
  transform: none !important;
  box-shadow: var(--shadow-flat) !important;
}
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: none !important;
  box-shadow: var(--focus-ring) !important;
}
.btn:active, button:active, .m-btn:active {
  transform: scale(0.98) !important;
  transition: transform 60ms ease-out !important;
}
/* 主操作按钮：全视口唯一视觉锚点（Solid Sapphire Blue） */
.btn.pri {
  background: var(--accent-brand) !important;
  border: 1px solid var(--accent-brand) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.btn.pri:hover {
  background: var(--accent-brand-hover) !important;
  border-color: var(--accent-brand-hover) !important;
  color: #ffffff !important;
  filter: none !important;
  box-shadow: 0 2px 6px rgba(15, 82, 186, 0.25) !important;
}
.btn.danger {
  color: var(--status-rose) !important;
  border-color: rgba(225, 29, 72, 0.3) !important;
  background: var(--surface-card) !important;
}
.btn.danger:hover {
  background: var(--status-rose-bg) !important;
  border-color: var(--status-rose) !important;
}
.btn.sm {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  border-radius: var(--radius-sm) !important;
}

/* 输入框与控件：高对比度、无灰影 */
.harmony-inp, .fld input, .fld select, .fld textarea, input[type="text"], input[type="search"], input[type="number"], select {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--line-border) !important;
  padding: 8px 12px !important;
  background: var(--surface-card) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-shadow: none !important;
  outline: none !important;
}
.harmony-inp:hover, .fld input:hover, .fld select:hover, .fld textarea:hover, input[type="text"]:hover, select:hover {
  border-color: #cbd5e1 !important;
}
.harmony-inp:focus-visible, .fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible, input[type="text"]:focus-visible, select:focus-visible {
  border-color: var(--accent-brand) !important;
  box-shadow: var(--focus-ring) !important;
}

/* 卡片与面板：1px 细线边框，摒弃千篇一律的软灰阴影 */
.panel {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--line-border) !important;
  box-shadow: var(--shadow-flat) !important;
  background: var(--surface-card) !important;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.panel:hover {
  border-color: #d1d5db !important;
  box-shadow: var(--shadow-flat) !important;
}

/* KPI 统计卡片：高定精简、极简数字基准，消除彩色圆形发光伪元素 */
.kpi {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--line-border) !important;
  background: var(--surface-card) !important;
  box-shadow: var(--shadow-flat) !important;
  padding: 16px 18px !important;
  transition: border-color 0.15s ease !important;
}
.kpi::after {
  display: none !important; /* 彻底剔除伪元素圆形渐变装饰 */
}
.kpi:hover {
  transform: none !important;
  border-color: #cbd5e1 !important;
  box-shadow: var(--shadow-flat) !important;
}
.kpi .lb {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}
.kpi .v {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  font-variant-numeric: tabular-nums !important;
  margin-top: 6px !important;
}

/* 表格样式升级：清晰对齐基线、细线分割、tabular-nums */
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}
th {
  background: var(--surface-subtle) !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid var(--line-border) !important;
  padding: 10px 14px !important;
  font-size: 12px !important;
  letter-spacing: -0.01em !important;
}
td {
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--line-subtle) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
}
tbody tr:hover td {
  background: #f4f6fa !important;
}
td input, td select {
  font-variant-numeric: tabular-nums;
}

/* 分段选择器 (Segmented Control) */
.pill-tabs {
  display: inline-flex;
  background: var(--surface-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-border);
  gap: 2px;
}
.pill-tab {
  padding: 5px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pill-tab:hover {
  color: var(--text-primary);
}
.pill-tab.on {
  background: #ffffff;
  color: var(--accent-brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* UI Motion Toast 弹窗通知 (符合 anti-cheap 规范，顶部轻微回弹) */
.ui-toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(440px, 92vw);
}
.ui-toast-banner {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 16px 40px rgba(15, 31, 69, 0.28), 0 2px 6px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: toastIn 0.32s var(--spring-bounce) both;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ui-toast-banner.dismissing {
  animation: toastOut 0.22s var(--ease-in) forwards;
}
.ui-toast-banner.ui-toast-ok { background: rgba(16, 185, 129, 0.96); }
.ui-toast-banner.ui-toast-err { background: rgba(239, 68, 68, 0.96); }
.ui-toast-banner.ui-toast-ai { background: linear-gradient(135deg, #1d4ed8, #7c3aed); }
.ui-toast-icon { display: flex; align-items: center; flex: none; font-size: 18px; }
.ui-toast-msg { flex: 1; min-width: 0; line-height: 1.4; word-break: break-all; }
.ui-toast-action {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ui-toast-action:hover { background: rgba(255, 255, 255, 0.35); }
.ui-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.ui-toast-bar {
  height: 100%;
  width: 100%;
  background: #ffffff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.92); }
}

/* 空状态向量插画与指引 (Empty States) */
.ui-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  animation: emptyIn 0.35s var(--ease-out) both;
}
.ui-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--hm-text-title);
  margin: 16px 0 6px;
}
.ui-empty-sub {
  font-size: 12.5px;
  color: var(--hm-text-muted);
  max-width: 360px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.ui-empty-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@keyframes emptyIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 骨架屏微动 (Shimmer Skeleton) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.m-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite var(--ease-in-out);
  border-radius: 8px;
}

/* ==========================================================================
   Image Studio (图片工坊) 样式
   ========================================================================== */
.studio-modal {
  width: 1080px !important;
  max-width: 95vw !important;
  height: 88vh !important;
  max-height: 900px !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 20px !important;
  box-shadow: var(--hm-shadow-modal) !important;
}

.studio-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hm-border);
  background: #ffffff;
  border-radius: 20px 20px 0 0;
}
.studio-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.studio-icon {
  font-size: 26px;
}
.studio-title h3 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--hm-text-title);
  margin: 0;
}
.studio-sub {
  font-size: 11.5px;
  color: var(--hm-text-muted);
  margin-top: 3px;
}

.studio-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: #f8faff;
}

.studio-panel-left {
  width: 380px;
  flex: none;
  border-right: 1px solid var(--hm-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.studio-sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--hm-text-title);
  margin-bottom: 12px;
}

.studio-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.studio-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-right: 4px;
}

.st-thumb-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--hm-border);
  background: #f1f5fd;
  overflow: hidden;
  cursor: pointer;
  transition: var(--hm-transition);
}
.st-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.st-thumb-card:hover {
  border-color: var(--hm-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10, 89, 247, 0.15);
}
.st-thumb-card.sel {
  border-color: var(--hm-primary) !important;
  box-shadow: 0 0 0 3px rgba(10, 89, 247, 0.25) !important;
}
.st-thumb-card.main-thumb {
  border-color: #F59E0B;
}

.st-main-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.st-idx-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: rgba(15, 31, 69, 0.7);
  color: #fff;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 6px;
  z-index: 2;
}

.st-thumb-ops {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  gap: 4px;
  z-index: 3;
}
.st-thumb-card:hover .st-thumb-ops {
  display: flex;
}
.st-op-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.st-op-btn.del { color: var(--hm-danger); }
.st-op-btn:hover { transform: scale(1.1); }

.studio-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  overflow-y: auto;
}

.studio-canvas-wrap {
  flex: 1;
  min-height: 320px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--hm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-bottom: 16px;
  padding: 16px;
}
#studioCanvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.studio-controls {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--hm-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ctrl-label {
  width: 90px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hm-text-muted);
  flex: none;
}

.studio-ft {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--hm-border);
  background: #ffffff;
  border-radius: 0 0 20px 20px;
}

/* ==========================================================================
   Desktop vs Mobile Responsive Engine (全面卡片流重构)
   ========================================================================== */

/* 桌面端 (宽度 > 860px) 保持大表格与全宽布局 */
@media (min-width: 861px) {
  .mobile-card-stream { display: none !important; }
  #mobileBottomNav { display: none !important; }
  .desktop-table-wrap { display: block; }
}

/* ==========================================================================
   移动端 (宽度 <= 860px) 终极重构：比例校准、紧凑顶栏、卡片流与原生 Dock
   ========================================================================== */
@media (max-width: 860px) {
  /* 根容器与视口溢出约束（彻底消除横向拉扯与背景空白） */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
    -webkit-text-size-adjust: 100% !important;
  }
  .app {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  .main {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }

  /* 抽屉侧边栏与遮罩 */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    max-width: 82vw !important;
    z-index: 10001 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.26s var(--spring-smooth) !important;
    box-shadow: 4px 0 32px rgba(4, 16, 48, 0.35) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .scrim {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    display: none;
  }
  .scrim.show {
    display: block !important;
  }

  /* 顶部栏极致精简：高度定死 52px，彻底杜绝换行挤压与垂直溢出 */
  .topbar {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid var(--hm-border) !important;
    box-shadow: 0 1px 6px rgba(15, 34, 78, 0.02) !important;
  }
  .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }
  #navBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    color: var(--hm-text-title, #0f1f45) !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
  }
  #navBtn:active {
    background: rgba(226, 232, 240, 0.6) !important;
    transform: scale(0.94) !important;
  }
  .topbar h1, #pageTitle {
    font-size: 15.5px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 130px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    flex-shrink: 1 !important;
    color: var(--hm-text-title, #0f1f45) !important;
  }
  /* 手机端隐藏顶栏冗余的店铺药丸，把空间留给标题 */
  #topShopPill {
    display: none !important;
  }

  /* 顶部栏右侧：隐藏桌面端冗余按钮，只保留超紧凑 AI 胶囊与用户头像 */
  .topbar-right, .topbar .right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  .top-desk-btn,
  .topbar .right button[onclick*="go('manual')"],
  .topbar .right button[onclick*="go('collect')"],
  .topbar .right .btn.pri,
  .topbar #topLogoutBtn {
    display: none !important;
  }
  /* AI Chip 紧凑化，绝不换行，杜绝挤压 */
  #aiChip {
    padding: 4px 8px !important;
    font-size: 11px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    line-height: 1 !important;
  }
  #aiChip .dot {
    width: 6px !important;
    height: 6px !important;
  }
  #aiChip .ai-text,
  #aiChip .ai-chip-txt {
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  /* 用户药丸：在移动端只保留纯圆头像，隐藏文本 */
  #topUserPill {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #topUserPill .user-text,
  #topUserPill .user-role,
  #topUserPill span {
    display: none !important;
  }
  #topUserPill > div:first-child {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  /* 页面内边距与留白（底部预留 76px 给手机底栏） */
  .content {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 12px 12px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 问候卡片 */
  .hero {
    padding: 14px 16px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%) !important;
    border: 1px solid rgba(191, 219, 254, 0.6) !important;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.04) !important;
  }
  .hero h2 {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #1E3A8A !important;
    margin-bottom: 3px !important;
    line-height: 1.35 !important;
  }
  .hero p {
    font-size: 11.5px !important;
    color: #3B82F6 !important;
    line-height: 1.45 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .hero .art {
    display: none !important;
  }

  /* KPI 卡片优化：前 4 张为 2x2 规整网格，第 5 张横跨满行成为横向统计条 */
  .kpis {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .kpis .kpi:nth-child(5) {
    grid-column: 1 / -1 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 14px !important;
  }
  .kpis .kpi:nth-child(5) .v {
    margin-top: 0 !important;
  }
  .kpis .kpi:nth-child(5):after {
    display: none !important;
  }
  .kpi {
    padding: 12px 12px 10px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 3px rgba(15, 34, 78, 0.03) !important;
  }
  .kpi .lb {
    font-size: 11px !important;
    color: var(--hm-text-muted, #64748b) !important;
  }
  .kpi .v {
    font-size: 19px !important;
    font-weight: 700 !important;
    margin-top: 4px !important;
    color: var(--hm-text-title, #0f1f45) !important;
    letter-spacing: -0.02em !important;
  }
  .kpi .up, .kpi .hint {
    font-size: 10px !important;
    margin-top: 2px !important;
  }

  /* 图表与栅格 */
  .row2, .row3 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }
  .panel {
    border-radius: 14px !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 4px rgba(15, 34, 78, 0.03) !important;
  }
  .panel .hd {
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .panel .hd .t {
    font-size: 13px !important;
    font-weight: 700 !important;
  }
  .panel .hd .hint {
    display: none !important;
  }
  .panel .bd {
    padding: 8px 12px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 快速入口卡片 */
  .quick {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .quick .q {
    padding: 10px 10px !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    transition: transform 0.15s var(--spring-bounce) !important;
  }
  .quick .q:active {
    transform: scale(0.96) !important;
  }
  .quick .q .ic {
    margin-bottom: 2px !important;
    color: var(--hm-primary, #0A59F7) !important;
  }
  .quick .q b {
    font-size: 12.5px !important;
    color: var(--hm-text-title, #0f1f45) !important;
  }
  .quick .q span {
    font-size: 10px !important;
    color: var(--hm-text-muted, #64748b) !important;
    line-height: 1.3 !important;
  }

  /* 商品管理搜索区 & 工具条移动端自适应 */
  #peSearch {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    background: #F8FAFC !important;
  }
  #peSearch label {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #475569 !important;
  }
  #peSearch input, #peSearch select {
    width: 100% !important;
    min-width: unset !important;
    box-sizing: border-box !important;
    height: 34px !important;
    font-size: 12px !important;
  }
  #peSearch button {
    height: 34px !important;
    width: 100% !important;
    font-size: 12px !important;
  }
  #peBar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    background: #F8FAFC !important;
  }
  #peBar button {
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    flex: 1 1 auto !important;
  }

  /* 页签横向滑动优化 */
  .tabs {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    gap: 6px !important;
  }
  .tabs .t {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 7px 12px !important;
  }

  /* 隐藏 PC 多列表格，展示触控卡片流 */
  .desktop-table-wrap { display: none !important; }
  #v-products table, #v-collect table, #v-orders table { display: none !important; }

  /* 移动端卡片流容器 */
  .mobile-card-stream {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }

  /* 移动端商品/采集/订单卡片通用规范 */
  .m-card {
    background: #ffffff !important;
    border-radius: 14px !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 2px 8px rgba(15, 34, 78, 0.04) !important;
    padding: 12px 12px 10px !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    transition: transform 0.18s var(--spring-bounce), box-shadow 0.18s ease !important;
    animation: mCardIn 0.32s var(--ease-out) calc(var(--i, 0) * 35ms) both;
  }
  .m-card:active {
    transform: scale(0.98) !important;
  }

  @keyframes mCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* 卡片顶部信息条 */
  .m-card-hd {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 11px !important;
  }
  .m-card-shop {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #64748b !important;
    font-weight: 500 !important;
  }
  .m-shop-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #10B981 !important;
  }
  .m-card-badges {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .m-badge {
    padding: 2px 7px !important;
    border-radius: 10px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
  }
  .m-badge-on { background: #ECFDF5; color: #059669; }
  .m-badge-wait { background: #EFF6FF; color: #2563EB; }
  .m-badge-stop { background: #FEF2F2; color: #DC2626; }
  .m-badge-star { background: #FFFBEB; color: #D97706; display: flex; align-items: center; gap: 3px; }

  /* 卡片主体：图片 + 详情 */
  .m-card-body {
    display: flex !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }
  .m-card-media {
    position: relative !important;
    width: 76px !important;
    height: 76px !important;
    flex: none !important;
    border-radius: 10px !important;
    border: 1px solid #EEF2FA !important;
    overflow: hidden !important;
    background: #F8FAFC !important;
  }
  .m-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .m-score-tag {
    position: absolute !important;
    bottom: 2px !important;
    right: 2px !important;
    background: rgba(15, 23, 42, 0.78) !important;
    color: #fff !important;
    font-size: 8.5px !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
  }

  .m-card-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
  }
  .m-card-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--hm-text-title, #0f1f45) !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-all !important;
  }
  .m-card-meta {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .m-chip-code {
    font-family: ui-monospace, SFMono-Regular, monospace !important;
    font-size: 10.5px !important;
    color: #475569 !important;
    background: #F1F5F9 !important;
    padding: 1px 5px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
  }
  .m-stock-tag {
    font-size: 10.5px !important;
    color: #059669 !important;
    background: #ECFDF5 !important;
    padding: 1px 5px !important;
    border-radius: 5px !important;
    font-weight: 500 !important;
  }
  .m-stock-tag.out {
    color: #DC2626 !important;
    background: #FEF2F2 !important;
  }
  .m-card-price-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    margin-top: 2px !important;
  }
  .m-price-rub {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--hm-primary, #0A59F7) !important;
  }
  .m-price-old {
    font-size: 11px !important;
    color: #94A3B8 !important;
    text-decoration: line-through !important;
  }
  .m-profit-tag {
    font-size: 10px !important;
    color: #D97706 !important;
    background: #FFFBEB !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
  }

  /* 卡片底部操作栏 */
  .m-card-ft {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding-top: 8px !important;
    border-top: 1px solid #F1F5F9 !important;
  }
  .m-btn {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    border: 1px solid var(--hm-border) !important;
    background: #ffffff !important;
    color: var(--hm-text-body) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: var(--hm-transition) !important;
    user-select: none !important;
  }
  .m-btn.pri {
    background: var(--hm-primary-gradient) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(10, 89, 247, 0.22) !important;
  }
  .m-btn.m-btn-icon {
    flex: none !important;
    width: 36px !important;
    padding: 0 !important;
    color: #64748B !important;
  }
  .m-btn:active {
    transform: scale(0.96) !important;
  }

  /* 抽屉手柄 */
  .sheet-drag-handle {
    width: 36px !important;
    height: 4px !important;
    border-radius: 2px !important;
    background: #CBD5E1 !important;
    margin: 8px auto 4px !important;
    display: block !important;
    cursor: grab !important;
  }

  /* 弹窗在手机上表现为 Bottom Sheet */
  .modal, .peModal {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    align-self: flex-end !important;
    margin: 0 !important;
    animation: msheet 0.3s var(--spring-smooth) both !important;
  }
  .mask:not(#loginMask) {
    align-items: flex-end !important;
    padding: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(8px) !important;
  }

  @keyframes msheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* 移动端底部常驻导航条 (Bottom Navigation Dock) */
  #mobileBottomNav {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 -4px 16px rgba(15, 34, 78, 0.06) !important;
    z-index: 9998 !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
  }

  .mb-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    font-size: 10px !important;
    color: #64748B !important;
    text-decoration: none !important;
    flex: 1 !important;
    height: 100% !important;
    transition: transform 0.2s var(--spring-bounce), color 0.15s ease !important;
    position: relative !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
  }
  .mb-nav-item:active {
    transform: scale(0.92) !important;
  }
  .mb-nav-item.on {
    color: var(--hm-primary, #0A59F7) !important;
    font-weight: 700 !important;
  }
  .mb-nav-item .ui-icon {
    width: 19px !important;
    height: 19px !important;
    transition: transform 0.2s var(--spring-bounce) !important;
  }
  .mb-nav-item.on .ui-icon {
    transform: scale(1.15) !important;
  }
  .mb-nav-item .mb-dot {
    width: 4px !important;
    height: 4px !important;
    border-radius: 50% !important;
    background: var(--hm-primary, #0A59F7) !important;
    position: absolute !important;
    bottom: 4px !important;
    display: none !important;
  }
  .mb-nav-item.on .mb-dot {
    display: block !important;
  }

  /* 图片工坊手机端自适应 */
  .studio-modal {
    height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .studio-body {
    flex-direction: column !important;
  }
  .studio-panel-left {
    width: 100% !important;
    max-height: 200px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--hm-border) !important;
  }
  .studio-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .studio-canvas-wrap {
    min-height: 190px !important;
  }

  /* 悬浮任务监控窗口手机端避让底部导航栏 */
  .monitor {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 9990 !important;
  }
}

/* ==========================================================================
   特征属性与变体管理 (OZON 专业 ERP 矩阵与双语强化)
   ========================================================================== */
.peSecTitleRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #2563eb;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}
.peAttrGroupTitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin: 14px 0 8px;
}
.peAttrGrid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
@media (max-width: 900px) {
  .peAttrGrid2 {
    grid-template-columns: 1fr;
  }
}
.peAttrRow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.peAttrLabel {
  width: 175px;
  flex-shrink: 0;
  font-size: 12px;
  color: #475569;
  text-align: right;
  line-height: 1.3;
}
.peAttrInputWrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.peAddBtn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #2563eb;
  color: #2563eb;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.peAddBtn:hover {
  background: #2563eb;
  color: #fff;
  transform: scale(1.08);
}
.peVariantsTableWrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 8px;
  background: #fff;
}
.peVariantsTable {
  width: 100%;
  min-width: 1360px;
  border-collapse: collapse;
  font-size: 12px;
}
.peVariantsTable th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.peVariantsTable td {
  padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.peBatchLink {
  display: inline-block;
  font-size: 11px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 400;
  margin-top: 2px;
  cursor: pointer;
}
.peBatchLink:hover {
  text-decoration: underline;
}
.peSinp {
  width: 100%;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  box-sizing: border-box;
}
.peSinp:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* ==========================================================================
 * 全局搜索框与输入控件现代化统一 (HarmonyOS Search & Form System)
 * 彻底消除原生浏览器 90 年代 3D 边框，实现全局苹果/鸿蒙级别质感
 * ========================================================================== */

/* 全局输入框基础 */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="password"],
input:not([type]),
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
}

input[type="text"]:hover,
input[type="search"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input:not([type]):hover,
textarea:hover {
  border-color: #94a3b8 !important;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input:not([type]):focus,
textarea:focus {
  border-color: #0A59F7 !important;
  box-shadow: 0 0 0 3px rgba(10, 89, 247, 0.14), 0 1px 3px rgba(10, 89, 247, 0.08) !important;
  background-color: #ffffff !important;
}

/* 全平台核心搜索框专属精致样式 (放大镜图标 + 优雅圆角) */
#peQOffer, #peQSku, #peQName,
#cbQ, #attrLibSearch, #attrPickSearch,
#clPickQ, #cmQ, #dictQ, #odFNo, #odFOffer {
  height: 36px !important;
  padding: 6px 14px 6px 34px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 15px 15px !important;
  font-size: 13px !important;
  color: #1e293b !important;
  outline: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, color 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important, opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#peQOffer:focus, #peQSku:focus, #peQName:focus,
#cbQ:focus, #attrLibSearch:focus, #attrPickSearch:focus,
#clPickQ:focus, #cmQ:focus, #dictQ:focus, #odFNo:focus, #odFOffer:focus {
  border-color: #0A59F7 !important;
  box-shadow: 0 0 0 3px rgba(10, 89, 247, 0.16), 0 2px 6px rgba(10, 89, 247, 0.1) !important;
  background-color: #ffffff !important;
}

/* 下拉菜单 (Select) 美化 */
select, #peQShop, #cbFilterStatus, #odFStatus {
  height: 36px !important;
  padding: 0 30px 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 10px) center !important;
  background-size: 11px 11px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
  font-size: 13px !important;
  color: #334155 !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: background-color 0.2s ease !important, border-color 0.2s ease !important, color 0.2s ease !important, opacity 0.2s ease !important;
}
select:hover, #peQShop:hover, #cbFilterStatus:hover, #odFStatus:hover {
  border-color: #94a3b8 !important;
}
select:focus, #peQShop:focus, #cbFilterStatus:focus, #odFStatus:focus {
  border-color: #0A59F7 !important;
  box-shadow: 0 0 0 3px rgba(10, 89, 247, 0.14) !important;
}

/* ==========================================================================
 * 全局按钮现代化质感全面升级 (HarmonyOS Button System)
 * ========================================================================== */
button, .btn, .m-btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-font-smoothing: antialiased !important;
  outline: none !important;
}

/* 默认标准按钮 (优雅白色微卡片) */
.btn, .m-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 16px !important;
  border-radius: 9px !important;
  border: 1px solid #dcdfe6 !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: background-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important, border-color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important, color 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important, opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  white-space: nowrap !important;
}
.btn:hover, .m-btn:hover {
  border-color: #0A59F7 !important;
  color: #0A59F7 !important;
  background: #f8faff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(10, 89, 247, 0.15) !important;
}
.btn:active, .m-btn:active {
  transform: scale(0.97) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* 主要行动按钮 (高定科技蓝渐变) */
.btn.pri, .m-btn.pri {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: 1px solid #1d4ed8 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28) !important;
}
.btn.pri:hover, .m-btn.pri:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42) !important;
  color: #ffffff !important;
  transform: translateY(-1.5px) !important;
}

/* 危险/删除按钮 */
.btn.danger, .m-btn.danger {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}
.btn.danger:hover, .m-btn.danger:hover {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15) !important;
}

/* 小按钮规格 (sm) */
.btn.sm, .m-btn.sm {
  height: 30px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

/* 幽灵/文字按钮 (ghost) */
.btn.ghost {
  border-color: transparent !important;
  background: transparent !important;
  color: #64748b !important;
  box-shadow: none !important;
}
.btn.ghost:hover {
  background: #f1f5f9 !important;
  color: #0A59F7 !important;
}

/* 任务监控浮窗高级质感与拖动样式 */
#monitor {
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  backdrop-filter: blur(8px) !important;
  transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}
#monitor.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32) !important;
  transform: scale(1.02) !important;
}
#monitorHead {
  cursor: grab !important;
  user-select: none !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
#monitorHead:active {
  cursor: grabbing !important;
}

/* ================= 移动端/窄屏响应式增强修复 (Bug M1 - M6) ================= */
@media (max-width: 860px) {
  /* M1: 确保内容区底部预留空间，不被底部导航 Dock 遮挡 */
  .content {
    padding-bottom: 84px !important;
  }

  /* M6: 模态弹窗在移动端自动转为半屏/全屏 BottomSheet，内部自适应滚动，底部保存按钮永不被截断 */
  .mask {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .mask .modal, .mask > div {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 88vh !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px)) !important;
    box-sizing: border-box !important;
  }

  /* M4: 商品列表图片限制尺寸，防止撑破卡片流 */
  .prod-img, .prod-cell img, .m-card-media img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  /* M5: 订单与商品表格横向滚动流畅 */
  .panel > .bd, div[style*="overflow:auto"], div[style*="overflow: auto"] {
    -webkit-overflow-scrolling: touch !important;
  }

  /* M3: 移动端任务监控浮窗定位适配 */
  #monitor {
    max-width: calc(100vw - 20px) !important;
    right: 10px !important;
    bottom: 74px !important;
  }
}
