:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --navy-950: #0a0f1a;
  --navy-900: #111827;
  --navy-800: #1a2744;
  --navy-700: #243b5c;
  --navy-600: #2f4d73;

  --gold-500: #b8954a;
  --gold-400: #d4b872;
  --gold-soft: rgba(184, 149, 74, 0.14);

  --text: #152033;
  --text-muted: #5a6b82;
  --primary: #1a3354;
  --primary-hover: #254770;
  --primary-soft: rgba(26, 51, 84, 0.1);
  --accent: #b8954a;
  --accent-hover: #9a7d3d;
  --required: #c0392b;
  --border: #d8dee8;
  --input-bg: #f8fafc;
  --focus-ring: rgba(26, 51, 84, 0.22);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --app-bg: #f4f9ff;
  --app-surface: #ffffff;
  --app-surface-muted: #f4f6fa;
  --app-surface-alt: #e8ecf3;
  --app-border: #dde3ed;
  --app-border-strong: #c5cedc;
  --app-text: #152033;
  --app-text-muted: #5a6b82;
  --app-table-head: #eef2f8;
  --app-table-row-alt: #f7f9fc;
  --app-table-foot: #e4eaf3;
  --app-modal-bg: rgba(10, 15, 26, 0.55);
  --app-sidebar-bg: #123f70;
  --app-sidebar-text: #f4f8fd;
  --app-sidebar-muted: #b8cbe0;
  --app-sidebar-hover: rgba(255, 255, 255, 0.1);
  --app-sidebar-active-bg: rgba(255, 255, 255, 0.18);
  --app-sidebar-accent: #a8c9eb;
  /* 财务管理菜单专用灰黄色（不再用绿色） */
  --nav-finance-accent: #c9b978;
  --nav-finance-accent-strong: #e0d49c;
  --app-sidebar-border: rgba(0, 0, 0, 0.22);
  --analysis-accent: #1a5f7a;
  --analysis-accent-bright: #2a8fad;
  --analysis-accent-soft: rgba(26, 95, 122, 0.12);
  --analysis-card-bg: rgba(255, 255, 255, 0.92);
  --analysis-card-border: rgba(26, 95, 122, 0.18);
  --analysis-grid-line: rgba(26, 95, 122, 0.06);
  --analysis-text-dim: #5a6b82;

  --toast-success: #0d7a5c;
  --toast-success-bg: #ecfdf5;
  --toast-success-border: #a7f3d0;
  --toast-error: #b42318;
  --toast-error-bg: #fef3f2;
  --toast-error-border: #fecdca;
  --toast-info: #1a3354;
  --toast-info-bg: #f0f4fa;
  --toast-info-border: #c5d4e8;
  --toast-warning: #92610a;
  --toast-warning-bg: #fffbeb;
  --toast-warning-border: #fde68a;
}

html[data-theme="dark"] {
  --text: #e8edf5;
  --text-muted: #94a3b8;
  --primary: #5b8fd4;
  --primary-hover: #7aa8e0;
  --primary-soft: rgba(91, 143, 212, 0.16);
  --accent: #d4b872;
  --accent-hover: #e8cc8a;
  --required: #f87171;
  --border: #2d3a4f;
  --input-bg: #1a2332;
  --focus-ring: rgba(91, 143, 212, 0.28);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --app-bg: #0a0f1a;
  --app-surface: #141c2b;
  --app-surface-muted: #1a2332;
  --app-surface-alt: #243044;
  --app-border: #2d3a4f;
  --app-border-strong: #3d4f68;
  --app-text: #e8edf5;
  --app-text-muted: #94a3b8;
  --app-table-head: #1a2332;
  --app-table-row-alt: #141c2b;
  --app-table-foot: #243044;
  --app-modal-bg: rgba(0, 0, 0, 0.72);
  --app-sidebar-bg: #1e2430;
  --app-sidebar-text: #e8edf5;
  --app-sidebar-muted: #a0aec0;
  --app-sidebar-hover: rgba(255, 255, 255, 0.06);
  --app-sidebar-active-bg: #2a3344;
  --app-sidebar-accent: #7a9bb8;
  --nav-finance-accent: #c2b274;
  --nav-finance-accent-strong: #ded199;
  --app-sidebar-border: rgba(255, 255, 255, 0.08);
  --analysis-accent: #5eead4;
  --analysis-accent-bright: #99f6e4;
  --analysis-accent-soft: rgba(94, 234, 212, 0.1);
  --analysis-card-bg: rgba(20, 28, 43, 0.95);
  --analysis-card-border: rgba(94, 234, 212, 0.2);
  --analysis-grid-line: rgba(94, 234, 212, 0.05);
  --analysis-text-dim: #94a3b8;

  --toast-success: #34d399;
  --toast-success-bg: rgba(6, 78, 59, 0.35);
  --toast-success-border: rgba(52, 211, 153, 0.35);
  --toast-error: #fca5a5;
  --toast-error-bg: rgba(127, 29, 29, 0.35);
  --toast-error-border: rgba(252, 165, 165, 0.35);
  --toast-info: #93c5fd;
  --toast-info-bg: rgba(30, 58, 95, 0.45);
  --toast-info-border: rgba(147, 197, 253, 0.3);
  --toast-warning: #fcd34d;
  --toast-warning-bg: rgba(120, 83, 9, 0.35);
  --toast-warning-border: rgba(252, 211, 77, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--app-bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow: auto;
  -webkit-font-smoothing: antialiased;
}

/* —— 登录页：左侧登录 + 右侧深蓝品牌区 —— */
body:not(.app-mode) {
  padding: 0;
  min-height: 100vh;
  justify-content: flex-start;
  align-items: stretch;
  background-color: #ffffff;
  background-image: none;
}

.page-stage {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100vh;
  max-width: none;
  line-height: normal;
  flex-shrink: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
}

.page-bg {
  display: none !important;
}

.form-panel {
  position: relative;
  width: 50%;
  max-width: 50vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  box-sizing: border-box;
  z-index: 1;
  background: #ffffff;
  flex-shrink: 0;
}

.form-panel::before {
  display: none;
}

.login-left-logo-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 33.333%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}

.login-left-logo {
  display: block;
  position: relative;
  top: 20%;
  width: auto;
  height: auto;
  max-width: min(102%, 456px);
  max-height: 105.6%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  user-select: none;
  pointer-events: none;
}

.login-brand-panel {
  position: relative;
  flex: 1 1 50%;
  width: 50%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 70% at 72% 28%, #3a5a9e 0%, transparent 58%),
    radial-gradient(ellipse 70% 60% at 40% 70%, #1a2a52 0%, transparent 55%),
    linear-gradient(160deg, #152044 0%, #0c122c 48%, #070b1a 100%);
}

.login-brand-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0 8%;
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

.login-brand-logo {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-width: 106.6%;
  max-height: 93.6vh;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
  user-select: none;
  pointer-events: none;
}

.login-card {
  position: absolute;
  top: 33.333%;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: calc(100% - 96px);
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 0 24px;
  box-shadow: none;
  box-sizing: border-box;
}

html[data-theme="dark"] .login-card {
  background: transparent;
  border: none;
}

.login-brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.login-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.login-brand-mark {
  display: none;
}

.login-brand-text {
  flex: 1;
  min-width: 0;
}

.system-name {
  display: none;
}

html[data-theme="dark"] .system-name {
  display: none;
}

.form-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1c1e;
  margin-bottom: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.form-title::after {
  display: none;
}

.form-subtitle {
  font-size: 0.9rem;
  color: #8b95a5;
  margin: 10px 0 22px;
  line-height: 1.55;
}

.form-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.field-label .required {
  color: #ef4444;
  margin-left: 4px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 42px;
  padding: 10px 44px 10px 16px;
  font-size: 0.95rem;
  color: #1a1c1e;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input::placeholder {
  color: #a0aec0;
}

.input-wrap input:focus {
  border-color: #4d63ff;
  box-shadow: 0 0 0 3px rgba(77, 99, 255, 0.12);
}

.input-wrap input.error {
  border-color: #ef4444;
}

.region-section {
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.region-section .field-label {
  margin-bottom: 8px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 42px;
  padding: 10px 40px 10px 16px;
  font-size: 0.95rem;
  color: #1a1c1e;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.select-wrap select:focus {
  border-color: #4d63ff;
  box-shadow: 0 0 0 3px rgba(77, 99, 255, 0.12);
}

.select-wrap select.error {
  border-color: #ef4444;
}

.select-wrap select:invalid {
  color: #a0aec0;
}

.select-wrap select option {
  color: #152033;
  background: #ffffff;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.toggle-password:hover {
  color: #4d63ff;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 20px;
  font-size: 0.875rem;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4d63ff;
  cursor: pointer;
  border-radius: 4px;
}

.forgot-link {
  color: #4d63ff;
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  height: 42px;
  padding: 0 20px;
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: #4d63ff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 8px 20px rgba(77, 99, 255, 0.28);
}

.btn-login:hover:not(:disabled) {
  background: #3f54f0;
  box-shadow: 0 10px 24px rgba(77, 99, 255, 0.34);
  transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
  background: #3648e0;
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.field-error {
  font-size: 0.8rem;
  color: var(--required);
  margin-top: 6px;
  display: none;
}

.field-error.show {
  display: block;
}

.toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20000; /* 高于发票弹窗（10000），否则确认回单的提示会被弹窗盖住，看着像“没反应” */
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 40px));
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.toast-item.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-item.hiding {
  opacity: 0;
  transform: translateX(24px);
}

.toast-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left;
  animation: toast-progress 4s linear forwards;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast-item-body {
  flex: 1;
  min-width: 0;
}

.toast-item.success {
  color: var(--toast-success);
  background: var(--toast-success-bg);
  border-color: var(--toast-success-border);
}

.toast-item.error {
  color: var(--toast-error);
  background: var(--toast-error-bg);
  border-color: var(--toast-error-border);
}

.toast-item.info {
  color: var(--toast-info);
  background: var(--toast-info-bg);
  border-color: var(--toast-info-border);
}

.toast-item.warning {
  color: var(--toast-warning);
  background: var(--toast-warning-bg);
  border-color: var(--toast-warning-border);
}

/* legacy single toast (fallback) */
.toast {
  display: none;
}

.hidden {
  display: none !important;
}

body.app-mode {
  background: var(--app-bg);
  align-items: stretch;
  justify-content: center;
  padding: 12px;
  display: flex;
  overflow: auto;
  min-height: 100vh;
  box-sizing: border-box;
}

.app-shell {
  display: none;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--app-surface);
  box-shadow: var(--shadow-lg);
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-text);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-right: 1px solid var(--app-sidebar-border);
}

.sidebar-brand {
  padding: 18px 16px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--app-sidebar-text);
  border-bottom: 1px solid var(--app-sidebar-border);
}

.sidebar-brand::before {
  display: none;
}

.nav-item.active {
  background: var(--app-sidebar-active-bg);
  color: var(--app-sidebar-text);
  box-shadow: inset 3px 0 0 var(--app-sidebar-accent);
  font-weight: 600;
}

.btn-action {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 100%);
  color: #fff;
  transition: filter 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  letter-spacing: 0.01em;
}

.btn-action:hover {
  filter: brightness(1.08);
}

.btn-action.secondary {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border-strong);
  box-shadow: none;
}

.btn-action.secondary:hover {
  background: var(--app-surface-muted);
  border-color: var(--navy-600);
}

.btn-action.danger-outline {
  background: var(--app-surface);
  color: #b42318;
  border: 1px solid #fecdca;
}

.btn-action.danger-outline:hover {
  background: #fef3f2;
  box-shadow: none;
}

.main-header {
  padding: 16px 24px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.main-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--app-text);
}

.content-panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow);
}

/* —— 语言下拉 —— */
.lang-dropdown {
  position: relative;
  display: inline-flex;
}

.lang-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--app-border-strong);
  border-radius: var(--radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.lang-dropdown-trigger:hover,
.lang-dropdown.open .lang-dropdown-trigger {
  border-color: var(--navy-600);
  background: var(--app-surface-muted);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.lang-dropdown-trigger svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.lang-dropdown-chevron {
  transition: transform 0.2s;
}

.lang-dropdown.open .lang-dropdown-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.lang-dropdown-menu.hidden {
  display: none;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--app-text);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.lang-dropdown-item:hover {
  background: var(--app-surface-muted);
}

.lang-dropdown-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.lang-dropdown-item .lang-check {
  width: 16px;
  opacity: 0;
  color: var(--accent);
}

.lang-dropdown-item.active .lang-check {
  opacity: 1;
}

.login-lang-dropdown .lang-dropdown-trigger {
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #4b5563;
  padding: 7px 12px;
  box-shadow: none;
}

.login-lang-dropdown .lang-dropdown-trigger:hover,
.login-lang-dropdown.open .lang-dropdown-trigger {
  background: #e5e7eb;
  border-color: transparent;
  box-shadow: none;
}

.login-lang-dropdown .lang-dropdown-trigger svg {
  color: #6b7280;
}

html[data-theme="dark"] .login-lang-dropdown .lang-dropdown-trigger {
  background: #f3f4f6;
  border-color: transparent;
  color: #4b5563;
}

.btn-theme-toggle {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--app-border-strong);
  border-radius: var(--radius-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-theme-toggle:hover {
  background: var(--app-surface-muted);
  border-color: var(--navy-600);
}

body.app-mode .app-shell {
  display: flex;
  flex-direction: row;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-text);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-right: 1px solid var(--app-sidebar-border);
}

.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.main-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-lang-toggle,
.lang-btn {
  border: 1px solid var(--border-subtle, #d6d3d1);
  background: var(--surface-elevated, #fff);
  color: var(--text-primary, #1c1917);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.2;
}

.btn-lang-toggle:hover,
.lang-btn:hover {
  border-color: var(--accent, #0d9488);
  color: var(--accent, #0d9488);
}

.lang-btn.active {
  background: var(--accent, #0d9488);
  border-color: var(--accent, #0d9488);
  color: #fff;
}

.login-lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.sidebar-user {
  padding: 10px 16px;
  font-size: 0.78rem;
  color: var(--app-sidebar-muted);
  border-bottom: 1px solid var(--app-sidebar-border);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

#nav-group-finance {
  order: 90;
}

#nav-wallet {
  order: 91;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--app-sidebar-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--app-sidebar-hover);
  color: var(--app-sidebar-text);
}

.nav-item.active {
  background: var(--app-sidebar-active-bg);
  color: var(--app-sidebar-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--app-sidebar-accent);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-footer {
  padding: 12px 8px 14px;
  border-top: 1px solid var(--app-sidebar-border);
}

.btn-logout {
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--app-sidebar-muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--app-sidebar-text);
  border-color: rgba(255, 255, 255, 0.24);
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--app-bg);
  border-left: 1px solid var(--border);
}

.main-header {
  padding: 20px 28px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.main-header-text {
  min-width: 0;
}

.btn-theme-toggle {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-theme-toggle:hover {
  background: var(--app-surface-alt);
  border-color: var(--app-border-strong);
}

body.app-mode .main-header {
  padding: 12px 18px;
}

body.app-mode .main-header h2 {
  font-size: 1.1rem;
}

.main-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.main-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.main-content {
  flex: 1;
  padding: 20px 24px 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.app-mode .main-content {
  padding: 10px 14px 14px;
}

.content-panel {
  display: none;
  background: var(--app-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

.content-panel.active {
  display: flex;
  display: block;
}
/* 通知中心：通知条数多时会超出父容器被裁掉（父级 main-content 是 overflow:hidden），
   这里让面板自身可纵向滚动，并在右侧常显一条可拖动的滚动条。 */
#panel-notifications.content-panel.active {
  max-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
#panel-notifications.content-panel.active::-webkit-scrollbar {
  width: 10px;
}
#panel-notifications.content-panel.active::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
}
#panel-notifications.content-panel.active::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#panel-notifications.content-panel.active::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
  background-clip: padding-box;
}
/* 订单（导入表格创建 / 直接上传）内容比一屏长：面板允许纵向滚动，
   否则下方的数据表格会被裁到视口外，看起来像"没有数据"。 */
#panel-inbound-import.content-panel.active,
#panel-batch-upload.content-panel.active {
  overflow-y: auto;
  overflow-x: hidden;
}
/* 互动聊天布局：面板定高 + 消息区内滚 + 输入框钉死，输入框永远可见 */
#panel-interaction.content-panel.active,
#panel-ai-reply.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#panel-interaction .im-layout,
#panel-ai-reply .im-layout {
  flex: 1;
  min-height: 0;
}
#panel-interaction .im-side,
#panel-interaction .im-chat,
#panel-interaction .im-chat-msgs-wrap,
#panel-ai-reply .im-side,
#panel-ai-reply .im-chat,
#panel-ai-reply .im-chat-msgs-wrap {
  min-height: 0;
}
#panel-interaction .im-messages,
#panel-ai-reply .im-messages {
  min-height: 0;
  max-height: none;
}
#panel-interaction .im-composer,
#panel-ai-reply .im-composer {
  flex-shrink: 0;
}

#panel-meeting.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#panel-meeting .meeting-lobby {
  flex-shrink: 0;
}
#panel-inbound-import.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* 上传区较高时下面的数据表格会被裁到视口外（看起来像"没有数据"），
     所以面板本身要能纵向滚动 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 10px;
}

#panel-inbound-import.content-panel.active > .panel-title-row {
  margin: 0 0 2px;
}

#panel-inbound-import.content-panel.active > .panel-title-row h3 {
  font-size: 1.05rem;
}

#panel-inbound-import.content-panel.active > .inbound-intro {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0 0 4px;
  flex-shrink: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.panel-title-row h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-refresh-view {
  flex-shrink: 0;
}

.content-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.content-panel p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

#panel-inbound-import .panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 4px;
  flex-shrink: 0;
}

#panel-inbound-import .panel-toolbar .btn-action {
  padding: 7px 14px;
  font-size: 0.84rem;
}

#panel-inbound-import .toolbar-maker-label {
  font-size: 0.84rem;
}

#panel-inbound-import .toolbar-maker {
  gap: 6px;
}

#panel-inbound-import .toolbar-maker .filter-region-select {
  min-width: 140px;
  padding: 5px 8px;
  font-size: 0.82rem;
}

#panel-inbound-import .import-maker-hint {
  font-size: 0.72rem;
  margin: 0 0 2px;
  line-height: 1.3;
}

#panel-inbound-import .import-meta {
  margin: 0 0 4px;
  font-size: 0.72rem;
  line-height: 1.3;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 12px;
}

.toolbar-maker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-maker-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.toolbar-maker .filter-region-select {
  min-width: 160px;
}

.toolbar-maker .required {
  color: #ef4444;
  margin-left: 2px;
}

.toolbar-maker .filter-region-select.import-maker-missing {
  border-color: #ef4444;
  background: #fef2f2;
}

.import-maker-hint {
  font-size: 0.8rem;
  color: #dc2626;
  margin: 0 0 4px;
  flex-shrink: 0;
}

.import-maker-hint.hidden {
  display: none;
}

.btn-action.is-view-only,
.btn-action.is-view-only:hover {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.toolbar-spacer {
  flex: 1;
}

.btn-action {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(28, 36, 48, 0.08);
}

.btn-action:hover {
  background: var(--primary-hover);
}

.btn-action.secondary {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-action.secondary:hover {
  background: var(--app-surface-muted);
}

.btn-action.danger-outline {
  background: var(--app-surface);
  color: #c0392b;
  border: 1px solid #e8b4b0;
}

.btn-action.danger-outline:hover {
  background: #fdf2f2;
  box-shadow: none;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 8px;
  padding: 14px 16px;
  background: var(--app-surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--app-border);
}

.filter-bar.hidden {
  display: none;
}

.filter-bar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.filter-inline-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--app-text);
  white-space: nowrap;
}

.filter-sep {
  font-size: 0.9rem;
  color: var(--app-text-muted);
  white-space: nowrap;
}

.filter-date,
.filter-time,
.filter-region-select {
  padding: 7px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--app-text);
  outline: none;
}

.filter-datetime-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-datetime-row .filter-bar-spacer {
  flex: 1;
  min-width: 12px;
}

.filter-datetime-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.btn-filter-reset-green {
  color: var(--app-text) !important;
  border-color: var(--app-border-strong) !important;
  background: var(--app-surface) !important;
  box-shadow: none !important;
  font-weight: 600;
}

.btn-filter-reset-green:hover {
  color: var(--app-text) !important;
  border-color: var(--navy-600) !important;
  background: var(--app-surface-muted) !important;
  box-shadow: none !important;
}

.filter-date {
  min-width: 142px;
}

.filter-time {
  min-width: 108px;
}

.filter-date:focus,
.filter-time:focus,
.filter-region-select:focus,
.filter-field input:focus {
  border-color: #9ca3af;
  box-shadow: none;
}

.filter-region-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-right: 4px;
}

.filter-region-select {
  padding-right: 28px;
  min-width: 120px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.filter-region-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.filter-region-hint.hidden,
.filter-region-row.hidden {
  display: none;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  flex: 1;
}

.filter-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
}

.filter-field input {
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.filter-highlight-ticket,
.filter-highlight-code {
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.filter-bar label[for="filter-ticket"],
.filter-bar label[for="filter-code"],
.filter-bar label[for="out-filter-ticket"],
.filter-bar label[for="out-filter-code"],
.filter-bar label[for="qry-filter-ticket"],
.filter-bar label[for="qry-filter-code"],
.filter-bar label[for="veh-view-filter-ticket"],
.filter-bar label[for="veh-view-filter-code"],
.filter-highlight-ticket label,
.filter-highlight-code label {
  color: var(--app-text);
  font-weight: 500;
}

.filter-bar input[id="filter-ticket"],
.filter-bar input[id="filter-code"],
.filter-bar input[id="out-filter-ticket"],
.filter-bar input[id="out-filter-code"],
.filter-bar input[id="qry-filter-ticket"],
.filter-bar input[id="qry-filter-code"],
.filter-bar input[id="veh-view-filter-ticket"],
.filter-bar input[id="veh-view-filter-code"],
.filter-highlight-ticket input,
.filter-highlight-code input {
  border-color: var(--border);
  background: var(--input-bg);
}

.filter-bar input[id$="filter-ticket"]:focus,
.filter-bar input[id$="filter-code"]:focus,
.filter-highlight-ticket input:focus,
.filter-highlight-code input:focus {
  border-color: #9ca3af;
  box-shadow: none;
  background: var(--input-bg);
}

/* ==== 创建订单页筛选区：去掉重复的制单人/发货人（顶部已有），美化剩余筛选项 ==== */
#filter-bar .filter-field:has(#filter-maker),
#filter-bar .filter-field:has(#filter-sender),
#inbound-filter-bar .filter-field:has(#filter-sender),
#outbound-filter-bar .filter-field:has(#out-filter-sender),
#query-filter-bar .filter-field:has(#qry-filter-sender) {
  display: none;
}
#filter-bar,
#inbound-filter-bar,
#outbound-filter-bar,
#query-filter-bar {
  border: 1px solid var(--app-border-strong);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
#filter-bar .filter-field label,
#inbound-filter-bar .filter-field label,
#outbound-filter-bar .filter-field label,
#query-filter-bar .filter-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--app-text);
}
#filter-bar .filter-field input,
#filter-bar .filter-region-select,
#filter-bar .filter-date,
#filter-bar .filter-time,
#inbound-filter-bar .filter-field input,
#inbound-filter-bar .filter-region-select,
#inbound-filter-bar .filter-date,
#inbound-filter-bar .filter-time,
#outbound-filter-bar .filter-field input,
#outbound-filter-bar .filter-region-select,
#outbound-filter-bar .filter-date,
#outbound-filter-bar .filter-time,
#query-filter-bar .filter-field input,
#query-filter-bar .filter-region-select,
#query-filter-bar .filter-date,
#query-filter-bar .filter-time {
  border: 1.5px solid var(--app-border-strong);
  font-weight: 600;
  background: var(--input-bg);
}
#filter-bar .filter-field input::placeholder,
#inbound-filter-bar .filter-field input::placeholder,
#outbound-filter-bar .filter-field input::placeholder,
#query-filter-bar .filter-field input::placeholder {
  font-weight: 400;
  opacity: 0.75;
}
#filter-bar .filter-field input:focus,
#filter-bar .filter-region-select:focus,
#filter-bar .filter-date:focus,
#filter-bar .filter-time:focus,
#inbound-filter-bar .filter-field input:focus,
#inbound-filter-bar .filter-region-select:focus,
#inbound-filter-bar .filter-date:focus,
#inbound-filter-bar .filter-time:focus,
#outbound-filter-bar .filter-field input:focus,
#outbound-filter-bar .filter-region-select:focus,
#outbound-filter-bar .filter-date:focus,
#outbound-filter-bar .filter-time:focus,
#query-filter-bar .filter-field input:focus,
#query-filter-bar .filter-region-select:focus,
#query-filter-bar .filter-date:focus,
#query-filter-bar .filter-time:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
#filter-bar .filter-inline-label,
#filter-bar .filter-region-label,
#inbound-filter-bar .filter-inline-label,
#inbound-filter-bar .filter-region-label,
#outbound-filter-bar .filter-inline-label,
#outbound-filter-bar .filter-region-label,
#query-filter-bar .filter-inline-label,
#query-filter-bar .filter-region-label {
  font-weight: 700;
}

.inbound-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.import-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.35;
  flex-shrink: 0;
}

.import-meta.hidden {
  display: none;
}

#panel-inbound-import .filter-bar {
  flex-shrink: 0;
  margin: 0 0 6px;
  padding: 6px 8px;
  gap: 6px;
}

#panel-inbound-import #inbound-cargo-stats {
  flex-shrink: 0;
  margin: 0 0 8px;
}

#panel-inbound-import .filter-bar-row {
  gap: 6px 10px;
}

#panel-inbound-import .filter-field {
  min-width: 118px;
  gap: 3px;
}

#panel-inbound-import .filter-field label {
  font-size: 0.72rem;
}

#panel-inbound-import .filter-field input,
#panel-inbound-import .filter-date,
#panel-inbound-import .filter-time,
#panel-inbound-import .filter-region-select {
  padding: 5px 8px;
  font-size: 0.82rem;
}

#panel-inbound-import .filter-inline-label,
#panel-inbound-import .filter-sep,
#panel-inbound-import .filter-region-label {
  font-size: 0.82rem;
}

#panel-inbound-import .filter-bar .btn-action.secondary {
  padding: 6px 12px;
  font-size: 0.82rem;
}

#panel-outbound.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 14px;
}

#panel-outbound.content-panel.active > .panel-title-row {
  margin: 0 0 4px;
}

#panel-outbound.content-panel.active > .panel-title-row h3 {
  font-size: 1rem;
}

#panel-outbound.content-panel.active > .outbound-intro {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 0 0 6px;
  flex-shrink: 0;
}

#panel-outbound .panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 6px;
  flex-shrink: 0;
}

#panel-outbound .filter-bar {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 8px 10px;
  gap: 8px;
}

#panel-outbound #outbound-cargo-stats {
  flex-shrink: 0;
  margin: 0 0 8px;
}

#panel-outbound .table-viewport-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  max-height: none;
  margin-top: 0;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: transparent;
}

#panel-query.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 14px;
}

#panel-query.content-panel.active > h3 {
  font-size: 1rem;
  margin: 0 0 4px;
  flex-shrink: 0;
}

#panel-query.content-panel.active > .query-intro {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 0 0 6px;
  flex-shrink: 0;
}

.query-scope-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  flex-shrink: 0;
}

.query-scope-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.query-scope-btn.active {
  background: var(--accent, #0d9488);
  border-color: var(--accent, #0d9488);
  color: #fff;
}

#query-data-table.query-readonly-table td,
#query-data-table.query-readonly-table th {
  cursor: default;
}

#query-data-table.query-readonly-table td.cell-selectable:hover {
  background: inherit;
}

#panel-query .filter-bar {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 8px 10px;
  gap: 8px;
}

#panel-query #query-cargo-stats {
  flex-shrink: 0;
  margin: 0 0 8px;
}

#panel-query .table-viewport-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  max-height: none;
  margin-top: 0;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: transparent;
}

#panel-edit.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 10px;
}

#panel-edit.content-panel.active > .panel-title-row {
  margin: 0 0 4px;
}

#panel-edit.content-panel.active > .panel-title-row h3 {
  font-size: 0.95rem;
}

.edit-mode-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.edit-mode-tab {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  background: #fafaf9;
  color: #44403c;
  cursor: pointer;
}

.edit-mode-tab:hover {
  background: #f5f5f4;
  border-color: #a8a29e;
}

.edit-mode-tab.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

.edit-mode-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.edit-mode-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.edit-mode-panel.active {
  display: flex;
}

.edit-mode-panel > .edit-panel-intro {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0 0 4px;
  flex-shrink: 0;
}

.edit-mode-panel .panel-toolbar {
  flex-shrink: 0;
  margin: 0 0 4px;
  gap: 6px;
}

.edit-mode-panel .panel-toolbar .btn-action {
  padding: 7px 14px;
  font-size: 0.84rem;
}

.edit-mode-panel .toolbar-maker-label {
  font-size: 0.84rem;
}

.edit-mode-panel .import-meta {
  margin: 0 0 4px;
  font-size: 0.72rem;
  line-height: 1.3;
}

.edit-mode-panel .filter-bar {
  flex-shrink: 0;
  margin: 0 0 6px;
  padding: 6px 8px;
  gap: 6px;
}

.edit-mode-panel .filter-bar-row {
  gap: 6px 10px;
}

.edit-mode-panel .filter-field {
  min-width: 118px;
  gap: 3px;
}

.edit-mode-panel .filter-field label {
  font-size: 0.72rem;
}

.edit-mode-panel .filter-field input,
.edit-mode-panel .filter-date,
.edit-mode-panel .filter-time,
.edit-mode-panel .filter-region-select {
  padding: 5px 8px;
  font-size: 0.82rem;
}

.edit-mode-panel .filter-inline-label,
.edit-mode-panel .filter-sep,
.edit-mode-panel .filter-region-label {
  font-size: 0.82rem;
}

.edit-mode-panel .filter-bar .btn-action.secondary {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.edit-mode-panel .table-viewport-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  max-height: none;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: transparent;
}

.edit-mode-panel .data-table .edit-select-col {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  text-align: center;
  vertical-align: middle;
  padding: 2px;
  background: transparent;
}

.edit-mode-panel .data-table thead .edit-select-col {
  background: #f1f5f9;
}

.edit-mode-panel .data-table .edit-select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
}

.edit-mode-panel .data-table tr.edit-row-selected td {
  background: #eff6ff;
}

.edit-mode-panel .data-table tr.edit-row-selected .edit-select-col {
  background: #dbeafe;
}

.edit-modify-banner {
  font-size: 0.78rem;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 4px;
  line-height: 1.35;
  flex-shrink: 0;
}

.edit-modify-banner.hidden {
  display: none;
}

.edit-mode-panel .data-table td.cell-editable {
  cursor: text;
}

.edit-mode-panel .data-table td.cell-editing,
.edit-mode-panel .data-table td.cell-selected.cell-editable {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #fff;
}

.edit-mode-panel .data-table td.cell-modified {
  background: #fef9c3;
}

.edit-mode-panel .data-table tr.edit-row-selected td.cell-modified {
  background: #fde68a;
}

.edit-supplement-picker {
  flex-shrink: 0;
  margin: 0 0 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.edit-supplement-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.edit-modify-item-input {
  min-width: 220px;
  padding: 7px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--app-text);
  outline: none;
}

.edit-modify-item-input:focus {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}



.edit-supplement-picker #eds-supplement-vehicle-id {
  min-width: 280px;
  flex: 1;
  max-width: 480px;
}

.edit-supplement-banner {
  font-size: 0.78rem;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 6px;
  line-height: 1.35;
  flex-shrink: 0;
}

.edit-supplement-banner.hidden,
.edit-supplement-picker.hidden,
.edit-supplement-form-wrap.hidden,
.edit-supplement-table-host.hidden {
  display: none !important;
}

.edit-supplement-form-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.edit-supplement-form-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  background: #fff;
  align-content: start;
}

.edit-supplement-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.edit-supplement-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.25;
}

.edit-supplement-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.84rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.edit-supplement-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.edit-supplement-form-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.edit-supplement-form-empty {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 24px;
}

.edit-supplement-unit-price {
  display: flex;
  gap: 8px;
  width: 100%;
}

.edit-supplement-unit-price select {
  flex: 0 0 108px;
  min-width: 0;
}

.edit-supplement-unit-price input {
  flex: 1;
  min-width: 0;
}

.edit-supplement-readonly {
  background: #f8fafc !important;
  color: #64748b !important;
  cursor: default;
}

.inbound-supplement-pick-bar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
}

.inbound-supplement-pick-bar.hidden {
  display: none;
}

.inbound-supplement-pick-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #854d0e;
  line-height: 1.45;
  flex: 1;
  min-width: 200px;
}

.inbound-supplement-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#inbound-data-table tr.inbound-supplement-pick-selected td {
  background: #eff6ff;
}

#edit-panel-supplement.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.outbound-draft-banner {
  font-size: 0.82rem;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 8px;
  flex-shrink: 0;
  line-height: 1.45;
}

.outbound-draft-banner.hidden {
  display: none;
}

.receipt-queue-wrap {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
}
.receipt-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #92400e;
}
.receipt-queue-count {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
}
.receipt-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.receipt-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #fde68a;
}
.receipt-queue-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  font-size: 13px;
  color: #78350f;
  flex: 1;
}
.receipt-label {
  color: #a16207;
  margin-right: 6px;
}
.btn-receipt-confirm {
  flex-shrink: 0;
  white-space: nowrap;
}

#panel-inbound-import .table-viewport-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  max-height: none;
  margin-top: 0;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: transparent;
}

.table-viewport-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  max-height: calc(100vh - 320px);
  margin-top: 12px;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: transparent;
}

.table-viewport-wrap.hidden-hscroll .table-hscroll {
  display: none;
}

.table-viewport {
  flex: 1;
  min-height: 0;
  /* 支持左右移动：触控板双指横扫、Shift+滚轮、原生横向滚动条 */
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #9ca3af #f3f4f6;
  -webkit-overflow-scrolling: touch;
}

.table-hscroll {
  flex-shrink: 0;
  height: 16px;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #9ca3af #f3f4f6;
  /* 横向滚动已由表格区域的原生滚动条承担，这条旧细条隐藏，避免出现两条滚动条 */
  display: none;
}

.table-hscroll-spacer {
  height: 1px;
}

.table-viewport::-webkit-scrollbar,
.table-hscroll::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.table-viewport::-webkit-scrollbar-track,
.table-hscroll::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.table-viewport::-webkit-scrollbar-thumb,
.table-hscroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 7px;
  border: 3px solid #f3f4f6;
}

.table-viewport::-webkit-scrollbar-thumb:hover,
.table-hscroll::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

.data-table {
  width: max-content;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}

/* 账单明细保持标准数据表布局，避免列宽被内容挤成一团 */
.bill-table {
  min-width: 760px;
}
.bill-table:not(.bill-customer-table) th:nth-child(1),
.bill-table:not(.bill-customer-table) td:nth-child(1) { width: 150px; }
.bill-table:not(.bill-customer-table) th:nth-child(2),
.bill-table:not(.bill-customer-table) td:nth-child(2) { width: 100px; }
.bill-table:not(.bill-customer-table) th:nth-child(3),
.bill-table:not(.bill-customer-table) td:nth-child(3) { width: 245px; }
.bill-table:not(.bill-customer-table) th:nth-child(4),
.bill-table:not(.bill-customer-table) td:nth-child(4) { width: 105px; }
.bill-table:not(.bill-customer-table) th:nth-child(5),
.bill-table:not(.bill-customer-table) td:nth-child(5) { width: 90px; text-align: right; }
.bill-table:not(.bill-customer-table) th:nth-child(6),
.bill-table:not(.bill-customer-table) td:nth-child(6) { width: 190px; }

/* 客户账单（按发货人归集，只含运单费用） */
.bill-customer-table {
  min-width: 900px;
}
.bill-customer-table th:nth-child(1),
.bill-customer-table td:nth-child(1) { width: 180px; }
.bill-customer-table th:nth-child(2),
.bill-customer-table td:nth-child(2) { width: 90px; text-align: right; }
.bill-customer-table th:nth-child(n + 3),
.bill-customer-table td:nth-child(n + 3) { width: 122px; text-align: right; }
.bill-customer-table tr.sum-row td {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
}

/* 客户账单：现付 / 提付 / 欠账 / 欠账额度 */
.bill-credit-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 10px;
}
.bill-credit-card {
  flex: 1 1 168px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}
.bill-credit-label {
  font-size: 0.82rem;
  color: #6b7280;
}
.bill-credit-value {
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--app-text);
}
.bill-credit-card.is-over .bill-credit-value {
  color: #dc2626;
}
/* 未付款金额始终标红 */
.bill-credit-card.bill-credit-unpaid .bill-credit-value {
  color: #dc2626;
}
.bill-credit-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bill-credit-edit input {
  width: 118px;
  padding: 5px 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--app-text);
}
.bill-credit-sub {
  font-size: 0.78rem;
  color: #6b7280;
}
.bill-credit-hint {
  margin: 4px 0 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  color: #6b7280;
  border: 1px dashed var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-muted);
}
.bill-port-entry {
  margin-bottom: 10px;
}
/* 钱包 */
.wallet-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 12px;
}
.wallet-card {
  flex: 1 1 190px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}
.wallet-card-label {
  font-size: 0.82rem;
  color: #6b7280;
}
.wallet-card-value {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--app-text);
}
.wallet-card-balance {
  background: linear-gradient(135deg, #eff6ff, var(--app-surface-muted));
  border-color: #bfdbfe;
}
.wallet-card-balance.is-negative .wallet-card-value {
  color: #dc2626;
}
.wallet-transfer-bar {
  margin-bottom: 10px;
}
.wallet-table .wallet-in {
  color: #047857;
  font-weight: 600;
}
.wallet-table .wallet-out {
  color: #dc2626;
  font-weight: 600;
}
/* 钱包收付款 */
.wallet-pay {
  margin: 0 0 14px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
  padding: 12px 16px 16px;
}
.wallet-pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wallet-pay-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--app-text);
}
.wallet-pay-tabs {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 999px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
}
.wallet-pay-tab {
  border: 0;
  background: transparent;
  color: #4b5563;
  padding: 5px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  cursor: pointer;
}
.wallet-pay-tab.is-active {
  background: #1f2937;
  color: #fff;
}
.wallet-pay-body {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.wallet-pay-form {
  flex: 1 1 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
}
.wallet-pay-form .filter-field {
  min-width: 170px;
}
.wallet-pay-hint {
  flex: 1 1 100%;
  font-size: 0.82rem;
  color: #6b7280;
}
.wallet-pay-code {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 10px;
}
.wallet-qr-box {
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wallet-qr-box img {
  width: 132px;
  height: 132px;
  display: block;
}
.wallet-qr-tip {
  font-size: 0.76rem;
  color: #6b7280;
}
.wallet-qr-fallback {
  font-size: 0.76rem;
  color: #b45309;
  text-align: center;
  line-height: 1.4;
}
.wallet-qr-payload {
  margin: 0;
  max-width: 180px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #6b7280;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
}
/* 扫一扫 */
.wallet-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wallet-scan-modal.hidden {
  display: none;
}
.wallet-scan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.wallet-scan-panel {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--app-surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 16px 18px 18px;
}
.wallet-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wallet-scan-head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--app-text);
}
.wallet-scan-body {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.wallet-scan-video-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 280px;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.wallet-scan-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wallet-scan-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: #cbd5e1;
  font-size: 0.84rem;
}
.wallet-scan-placeholder.hidden {
  display: none;
}
.wallet-scan-side {
  flex: 1 1 300px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallet-scan-status {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}
.wallet-scan-label {
  font-size: 0.78rem;
  color: #6b7280;
}
.wallet-scan-manual {
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--app-text);
  resize: vertical;
}
.wallet-scan-result {
  margin-top: 4px;
}
.wallet-scan-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}
.wallet-scan-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: #4b5563;
}
.wallet-scan-row b {
  color: var(--app-text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.wallet-scan-blocked {
  margin: 0;
  font-size: 0.78rem;
  color: #b45309;
}
.wallet-scan-error {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #b45309;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}
/* 支付密码弹窗 */
.wallet-delivery-qr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  text-align: center;
}
.wallet-delivery-qr-center p {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
}
.wallet-pwd-panel {
  width: min(400px, calc(100vw - 32px));
}
.wallet-pwd-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #6b7280;
}
.wallet-pwd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.wallet-pwd-field label {
  font-size: 0.78rem;
  color: #6b7280;
}
.wallet-pwd-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  letter-spacing: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--app-text);
}
.wallet-pwd-error {
  min-height: 18px;
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #dc2626;
}
.wallet-pwd-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.bill-credit-caption {
  margin: 4px 0 6px;
  font-size: 0.82rem;
  color: #6b7280;
}

.datagrid-table th,
.datagrid-table td {
  padding: 6px 10px;
  text-align: left;
  border: 1px solid #e5e7eb;
  vertical-align: middle;
  white-space: nowrap;
  min-width: 64px;
  width: 110px;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.datagrid-table th.col-resizable-th {
  position: relative;
  padding-right: 14px;
}

.datagrid-table .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
  background: linear-gradient(
    to left,
    rgba(148, 163, 184, 0.55) 2px,
    transparent 2px
  );
}

.datagrid-table .col-resizer:hover {
  background: rgba(37, 99, 235, 0.5);
}

.datagrid-table th.col-resizable-th:hover,
.datagrid-table th.col-resizable-leading-th:hover {
  background-image: linear-gradient(
    to left,
    rgba(37, 99, 235, 0.35) 10px,
    transparent 10px
  );
}

body.col-resize-active {
  cursor: col-resize !important;
  user-select: none !important;
}

body.col-resize-active * {
  cursor: col-resize !important;
}

.batch-divider-row td {
  background: #f5f5f4;
  font-weight: 500;
  font-size: 0.78rem;
  color: #374151;
  border-top: 1px solid #d6d3d1;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 10px;
  line-height: 1.25;
  height: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.batch-divider-row.batch-divider-first td {
  border-top: none;
}

.datagrid-table tr.batch-divider-row + tr td {
  border-top: none;
}

.batch-empty-row {
  display: none;
}

.invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
  box-sizing: border-box;
}

.invoice-modal.hidden {
  display: none !important;
}

.invoice-modal-backdrop {
  display: none;
}

.invoice-floating-bar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
}

.invoice-floating-hint {
  font-size: 0.8rem;
  color: #64748b;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-floating-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-invoice-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.delete-edit-search-bar,
.vehicle-edit-search-bar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-bottom: 2px solid #3b82f6;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.delete-edit-search-bar::before,
.vehicle-edit-search-bar::before {
  content: "搜索定位";
  font-size: 0.84rem;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-right: 2px;
}

html[lang="ru"] .delete-edit-search-bar::before,
html[lang="ru"] .vehicle-edit-search-bar::before {
  content: "Поиск";
}

.delete-edit-search-label,
.vehicle-edit-search-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e3a8a;
  white-space: nowrap;
}

.delete-edit-search-input,
.vehicle-edit-search-input {
  width: 148px;
  max-width: 36vw;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #0f172a;
  border: 2px solid #60a5fa;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.delete-edit-search-input::placeholder,
.vehicle-edit-search-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.delete-edit-search-input:focus,
.vehicle-edit-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.22),
    inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.vehicle-edit-search-bar .btn-invoice-sm,
.delete-edit-search-bar .btn-invoice-sm {
  min-height: 34px;
  font-weight: 600;
}

.invoice-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.invoice-nav.hidden {
  display: none;
}

.btn-invoice-nav {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.btn-invoice-nav:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-invoice-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.invoice-fields-empty {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

#invoice-nav-indicator {
  font-size: 0.8rem;
  color: #475569;
  min-width: 3.5em;
  text-align: center;
}

.invoice-modal-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 16px;
  overflow: hidden;
}

.invoice-modal-body {
  width: 100%;
  max-width: 1280px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.invoice-sheet {
  position: relative;
  width: 100%;
  max-width: 1220px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  padding: 32px 42px 28px;
  box-sizing: border-box;
  color: #0f172a;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 1.18rem;
}

.invoice-sheet-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 3px double #1e3a5f;
}

.invoice-brand-block {
  flex: 1;
  min-width: 0;
}

.invoice-brand-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: 0.06em;
}

.invoice-brand-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.invoice-doc-ids {
  position: relative;
  text-align: right;
  font-size: 0.92rem;
  line-height: 1.55;
  flex-shrink: 0;
}

.invoice-doc-ids .doc-line {
  display: block;
}

.invoice-doc-ids .doc-line strong {
  color: #1e3a5f;
  font-weight: 700;
  font-size: 1.06rem;
}

.invoice-doc-ids .ticket-qr-line {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #475569;
}

.invoice-doc-ids .ticket-qr-wrap {
  display: block;
  margin: 4px 0 0 auto;
  width: 96px;
  height: 96px;
  background: #fff;
}

.invoice-doc-ids .ticket-qr-wrap img {
  display: block;
  width: 96px;
  height: 96px;
}

.invoice-head {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #1e3a5f;
}

.invoice-seal-stamp {
  position: absolute;
  left: var(--seal-x, 86%);
  top: var(--seal-y, 38%);
  width: var(--seal-w, 10%);
  height: auto;
  opacity: var(--seal-o, 0.9);
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

.invoice-seal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.invoice-seal-toggle.hidden {
  display: none;
}

.invoice-seal-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary, #1e3a5f);
  cursor: pointer;
}

.invoice-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: #0f172a;
}

.invoice-title-en {
  margin: 4px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: #94a3b8;
  text-transform: uppercase;
}

.invoice-unit-price-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 2px solid #fecaca;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
}

.invoice-cargo-banner.invoice-unit-price-banner {
  border-color: #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.invoice-unit-price-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.invoice-unit-price-label {
  font-size: 1rem;
  font-weight: 700;
  color: #991b1b;
}

.invoice-cargo-banner .invoice-unit-price-label {
  color: #64748b;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.invoice-unit-price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.invoice-cargo-banner .invoice-unit-price-value,
.invoice-cargo-banner .invoice-sender-value {
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 700;
}

.invoice-unit-price-combined {
  flex: 1;
  min-width: min(100%, 320px);
}

.invoice-unit-price-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
}

.invoice-unit-price-part {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.invoice-unit-price-part em {
  font-style: normal;
  font-size: 1rem;
  font-weight: 700;
  color: #991b1b;
}

.invoice-unit-price-sep {
  color: #f87171;
  font-weight: 700;
  font-size: 1.25rem;
  user-select: none;
}

.modify-edit-input,
.invoice-edit-input {
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  color: #0f172a;
  background: #fff;
  min-width: 72px;
}

.invoice-unit-price-input,
.modify-edit-unit-prices .modify-edit-input {
  font-size: 1.4rem;
  font-weight: 800;
  color: #dc2626;
  width: 96px;
  text-align: center;
}

.modify-edit-field .modify-edit-input,
.modify-edit-metrics .modify-edit-input {
  width: 100%;
  margin-top: 4px;
}

.modify-edit-fee-hint {
  flex-basis: 100%;
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

body.modify-edit-open .invoice-floating-bar,
body.supplement-edit-open .invoice-floating-bar,
body.delete-edit-open .invoice-floating-bar,
body.invoice-open .invoice-floating-bar {
  z-index: 12002;
}

.invoice-brief {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
}

.invoice-brief-item .k {
  display: block;
  color: #64748b;
  margin-bottom: 2px;
  font-size: 0.82rem;
}

.invoice-brief-item .v {
  display: block;
  color: #0f172a;
  font-weight: 600;
  word-break: break-all;
}

.invoice-brief-pair {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.invoice-brief-pair .invoice-brief-item {
  flex: 1;
  min-width: 0;
}

.invoice-brief-pair .invoice-brief-item .v {
  font-size: 1.22rem;
  font-weight: 700;
}

.invoice-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
}

.invoice-metrics.invoice-metrics-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.invoice-metrics.invoice-metrics-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.invoice-metric-price .metric-label {
  color: #991b1b;
}

.invoice-sender-value {
  max-width: 280px;
  word-break: break-all;
}

#supplement-edit-modal .invoice-modal-stage,
#supplement-edit-modal .invoice-modal-body,
#delete-edit-modal .invoice-modal-stage,
#delete-edit-modal .invoice-modal-body {
  background: #eef2f7;
}

#supplement-edit-modal .invoice-sheet,
#delete-edit-modal .invoice-sheet {
  margin: 0 auto;
}

#invoice-modal .invoice-unit-price-value,
#modify-edit-modal .invoice-unit-price-value,
#supplement-edit-modal .invoice-unit-price-value,
#delete-edit-modal .invoice-unit-price-value {
  font-size: 1.58rem;
}

#invoice-modal .invoice-cargo-banner .invoice-unit-price-value,
#invoice-modal .invoice-cargo-banner .invoice-sender-value,
#modify-edit-modal .invoice-cargo-banner .invoice-unit-price-value,
#modify-edit-modal .invoice-cargo-banner .invoice-sender-value,
#supplement-edit-modal .invoice-cargo-banner .invoice-unit-price-value,
#supplement-edit-modal .invoice-cargo-banner .invoice-sender-value,
#delete-edit-modal .invoice-cargo-banner .invoice-unit-price-value,
#delete-edit-modal .invoice-cargo-banner .invoice-sender-value {
  font-size: 1.28rem;
  font-weight: 700;
}

#invoice-modal .invoice-cargo-banner .invoice-unit-price-label,
#modify-edit-modal .invoice-cargo-banner .invoice-unit-price-label,
#supplement-edit-modal .invoice-cargo-banner .invoice-unit-price-label,
#delete-edit-modal .invoice-cargo-banner .invoice-unit-price-label {
  font-size: 0.8rem;
}

#invoice-modal .invoice-metric-price-value,
#modify-edit-modal .invoice-metric-price-value,
#supplement-edit-modal .invoice-metric-price-value,
#delete-edit-modal .invoice-metric-price-value {
  font-size: 1.28rem;
}

#invoice-modal .metric-value,
#modify-edit-modal .metric-value,
#supplement-edit-modal .metric-value,
#delete-edit-modal .metric-value {
  font-size: 1.22rem;
}

#invoice-modal .invoice-title,
#modify-edit-modal .invoice-title,
#supplement-edit-modal .invoice-title,
#delete-edit-modal .invoice-title {
  font-size: 1.9rem;
}

.invoice-metric-price-value {
  color: #dc2626;
  font-weight: 800;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.invoice-cargo-verify-row,
.invoice-unit-price-pair-row {
  flex-wrap: nowrap;
  gap: 24px 32px;
}

.invoice-cargo-verify-row .invoice-unit-price-item,
.invoice-unit-price-pair-row .invoice-unit-price-item {
  flex: 0 1 auto;
}

.invoice-unit-price-pair-row .invoice-unit-price-cbm {
  margin-left: 0;
}

.invoice-cargo-banner .modify-edit-input {
  font-size: 1.22rem;
  font-weight: 700;
  color: #0f172a;
  width: auto;
  min-width: 120px;
  text-align: left;
  border-color: #cbd5e1;
  background: #fff;
}

.invoice-metric-price .modify-edit-input {
  font-size: 1.2rem;
  font-weight: 800;
  color: #dc2626;
  text-align: center;
  width: 100%;
  border-color: #fecaca;
  background: #fff;
}

.modify-edit-metrics .invoice-metric-card .modify-edit-input {
  width: 100%;
  text-align: center;
  margin-top: 2px;
}

.modify-edit-brief-pair .modify-edit-input,
.invoice-brief-pair .modify-edit-input {
  width: 100%;
  margin-top: 2px;
  font-size: 1.22rem;
  font-weight: 700;
}

.modify-edit-cargo-banner .modify-edit-input {
  font-size: 1.22rem;
  font-weight: 700;
  color: #0f172a;
  width: auto;
  min-width: 120px;
  text-align: left;
  border-color: #cbd5e1;
  background: #fff;
}

#invoice-modal .invoice-cargo-banner .modify-edit-input,
#modify-edit-modal .invoice-cargo-banner .modify-edit-input,
#supplement-edit-modal .invoice-cargo-banner .modify-edit-input,
#delete-edit-modal .invoice-cargo-banner .modify-edit-input {
  font-size: 1.28rem;
}

.modify-edit-cargo-banner .invoice-sender-value .modify-edit-input {
  max-width: 280px;
}

.modify-edit-readonly {
  display: inline-block;
  color: #475569;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: not-allowed;
}

.modify-edit-field-readonly .k::after {
  content: "（系统计算）";
  margin-left: 4px;
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 500;
}

html[lang="ru"] .modify-edit-field-readonly .k::after {
  content: " (расчёт системы)";
}

.modify-edit-fee-editable .modify-edit-input {
  width: 100%;
  text-align: center;
  font-weight: 700;
  margin-top: 4px;
}

.modify-edit-fee-calculated .modify-edit-fee-readonly {
  display: block;
  margin-top: 2px;
  text-align: center;
}

.invoice-fee-card.modify-edit-fee-calculated:not(.invoice-fee-total) .modify-edit-fee-readonly {
  color: #0f172a;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1.28rem;
  font-weight: 800;
  cursor: default;
}

td.cell-readonly-calc {
  background: #f8fafc;
  color: #475569;
  cursor: not-allowed;
}

#supplement-edit-modal .invoice-modal-stage,
#supplement-edit-modal .invoice-modal-body,
#delete-edit-modal .invoice-modal-stage,
#delete-edit-modal .invoice-modal-body {
  background: #eef2f7;
}

#supplement-edit-modal .invoice-sheet,
#delete-edit-modal .invoice-sheet {
  margin: 0 auto;
}

#modify-edit-modal .invoice-modal-stage,
#modify-edit-modal .invoice-modal-body {
  background: #eef2f7;
}

#modify-edit-modal .invoice-sheet {
  margin: 0 auto;
}

.invoice-metric-card {
  text-align: center;
  padding: 8px 6px;
}

.invoice-metric-card .metric-label {
  display: block;
  font-size: 0.88rem;
  color: #78716c;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.invoice-metric-card .metric-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
}

.invoice-fees {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.invoice-fee-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.invoice-fee-card.invoice-fee-extra .fee-value,
.invoice-fee-card.modify-edit-fee-editable .fee-value {
  color: #dc2626;
}

.invoice-fee-card.modify-edit-fee-editable .modify-edit-input {
  color: #dc2626;
  border-color: #fecaca;
  font-weight: 800;
  text-align: center;
  width: 100%;
}

.invoice-fee-card.invoice-fee-total .modify-edit-readonly,
.invoice-fee-card.invoice-fee-total .modify-edit-fee-readonly {
  color: #dc2626;
}

.invoice-fee-card .fee-label {
  display: block;
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.invoice-fee-card .fee-value {
  display: block;
  font-size: 1.46rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-all;
}

.invoice-fee-card.invoice-fee-total {
  border-color: #fecaca;
  background: #fff;
  box-shadow: none;
}

.invoice-fee-card.invoice-fee-total .fee-label {
  color: #64748b;
}

.invoice-fee-card.invoice-fee-total .fee-value {
  color: #dc2626;
  font-size: 1.55rem;
  font-weight: 800;
}

.manifest-col-seq,
.manifest-seq-cell {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  padding: 2px 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  background: transparent;
  font-weight: 600;
  font-size: 0.78rem;
}

#query-data-table .manifest-col-seq,
#query-data-table .manifest-seq-cell {
  min-width: 40px;
}

#query-data-table .manifest-col-status,
#query-data-table .manifest-status-cell {
  min-width: 7.5em;
}

#inbound-data-table .edit-select-col,
.data-table .edit-select-col {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  text-align: center;
  vertical-align: middle;
  padding: 2px;
  background: transparent;
}

#inbound-data-table thead .edit-select-col,
#outbound-data-table thead .outbound-select-col {
  background: transparent;
}

th.manifest-col-seq,
th.manifest-col-status,
th.manifest-col-qr {
  white-space: nowrap;
  z-index: 2;
}

.manifest-col-qr {
  min-width: 4.5em;
  white-space: nowrap;
  text-align: center;
}

/* 出库按件展示：同一票号多件时展开为多行 */
.parcel-sub-row td {
  background: transparent;
}

.parcel-sub-mark {
  color: #94a3b8;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* 主票/副票行（所有货物表通用；勾选/已出库等状态色优先） */
tr.parcel-main-row td {
  background: #dcfce7;
}

tr.parcel-sub-row td {
  background: transparent;
}

.parcel-main-star {
  color: #eab308;
  font-weight: 800;
  float: right;
  margin-left: 6px;
  text-shadow: 0 0 1px rgba(120, 53, 15, 0.55);
}

.btn-ticket-qr-print {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.6;
}

.btn-ticket-qr-print:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-ticket-qr-print:active {
  background: #cbd5e1;
}

.qr-print-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
}

.qr-print-batch-bar .qr-print-batch-hint {
  font-size: 0.8rem;
  color: var(--app-text-muted, #64748b);
}

.manifest-col-status,
.manifest-status-cell {
  min-width: 7.5em;
  white-space: nowrap;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

.manifest-status-cell.is-stock {
  color: #16a34a;
  background: transparent;
}

.manifest-status-cell.is-outbound {
  color: #b45309;
  background: transparent;
}

.manifest-status-cell.is-loaded {
  color: #1d4ed8;
  background: transparent;
}

.manifest-status-cell.is-dispatched {
  color: #047857;
  background: transparent;
}

.manifest-status-cell.is-received-transit {
  color: #dc2626;
  background: transparent;
}

.manifest-status-cell.is-received {
  color: #6d28d9;
  background: transparent;
}

.manifest-status-cell.is-delivered {
  color: #9ca3af;
  background: transparent;
  font-weight: 600;
}

.invoice-fields-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invoice-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}

.invoice-field {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 7px 10px;
  background: #fafbfc;
  min-height: 2.8em;
}

.invoice-field.invoice-field-highlight {
  border-color: #fecaca;
  background: #fff5f5;
}

.invoice-field.invoice-field-highlight .k {
  color: #dc2626;
  font-weight: 700;
}

.invoice-field .k {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-bottom: 2px;
  line-height: 1.2;
}

.vehicle-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(241, 245, 249, 0.88);
}

.vehicle-modal.hidden {
  display: none;
}

.vehicle-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(241, 245, 249, 0.88);
}

.vehicle-modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 22px 18px;
  color: var(--app-text);
}

.vehicle-modal-card h4 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.vehicle-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 12px;
}

.vehicle-form-field label {
  display: block;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 4px;
  font-weight: 500;
}

.vehicle-form-field input,
.vehicle-form-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.vehicle-form-field input:focus,
.vehicle-form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* 一程车禁用滞留费：灰底 + 不可填，鼠标停留显示原因 */
.vehicle-form-field.is-disabled label {
  color: #94a3b8;
}
.vehicle-form-field input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* 车辆弹窗与历史车牌：固定浅色，避免深色主题下系统 datalist 发黑 */
#vehicle-modal {
  color-scheme: light;
}

#vehicle-modal .vehicle-modal-card {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

#vehicle-modal .vehicle-form-field label {
  color: #475569;
}

#vehicle-modal .vehicle-form-field input,
#vehicle-modal .vehicle-form-field select {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.vehicle-plate-field-wrap {
  position: relative;
}

.vehicle-plate-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
}

.vehicle-plate-suggest.hidden {
  display: none;
}

.vehicle-plate-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  color: #111827;
}

.vehicle-plate-suggest-item:hover,
.vehicle-plate-suggest-item:focus {
  background: #eff6ff;
  outline: none;
}

.vehicle-plate-suggest-plate {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e40af;
}

.vehicle-plate-suggest-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

html[data-theme="dark"] #vehicle-modal .vehicle-modal-card,
html[data-theme="dark"] #vehicle-modal .vehicle-form-field input,
html[data-theme="dark"] #vehicle-modal .vehicle-form-field select,
html[data-theme="dark"] .vehicle-plate-suggest {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.vehicle-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
  .vehicle-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

#outbound-data-table .outbound-select-col {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  text-align: center;
  vertical-align: middle;
  padding: 2px;
  background: transparent;
}

#outbound-data-table thead .outbound-select-col {
  background: transparent;
}

#outbound-data-table .outbound-select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
}

#outbound-data-table tr.parcel-main-row td {
  background: #dcfce7;
}

#outbound-data-table tr.outbound-row-selected td {
  background: #eff6ff;
}

#outbound-data-table tr.outbound-row-shipped td {
  color: #9ca3af;
  background: #e5e7eb;
  text-decoration: line-through;
}

#outbound-data-table tr.outbound-row-shipped .outbound-select-col input[type="checkbox"] {
  cursor: not-allowed;
}

#outbound-data-table tr.outbound-row-selected .outbound-select-col {
  background: #dbeafe;
}

#panel-vehicles-origin.content-panel.active,
#panel-vehicles-transit.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 14px;
}

#panel-vehicles-origin.content-panel.active .panel-title-row h3,
#panel-vehicles-transit.content-panel.active .panel-title-row h3 {
  font-size: 1rem;
  margin: 0;
  flex-shrink: 0;
}

.vehicle-panel-intro {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
  flex-shrink: 0;
}

.vehicle-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.vehicle-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.vehicle-list-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.vehicle-list-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.vehicle-list-table tbody tr:hover td {
  background: #fafafa;
}

.vehicle-list-table .col-no {
  width: 48px;
  color: #64748b;
}

#panel-users .users-intro,
#panel-warehouse-create .users-intro {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
  flex-shrink: 0;
}

#panel-users.content-panel.active,
#panel-warehouse-create.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#panel-users #users-admin-panel,
#panel-warehouse-create #warehouse-create-admin-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 新建仓库：下方列表卡片撑满剩余高度，表体在卡片内滚动，页面整体不再被顶出去 */
#panel-warehouse-create .users-create-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#panel-warehouse-create .users-create-card:last-child {
  flex: 1;
}
#panel-warehouse-create .users-account-table-wrap {
  overflow: hidden;
  min-height: 140px;
}
#panel-warehouse-create .users-account-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 新建仓库列表美化：类型徽章 / 账号胶囊 / 操作间距 / 内置标签 */
#panel-warehouse-create .users-create-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}
#panel-warehouse-create .users-create-card h4::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(135deg, #4338ca, #6366f1);
}
/* 仓库管理列表放大：行高字大、按钮大，铺满整个卡片宽度 */
#panel-warehouse-create .users-account-table {
  font-size: 1rem;
}
#panel-warehouse-create .users-account-table thead th {
  font-size: .92rem;
  padding: 16px 22px;
}
#panel-warehouse-create .users-account-table tbody td {
  padding: 18px 22px;
  font-size: 1rem;
}
#panel-warehouse-create .users-account-table tbody td strong {
  font-size: 1.08rem;
}
.wh-role-badge {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 999px;
  white-space: nowrap;
}
.wh-role-origin { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.wh-role-transit { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.wh-role-terminal { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.wh-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.wh-builtin-tag {
  font-size: .8rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
.wh-edit-select {
  padding: 8px 14px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: .92rem;
  background: #eef2ff;
  color: #1e293b;
}
#panel-warehouse-create .btn-warehouse-edit-save,
#panel-warehouse-create .btn-warehouse-edit,
#panel-warehouse-create .btn-warehouse-delete {
  padding: 9px 26px;
  font-size: .88rem;
  border-radius: 999px;
}

#panel-users .users-list-filter-bar,
#panel-warehouse-create .users-list-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  flex-shrink: 0;
}

#panel-users .users-list-filter-bar .users-form-field,
#panel-warehouse-create .users-list-filter-bar .users-form-field {
  min-width: 160px;
  flex: 1 1 160px;
  max-width: 240px;
}

#panel-users .users-create-card,
#panel-warehouse-create .users-create-card {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 16px 18px 18px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

#panel-users .users-create-card h4,
#panel-warehouse-create .users-create-card h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--app-text);
}

#panel-users .users-create-grid,
#panel-warehouse-create .users-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

#panel-users .users-form-field label,
#panel-warehouse-create .users-form-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--app-text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

#panel-users .users-form-field input,
#panel-users .users-form-field select,
#panel-warehouse-create .users-form-field input,
#panel-warehouse-create .users-form-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--input-bg);
  color: var(--app-text);
}

#panel-users .users-create-actions,
#panel-warehouse-create .users-create-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#panel-users .users-account-table-wrap,
#panel-warehouse-create .users-account-table-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  min-width: 0;
  margin-top: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
}

#panel-users .users-account-table-wrap .table-viewport,
#panel-warehouse-create .users-account-table-wrap .table-viewport {
  flex: 1;
  min-height: 0;
}

#panel-users .users-account-table,
#panel-warehouse-create .users-account-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#panel-users .users-account-table thead th,
#panel-warehouse-create .users-account-table thead th {
  background: var(--app-table-head);
  color: var(--app-text-muted);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
}

#panel-users .users-account-table tbody td,
#panel-warehouse-create .users-account-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  vertical-align: middle;
}

#panel-users .users-account-table tbody tr:hover td,
#panel-warehouse-create .users-account-table tbody tr:hover td {
  background: var(--app-table-row-alt);
}

#panel-users .users-empty,
#panel-users .users-muted,
#panel-warehouse-create .users-empty,
#panel-warehouse-create .users-muted {
  color: var(--app-text-muted);
  font-size: 0.88rem;
}

#panel-users .users-row-actions,
#panel-warehouse-create .users-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.users-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(241, 245, 249, 0.88);
}

.users-edit-modal.hidden {
  display: none;
}

.users-edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(241, 245, 249, 0.88);
}

.users-edit-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 22px 18px;
  color: var(--app-text);
}

.users-edit-modal-card h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.users-edit-account-label {
  font-size: 0.85rem;
  color: var(--app-text-muted);
  margin-bottom: 14px;
}

.users-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.users-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.users-edit-field label {
  font-size: 0.82rem;
  color: var(--app-text-muted);
  font-weight: 500;
}

.users-edit-field input,
.users-edit-field select,
.users-edit-readonly {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--input-bg);
  color: var(--app-text);
}

.users-edit-readonly {
  background: var(--app-surface-muted);
}

.users-edit-field.full-width {
  grid-column: 1 / -1;
}

.users-edit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}

#panel-users .users-denied,
#panel-warehouse-create .users-denied,
#panel-seal-manage .users-denied {
  padding: 24px;
  text-align: center;
  color: var(--app-text-muted);
  background: var(--app-surface-muted);
  border-radius: var(--radius-md);
  border: 1px dashed var(--app-border);
}

#panel-seal-manage.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#panel-seal-manage .users-intro {
  margin: 0 0 16px;
  color: var(--app-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex-shrink: 0;
}

#panel-seal-manage .users-create-card {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 16px 18px 18px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

#panel-seal-manage .users-create-card h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--app-text);
}

#panel-seal-manage .users-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

#panel-seal-manage .users-form-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--app-text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

#panel-seal-manage .users-form-field input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--input-bg);
  color: var(--app-text);
}

#panel-seal-manage .users-create-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#panel-seal-manage .users-muted {
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.seal-adjust-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(240px, 1fr);
  gap: 18px 22px;
  align-items: start;
}

.seal-preview-box {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  padding: 14px;
}

.seal-preview-box {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  padding: 14px;
  overflow: auto;
}

/* 预览直接复用真实发票单据结构（.invoice-sheet），所见即所得 */
.seal-preview-scale {
  zoom: 0.52;
}

.seal-live-preview {
  max-width: none;
  margin: 0;
}

.seal-preview-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fffbeb;
}

.seal-adjust-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seal-adjust-controls .users-form-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.seal-adjust-controls input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

@media (max-width: 900px) {
  .seal-adjust-layout {
    grid-template-columns: 1fr;
  }
}

#panel-analysis.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 14px;
  background: transparent;
  border: none;
  box-shadow: none;
}

#panel-analysis .panel-title-row {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.analysis-dashboard {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 2px 8px;
  background-image:
    linear-gradient(var(--analysis-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--analysis-grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

.analysis-hero {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--analysis-card-border);
  background: linear-gradient(
    135deg,
    var(--analysis-accent-soft),
    var(--analysis-card-bg)
  );
  box-shadow: 0 0 32px var(--analysis-accent-soft);
}

.analysis-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: translateX(-100%);
  animation: analysis-scan 6s linear infinite;
  pointer-events: none;
}

@keyframes analysis-scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.analysis-hero-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--app-text);
  margin: 0 0 6px;
}

.analysis-hero-sub {
  font-size: 0.82rem;
  color: var(--analysis-text-dim);
  margin: 0;
  line-height: 1.55;
}

.analysis-hero-meta {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--analysis-accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.04em;
}

.analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.analysis-kpi {
  padding: 14px 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--analysis-card-border);
  background: var(--analysis-card-bg);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.analysis-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--analysis-accent), transparent);
  opacity: 0.85;
}

.analysis-kpi-label {
  font-size: 0.72rem;
  color: var(--analysis-text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.analysis-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--analysis-accent-bright);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.1;
}

.analysis-kpi-unit {
  font-size: 0.72rem;
  color: var(--analysis-text-dim);
  margin-left: 4px;
  font-weight: 500;
}

.analysis-kpi-foot {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--analysis-text-dim);
}

.analysis-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 960px) {
  .analysis-section-grid {
    grid-template-columns: 1fr;
  }
}

.analysis-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--analysis-card-border);
  background: var(--analysis-card-bg);
  backdrop-filter: blur(8px);
  padding: 14px 16px 16px;
  min-width: 0;
}

.analysis-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--app-text);
  letter-spacing: 0.12em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-card-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--analysis-accent);
  box-shadow: 0 0 10px var(--analysis-accent);
}

.analysis-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-top: 8px;
}

.analysis-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.analysis-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(
    180deg,
    var(--analysis-accent-bright),
    var(--analysis-accent)
  );
  box-shadow: 0 0 12px var(--analysis-accent-soft);
  min-height: 4px;
  transition: height 0.3s ease;
}

.analysis-bar-label {
  font-size: 0.62rem;
  color: var(--analysis-text-dim);
  writing-mode: horizontal-tb;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.analysis-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.analysis-donut {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--analysis-accent-soft);
}

.analysis-donut-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.analysis-donut-hole {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--analysis-card-bg);
  border: 1px solid var(--analysis-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--analysis-text-dim);
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}

.analysis-legend {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--app-text);
}

.analysis-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.analysis-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.analysis-rank-idx {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--analysis-accent);
  font-size: 0.75rem;
}

.analysis-rank-name {
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-rank-bar-wrap {
  grid-column: 2 / 4;
  height: 4px;
  background: var(--app-surface-muted);
  border-radius: 2px;
  overflow: hidden;
}

.analysis-rank-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--analysis-accent), var(--analysis-accent-bright));
  box-shadow: 0 0 8px var(--analysis-accent-soft);
}

.analysis-rank-val {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  color: var(--analysis-text-dim);
}

.analysis-metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.analysis-metrics-table th,
.analysis-metrics-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
}

.analysis-metrics-table th {
  color: var(--analysis-text-dim);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.analysis-metrics-table td {
  color: var(--app-text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
}

.analysis-insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.analysis-insight {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--analysis-card-border);
  background: var(--analysis-accent-soft);
  font-size: 0.78rem;
  color: var(--app-text);
  line-height: 1.5;
}

.analysis-insight strong {
  color: var(--analysis-accent-bright);
  font-weight: 600;
}

.analysis-empty {
  padding: 28px;
  text-align: center;
  color: var(--analysis-text-dim);
  font-size: 0.88rem;
}

.analysis-product-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
}

.analysis-product-table td:first-child,
.analysis-product-table th:first-child {
  width: 36px;
  text-align: center;
}

.analysis-card-desc {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--analysis-text-dim);
  line-height: 1.5;
}

.analysis-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.analysis-compare-grid-item {
  min-width: 0;
}

.analysis-compare-chart {
  border: 1px solid var(--analysis-card-border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.35);
}

.analysis-compare-metric-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--analysis-accent);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.analysis-compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.analysis-compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--analysis-text-dim);
}

.analysis-compare-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.analysis-compare-cols {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 140px;
  padding-top: 4px;
}

.analysis-compare-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.analysis-compare-bar {
  width: 100%;
  max-width: 48px;
  border-radius: 4px 4px 2px 2px;
  min-height: 6px;
  transition: height 0.2s ease;
}

.analysis-compare-col-label {
  font-size: 0.68rem;
  color: var(--analysis-text-dim);
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
}

.analysis-compare-col-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--analysis-accent-bright);
  font-variant-numeric: tabular-nums;
}

.analysis-dim-compare {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-dim-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-dim-row {
  display: grid;
  grid-template-columns: minmax(72px, 120px) 1fr minmax(56px, 72px);
  gap: 10px;
  align-items: end;
}

.analysis-dim-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-dim-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 72px;
  min-width: 0;
}

.analysis-dim-bar {
  flex: 1;
  min-width: 8px;
  max-width: 28px;
  border-radius: 3px 3px 1px 1px;
  align-self: flex-end;
}

.analysis-dim-total {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--analysis-text-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analysis-warehouse-summary-table {
  min-width: 960px;
}

.analysis-warehouse-summary-table th,
.analysis-warehouse-summary-table td {
  white-space: nowrap;
  font-size: 0.78rem;
}

.vehicle-waybill-link {
  color: #2563eb;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
}

.vehicle-waybill-link:hover {
  text-decoration: underline;
}

.vehicle-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.vehicle-status-badge.status-transit {
  background: #dbeafe;
  color: #1d4ed8;
}

.vehicle-status-badge.status-arrived {
  background: #ffedd5;
  color: #c2410c;
}

.vehicle-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 车辆操作按钮美化：胶囊渐变 + 阴影 + 悬停上浮 ===== */
.vehicle-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vehicle-list-actions > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(15,23,42,.12);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.vehicle-list-actions > button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15,23,42,.2);
}
.vehicle-list-actions > button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15,23,42,.12);
}
.vehicle-list-actions > button:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}
/* 查看：宝石蓝渐变 */
.btn-vehicle-view {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border-color: #1d4ed8;
}
.btn-vehicle-view:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
}
/* 编辑：白底 slate 描边 */
.btn-vehicle-edit {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-vehicle-edit:hover {
  background: #f1f5f9;
  border-color: #64748b;
}
/* 发货：翡翠绿渐变 */
.btn-vehicle-dispatch {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  border-color: #047857;
}
.btn-vehicle-dispatch:hover {
  background: linear-gradient(135deg, #059669, #065f46);
}
.btn-vehicle-dispatch.is-dispatched {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
  transform: none;
}
.btn-vehicle-dispatch.is-dispatched:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: none;
  box-shadow: none;
}
/* 审核：琥珀渐变 */
.btn-vehicle-audit {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
  border-color: #d97706;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn-vehicle-audit:hover {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}
/* 一键回单：紫罗兰渐变 */
.btn-vehicle-receipt {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  border-color: #6d28d9;
}
.btn-vehicle-receipt:hover {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}
/* 收货：天空蓝渐变 */
.btn-vehicle-receive {
  background: linear-gradient(135deg, #38bdf8, #0369a1);
  color: #fff;
  border-color: #0369a1;
}
.btn-vehicle-receive:hover {
  background: linear-gradient(135deg, #0ea5e9, #075985);
}
/* 撤销/整车作业类： slate 描边浅底 */
.btn-vehicle-revert {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}
.btn-vehicle-revert:hover {
  background: #ffedd5;
  border-color: #fb923c;
}
/* 作废/删除：红色描边 */
.btn-vehicle-void,
.btn-vehicle-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-vehicle-void:hover,
.btn-vehicle-delete:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.btn-vehicle-receive {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.btn-vehicle-receive:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.vehicle-status-cell {
  white-space: nowrap;
  min-width: 7.5em;
}

.vehicle-status-text {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
}

.vehicle-status-text.vehicle-status-dispatched {
  color: #b45309;
}

.vehicle-status-text.vehicle-status-received {
  color: #047857;
}

.vehicle-status-text.vehicle-status-saved {
  color: #2563eb;
}

.vehicle-status-text.vehicle-status-reverted {
  color: #6b7280;
}

.btn-vehicle-void {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.btn-vehicle-void:hover {
  background: #fde68a;
  border-color: #fbbf24;
}

.btn-vehicle-revert {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.btn-vehicle-revert:hover {
  background: #ffedd5;
  border-color: #fb923c;
}

.btn-vehicle-delete {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-vehicle-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.vehicle-list-empty {
  text-align: center;
  padding: 48px 16px;
  color: #94a3b8;
}

.vehicle-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(241, 245, 249, 0.88);
}

.vehicle-detail-modal.hidden {
  display: none;
}

.vehicle-detail-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 20px 22px;
}

.vehicle-detail-card.vehicle-detail-card-wide {
  width: min(96vw, 1400px);
  height: min(92vh, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px 12px;
}

.vehicle-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.vehicle-detail-head h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.vehicle-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vehicle-detail-summary {
  font-size: 0.82rem;
  color: #64748b;
  margin: 4px 0 0;
  line-height: 1.45;
}

.vehicle-detail-card-wide .vehicle-view-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vehicle-cargo-stats {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
}

.vehicle-cargo-stats.hidden {
  display: none !important;
}

.vehicle-cargo-stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1100px) {
  .vehicle-cargo-stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .vehicle-cargo-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.vehicle-cargo-stat-card {
  border-radius: 8px;
  padding: 10px 12px 9px;
  border: 1px solid transparent;
  min-width: 0;
}

.vehicle-cargo-stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-cargo-stat-card .stat-value {
  display: block;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-cargo-stat-card.tone-blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.vehicle-cargo-stat-card.tone-blue .stat-value {
  color: #2563eb;
}

.vehicle-cargo-stat-card.tone-teal {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.vehicle-cargo-stat-card.tone-teal .stat-value {
  color: #0d9488;
}

.vehicle-cargo-stat-card.tone-green {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.vehicle-cargo-stat-card.tone-green .stat-value {
  color: #16a34a;
}

.vehicle-cargo-stat-card.tone-purple {
  background: #faf5ff;
  border-color: #e9d5ff;
}
.vehicle-cargo-stat-card.tone-purple .stat-value {
  color: #9333ea;
}

.vehicle-cargo-stat-card.tone-orange {
  background: #fff7ed;
  border-color: #fed7aa;
}
.vehicle-cargo-stat-card.tone-orange .stat-value {
  color: #ea580c;
}

.vehicle-cargo-stat-card.tone-navy {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.vehicle-cargo-stat-card.tone-navy .stat-value {
  color: #1e3a8a;
}

.vehicle-detail-card-wide #vehicle-view-filter-bar {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 8px 10px;
  gap: 8px;
}

.vehicle-detail-card-wide .vehicle-view-table-wrap {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.vehicle-detail-card-wide .vehicle-view-table-wrap .table-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.vehicle-detail-card h4 {
  margin: 0 0 12px;
}

.vehicle-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.vehicle-detail-grid .k {
  color: #64748b;
  font-size: 0.78rem;
  margin-bottom: 2px;
  display: block;
}

.vehicle-detail-grid .v {
  color: #1e293b;
  font-weight: 500;
}

.vehicle-detail-lines {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  font-size: 0.85rem;
  color: #475569;
  max-height: 200px;
  overflow: auto;
}

.vehicle-edit-only.hidden {
  display: none;
}

.invoice-field .v {
  display: block;
  color: #0f172a;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.35;
}

.invoice-field.invoice-field-highlight .v {
  color: #dc2626;
  font-weight: 700;
}

.invoice-foot {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}

.invoice-sheet-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.tracking-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
  box-sizing: border-box;
}

.tracking-modal.hidden {
  display: none !important;
}

.tracking-modal-backdrop {
  display: none;
}

.tracking-floating-bar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
  max-width: none;
  flex-wrap: wrap;
}

.tracking-floating-hint {
  font-size: 0.8rem;
  color: #64748b;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracking-floating-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tracking-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.tracking-modal-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 16px;
  overflow: hidden;
}

/* 扫码装载：车牌输入大气版 */
.scan-plate-field label {
  font-size: 15px;
  font-weight: 600;
}
.scan-plate-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 13px 16px;
  border: 2px solid #2f6fed;
  border-radius: 12px;
  margin: 8px 0 12px;
}
/* 作业仓库（下拉）与车牌号（输入框）统一尺寸，避免一高一矮 */
#scan-inbound-region,
.scan-plate-input {
  box-sizing: border-box;
  height: 48px;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.2;
  border-radius: 10px;
}
.scan-plate-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.18);
}
.scan-loading-start {
  width: 100%;
  padding: 13px 0;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
}
/* 扫码装载：车牌开始装载 + 本仓装载中列表 + 装载中状态 */
.scan-loading-list-wrap {
  margin: 10px 0;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  padding: 10px 12px;
  background: #eff6ff;
}
.scan-loading-list-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
}
.scan-loading-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.scan-loading-plate { font-weight: 700; }
.scan-loading-meta { color: #64748b; font-size: 12px; flex: 1; }
.vehicle-status-loading {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.btn-vehicle-join-loading {
  border: 1px solid #2f6fed;
  background: #2f6fed;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
}
.btn-scan-join-loading { flex-shrink: 0; }

/* 定位弹窗：真实地图铺满整个弹窗，车辆卡片浮在地图上 */
.loc-fullmap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  background: #0b1220;
  overflow: hidden;
}
.loc-leaflet {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b1220;
}
.loc-leaflet .leaflet-container {
  background: #0b1220;
  font: inherit;
}
.loc-fallback {
  position: absolute;
  inset: 0;
}
.loc-fallback .loc-map {
  height: 100%;
}
.loc-fallback .loc-map-svg {
  height: 100%;
}
.loc-full-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.loc-full-hint {
  background: rgba(10, 15, 25, 0.82);
  color: #4ade80;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
}
.loc-full-top .btn-action {
  margin-left: auto;
  pointer-events: auto;
  background: rgba(10, 15, 25, 0.82);
}
.loc-full-cards {
  position: absolute;
  top: 64px;
  left: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100% - 84px);
  overflow-y: auto;
  max-width: min(430px, calc(100% - 24px));
}
.loc-full-card {
  background: rgba(10, 15, 25, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.7;
}
.loc-full-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.loc-full-addr { color: #d1d5db; }
.loc-full-meta { color: #9ca3af; font-size: 12px; }
.loc-full-actions { margin-top: 6px; }
.loc-full-zoom {
  position: absolute;
  left: 12px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 25, 0.85);
  border-radius: 10px;
  overflow: hidden;
}
.loc-full-zoom button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.loc-full-zoom button + button { border-top: 1px solid rgba(255, 255, 255, 0.15); }
.loc-leaf-pin > span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #22c55e;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.loc-leaf-me > span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 定位弹窗全屏：只有 location-modal 铺满，不动跟踪/发票弹窗 */
#location-modal .tracking-modal-stage {
  padding: 0;
  align-items: stretch;
}
#location-modal .tracking-modal-body {
  max-width: none;
  max-height: none;
  height: 100%;
  align-items: stretch;
  justify-content: stretch;
}
#location-modal .tracking-capture-sheet {
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#location-modal .loc-map {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#location-modal .loc-map-svg {
  flex: 1;
  min-height: 0;
  height: auto;
}
.tracking-modal-body {
  width: 100%;
  max-width: 1380px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.tracking-capture-sheet {
  width: 100%;
  max-width: 1320px;
}

.tracking-sheet-head {
  margin-bottom: 16px;
}

.tracking-capture-sheet .tracking-status-bar {
  margin-bottom: 16px;
}

.tracking-capture-sheet .tracking-route-panel {
  margin-top: 0;
  padding: 20px 16px 12px;
}

.tracking-capture-sheet .tracking-route-wrap {
  padding: 36px 12px 16px;
}

.tracking-capture-sheet .tracking-route-nodes {
  min-width: 0;
}

.tracking-capture-sheet .tracking-vehicle-marker {
  margin-bottom: 10px;
}

.tracking-capture-sheet .tracking-route-track {
  top: 58px;
}

.tracking-capture-sheet .tracking-node-label {
  font-size: 0.8rem;
}

.tracking-capture-sheet .tracking-node-place,
.tracking-capture-sheet .tracking-node-time,
.tracking-capture-sheet .tracking-node-maker {
  font-size: 0.66rem;
}

.tracking-node-maker {
  margin-top: 3px;
  color: #15803d;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-all;
}

.tracking-route-node.lamp-off .tracking-node-maker {
  color: #94a3b8;
  font-weight: 500;
}

.tracking-route-detail-maker {
  font-size: 0.78rem;
  color: #15803d;
  font-weight: 600;
  margin-bottom: 4px;
}

.tracking-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.tracking-current-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.tracking-current-value {
  font-size: 1.12rem;
  font-weight: 800;
  color: #1d4ed8;
  text-align: right;
}

.tracking-sheet,
.tracking-capture-sheet {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  box-sizing: border-box;
}

.tracking-capture-sheet.invoice-sheet {
  border-radius: 8px;
  padding: 28px 36px 24px;
}

.tracking-head {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #1e3a5f;
}

.tracking-head-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tracking-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.tracking-subtitle {
  margin: 6px 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: #94a3b8;
  text-transform: uppercase;
}

.tracking-sheet-badge {
  padding: 2px 8px;
  font-size: 0.65rem;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.tracking-brief {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.78rem;
}

.tracking-brief-item .k {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  margin-bottom: 2px;
}

.tracking-brief-item .v {
  display: block;
  color: #0f172a;
  font-weight: 600;
  word-break: break-all;
}

.tracking-timeline-title {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.12em;
}

.tracking-sheet-route-col .tracking-route-track {
  top: 48px;
}

.tracking-route-panel {
  margin-top: 4px;
  padding: 14px 10px 6px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.tracking-route-heading {
  margin: 0 0 14px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #64748b;
  text-transform: uppercase;
}

.tracking-route-wrap {
  position: relative;
  padding: 28px 8px 12px;
}

.tracking-route-track {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 52px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  z-index: 0;
}

.tracking-route-progress {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #4ade80 50%, #86efac 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
  transition: width 0.35s ease;
}

.tracking-route-nodes {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.tracking-route-node {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 2px;
}

.tracking-vehicle-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.tracking-vehicle {
  position: relative;
  width: 34px;
  height: 28px;
  color: #94a3b8;
}

.tracking-vehicle-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.tracking-vehicle-num {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tracking-route-node.lamp-on .tracking-vehicle,
.tracking-route-node.lamp-active .tracking-vehicle {
  color: #16a34a;
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.45));
}

.tracking-route-node.lamp-on .tracking-vehicle-num,
.tracking-route-node.lamp-active .tracking-vehicle-num {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.tracking-route-node.lamp-active .tracking-vehicle-marker {
  animation: tracking-vehicle-pulse 1.6s ease-in-out infinite;
}

@keyframes tracking-vehicle-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(74, 222, 128, 1));
  }
}

.tracking-node-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
}

.tracking-route-node.lamp-off .tracking-node-label {
  color: #94a3b8;
}

.tracking-route-node.lamp-active .tracking-node-label {
  color: #15803d;
}

.tracking-node-place,
.tracking-node-time {
  font-size: 0.58rem;
  color: #64748b;
  line-height: 1.3;
  word-break: break-all;
}

.tracking-route-node.lamp-off .tracking-node-place,
.tracking-route-node.lamp-off .tracking-node-time {
  opacity: 0.45;
}

.tracking-route-detail {
  margin-top: 14px;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  text-align: center;
}

.tracking-route-detail-label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: #64748b;
  margin-bottom: 4px;
}

.tracking-route-detail-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 4px;
}

.tracking-route-detail-note {
  font-size: 0.74rem;
  color: #475569;
  line-height: 1.45;
}

.tracking-invoice-panel {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #0f172a;
}

.tracking-invoice-heading {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.1em;
}

.tracking-invoice-top {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.tracking-sheet .tracking-invoice-panel .invoice-foot {
  margin-top: 10px;
}

.tracking-capture-hint {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.68rem;
  color: #64748b;
  letter-spacing: 0.06em;
}

.filter-field-status select {
  min-width: 118px;
}

body.tracking-open {
  overflow: hidden;
}

body.invoice-open {
  overflow: hidden;
}

body.supplement-edit-open {
  overflow: hidden;
}

body.delete-edit-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .invoice-fees {
    grid-template-columns: repeat(2, 1fr);
  }

  .invoice-fee-card.invoice-fee-total {
    grid-column: span 2;
  }

  .invoice-brief {
    grid-template-columns: repeat(2, 1fr);
  }

  .invoice-fields-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tracking-brief {
    grid-template-columns: repeat(2, 1fr);
  }

  .tracking-route-nodes {
    flex-wrap: wrap;
    row-gap: 18px;
    justify-content: center;
  }

  .tracking-route-node {
    flex: 0 0 22%;
    min-width: 72px;
  }

  .tracking-route-track {
    display: none;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #invoice-modal,
  #invoice-modal .invoice-sheet,
  #invoice-modal .invoice-sheet * {
    visibility: visible !important;
  }

  #tracking-modal,
  #tracking-modal .tracking-capture-sheet,
  #tracking-modal .tracking-capture-sheet * {
    visibility: visible !important;
  }

  #invoice-modal {
    position: absolute;
    inset: 0;
    display: flex !important;
    background: #fff;
  }

  #tracking-modal {
    position: absolute;
    inset: 0;
    display: flex !important;
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .invoice-modal-stage {
    padding: 0;
    overflow: visible;
  }

  .tracking-modal-stage {
    padding: 0;
    overflow: visible;
  }

  .invoice-modal-body {
    max-height: none;
    overflow: visible;
  }

  .invoice-sheet {
    box-shadow: none;
    border: 1px solid #000;
    max-width: 100%;
    page-break-inside: avoid;
  }

  .tracking-modal-body {
    max-height: none;
    overflow: visible;
  }

  .tracking-capture-sheet {
    box-shadow: none;
    border: 1px solid #000;
    max-width: 100%;
    page-break-inside: avoid;
  }
}

.datagrid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--app-table-head);
  font-weight: 600;
  color: var(--app-text);
}

.datagrid-table tbody tr:nth-child(even) {
  background: var(--app-table-row-alt);
}

.datagrid-table tbody td,
.datagrid-table thead th,
.datagrid-table tfoot td {
  cursor: cell;
  user-select: text;
}

.datagrid-table td.cell-selected,
.datagrid-table th.cell-selected {
  outline: 2px solid #4d6bff;
  outline-offset: -2px;
  background: #eef2ff !important;
  position: relative;
  z-index: 1;
}

.datagrid-table td.cell-merge-master {
  vertical-align: middle;
  white-space: pre-wrap;
}

.datagrid-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  white-space: normal;
  min-width: auto;
  border: none;
}

.datagrid-table tfoot {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.datagrid-table tfoot .summary-row td {
  background: var(--app-table-foot);
  font-weight: 700;
  color: #dc2626;
  border: 1px solid var(--app-border);
  text-align: left;
  white-space: nowrap;
  min-width: 110px;
  width: 110px;
  max-width: 320px;
  padding: 6px 10px;
  vertical-align: middle;
}

html[data-theme="dark"] body.app-mode {
  background: var(--app-bg);
}

html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .panel-toolbar,
html[data-theme="dark"] .vehicle-detail-card,
html[data-theme="dark"] .tracking-floating-bar,
html[data-theme="dark"] .invoice-floating-bar,
html[data-theme="dark"] .delete-edit-search-bar,
html[data-theme="dark"] .vehicle-edit-search-bar {
  background: linear-gradient(180deg, #1e3a5f 0%, #172554 100%);
  border-color: #3b82f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: var(--app-text);
}

html[data-theme="dark"] .delete-edit-search-bar::before,
html[data-theme="dark"] .vehicle-edit-search-bar::before {
  color: #93c5fd;
}

html[data-theme="dark"] .delete-edit-search-label,
html[data-theme="dark"] .vehicle-edit-search-label {
  color: #bfdbfe;
}

html[data-theme="dark"] .delete-edit-search-input,
html[data-theme="dark"] .vehicle-edit-search-input {
  background: var(--input-bg);
  color: var(--app-text);
  border-color: #3b82f6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .delete-edit-search-input:focus,
html[data-theme="dark"] .vehicle-edit-search-input:focus {
  border-color: #60a5fa;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.35),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .filter-field input,
html[data-theme="dark"] .filter-field select,
html[data-theme="dark"] .filter-date,
html[data-theme="dark"] .filter-time,
html[data-theme="dark"] .filter-region-select,
html[data-theme="dark"] .import-maker-input {
  background: var(--input-bg);
  color: var(--app-text);
  border-color: var(--border);
}

html[data-theme="dark"] .filter-highlight-ticket,
html[data-theme="dark"] .filter-highlight-code {
  background: transparent;
}

html[data-theme="dark"] .filter-highlight-ticket input,
html[data-theme="dark"] .filter-highlight-code input,
html[data-theme="dark"] .filter-bar input[id$="filter-ticket"],
html[data-theme="dark"] .filter-bar input[id$="filter-code"] {
  background: var(--input-bg);
  border-color: var(--border);
  color: var(--app-text);
}

html[data-theme="dark"] .btn-filter-reset-green {
  color: var(--app-text) !important;
  background: var(--app-surface) !important;
  border-color: var(--app-border-strong) !important;
}

html[data-theme="dark"] .btn-filter-reset-green:hover {
  color: var(--app-text) !important;
  background: var(--app-surface-muted) !important;
  border-color: var(--navy-600) !important;
}

html[data-theme="dark"] .datagrid-table td.cell-selected,
html[data-theme="dark"] .datagrid-table th.cell-selected {
  background: var(--primary-soft) !important;
  outline: 1px solid var(--primary);
}

html[data-theme="dark"] .btn-action.danger-outline {
  background: var(--app-surface-muted);
  color: #f87171;
  border-color: #7f1d1d;
}

html[data-theme="dark"] .btn-action.danger-outline:hover {
  background: #3f1515;
}

html[data-theme="dark"] .datagrid-table tbody td,
html[data-theme="dark"] .datagrid-table thead th,
html[data-theme="dark"] .datagrid-table tfoot td {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

html[data-theme="dark"] .datagrid-table tbody tr:nth-child(even) td {
  background: var(--app-table-row-alt);
}

html[data-theme="dark"] .batch-divider-row td,
html[data-theme="dark"] .batch-header-row td {
  background: var(--app-surface-muted) !important;
  color: var(--app-text-muted);
}

html[data-theme="dark"] .btn-action.secondary {
  background: var(--app-surface-muted);
  color: var(--app-text);
  border-color: var(--border);
}

html[data-theme="dark"] .btn-action.secondary:hover {
  background: var(--app-surface-alt);
}

html[data-theme="dark"] .vehicle-detail-modal {
  background: rgba(241, 245, 249, 0.88);
}

html[data-theme="dark"] .invoice-modal,
html[data-theme="dark"] .tracking-modal {
  background: #eef2f7;
}

html[data-theme="dark"] .invoice-sheet,
html[data-theme="dark"] .tracking-capture-sheet,
html[data-theme="dark"] .tracking-route-panel,
html[data-theme="dark"] .tracking-status-bar {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

html[data-theme="dark"] .vehicle-list-table tbody tr:hover {
  background: var(--app-surface-muted);
}

html[data-theme="dark"] .inbound-intro,
html[data-theme="dark"] .outbound-intro,
html[data-theme="dark"] .query-intro,
html[data-theme="dark"] .import-meta,
html[data-theme="dark"] .vehicle-detail-summary {
  color: var(--app-text-muted);
}

html[data-theme="dark"] .table-viewport-wrap,
html[data-theme="dark"] .vehicle-view-table-wrap {
  border-color: var(--app-border);
  background: transparent;
}

html[data-theme="dark"] .vehicle-cargo-stat-card.tone-blue {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
html[data-theme="dark"] .vehicle-cargo-stat-card.tone-teal {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
}
html[data-theme="dark"] .vehicle-cargo-stat-card.tone-green {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
}
html[data-theme="dark"] .vehicle-cargo-stat-card.tone-purple {
  background: rgba(147, 51, 234, 0.12);
  border-color: rgba(192, 132, 252, 0.35);
}
html[data-theme="dark"] .vehicle-cargo-stat-card.tone-orange {
  background: rgba(234, 88, 12, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
}
html[data-theme="dark"] .vehicle-cargo-stat-card.tone-navy {
  background: rgba(30, 58, 138, 0.14);
  border-color: rgba(96, 165, 250, 0.25);
}
html[data-theme="dark"] .vehicle-cargo-stat-card .stat-label {
  color: var(--app-text-muted);
}

@media (max-width: 900px) {
  body:not(.app-mode) {
    align-items: flex-start;
  }

  .page-stage {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    overflow: visible;
  }

  .form-panel {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    background: #ffffff;
    padding: 160px 24px 40px;
  }

  .login-left-logo-wrap {
    height: 140px;
    padding: 16px 24px;
  }

  .login-left-logo {
    max-width: min(56%, 220px);
    max-height: 110px;
  }

  .login-card {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 8px 0 0;
  }

  .login-brand-panel {
    width: 100%;
    min-height: 280px;
    padding: 0;
  }

  .login-brand-visual {
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-width: none;
    max-height: none;
    padding: 24px 10%;
  }

  .login-brand-logo {
    width: 100%;
    height: auto;
    min-height: 0;
    max-width: 88%;
    max-height: 220px;
    object-fit: contain;
  }
}

@media (max-width: 480px) {
  .form-panel {
    padding: 140px 18px 40px;
  }

  .form-title {
    font-size: 1.75rem;
  }

  .login-card {
    max-width: 100%;
  }

  .login-brand-panel {
    min-height: 220px;
    padding: 0;
  }

  .login-brand-visual {
    min-height: 220px;
    padding: 20px 8%;
  }

  .login-brand-logo {
    min-height: 0;
    max-height: 180px;
  }
}

/* —— 新版 UI 组件精修 —— */
.filter-bar {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
}

.query-scope-btn.active {
  background: var(--navy-700) !important;
  border-color: var(--navy-700) !important;
  color: #fff !important;
}

.edit-mode-tabs {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.edit-mode-tab {
  border-radius: 8px;
  font-weight: 600;
}

.edit-mode-tab.active {
  background: var(--app-surface);
  color: var(--navy-800);
  box-shadow: var(--shadow);
}

.table-viewport-wrap,
.vehicle-view-table-wrap {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--radius-md) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.receipt-queue-wrap {
  border: 1px solid var(--gold-soft);
  background: linear-gradient(135deg, rgba(184, 149, 74, 0.08), rgba(26, 51, 84, 0.04));
  border-radius: var(--radius-md);
}

.panel-title-row h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--app-text);
}

.input-wrap input:focus,
.select-wrap select:focus,
.filter-region-select:focus,
.filter-field input:focus {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.invoice-modal,
.tracking-modal,
.vehicle-detail-modal {
  backdrop-filter: blur(6px);
}

.invoice-sheet,
.tracking-capture-sheet {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.analysis-hero {
  border-radius: var(--radius-lg);
}

body.app-mode .app-shell {
  display: flex;
  flex-direction: row;
}

/* —— 界面精简：仅保留按钮与有效菜单 —— */
.inbound-intro,
.outbound-intro,
.query-intro,
.vehicle-panel-intro,
.users-intro,
.import-maker-hint,
.import-meta,
.filter-region-hint,
.main-header .breadcrumb,
.panel-title-row > h3,
.content-panel > h3:first-child,
#vehicle-modal .outbound-intro {
  display: none !important;
}

.panel-title-row {
  justify-content: flex-end;
  margin-bottom: 6px;
}

.filter-bar {
  margin-top: 0;
}

#filter-region-hint.super-admin-scope-hint {
  display: block !important;
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--app-text-muted);
}

.admin-act-as-wrap,
.toolbar-admin-origin {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-act-as-label,
.toolbar-admin-origin .toolbar-maker-label {
  font-size: 0.82rem;
  color: var(--app-text-muted);
  white-space: nowrap;
}

.admin-act-as-select {
  min-width: 168px;
}

.wms-dialog-root {
  position: relative;
  z-index: 12000;
}

.wms-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(241, 245, 249, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 12001;
}

.wms-dialog-panel {
  width: min(440px, 100%);
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 20px 22px 18px;
}

html[data-theme="dark"] .wms-dialog-panel {
  background: #ffffff;
  color: #1f2937;
  border-color: #d8dee8;
}

.wms-dialog-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.wms-dialog-body {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #374151;
}

.wms-dialog-input {
  width: 100%;
  margin: 0 0 14px;
  padding: 9px 11px;
  border: 1px solid #c5cedc;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #111827;
}

.wms-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wms-dialog-btn-ok.danger-outline {
  color: #b42318;
  border-color: #fecdca;
}

.nav-item {
  position: relative;
}

.nav-notify-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.notifications-empty {
  padding: 24px 16px;
  color: var(--text-muted, #64748b);
  background: var(--app-surface, #f8fafc);
  border: 1px dashed var(--app-border, #e2e8f0);
  border-radius: 8px;
}

.notification-item {
  padding: 14px 16px;
  border: 1px solid var(--app-border, #e2e8f0);
  border-radius: 10px;
  background: var(--app-surface, #fff);
}

.notification-item.is-unread {
  border-left: 3px solid var(--accent, #0d9488);
  background: rgba(13, 148, 136, 0.04);
}

.notification-item.is-resolved {
  opacity: 0.72;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.notification-title {
  font-size: 0.95rem;
}

.notification-time {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.notification-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
}

.notification-actions {
  margin-top: 12px;
}

.tutorial-intro {
  margin: 0 0 14px;
  color: var(--text-secondary, #475569);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tutorial-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.tutorial-manual-status {
  font-size: 0.82rem;
  color: #64748b;
}

.tutorial-manual-status.is-error {
  color: #dc2626;
}

.tutorial-manual-viewer {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  min-height: min(72vh, 820px);
}

.tutorial-manual-frame {
  display: block;
  width: 100%;
  min-height: min(72vh, 820px);
  height: min(72vh, 820px);
  border: 0;
  background: #fff;
}

.tutorial-manual-render-host {
  position: fixed;
  left: 0;
  top: 0;
  width: 794px;
  max-width: 794px;
  z-index: -1;
  opacity: 0.01;
  pointer-events: none;
  background: #fff;
  overflow: hidden;
}

.tutorial-manual-render-host.is-active {
  visibility: visible;
}

.datagrid-table th.col-resizable-leading-th {
  /* 注意：这里不能写 position: relative —— 会覆盖 thead th 的 position: sticky，
     导致勾选/№/状态这几个前导列表头一往下拉就滚走。sticky 本身已是定位元素，
     拖拽手柄（.col-resizer 绝对定位）照样以它为准。 */
  position: sticky;
  top: 0;
  z-index: 3;
  /* 前导列（勾选/№/状态）放开 CSS 里的固定宽/最小宽/最大宽限制，实现自由拖拽 */
  min-width: 10px !important;
  max-width: none !important;
}

/* 只给 № / 状态列留出手柄位，勾选列保持原样不受影响 */
.datagrid-table th.manifest-col-seq.col-resizable-leading-th,
.datagrid-table th.manifest-col-status.col-resizable-leading-th {
  padding-right: 14px;
}

.datagrid-table th.col-resizable-th {
  min-width: 10px !important;
  max-width: none !important;
}

.datagrid-table th.col-resizable-leading-th:hover .col-resizer,
.datagrid-table th.col-resizable-th:hover .col-resizer {
  background: rgba(37, 99, 235, 0.5);
}

.login-bg-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-bg-preview-modal.hidden {
  display: none;
}

.login-bg-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(241, 245, 249, 0.88);
}

.login-bg-preview-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 22px 18px;
  color: var(--app-text);
}

.login-bg-preview-card h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.login-bg-preview-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--app-text-muted);
  line-height: 1.5;
}

.login-bg-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.login-bg-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.login-bg-preview-form-overlay {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50%;
  box-sizing: border-box;
  border-right: 1px dashed rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  pointer-events: none;
}

.login-bg-preview-form-overlay span {
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.45);
  letter-spacing: 0.02em;
}

.login-bg-preview-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.login-bg-preview-controls label {
  font-size: 0.85rem;
  color: var(--app-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.login-bg-preview-controls input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--primary);
}

.login-bg-preview-scale-label {
  min-width: 3.2rem;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-text);
}

.login-bg-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ===== 扫码入库（作业入口弹窗 + 仓库/区域→扫码弹窗） ===== */
.ops-entry-modal,
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
}
.ops-entry-modal.hidden,
.scan-modal.hidden {
  display: none;
}
/* 货物图片列：缩略图 + 张数 + 添加按钮 */
th.manifest-col-photo,
td.manifest-col-photo {
  min-width: 7em;
  max-width: 13em;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
}
.photo-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2px 0;
}
.photo-thumb {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 1px;
  cursor: zoom-in;
  width: 44px;
  height: 44px;
  overflow: hidden;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-count {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
}
.photo-add-btn {
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.photo-add-btn:hover {
  border-color: #0ea5e9;
  color: #0284c7;
  background: #f0f9ff;
}
/* 图片粘贴面板 */
.photo-paste-panel {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-paste-panel.hidden {
  display: none;
}
.photo-paste-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.photo-paste-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px 22px;
}
.photo-paste-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.photo-paste-head h4 {
  margin: 0;
  font-size: 1.05rem;
}
.photo-paste-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #64748b;
}
.photo-paste-sub {
  margin: 6px 0 12px;
  color: #64748b;
  font-size: 0.86rem;
}
.photo-paste-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.photo-paste-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.photo-paste-item .photo-thumb {
  width: 84px;
  height: 84px;
  cursor: zoom-in;
}
.photo-del-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 0.78rem;
  padding: 2px 10px;
  cursor: pointer;
}
.photo-paste-drop {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.9rem;
  text-align: center;
  padding: 26px 12px;
  cursor: pointer;
  outline: none;
}
.photo-paste-drop:focus {
  border-color: #0ea5e9;
  background: #f0f9ff;
}
.photo-paste-tip {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.8rem;
}
/* 扫码弹窗打开时，左侧菜单浮到遮罩之上：扫码途中去「查询」不用先关弹窗 */
body.scan-modal-open .sidebar {
  position: relative;
  z-index: 1400;
}
.ops-entry-card,
.scan-modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  width: min(560px, 100%);
  padding: 26px;
}
.scan-modal-card {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
}
.ops-entry-card h4,
.scan-modal-head h4 {
  margin: 0;
  font-size: 1.35rem;
}
.scan-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.scan-modal-badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.82rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}
.scan-modal-badge.is-active {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}
.scan-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.ops-entry-sub,
.scan-setup-tip,
.scan-hint {
  color: #64748b;
  font-size: 0.88rem;
}
.ops-entry-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
.ops-entry-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}
.ops-entry-option:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
}
.ops-entry-icon {
  font-size: 2rem;
}
.ops-entry-label {
  font-size: 1.25rem;
  font-weight: 800;
}
.ops-entry-desc {
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}
.ops-entry-option-out {
  border-color: #fde68a;
  background: #fffbeb;
}
.ops-entry-actions {
  display: flex;
  justify-content: center;
}
.scan-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.scan-form-field select,
.scan-zone-add input,
.scan-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}
.scan-input {
  font-size: 1.05rem;
  border-width: 2px;
  border-color: #0ea5e9;
  background: #f0f9ff;
  margin-top: 10px;
}
.scan-zone-add {
  display: flex;
  gap: 8px;
}
.scan-setup-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.scan-stage.hidden {
  display: none;
}
.scan-target {
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.scan-stats {
  margin: 10px 0 8px;
  font-weight: 700;
}
.scan-list-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.scan-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.scan-list-table th,
.scan-list-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.scan-list-table th {
  background: #f8fafc;
  position: sticky;
  top: 0;
}
.scan-list-empty {
  text-align: center;
  color: #94a3b8;
  padding: 18px;
}
.scan-stage-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
@media (max-width: 560px) {
  .ops-entry-options {
    grid-template-columns: 1fr;
  }
}
@media print {
  .ops-entry-modal,
  .scan-modal {
    display: none !important;
  }
  #btnScanInbound {
    display: none !important;
  }
}

/* ===== 入库子菜单：批量上传（左侧导航二级项） ===== */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-item.nav-sub-item {
  margin: 2px 0 0 0;
  padding-left: 34px;
  font-size: 0.85rem;
  opacity: 0.92;
}

.nav-item.nav-sub-item::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 8px;
  height: 2px;
  transform: translateY(-50%);
  background: currentColor;
  opacity: 0.45;
  border-radius: 2px;
}

.nav-item.nav-sub-item {
  position: relative;
}

/* ===== 批量上传面板 ===== */
#panel-batch-upload.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* 同上：内容超过一屏时允许纵向滚动，保证下方表格可见 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 14px;
}

.bulk-upload-toolbar {
  flex-wrap: wrap;
  row-gap: 8px;
}

.bulk-upload-grid-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  margin-top: 10px;
}

.bulk-upload-table {
  width: max-content;
  min-width: 100%;
}

.bulk-upload-table th,
.bulk-upload-table td {
  padding: 2px 4px;
}

.bulk-upload-table thead th.bulk-head-cell,
.bulk-upload-table th.bulk-no-cell,
.bulk-upload-table th.bulk-op-cell {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  color: var(--app-text);
}

.bulk-upload-table th.bulk-no-cell,
.bulk-upload-table td.bulk-no-cell {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.bulk-upload-table th.bulk-op-cell,
.bulk-upload-table td.bulk-op-cell {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
}

.bulk-upload-table td.bulk-input-cell {
  padding: 1px 2px;
}

.bulk-upload-table .bulk-input {
  width: 100%;
  min-width: 84px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 5px 6px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--app-text);
  outline: none;
}

.bulk-upload-table .bulk-input:hover {
  border-color: #cbd5e1;
}

.bulk-upload-table .bulk-input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.bulk-upload-table tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.06);
}

.bulk-upload-table .btn-bulk-row-del {
  appearance: none;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.bulk-upload-table .btn-bulk-row-del:hover {
  background: #fee2e2;
}

/* 直接上传：拖选时禁止文字被选中（松开即恢复） */
body.bulk-dragging,
body.bulk-dragging .bulk-upload-table td {
  user-select: none;
  -webkit-user-select: none;
}

/* 直接上传：图片格 + Excel 式选区（单元格 / 整行 / 整列 / 全选） */
.bulk-upload-table th.bulk-corner-cell,
.bulk-upload-table th.bulk-head-cell {
  cursor: pointer;
}

.bulk-upload-table th.bulk-head-photo {
  background: #e0f2fe;
}

.bulk-upload-table th.bulk-head-selected {
  background: #bfdbfe;
  color: #1e3a8a;
}

.bulk-upload-table td.bulk-no-cell[data-bulk-row-head] {
  cursor: pointer;
}

.bulk-upload-table td.bulk-photo-cell {
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}

.bulk-upload-table .bulk-photo-box {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 26px;
  min-width: 78px;
  padding: 2px 4px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
}

.bulk-upload-table .bulk-photo-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
}

.bulk-upload-table .bulk-photo-thumb {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.bulk-upload-table .bulk-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bulk-upload-table tbody tr td.bulk-cell-selected,
.bulk-upload-table tbody tr:nth-child(even) td.bulk-cell-selected {
  background: rgba(37, 99, 235, 0.14);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.5);
}

.bulk-upload-table tbody tr td.bulk-cell-selected .bulk-input {
  background: rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] .bulk-upload-table th.bulk-head-photo {
  background: rgba(56, 189, 248, 0.18);
}

html[data-theme="dark"] .bulk-upload-table th.bulk-head-selected {
  background: rgba(59, 130, 246, 0.3);
  color: #dbeafe;
}

html[data-theme="dark"] .bulk-upload-table .bulk-photo-box {
  background: rgba(148, 163, 184, 0.12);
  border-color: #475569;
}

.bulk-upload-stats {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bulk-stat-card {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--app-surface);
}

.bulk-stat-card.tone-blue { background: #eff6ff; border-color: #bfdbfe; }
.bulk-stat-card.tone-green { background: #ecfdf5; border-color: #a7f3d0; }
.bulk-stat-card.tone-amber { background: #fffbeb; border-color: #fde68a; }
.bulk-stat-card.tone-violet { background: #f5f3ff; border-color: #ddd6fe; }

.bulk-stat-label {
  margin: 0;
  font-size: 0.72rem;
  color: #475569;
}

.bulk-stat-value {
  margin: 2px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .bulk-upload-table thead th.bulk-head-cell,
html[data-theme="dark"] .bulk-upload-table th.bulk-no-cell,
html[data-theme="dark"] .bulk-upload-table th.bulk-op-cell {
  background: #1e293b;
  color: #e2e8f0;
}

html[data-theme="dark"] .bulk-upload-table .bulk-input:focus {
  background: #0f172a;
}

html[data-theme="dark"] .bulk-stat-card.tone-blue { background: rgba(37, 99, 235, 0.14); }
html[data-theme="dark"] .bulk-stat-card.tone-green { background: rgba(16, 185, 129, 0.14); }
html[data-theme="dark"] .bulk-stat-card.tone-amber { background: rgba(245, 158, 11, 0.14); }
html[data-theme="dark"] .bulk-stat-card.tone-violet { background: rgba(139, 92, 246, 0.14); }

@media (max-width: 900px) {
  .bulk-upload-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== 入库大菜单：默认只显示大菜单，双击展开/收起子菜单 ===== */
.nav-group .nav-sub-item {
  overflow: hidden;
  max-height: 44px;
  opacity: 1;
  transition: max-height 0.18s ease, opacity 0.18s ease, margin 0.18s ease, padding 0.18s ease;
}

.nav-group.collapsed .nav-sub-item {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.nav-group-parent .nav-caret {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.nav-group:not(.collapsed) .nav-group-parent .nav-caret {
  transform: rotate(90deg);
}

/* 表头「打印」一键按钮：等同全选打印下方全部票号 */
.btn-qr-print-all {
  appearance: none;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.6;
  font-family: inherit;
}

.btn-qr-print-all:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.btn-qr-print-all:active {
  background: #bfdbff;
}

/* 超大运单（上千行）上下滚动优化：屏幕外的行跳过渲染，只保留占位高度。
   表格为固定列宽布局，列宽不受影响；点了还能照常选中、复制、打印。 */
.datagrid-table tbody tr {
  content-visibility: auto;
  contain-intrinsic-size: auto 34px;
}

/* 扫码作业三模式切换（入库 / 出库 / 交付） */
.scan-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 0 18px 10px;
}

.scan-mode-tab {
  appearance: none;
  flex: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.scan-mode-tab:hover {
  border-color: #94a3b8;
  background: #eef2f7;
}

.scan-mode-tab.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

/* ===== 库存管理：查询 / 新建 / 删除 / 分析 ===== */
.inventory-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 8px;
}

.inventory-summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 2px;
}

.inventory-region-card {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  padding: 12px 14px 14px;
}

.inventory-region-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.inventory-region-head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--app-text);
}

.inventory-region-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inventory-zone-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.inventory-zone-card {
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inventory-zone-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.inventory-zone-card.is-empty {
  cursor: default;
  opacity: 0.75;
}

.inventory-zone-card.is-empty:hover {
  border-color: var(--app-border);
  box-shadow: none;
}

.inventory-zone-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.inventory-zone-head strong {
  font-size: 0.85rem;
  color: var(--app-text);
}

.inventory-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.inventory-tag-empty {
  background: #f1f5f9;
  color: #64748b;
}

.inventory-zone-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inventory-zone-stats {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.inventory-zone-actions {
  margin-top: 8px;
}

.inventory-zone-actions .btn-action {
  font-size: 0.74rem;
  padding: 3px 10px;
}

.inventory-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-chip {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.inventory-chip.is-empty {
  border-color: var(--app-border);
  background: #f8fafc;
  color: #64748b;
}

.inventory-empty {
  padding: 22px 16px;
  border: 1px dashed var(--app-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.inventory-detail {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: #f8fbff;
  padding: 12px 14px 14px;
}

.inventory-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.inventory-detail-table-wrap {
  max-height: 300px;
  overflow: auto;
}

.inventory-row-actions {
  white-space: nowrap;
}

.inventory-row-actions .btn-action {
  font-size: 0.74rem;
  padding: 3px 10px;
}

.inventory-bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 72px;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.inventory-bar-label {
  font-size: 0.78rem;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.inventory-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.inventory-bar-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.analysis-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.inventory-host .analysis-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analysis-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inventory-host .analysis-card strong {
  font-size: 1.15rem;
  color: var(--app-text);
}

.analysis-section-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--app-text);
  margin: 4px 0 -2px;
}

@media (max-width: 640px) {
  .inventory-zone-list {
    grid-template-columns: 1fr;
  }
  .inventory-bar-row {
    grid-template-columns: 78px 1fr 60px;
  }
}

/* ===== 库存管理面板布局：与用户管理/新建仓库保持同一套表单样式 ===== */
#panel-inventory-query.content-panel.active,
#panel-inventory-create.content-panel.active,
#panel-inventory-delete.content-panel.active,
#panel-inventory-analysis.content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#panel-inventory-query .users-intro,
#panel-inventory-create .users-intro,
#panel-inventory-delete .users-intro,
#panel-inventory-analysis .users-intro {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
  flex-shrink: 0;
}

/* —— 新建库存区域：表单卡片 —— */
#panel-inventory-create .users-create-card {
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 16px 18px 18px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

#panel-inventory-create .users-create-card h4 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--app-text);
}

#panel-inventory-create .users-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 18px;
  align-items: end;
}

#panel-inventory-create .users-form-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#panel-inventory-create .users-form-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--app-text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

#panel-inventory-create .users-form-field input,
#panel-inventory-create .users-form-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--input-bg);
  color: var(--app-text);
}

#panel-inventory-create .users-create-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 2px;
}

/* 新建结果区：普通文档流，不抢高度 */
.inventory-create-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 auto;
}

.inventory-create-result:empty {
  display: none;
}

.inventory-create-result .inventory-region-card {
  margin: 0;
}

/* 库存管理各面板：内部滚动交给 .inventory-host，卡片不吸顶 */
#panel-inventory-query .inventory-host,
#panel-inventory-create .inventory-host,
#panel-inventory-delete .inventory-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
}

#panel-inventory-query .inventory-host:empty,
#panel-inventory-create .inventory-host:empty,
#panel-inventory-delete .inventory-host:empty {
  flex: 0 0 auto;
}

/* 库存分析面板：沿用分析面板排版，但去掉多余留白 */
#panel-inventory-analysis .analysis-dashboard {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  gap: 14px;
}

/* ===== 扫码包裹面板：扫一件后立即展示整票包裹（已扫绿 / 未扫红） ===== */
.scan-parcel-panel {
  margin: 8px 0 4px;
  padding: 10px 12px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  flex-shrink: 0;
}

.scan-parcel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.scan-parcel-head strong {
  font-size: 0.9rem;
  color: var(--app-text);
}

.scan-parcel-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 1px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.scan-parcel-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.scan-parcel-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-left: 4px;
}

.scan-parcel-dot.is-done {
  background: #16a34a;
}

.scan-parcel-dot.is-todo {
  background: #dc2626;
}

.scan-parcel-close {
  margin-left: auto;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.scan-parcel-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.scan-parcel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
}

.scan-parcel-chip {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 已扫描：绿色 */
.scan-parcel-chip.is-done {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

/* 未扫描：红色 */
.scan-parcel-chip.is-todo {
  background: #fee2e2;
  border-color: #dc2626;
  color: #b91c1c;
}

/* 本次刚扫到的那一件：高亮描边，方便扫码员确认 */
.scan-parcel-chip.is-just {
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.45);
}

.scan-parcel-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.scan-progress-cell {
  font-weight: 700;
  color: #15803d;
}

.scan-progress-cell.is-partial {
  color: #b45309;
}

.scan-row-open {
  cursor: pointer;
}

/* 扫码输入行：输入框 + 测试声音按钮 */
.scan-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.scan-input-row .scan-input {
  flex: 1;
  min-width: 0;
}

.scan-sound-test {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 扫码结果闪屏：成功绿 / 重复黄 / 失败红，声音听不见时看它 */
#scan-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
}

#scan-flash.show-ok {
  animation: scan-flash-ok 0.45s ease-out;
}

#scan-flash.show-dup {
  animation: scan-flash-dup 0.45s ease-out;
}

#scan-flash.show-error {
  animation: scan-flash-error 0.45s ease-out;
}

@keyframes scan-flash-ok {
  0% { opacity: 1; box-shadow: inset 0 0 0 6px #16a34a, inset 0 0 60px rgba(22, 163, 74, 0.45); }
  100% { opacity: 0; box-shadow: inset 0 0 0 6px rgba(22, 163, 74, 0), inset 0 0 60px rgba(22, 163, 74, 0); }
}

@keyframes scan-flash-dup {
  0% { opacity: 1; box-shadow: inset 0 0 0 6px #d97706, inset 0 0 60px rgba(217, 119, 6, 0.45); }
  100% { opacity: 0; box-shadow: inset 0 0 0 6px rgba(217, 119, 6, 0), inset 0 0 60px rgba(217, 119, 6, 0); }
}

@keyframes scan-flash-error {
  0% { opacity: 1; box-shadow: inset 0 0 0 6px #dc2626, inset 0 0 60px rgba(220, 38, 38, 0.5); }
  100% { opacity: 0; box-shadow: inset 0 0 0 6px rgba(220, 38, 38, 0), inset 0 0 60px rgba(220, 38, 38, 0); }
}

/* 上次扫码内容诊断行 */
.scan-last-payload {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* 多选一对话框（导出模式选择等） */
.wms-dialog-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.wms-dialog-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  white-space: normal;
  padding: 10px 14px;
}

.wms-dialog-choice-label {
  font-weight: 600;
}

.wms-dialog-choice-hint {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.75;
  line-height: 1.4;
}

/* 扫描面板：主票 / 副票 标识 */
.scan-parcel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.scan-parcel-role {
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.08);
  opacity: 0.85;
  white-space: nowrap;
}

.scan-parcel-chip.is-main-parcel .scan-parcel-role {
  background: rgba(180, 83, 9, 0.16);
  color: #b45309;
  font-weight: 600;
}

.scan-parcel-chip.is-done .scan-parcel-role {
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
}

/* 唯一包裹号标签：长按打标后的徽标 */
.scan-parcel-chip .scan-parcel-tag {
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.scan-parcel-tags {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
}

.scan-parcel-chip.has-tags {
  border-style: dashed;
}

/* 长按进行中：2 秒内逐渐填色，松手即取消 */
.scan-parcel-chip.is-pressing {
  position: relative;
  overflow: hidden;
  cursor: progress;
}

.scan-parcel-chip.is-pressing::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.75;
  transform-origin: left center;
  animation: scanChipPress 1s linear forwards;
}

@keyframes scanChipPress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.scan-parcel-chip-no {
  font-variant-numeric: tabular-nums;
}

/* 长按提示行 */
.scan-parcel-taghint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* 多选一对话框：已选中项 */
.wms-dialog-choice.is-active {
  border-color: #f59e0b;
  background: #fffbeb;
}

.wms-dialog-choice.is-active .wms-dialog-choice-label::before {
  content: "✓ ";
  color: #b45309;
  font-weight: 700;
}

/* 表格/清单里的唯一包裹号标签徽标 */
.parcel-tag-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.parcel-tag-badge {
  display: inline-block;
  font-size: 10px;
  line-height: 1.5;
  padding: 0 5px;
  border-radius: 4px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

/* 打印标签上的标签徽标（大一号，方便装卸人员看） */
.qr-print-tag {
  display: inline-block;
  margin: 0 4px 2px 0;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-weight: 700;
}


/* ===== 客户管理 / 我的订单 ===== */
.toolbar-customer .customer-select {
  min-width: 220px;
}
.toolbar-customer .customer-select.is-empty,
.customer-select.error {
  border-color: #e5484d;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.16);
}
#panel-customers .users-intro,
#panel-my-orders .users-intro {
  margin: 0 0 12px;
}
#panel-customers .panel-title-actions,
#panel-my-orders .panel-title-actions {
  display: flex;
  gap: 8px;
}
#panel-customers .empty-row td,
#panel-my-orders .empty-row td {
  text-align: center;
  padding: 22px 10px;
}
.customer-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  background: #eef2ff;
  color: #3b4cca;
  font-weight: 700;
  vertical-align: middle;
}
/* 客户管理列表放大：行高字大、按钮大，铺满整个卡片 */
#customers-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  font-size: .95rem;
}
#customers-table thead th {
  font-size: .88rem;
  padding: 15px 18px;
  background: var(--app-table-head);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
#customers-table tbody td {
  padding: 16px 18px;
  font-size: .95rem;
  vertical-align: middle;
}
#customers-table tbody tr:hover td {
  background: #f8fafc;
}
#customers-table .customer-avatar {
  width: 42px;
  height: 42px;
  margin-right: 12px;
  font-size: 1.05rem;
}
#customers-table .customer-cell strong {
  font-size: 1.02rem;
}
#customers-table .customer-cell small {
  font-size: .8rem;
}
#customers-table .customer-status {
  padding: 5px 16px;
  border-radius: 999px;
  font-size: .82rem;
}
#panel-customers tbody td .btn-action {
  margin-right: 10px;
  padding: 8px 22px;
  font-size: .85rem;
  border-radius: 999px;
}
#panel-customers tbody td .btn-action:last-child {
  margin-right: 0;
}
.customer-cell {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  line-height: 1.3;
}
.customer-cell small {
  color: #8a94a6;
  font-size: 12px;
}
.customer-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.customer-status.is-on {
  background: #e8f7ee;
  color: #1a7f45;
}
.customer-status.is-off {
  background: #fdeaea;
  color: #c0392b;
}
#panel-customers tbody td .btn-action {
  margin-right: 6px;
  padding: 4px 10px;
  font-size: 13px;
}
.myo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}
.myo-stat {
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-subtle-bg, #f5f7fb);
  border: 1px solid var(--panel-border, #e4e8f0);
}
.myo-stat-label {
  display: block;
  font-size: 12px;
  color: #7b8494;
}
.myo-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
}
#panel-my-orders .parcel-tag-badges {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ===== 客户删除弹窗（名下订单必须先转移或移除） ===== */
#customer-delete-body {
  margin: 4px 0 12px;
}
.customer-delete-line {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2a3140;
}
.customer-delete-meta {
  margin: 0 0 4px;
  font-size: 13px;
  color: #7b8494;
}
.customer-delete-warn {
  margin: 10px 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #a3421a;
  background: rgba(233, 137, 61, 0.12);
  border: 1px solid rgba(233, 137, 61, 0.35);
}
html[data-theme="dark"] .customer-delete-line {
  color: #e6ebf5;
}
html[data-theme="dark"] .customer-delete-warn {
  color: #f0b184;
  background: rgba(233, 137, 61, 0.16);
}

/* ===== 登录账号输入（只允许英文字母前缀） ===== */
.account-email-bad {
  border-color: #e0724d !important;
  box-shadow: 0 0 0 2px rgba(224, 114, 77, 0.16) !important;
}
.account-email-warn {
  color: #c1541f !important;
}
html[data-theme="dark"] .account-email-warn {
  color: #f0b184 !important;
}

/* ===== 订单管理（三级子菜单 + 查找结果卡） ===== */
.nav-sub-group {
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.18s ease;
}
.nav-sub-group.collapsed {
  max-height: 0;
}
.nav-item.nav-sub-parent .nav-caret {
  margin-left: auto;
  transition: transform 0.18s ease;
}
.nav-item.nav-sub-parent[aria-expanded="true"] .nav-caret {
  transform: rotate(90deg);
}
.nav-item.nav-sub-item.nav-sub-sub {
  padding-left: 52px;
  font-size: 0.82rem;
}
.nav-item.nav-sub-item.nav-sub-sub::before {
  left: 40px;
}
/* 账单 → 口岸账单 的第四级菜单（报关/清关/转关/其他） */
.nav-item.nav-sub-item.nav-sub-depth-3 {
  padding-left: 68px;
  font-size: 0.78rem;
}
.nav-item.nav-sub-item.nav-sub-depth-3::before {
  left: 56px;
}
#nav-subgroup-bill {
  max-height: 420px;
}
#nav-subgroup-bill.collapsed {
  max-height: 0;
}
#nav-subgroup-bill-port {
  max-height: 220px;
}
#nav-subgroup-bill-port.collapsed {
  max-height: 0;
}
.order-result {
  margin: 4px 0 12px;
}
.order-result-empty {
  margin: 0;
  padding: 10px 12px;
  color: #7b8494;
  font-size: 13px;
}
.order-result-card {
  border: 1px solid var(--panel-border, #e4e8f0);
  border-radius: 10px;
  background: var(--panel-subtle-bg, #f5f7fb);
  padding: 10px 14px;
  max-width: 640px;
}
.order-result-row {
  display: flex;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
}
.order-result-row span {
  min-width: 70px;
  color: #7b8494;
}
.order-result-row strong {
  color: #2a3140;
  font-weight: 600;
  word-break: break-all;
}
html[data-theme="dark"] .order-result-card {
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .order-result-row span {
  color: #9aa3b5;
}
html[data-theme="dark"] .order-result-row strong {
  color: #e6ebf5;
}

tr.batch-divider-row.order-locate-flash > td {
  animation: order-locate-blink 1s ease-in-out 3;
  background: rgba(64, 158, 255, 0.22);
}
@keyframes order-locate-blink {
  0%, 100% { background: rgba(64, 158, 255, 0.22); }
  50% { background: rgba(64, 158, 255, 0.55); }
}

/* ===== 查询页：只显示订单表；筛选/统计/打印区隐藏 ===== */
#panel-query.order-list-mode .query-intro,
#panel-query.order-list-mode #query-scope-toggle,
#panel-query.order-list-mode #query-waybill-meta,
#panel-query.order-list-mode #query-filter-bar,
#panel-query.order-list-mode #query-qr-print-bar,
#panel-query.order-list-mode #query-cargo-stats {
  display: none !important;
}
#panel-inbound-import.order-list-mode .inbound-intro,
#panel-inbound-import.order-list-mode #inbound-waybill-meta,
#panel-inbound-import.order-list-mode #inbound-filter-bar,
#panel-inbound-import.order-list-mode #inbound-qr-print-bar,
#panel-inbound-import.order-list-mode #inbound-cargo-stats,
#panel-outbound.order-list-mode .outbound-intro,
#panel-outbound.order-list-mode #outbound-waybill-meta,
#panel-outbound.order-list-mode #outbound-filter-bar,
#panel-outbound.order-list-mode #outbound-cargo-stats {
  display: none !important;
}
#query-data-table th,
#query-data-table td {
  vertical-align: middle;
}
#tbody-query tr.empty-row td {
  text-align: center;
  color: #7b8494;
  padding: 22px 12px;
}
.ord-cust-acct {
  font-size: 12px;
  color: #7b8494;
}
.batch-sum-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  background: rgba(64, 158, 255, 0.12);
  color: #2f6fed;
}
.ord-view-batch {
  border: 1px solid #c9d4e4;
  background: #fff;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #2f6fed;
  white-space: nowrap;
}
.ord-view-batch:hover {
  border-color: #2f6fed;
  background: rgba(64, 158, 255, 0.08);
}
html[data-theme="dark"] table.order-table-mode tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] table.order-table-mode tr.order-total-row td {
  background: rgba(224, 82, 82, 0.08);
}
html[data-theme="dark"] .ord-cust-acct { color: #9aa3b5; }
html[data-theme="dark"] .ord-view-batch {
  background: transparent;
  color: #8fb8ff;
  border-color: #3a4a63;
}
.ord-out-batch {
  border: 1px solid #2f6fed;
  background: #2f6fed;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
  margin-left: 6px;
}
.ord-out-batch:hover { background: #1f5fe0; }
html[data-theme="dark"] .ord-out-batch {
  background: #2f6fed;
  color: #fff;
  border-color: #2f6fed;
}
.query-detail-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 13px;
  color: #2a3140;
}

/* ===== 订单表铺满 + 客户可搜索下拉 ===== */
table.order-table-mode {
  width: 100%;
  table-layout: fixed;
  font-size: 0.85rem;
}
table.order-table-mode th,
table.order-table-mode td {
  padding: 10px 14px;
  overflow: hidden;
}
table.order-table-mode tbody tr:hover td {
  background: #f6f9fd;
}
table.order-table-mode td strong {
  font-weight: 600;
}
table.order-table-mode tr.order-total-row td {
  font-weight: 700;
  color: #c0392b;
  background: #fdf3f2;
  border-top: 1px solid var(--panel-border, #e4e8f0);
}
.cust-combo {
  position: relative;
  min-width: 200px;
}
.cust-combo-input {
  width: 100%;
}
.cust-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--panel-border, #e4e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(30, 45, 70, 0.14);
  z-index: 60;
  padding: 4px;
}
.cust-combo-item {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-combo-item:hover {
  background: rgba(64, 158, 255, 0.1);
}
.cust-combo-item.selected {
  background: rgba(64, 158, 255, 0.16);
  font-weight: 600;
}
.cust-combo-empty,
.cust-combo-more {
  padding: 7px 10px;
  font-size: 12px;
  color: #7b8494;
}
html[data-theme="dark"] .cust-combo-list {
  background: #1c2333;
  border-color: #3a4a63;
}
html[data-theme="dark"] .cust-combo-item:hover {
  background: rgba(64, 158, 255, 0.18);
}
html[data-theme="dark"] #query-data-table.order-table-mode tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

/* ===== 查询面板 + 财务订单 筛选栏布局：网格排布 + 控件统一等宽对齐 ===== */
/* 只作用于 #order-filter-bar（查询）与 #finord-filter-bar（财务订单），入库、出库不受影响 */
#order-filter-bar .filter-bar-row,
#finord-filter-bar .filter-bar-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px 14px;
  align-items: end;
}

#order-filter-bar .filter-field,
#finord-filter-bar .filter-field {
  min-width: 0;
  flex: none;
}

#order-filter-bar .filter-field label,
#finord-filter-bar .filter-field label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 控件统一撑满所在列，避免出现「下拉宽、输入框窄」的参差感 */
#order-filter-bar .filter-field input,
#order-filter-bar .filter-field select,
#order-filter-bar .cust-combo,
#order-filter-bar .cust-combo-input,
#finord-filter-bar .filter-field input,
#finord-filter-bar .filter-field select,
#finord-filter-bar .cust-combo,
#finord-filter-bar .cust-combo-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* 客户下拉自带 200px 最小宽，放进网格要放开，否则会撑破列 */
#order-filter-bar .cust-combo,
#finord-filter-bar .cust-combo {
  min-width: 0;
}

#order-filter-bar .filter-field input,
#order-filter-bar .filter-field select,
#finord-filter-bar .filter-field input,
#finord-filter-bar .filter-field select {
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* 重置按钮不占整列，贴齐所在行控件底部 */
#order-filter-bar #ord-filter-reset,
#finord-filter-bar #finord-filter-reset {
  white-space: nowrap;
  align-self: end;
  margin-bottom: 1px;
}

/* 中等宽度：3 列，避免输入框被压到截断占位文字 */
@media (max-width: 1080px) {
  #order-filter-bar .filter-bar-row,
  #finord-filter-bar .filter-bar-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  }
}

/* 窄屏：2 列 */
@media (max-width: 820px) {
  #order-filter-bar .filter-bar-row,
  #finord-filter-bar .filter-bar-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

/* ===== 财务管理：大菜单子菜单（订单管理 / 运输管理 / 工资管理 / 其他） ===== */
.finance-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
}

.finance-tab {
  padding: 10px 28px;
  font-size: 1.02rem;
  font-weight: 700;
  min-width: 132px;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  background: #fafaf9;
  color: #44403c;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.finance-tab:hover {
  background: #f5f5f4;
  border-color: #a8a29e;
}

.finance-tab.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

/* 运输管理第二排子菜单 */
.finance-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
}

.finance-subtabs.hidden {
  display: none;
}

.finance-subtab {
  padding: 7px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--app-text);
  cursor: pointer;
}

.finance-subtab.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

.finance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.finance-summary b {
  color: #b45309;
}

.finance-warehouse-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-warehouse-btn {
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.finance-warehouse-btn.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

.finance-salary-input {
  width: 130px;
  padding: 5px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
}

.finance-note {
  color: var(--app-text-muted, #6b7280);
  font-size: 0.85rem;
  margin: 0 0 10px;
}

/* ===== 财务-编辑内的改单 / 补单 / 删单切换（与左侧编辑页同款式） ===== */
.finance-edit-mode-tabs {
  margin: 0 0 8px;
}

.finance-edit-tab {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  background: #fafaf9;
  color: #44403c;
  cursor: pointer;
}

.finance-edit-tab:hover {
  background: #f5f5f4;
  border-color: #a8a29e;
}

.finance-edit-tab.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

/* ===== 车辆查看 → 添加订单：出库页顶部提示条 ===== */
.vehicle-add-order-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 8px;
  flex-shrink: 0;
}

.vehicle-add-order-bar.hidden {
  display: none;
}

.vehicle-add-order-hint {
  margin: 0;
  flex: 1;
  min-width: 240px;
}

.vehicle-add-order-actions {
  display: flex;
  gap: 8px;
}

/* ================= 互动 ================= */
.interaction-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.im-layout {
  display: flex;
  gap: 12px;
  min-height: 480px;
  flex: 1;
}

.im-side {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.im-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--app-text-muted, #6b7280);
}

.im-pick select {
  padding: 7px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
#im-peer-search-staff,
#im-peer-search-customer {
  padding: 9px 12px;
  font-size: 0.85rem;
  border: 2px solid #1c1917;
  border-radius: 9px;
  background: #fff;
  color: #1c1917;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
#im-peer-search-staff::placeholder,
#im-peer-search-customer::placeholder {
  color: #78716c;
}
#im-peer-search-staff:focus,
#im-peer-search-customer:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
.im-pick > span {
  font-weight: 700;
  color: #1c1917;
}

.im-thread-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  min-height: 60px;
}
/* 左侧栏整体上下滑动：搜索框 + 会话列表一起滚 */
.im-side {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}
.im-side::-webkit-scrollbar {
  width: 10px;
}
.im-side::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}
.im-side::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

.im-thread {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafaf9;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.im-thread.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.im-thread.active small {
  color: rgba(255,255,255,.85);
}

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

.im-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px 4px;
  letter-spacing: .05em;
}
.im-sec-head em { font-style: normal; font-weight: 400; opacity: .6; font-size: 11px; }
.im-sec-head.sec-group { color: #1d4ed8; }
.im-sec-head.sec-staff { color: #0f766e; }
.im-sec-head.sec-customer { color: #c2410c; }
.im-thread-staff { border-left: 3px solid #14b8a6; }
.im-thread-customer { border-left: 3px solid #fb923c; }
.im-thread-group { border-left: 3px solid #60a5fa; }
.im-peer-staff { border-left: 3px solid #14b8a6; }
.im-peer-customer { border-left: 3px solid #fb923c; }
.im-thread-main small {
  color: #44403c;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.im-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* 会话头像左上角未读数（微信同款红圈） */
.im-thread-avatar {
  position: relative;
  flex-shrink: 0;
}
.im-thread-unread {
  position: absolute;
  top: -7px;
  left: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  z-index: 2;
}

.im-chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  /* 底色透明，底层水印从消息区空白处透出来；气泡本身不透明，内容不受影响 */
  background: transparent;
  overflow: hidden;
}

.im-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--app-surface-muted);
}

.im-chat-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.im-chat-title small {
  color: var(--app-text-muted, #6b7280);
  font-size: 0.75rem;
}

.im-messages {
  flex: 1;
  min-height: 300px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
}

.im-msg {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(28,25,23,.12);
  box-shadow: 0 1px 3px rgba(28,25,23,.1);
  align-self: flex-start;
}


/* 互动：微信式气泡（头像+名字外显）/ 长按浮层 / logo 水印（v20260104） */
.im-chat { position: relative; }
/* 全系统背景水印：挂在主内容区，所有页面共用（互动那张放大 20%：560px → 672px） */
.main-content {
  position: relative;
}
/* 新图已是透明底：盖在内容上层（白色卡片也能透出），只响应视觉不挡点击。
   只在互动 / 通知中心 / 客服 / AI自动回单四个界面显示，其它界面无水印 */
body.app-mode .main-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: 739px auto;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
  opacity: .11;
}
body.app-mode.wm-new[data-view="interaction"] .main-content::before,
body.app-mode.wm-new[data-view="ai-reply"] .main-content::before,
body.app-mode.wm-new[data-view="notifications"] .main-content::before,
body.app-mode.wm-new[data-view="customer-service"] .main-content::before,
body.app-mode.wm-new[data-view="auto-receipt"] .main-content::before {
  background-image: url("login-watermark-logo.png");
}
body.app-mode.wm-brand[data-view="interaction"] .main-content::before,
body.app-mode.wm-brand[data-view="ai-reply"] .main-content::before,
body.app-mode.wm-brand[data-view="notifications"] .main-content::before,
body.app-mode.wm-brand[data-view="customer-service"] .main-content::before,
body.app-mode.wm-brand[data-view="auto-receipt"] .main-content::before {
  background-image: url("login-brand-logo.png");
}
/* 还没放新图：用旧品牌图直接显示（不反色） */
body.app-mode.wm-brand .main-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("login-brand-logo.png");
  background-position: center center;
  background-size: 672px auto;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: .1;
}
.main-content > * { position: relative; z-index: 1; }
.im-chat > * { position: relative; z-index: 1; }
.im-chat-msgs-wrap { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.im-unread-pill {
  position: absolute;
  top: 8px;
  right: 14px;
  z-index: 20;
  border: 0;
  border-radius: 999px;
  background: rgba(28,25,23,.82);
  color: #4ade80;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.im-unread-pill:hover { background: rgba(28,25,23,.95); }
/* 未读标签：名字加红 + 头像右上角红点（微信同款） */
.im-row-unread .im-row-name { color: #ef4444; font-weight: 700; }
.im-row-avatar { position: relative; display: inline-block; }
.im-unread-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}
.im-row-unread .im-msg:not(:has(.im-voice-bubble)):not(:has(.im-image-link)):not(:has(.im-file)) { outline: 1px solid rgba(239,68,68,.35); }
.im-messages > * { position: relative; z-index: 1; }
.im-row { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; max-width: 100%; position: relative; z-index: 3; }
.im-row-peer { justify-content: flex-start; }
.im-row-mine { justify-content: flex-end; }
.im-row-mine .im-row-avatar { order: 2; }
.im-row-mine .im-row-main { order: 1; align-items: flex-end; }
.im-row-avatar .im-avatar { border-radius: 8px; }
.im-row-main { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.im-row-name { font-size: 12px; opacity: .65; margin: 0 2px 3px; }
.im-row-mine .im-msg { background: #95ec69; color: #1c1917; border: 1px solid rgba(63,98,18,.25); box-shadow: 0 1px 3px rgba(63,98,18,.18); }
/* 语音/图片/文件自己就是内容：外层一律不再套任何框（不描边、不留白底、不加阴影、不加内边距） */
.im-row .im-msg:has(.im-voice-bubble),
.im-row .im-msg:has(.im-image-link),
.im-row .im-msg:has(.im-file) { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: 100%; }
.im-image { box-shadow: 0 1px 4px rgba(28,25,23,.2); }
.im-file { background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 1px 3px rgba(28,25,23,.16); }
.im-row-mine .im-file { background: #95ec69; }
.im-pending-voice { background: transparent; border: 0; }
.im-row-time { font-size: 11px; opacity: .5; margin-top: 3px; }
.im-ctx {
  position: fixed;
  z-index: 9999;
  background: #2b2b2b;
  border-radius: 10px;
  padding: 4px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.im-ctx button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  padding: 9px 12px;
  font-size: 14px;
  border-radius: 7px;
  cursor: pointer;
}
.im-ctx button + button { border-top: 1px solid rgba(255,255,255,.15); }
.im-ctx button:hover { background: rgba(255,255,255,.12); }
.im-ctx button.is-disabled { opacity: .45; }
.im-shot-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.im-shot-tip { color: #fff; font-size: 14px; opacity: .9; }
.im-shot-stage { position: relative; max-width: 92vw; max-height: 76vh; touch-action: none; cursor: crosshair; }
.im-shot-img { display: block; max-width: 92vw; max-height: 76vh; user-select: none; -webkit-user-drag: none; }
.im-shot-sel { position: absolute; border: 2px solid #07c160; background: rgba(7,193,96,.12); box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.im-shot-bar { display: flex; gap: 10px; }
.im-mention-tabs { display: flex; gap: 6px; padding: 6px 8px 0; }
.im-mention-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: #f5f5f4;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
}
.im-mention-tab.active { background: #1c1917; color: #fff; border-color: #1c1917; }
.im-mention-items { max-height: 260px; overflow-y: auto; }
.im-img-viewer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  cursor: zoom-out;
}
.im-img-viewer-tip { color: #fff; font-size: 13px; opacity: .85; }
.im-img-viewer-img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.im-sheet-viewer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.88);
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.im-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; margin-bottom: 10px; }
.im-sheet-actions { display: flex; gap: 8px; }
.im-sheet-wrap { flex: 1; overflow: auto; background: #fff; border-radius: 8px; }
.im-sheet-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13px; background: #fff; }
.im-sheet-table th, .im-sheet-table td { border: 1px solid #333; padding: 6px 12px; white-space: nowrap; text-align: center; vertical-align: middle; }
.im-sheet-title th { background: #00b0f0; color: #000; font-size: 17px; font-weight: 800; padding: 10px 12px; }
.im-sheet-header th { background: #00b0f0; color: #000; font-weight: 700; position: sticky; top: 0; }
.im-sheet-table td { background: #fff; color: #111; }
.im-sheet-notice td, .im-sheet-notice th { color: #d40000; font-weight: 700; white-space: normal; }
.im-sheet-table tr.im-sheet-total td.im-sheet-total-cell { background: #ffff00; font-weight: 700; }
/* ===== 远程会议 ===== */
.meeting-signal-warn {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .8rem;
  margin-bottom: 10px;
}
.meeting-signal-warn.hidden { display: none; }
.meeting-signal-warn .btn-action { margin-left: 10px; }

/* 邀请对象筛选栏 */
.meeting-invite-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.meeting-invite-search {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .8rem;
}
.meeting-invite-item.hidden { display: none; }

/* 回放弹窗 */
.meeting-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.meeting-play-box {
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 12px 40px rgba(15,23,42,.3);
}
.meeting-play-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.meeting-play-head small { color: #64748b; font-size: .75rem; }
.meeting-play-head .btn-action { margin-left: auto; }
.meeting-play-box audio { width: 100%; margin-bottom: 10px; }
.meeting-play-box video,
.meeting-play-box #meeting-play-video {
  width: 100%;
  max-height: 56vh;
  background: #0f172a;
  border-radius: 10px;
  margin-bottom: 10px;
  display: block;
  object-fit: contain;
}
.meeting-play-note {
  font-size: .78rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.meeting-play-note.hidden { display: none; }

/* 进会权限申请框：拿不到摄像头/麦克风时每次进会弹一次 */
.meeting-perm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10200;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.meeting-perm-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(15,23,42,.3);
}
.meeting-perm-box h4 { margin: 0 0 10px; font-size: 1rem; }
.meeting-perm-box p { margin: 0 0 12px; font-size: .85rem; color: #475569; line-height: 1.7; }
.meeting-perm-guide {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .82rem;
  color: #92400e;
  line-height: 1.8;
  margin: 0 0 12px;
}
.meeting-perm-diag {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .8rem;
  color: #334155;
  line-height: 1.8;
  margin: 0 0 16px;
  max-height: 220px;
  overflow-y: auto;
}
.meeting-perm-diag:empty { display: none; }
.meeting-perm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.meeting-play-members {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-bottom: 10px;
}
.meeting-play-members h5 { margin: 0 0 4px; font-size: .8rem; color: #475569; }
.meeting-play-members p { margin: 0; font-size: .82rem; color: #334155; line-height: 1.6; }
.meeting-play-actions { display: flex; gap: 8px; margin-bottom: 10px; }

/* 会议：录制中标记 / 时长 / 成员面板 */
.meeting-rec-dot {
  color: #dc2626;
  font-size: .78rem;
  font-weight: 700;
  animation: meetingRecBlink 1.6s ease-in-out infinite;
}
.meeting-rec-off {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
  cursor: help;
}
.meeting-signal-down {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 12px;
  animation: meetingRecBlink 1.6s ease-in-out infinite;
}
.meeting-remain {
  font-size: .78rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 12px;
  font-variant-numeric: tabular-nums;
}
@keyframes meetingRecBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.meeting-duration {
  font-size: .78rem;
  color: #475569;
  font-variant-numeric: tabular-nums;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 10px;
}
.meeting-members-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.meeting-members-panel.hidden { display: none; }
.meeting-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: .85rem;
}
.meeting-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
}
.meeting-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  background: #f8fafc;
  font-size: .82rem;
}
.meeting-member-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4338ca;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
}
.meeting-member-role { color: #059669; font-size: .72rem; }
.meeting-play-chat {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meeting-play-chat h5 { margin: 0 0 4px; font-size: .8rem; color: #475569; }

/* 车辆表单缺项高亮 */
#vehicle-modal .field-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .18) !important;
  background: #fef2f2 !important;
}
.meeting-hall-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 2px 0 10px;
  padding-left: 10px;
  border-left: 4px solid #4338ca;
}
.meeting-intro { color: var(--text-muted); font-size: .78rem; margin: 0 0 10px; }
.meeting-lobby { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; }
@media (max-width: 900px) { .meeting-lobby { grid-template-columns: 1fr; } }
.meeting-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.meeting-card h4 { margin: 0 0 10px; font-size: .95rem; }
.meeting-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: .82rem; color: #475569; }
.meeting-field input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .85rem;
}
.meeting-invite-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meeting-invite-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .82rem;
}
.meeting-invite-item:hover { background: #f1f5f9; }
.meeting-invite-item small { display: block; color: #64748b; font-size: .72rem; }
.meeting-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meeting-tip { font-size: .75rem; color: #94a3b8; margin: 8px 0 0; }
.meeting-room { display: flex; flex-direction: column; gap: 10px; }
.meeting-room-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.meeting-room-id {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.meeting-members { margin-left: auto; font-size: .78rem; color: #64748b; }
.meeting-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.meeting-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}
.meeting-tile video { width: 100%; height: 100%; object-fit: cover; }
.meeting-tile-off {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: .85rem;
}
.meeting-tile-off small { color: #94a3b8; font-size: .72rem; }
.meeting-tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(15,23,42,.7);
  color: #fff;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.meeting-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.meeting-chat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.meeting-chat h4 { margin: 0 0 8px; font-size: .85rem; }
.meeting-chat-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.meeting-msg { font-size: .82rem; }
.meeting-msg b { color: #4338ca; margin-right: 6px; }
.meeting-msg.mine b { color: #047857; }
.meeting-chat-send { display: flex; gap: 8px; }
.meeting-wide { grid-column: 1 / -1; }
.meeting-sched-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: .82rem; }
.meeting-sched-item small { display: block; color: #64748b; font-size: .72rem; margin-top: 2px; }
.meeting-rec-chat { border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px; margin: -4px 0 8px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.meeting-rec-chat.hidden { display: none; }
.meeting-rec-chat small { color: #94a3b8; margin-left: 6px; font-size: .7rem; }
.meeting-chat-send input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .85rem;
}
.im-sheet-more { color: #fff; opacity: .8; font-size: 12px; margin-top: 8px; text-align: center; }
.im-pending-image {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f4;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.im-pending-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.im-pending-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.im-pending-meta small { opacity: .65; font-size: 12px; }
.im-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-left: 3px solid #16a34a;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #374151;
}
.im-reply-tag { color: #16a34a; font-weight: 700; flex: none; }
.im-reply-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-reply-cancel {
  flex: none;
  border: 0;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: #9ca3af;
  padding: 0 4px;
}
.im-reply-cancel:hover { color: #111827; }
/* 被引用的原消息：挂在气泡下方的灰色小字（不套任何框、不加底色、无边框） */
.im-quote {
  display: block;
  margin-top: 4px;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.45;
  color: #8a8a8a;
  border: 0;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.im-quote:hover { color: #6b6b6b; text-decoration: underline; }
.im-quote span { color: inherit; }
html[data-theme="dark"] .im-quote { color: rgba(255,255,255,.5); border: 0; background: transparent; }
html[data-theme="dark"] .im-quote:hover { color: rgba(255,255,255,.72); }
.im-row-mine .im-quote { text-align: right; }
/* 引用里的缩略图：不透明 */
.im-quote-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
  margin: 0 4px;
  opacity: 1;
}
.im-quote-voice {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin: 0 4px;
  vertical-align: middle;
  color: inherit;
}
.im-quote-voice i {
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 1;
}
.im-quote-voice i:nth-child(1) { height: 6px; }
.im-quote-voice i:nth-child(2) { height: 12px; }
.im-quote-voice i:nth-child(3) { height: 9px; }
.im-quote-file { color: inherit; }
.im-row.im-flash .im-msg { animation: imFlash 1.2s ease; }
@keyframes imFlash {
  0%, 100% { box-shadow: none; }
  30%, 60% { box-shadow: 0 0 0 3px #16a34a; }
}
.im-msg-head { position: relative; }
.im-msg-menu-btn {
  margin-left: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .55;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 6px;
}
.im-msg-menu-btn:hover { opacity: 1; background: rgba(127,127,127,.15); }
.im-msg-actions {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  background: #fff;
  color: #1c1917;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 4px;
  min-width: 96px;
}
.im-msg-actions.open { display: block; }
.im-msg-actions button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.im-msg-actions button:hover { background: #f3f4f6; }
.im-msg-actions button.is-disabled { opacity: .45; cursor: not-allowed; }
.im-recalled { font-style: italic; opacity: .7; font-size: 13px; }

.im-msg-mine {
  align-self: flex-end;
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

.im-msg-mine .im-msg-time {
  color: #d6d3d1;
}

.im-msg-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.im-msg-who {
  font-size: 0.75rem;
  font-weight: 700;
}

.im-msg-time {
  font-size: 0.7rem;
  color: var(--app-text-muted, #6b7280);
}

.im-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
}

.im-file {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 200px;
  max-width: 100%;
  cursor: pointer;
}
.im-file-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.im-file-name {
  font-weight: 700;
  word-break: break-all;
}

.im-file-size {
  font-size: 0.72rem;
  opacity: 0.75;
}
.im-file-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.im-file-xls { background: #22a06b; }
.im-file-pdf { background: #e5484d; }
.im-file-doc { background: #2f6fed; }
.im-file-img { background: #8e4ec6; }
.im-file-other { background: #8a8a8a; }

.im-image {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
  /* 缩略图必须完全不透明：盖住气泡底色与水印，不发虚 */
  opacity: 1;
  background: #fff;
}

.im-image-link {
  display: inline-block;
  background: #fff;
  border-radius: 8px;
  line-height: 0;
}

.im-file-size {
  line-height: 1.6;
}

/* 表情面板：跟 @ 选人面板同风格，点表情插进输入框 */
.im-emoji-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  background: #fafaf9;
  padding: 6px;
}

.im-emoji-item {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
}

.im-emoji-item:hover {
  background: #e7e5e4;
  transform: scale(1.15);
}

.im-receipt {
  border-left: 3px solid #b45309;
  padding-left: 8px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.im-receipt-title {
  font-weight: 800;
}

.im-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.im-composer textarea {
  min-height: 64px;
  resize: vertical;
  padding: 8px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

/* 输入框按钮组美化：胶囊浅底 + 发送钮灰→绿 */
.im-composer-actions .btn-action {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15,23,42,.1);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.im-composer-actions .btn-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(15,23,42,.16);
}
.im-composer-actions .btn-action.secondary {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.im-composer-actions .btn-action.secondary:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}
#im-btn-send {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #fff;
  min-width: 76px;
}
#im-btn-send.im-send-ready {
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-color: #15803d;
  color: #fff;
  box-shadow: 0 3px 10px rgba(34,197,94,.35);
}
#im-btn-send.im-send-ready:hover {
  background: linear-gradient(135deg, #16a34a, #166534);
}
.im-composer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.im-hint {
  color: var(--app-text-muted, #6b7280);
  font-size: 0.85rem;
  margin: 0;
}

.im-chat-empty {
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.im-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.im-modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: min(440px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.im-modal h4 {
  margin: 0;
}

.im-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.im-field select,
.im-field input {
  padding: 8px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.im-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.im-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e7e5e4;
}

.im-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37,99,235,.16);
  color: #1d4ed8;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-user-text small {
  font-size: 0.72rem;
  opacity: 0.75;
}

.sidebar-avatar-btn {
  font-size: 0.72rem;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .im-layout {
    flex-direction: column;
  }
  .im-side {
    width: 100%;
  }
  .im-msg {
    max-width: 92%;
  }
}

/* ===== 互动：搜索联系人 / 全局群 / @ / 语音 ===== */
.im-peer-results {
  max-height: 210px;
  overflow-y: auto;
  margin: 6px 0 10px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  background: #fff;
}

.im-peer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #f5f5f4;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.im-peer:last-child {
  border-bottom: 0;
}

.im-peer:hover {
  background: #f5f5f4;
}

.im-peer.active {
  background: #eff6ff;
}

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

.im-peer-main strong {
  font-size: 0.84rem;
  color: #1c1917;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.im-peer-main small {
  font-size: 0.78rem;
  color: #44403c;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.im-avatar-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(37,99,235,.16);
  color: #1d4ed8;
  font-weight: 700;
  flex-shrink: 0;
}

.im-thread-group strong {
  color: #1c1917;
}

.im-mention-picker {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid #e7e5e4;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fafaf9;
}

.im-mention-head {
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #78716c;
  border-bottom: 1px solid #f5f5f4;
}

.im-mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.im-mention-item:hover {
  background: #f5f5f4;
}

.im-mention {
  color: #1d4ed8;
  font-weight: 600;
  background: #eff6ff;
  border-radius: 4px;
  padding: 0 3px;
}

.im-mention-me {
  color: #b45309;
  background: #fef3c7;
}

.im-msg-mentioned {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}

.im-voice {
  display: flex;
  align-items: center;
  gap: 8px;
}

.im-voice audio {
  height: 34px;
}

.im-voice-dur {
  font-size: 0.76rem;
  color: #57534e;
}

.im-composer-actions .is-recording {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

/* ==== 录音效果条（互动）：红点 + 计时 + 实时波形 ==== */
.im-voice-recbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}
html[data-theme="dark"] .im-voice-recbar {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.im-rec-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: im-rec-blink 1.1s ease-in-out infinite;
}
@keyframes im-rec-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.im-rec-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 3.2em;
}
.im-rec-waves {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 28px;
  min-width: 0;
  overflow: hidden;
}
.im-rec-waves i {
  flex: 0 0 3px;
  height: 12%;
  min-height: 3px;
  max-height: 100%;
  border-radius: 2px;
  background: #22c55e;
  transition: height 0.09s linear;
}
.im-rec-tip {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

/* ==== 微信式语音气泡（互动）==== */
.im-composer { position: relative; }
.im-pending-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 0 0 6px;
  border: 1px dashed rgba(120,120,120,0.5);
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
}
.im-pending-label { font-size: 12px; color: #888; white-space: nowrap; }
.im-pending-cancel { font-size: 12px; margin-left: auto; }
.im-voice-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  margin: 4px 0;
  border: 1px solid rgba(28,25,23,.12);
  box-shadow: 0 1px 3px rgba(28,25,23,.1);
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  background: #e8e8ea;
  color: #111;
  max-width: 100%;
  box-sizing: border-box;
  transition: filter 0.15s ease;
}
.im-msg-mine .im-voice-bubble, .im-pending-voice .im-voice-bubble { background: #95ec69; color: #333; }
.im-voice-bubble:hover { filter: brightness(0.97); }
.im-voice-waves { display: inline-flex; align-items: center; gap: 2px; height: 18px; }
.im-voice-bubble.is-mine .im-voice-waves { order: 2; }
.im-voice-bubble.is-mine .im-voice-dur { order: 1; }
.im-voice-waves i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; opacity: 1; }
.im-voice-bubble.is-playing .im-voice-waves i { animation: imWave 0.9s ease-in-out infinite; }
.im-voice-waves i:nth-child(1){ animation-delay: 0s; }
.im-voice-waves i:nth-child(2){ animation-delay: 0.2s; }
.im-voice-waves i:nth-child(3){ animation-delay: 0.4s; }
@keyframes imWave { 0%,100%{ height:6px; } 50%{ height:18px; } }
.im-voice-dur { margin: 0; font-weight: 600; white-space: nowrap; }

/* ===== 将订单添加到批次：可搜索 / 筛选 / 分页的勾选弹窗 ===== */
.vab-modal {
  position: fixed;
  inset: 0;
  /* 必须高于「车辆装载运单」弹窗(.vehicle-detail-modal z-index:1250)，否则会被压在下面点不出来 */
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.vab-modal.hidden { display: none; }
.vab-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
.vab-card {
  position: relative;
  width: min(1080px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,.35);
}
.vab-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
}
.vab-head-text { flex: 1; min-width: 0; }
.vab-head-text h4 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 800; color: #fff; }
.vab-sub { margin: 0; font-size: .8rem; line-height: 1.5; color: rgba(255,255,255,.88); }
.vab-head-actions { display: flex; align-items: center; gap: 10px; }
.vab-head-actions .btn-action { box-shadow: 0 2px 8px rgba(15,23,42,.25); }
.vab-head-actions .btn-action:disabled { opacity: .55; cursor: not-allowed; }
.vab-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.vab-close:hover { background: rgba(255,255,255,.3); }
.vab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.vab-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vab-field {
  flex: 1 1 240px;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #94a3b8;
}
.vab-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: .86rem;
  color: #0f172a;
  background: transparent;
}
.vab-select {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: .86rem;
  color: #0f172a;
  min-width: 180px;
}
.vab-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.vab-stat {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.vab-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.vab-stat-icon.is-blue { background: #6366f1; }
.vab-stat-icon.is-purple { background: #8b5cf6; }
.vab-stat-icon.is-green { background: #22c55e; }
.vab-stat-body { display: flex; flex-direction: column; line-height: 1.25; }
.vab-stat-body em { font-style: normal; font-size: .72rem; color: #64748b; }
.vab-stat-body strong { font-size: 1rem; color: #0f172a; }
.vab-list { display: flex; flex-direction: column; gap: 10px; }
.vab-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.vab-row.is-checked { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.12); }
.vab-row.is-blocked { background: #f8fafc; }
.vab-row.is-blocked .vab-row-title { color: #94a3b8; font-weight: 500; }
.vab-row.is-blocked .vab-row-check input { cursor: not-allowed; opacity: .5; }
.vab-row-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: .72rem;
  font-weight: 600;
}
.vab-row-check { display: inline-flex; align-items: center; }
.vab-row-check input { width: 17px; height: 17px; }
.vab-row-main { flex: 1; min-width: 0; }
.vab-row-title { font-size: .88rem; color: #0f172a; font-weight: 600; overflow-wrap: anywhere; }
.vab-row-cust { color: #475569; font-weight: 500; }
.vab-row-bags { color: #0f172a; }
.vab-row-date { color: #64748b; font-weight: 500; }
.vab-row-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  font-size: .78rem;
  color: #475569;
}
.vab-row-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.vab-row-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-2px) rotate(45deg);
}
.vab-row-toggle.is-open::before { transform: translateY(1px) rotate(-135deg); }
.vab-empty { margin: 24px 0; text-align: center; color: #64748b; font-size: .86rem; }
.vab-row { cursor: pointer; }
.vab-children {
  margin: -4px 0 4px;
  padding: 12px 14px 12px 44px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}
.vab-row + .vab-children { margin-top: -10px; }
.vab-children-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.vab-children-title { font-size: .8rem; color: #475569; font-weight: 600; }
.vab-cargo-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  min-width: 220px;
}
.vab-cargo-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: .8rem;
  color: #0f172a;
}
.vab-children-list { display: flex; flex-direction: column; gap: 8px; }
.vab-cargo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 10px;
}
.vab-cargo.is-checked { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.12); background: #eef2ff; }
.vab-cargo.is-blocked .vab-row-title { color: #94a3b8; font-weight: 500; }
.vab-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}
.vab-pageinfo { font-size: .8rem; color: #64748b; }
.vab-pager { display: flex; align-items: center; gap: 6px; }
.vab-page {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: .82rem;
  cursor: pointer;
}
.vab-page:hover:not(:disabled) { border-color: #6366f1; color: #4f46e5; }
.vab-page.is-active { background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: 700; }
.vab-page:disabled { opacity: .45; cursor: not-allowed; }
.vab-page-gap { color: #94a3b8; font-size: .82rem; }

/* ===== 全网订单号列表：最左侧全选/单选列 ===== */
.order-table-mode .ord-check-th,
.order-table-mode .ord-check-td {
  width: 4%;
  min-width: 38px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.order-table-mode .ord-check-th { vertical-align: middle; }
.order-table-mode .ord-check-th input,
.order-table-mode .ord-check-td input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
}
.order-table-mode tbody tr.order-row.ord-row-selected { background: #eef2ff; }
.order-table-mode tbody tr.order-row.ord-row-selected > td { background: #eef2ff; }
.order-table-mode .order-total-row .ord-check-td { background: inherit; }
/* ===== 货物定位卡片 ===== */
.loc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px auto;
  max-width: 640px;
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.loc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.loc-plate { font-size: 1.1rem; font-weight: 700; color: #0f172a; }
.loc-status {
  font-size: .78rem;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 2px 10px;
}
.loc-rows { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: #475569; margin-bottom: 10px; }
/* ===== 模拟地图 ===== */
.loc-map {
  position: relative;
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3ec;
}
.loc-map-svg { display: block; width: 100%; height: 150px; }
.loc-pin { position: absolute; left: 50%; top: 44%; width: 0; height: 0; }
.loc-pin > span {
  position: absolute;
  left: -9px;
  top: -26px;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: #ef4444;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transform: rotate(-45deg);
}
.loc-pin::after {
  content: "";
  position: absolute;
  left: -18px;
  top: -8px;
  width: 36px;
  height: 14px;
  border-radius: 50%;
  background: rgba(239,68,68,.25);
  animation: loc-ping 1.6s ease-out infinite;
}
@keyframes loc-ping {
  0% { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}
.loc-map-label {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(14px, -34px);
  background: rgba(15,23,42,.85);
  color: #fff;
  font-size: .76rem;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.loc-coords {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(255,255,255,.92);
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.loc-gps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .8rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
}
/* ===== 订单表货号明细子行 ===== */
.order-table-mode .ord-cargo-sub > td { background: #f8fafc; padding: 6px 10px 10px 12px; }
.order-table-mode .ord-cargo-sub .ord-check-td { background: #f8fafc; }
.ord-cargo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ord-cargo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: .78rem;
  color: #475569;
}
.ord-cargo-chip > b { color: #0f172a; font-size: .82rem; }
.ord-cargo-ticket { color: #94a3b8; }
.ord-cargo-chip.is-hit { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.15); background: #eef2ff; }
.ord-cargo-chip.is-hit > b { color: #4338ca; }

/* ===== 表头固定（最后兜底，覆盖一切更早的 thead 规则）=====
   需求：往下拉时表头行固定不动，方便确认每一列。只做“粘住”，不动其他样式。 */
.table-viewport table.data-table thead th,
.vehicle-list-wrap table.vehicle-list-table thead th,
.scan-list-wrap table.scan-list-table thead th,
.table-viewport table.scan-list-table thead th,
.table-viewport table.users-account-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 3;
}

/* ===== 左侧菜单：极简风格（含折叠态）=====
   只改外观，不动结构与交互：
   - 取消左侧 3px 高亮竖条，选中只留淡淡的底色
   - 二级项不再显示小图标和短横线，只保留缩进
   - 折叠箭头做细小、低对比，展开时轻微旋转
   - 折叠动画只做高度，避免行距跳动 */
.sidebar-nav {
  padding: 8px 8px 10px;
  gap: 1px;
}

.nav-item {
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--app-sidebar-hover);
}

.nav-item.active {
  background: var(--app-sidebar-active-bg);
  font-weight: 600;
  box-shadow: none;
}

.nav-icon {
  width: 16px;
  font-size: 0.86rem;
  opacity: 0.7;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

/* 二级菜单：去掉小图标 + 去掉短横线，仅靠缩进分层 */
.nav-item.nav-sub-item {
  padding-left: 30px;
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 1;
  color: var(--app-sidebar-muted);
}

.nav-item.nav-sub-item .nav-icon {
  display: none;
}

.nav-item.nav-sub-item::before {
  content: none;
}

.nav-item.nav-sub-item:hover {
  color: var(--app-sidebar-text);
}

.nav-item.nav-sub-item.active {
  color: var(--app-sidebar-text);
  background: var(--app-sidebar-hover);
  font-weight: 600;
}

/* 折叠箭头：细小、低对比 */
.nav-group-parent .nav-caret,
.nav-item.nav-sub-parent .nav-caret {
  font-size: 0.58rem;
  opacity: 0.45;
  margin-left: auto;
}

.nav-group-parent:hover .nav-caret,
.nav-item.nav-sub-parent:hover .nav-caret {
  opacity: 0.8;
}

/* 折叠/展开动画：只动高度与透明度 */
.nav-group .nav-sub-item {
  max-height: 40px;
  transition: max-height 0.16s ease, opacity 0.16s ease;
}

.nav-group.collapsed .nav-sub-item {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* 折叠时若当前页在分组内，让分组标题稍微亮一点，便于定位（不加底色，保持简单） */
.nav-group:has(> .nav-sub-item.active) > .nav-group-parent {
  color: var(--app-sidebar-text);
}

.nav-group:has(> .nav-sub-item.active) > .nav-group-parent .nav-icon {
  opacity: 1;
}

.nav-group:has(> .nav-sub-item.active) > .nav-group-parent .nav-caret {
  opacity: 0.8;
}

/* ===== 菜单折叠指示：改为右侧小尖头（chevron）=====
   收起 = 尖头朝下，展开 = 尖头朝上（并有强调色），和参考样式一致。
   只替换箭头本身，行高、间距、配色其余不变。 */
.nav-group-parent .nav-caret,
.nav-item.nav-sub-parent .nav-caret {
  display: inline-block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-left: auto;
  margin-right: 1px;
  font-size: 0;
  line-height: 0;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  border-radius: 1px;
  opacity: 0.68;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 0.18s ease, opacity 0.15s ease, color 0.15s ease;
}

/* 展开：尖头朝上 + 强调色（对应参考图里展开时变成蓝色朝上） */
.nav-group:not(.collapsed) .nav-group-parent .nav-caret,
.nav-item.nav-sub-parent[aria-expanded="true"] .nav-caret {
  transform: rotate(-135deg);
  opacity: 1;
  color: var(--app-sidebar-accent);
}

.nav-group-parent:hover .nav-caret,
.nav-item.nav-sub-parent:hover .nav-caret {
  opacity: 0.95;
}

/* ===== 会议记录：标题栏工具（全选 / 删除选中）===== */
.meeting-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.meeting-card-head h4 { margin: 0; }
.meeting-rec-tools { display: flex; align-items: center; gap: 6px; }
.meeting-rec-check {
  width: 14px;
  height: 14px;
  margin: 0 8px 0 0;
  vertical-align: -2px;
  cursor: pointer;
  accent-color: #4f46e5;
}

/* ===== 聊天内容不透明：消息区（文字/图片/文件/语音）压在水印层之上 =====
   水印层是 .main-content::before（z-index:2）。把会话面板的层叠上下文放开（z-index:auto），
   再把消息列表抬到 3，聊天气泡和图片就 100% 不透明，水印只在气泡之间的空白底色透出。 */
body.app-mode[data-view="interaction"] .main-content > .content-panel.active,
body.app-mode[data-view="customer-service"] .main-content > .content-panel.active,
body.app-mode[data-view="ai-reply"] .main-content > .content-panel.active {
  z-index: auto;
}
body.app-mode[data-view="interaction"] .content-panel.active .im-chat-msgs-wrap,
body.app-mode[data-view="customer-service"] .content-panel.active .im-chat-msgs-wrap,
body.app-mode[data-view="ai-reply"] .content-panel.active .im-chat-msgs-wrap {
  z-index: 3;
}
/* 消息里的图片/文件/气泡一律不透明、不留半透明底 */
body.app-mode .im-chat-msgs-wrap .im-image,
body.app-mode .im-chat-msgs-wrap .im-image-link,
body.app-mode .im-chat-msgs-wrap .im-msg {
  opacity: 1;
}

/* ===== 账号资料弹窗（头像 / 名称 / 修改密码 / 退出登录）===== */
.sidebar-user-clickable { cursor: pointer; border-radius: 8px; transition: background-color .15s ease; }
.sidebar-user-clickable:hover { background: var(--app-sidebar-hover); }
.acct-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.acct-profile-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 20px 50px rgba(15, 23, 42, .35));
  padding: 20px 20px 16px;
}
.acct-profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.acct-profile-close:hover { background: var(--app-surface-muted); }
.acct-profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acct-profile-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-muted);
}
.acct-avatar-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; }
.acct-profile-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-profile-id strong { font-size: 1.02rem; line-height: 1.25; word-break: break-all; }
.acct-profile-id small { color: var(--text-muted); font-size: .76rem; word-break: break-all; }
.acct-profile-section {
  border-top: 1px solid var(--app-border);
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acct-profile-label { font-size: .8rem; font-weight: 700; color: var(--app-text); }
.acct-profile-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-profile-input {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: .84rem;
  background: var(--input-bg, var(--app-surface));
  color: var(--app-text);
}
.acct-profile-input:disabled { opacity: .6; cursor: not-allowed; }
.acct-profile-hint { margin: 0; font-size: .72rem; color: var(--text-muted); }
.acct-profile-hint.is-error { color: #dc2626; }
.acct-profile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--app-border);
  margin-top: 16px;
  padding-top: 12px;
}

/* ===== 财务管理菜单：只有前面的小图标是灰黄色，文字与箭头保持菜单默认配色 ===== */
#nav-group-finance > .nav-group-parent .nav-icon {
  color: var(--nav-finance-accent);
  opacity: 1;
}

#nav-group-finance > .nav-group-parent:hover .nav-icon,
#nav-group-finance > .nav-group-parent.active .nav-icon {
  color: var(--nav-finance-accent-strong);
}

/* ===== 互动 · 一对一语音 / 视频通话（只新增样式，不影响其他模块） ===== */
.im-call-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.im-call-btn.is-busy {
  opacity: 0.55;
}

.wms-call-layer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  pointer-events: none;
}

.wms-call-layer.hidden {
  display: none;
}

.wms-call-card {
  pointer-events: auto;
  width: 332px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #1b2434 0%, #0f1723 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(3, 8, 18, 0.45);
  color: #eef3fb;
  font-size: 0.85rem;
  animation: wms-call-in 0.18s ease-out;
}

@keyframes wms-call-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wms-call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.76rem;
  color: rgba(238, 243, 251, 0.75);
  background: rgba(255, 255, 255, 0.04);
}

.wms-call-kind { letter-spacing: 0.02em; }
.wms-call-timer { font-variant-numeric: tabular-nums; }

.wms-call-stage {
  position: relative;
  height: 176px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 65%);
}

.wms-call-stage.has-video { height: 196px; background: #05080e; }

.wms-call-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05080e;
}

.wms-call-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.wms-call-stage.has-video .wms-call-avatar { display: none; }

.wms-call-local {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 92px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #05080e;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.wms-call-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px 0;
  text-align: center;
}

.wms-call-info strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.wms-call-info small {
  color: rgba(238, 243, 251, 0.7);
  font-size: 0.76rem;
}

.wms-call-actions {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
}

.wms-call-btn {
  flex: 1;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #eef3fb;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.wms-call-btn:hover { background: rgba(255, 255, 255, 0.16); }
.wms-call-btn:active { transform: translateY(1px); }

.wms-call-btn.primary {
  background: #16a34a;
  border-color: #16a34a;
}

.wms-call-btn.primary:hover { background: #15803d; }

.wms-call-btn.danger {
  background: #dc2626;
  border-color: #dc2626;
}

.wms-call-btn.danger:hover { background: #b91c1c; }

@media (max-width: 560px) {
  .wms-call-layer {
    right: 8px;
    left: 8px;
    bottom: 8px;
  }
  .wms-call-card { width: 100%; max-width: none; }
}

/* ===== 通话卡片：按钮重排（图标 + 文字），挂断键始终一眼可见 ===== */
.wms-call-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.wms-call-stage {
  flex: 0 0 auto;
}

.wms-call-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px 16px;
  flex: 0 0 auto;
}

.wms-call-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #f4f8ff;
  font-size: 0.76rem;
  line-height: 1.15;
  cursor: pointer;
}

.wms-call-btn:hover { background: rgba(255, 255, 255, 0.22); }

.wms-call-ico {
  font-size: 1.15rem;
  line-height: 1;
}

.wms-call-lbl {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.wms-call-btn.primary {
  background: #16a34a;
  border-color: #22c55e;
}

.wms-call-btn.danger,
.wms-call-btn.hangup {
  background: #dc2626;
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35) inset;
}

.wms-call-btn.danger:hover,
.wms-call-btn.hangup:hover {
  background: #b91c1c;
}

.wms-call-float-hangup {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.45);
  z-index: 2;
}

.wms-call-float-hangup:hover { background: #b91c1c; }

@media (max-height: 520px) {
  .wms-call-stage { height: 132px; }
  .wms-call-stage.has-video { height: 148px; }
}

/* 窗口再矮也保证按钮行不被裁掉：画面区可压缩，按钮区固定 */
.wms-call-stage {
  flex: 1 1 auto;
  min-height: 118px;
  height: auto;
  max-height: 196px;
}

.wms-call-stage.has-video {
  height: auto;
  max-height: 196px;
}

/* ===== 视频通话：微信式居中大窗口（画面 + 声音） ===== */
.wms-call-float-hangup {
  pointer-events: auto;
}

.wms-call-layer.has-video-card {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.42);
}

.wms-call-card[data-kind="video"] {
  width: min(900px, 92vw);
  height: min(600px, 86vh);
  pointer-events: auto;
}

.wms-call-card[data-kind="video"] .wms-call-head {
  padding-right: 108px;
}

.wms-call-card[data-kind="video"] .wms-call-stage {
  flex: 1 1 auto;
  min-height: 240px;
  height: auto;
  max-height: none;
  border-radius: 0;
}

.wms-call-card[data-kind="video"] .wms-call-remote {
  border-radius: 0;
}

.wms-call-card[data-kind="video"] .wms-call-local {
  top: 12px;
  right: 12px;
  bottom: auto;
  left: auto;
  width: 156px;
  height: 116px;
  z-index: 3;
}

.wms-call-card[data-kind="video"] .wms-call-avatar {
  width: 96px;
  height: 96px;
  font-size: 38px;
}

.wms-call-card[data-kind="video"] .wms-call-info {
  padding: 10px 16px 0;
}

.wms-call-card[data-kind="video"] .wms-call-actions {
  justify-content: center;
}

.wms-call-card[data-kind="video"] .wms-call-btn {
  flex: 0 1 132px;
  min-height: 62px;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .wms-call-card[data-kind="video"] {
    width: 100%;
    height: 100%;
  }
  .wms-call-card[data-kind="video"] .wms-call-local {
    width: 108px;
    height: 80px;
  }
}

/* file:// 打开时的常驻提示条（仅在该模式下出现） */
.wms-call-file-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: #fde68a;
  color: #7c2d12;
  font-size: 0.82rem;
  line-height: 1.35;
  border-bottom: 1px solid #f59e0b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.wms-call-file-banner-text {
  flex: 1;
}

.wms-call-file-banner-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #7c2d12;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.wms-call-file-banner-close:hover {
  background: rgba(124, 45, 18, 0.12);
}

/* ===== 通话：会议式内嵌界面（画面 + 按钮行，落在互动面板里） ===== */
.wms-call-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
}

.wms-call-inline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--app-text);
}

.wms-call-inline-title {
  font-weight: 600;
}

.wms-call-inline-status {
  color: var(--app-text-muted);
  font-size: 0.78rem;
}

.wms-call-inline-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--app-text-muted);
  font-size: 0.78rem;
}

.wms-call-inline-videos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wms-call-tile {
  position: relative;
  flex: 0 0 auto;
  width: 246px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--app-border-strong);
}

.wms-call-tile.remote {
  width: 330px;
  height: 200px;
}

.wms-call-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f172a;
}

.wms-call-tile-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.74rem;
}

.wms-call-tile-empty[hidden] {
  display: none;
}

.wms-call-tile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
}

.wms-call-tile-name {
  position: absolute;
  left: 8px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.72rem;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wms-call-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wms-call-inline-actions .wms-call-act-btn {
  min-width: 96px;
}

.wms-call-end-btn {
  min-width: 104px;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  background: #fff !important;
}

.wms-call-end-btn:hover {
  background: #fef2f2 !important;
}

[data-theme="dark"] .wms-call-end-btn {
  background: transparent !important;
  border-color: rgba(248, 113, 113, 0.5) !important;
  color: #f87171 !important;
}

[data-theme="dark"] .wms-call-inline {
  background: var(--app-surface);
}
