/**
 * AI智能仓储管理系统 - 全局样式（PC + 移动端）
 */
@import url('demo-shell.css');

:root {
  --color-primary: #165dff;
  --color-primary-soft: #e8f3ff;
  --color-danger: #ff4d4f;
  --color-success: #52c41a;
  --color-bg: #ffffff;
  --color-border: #e5e6eb;
  --color-text: #1d2129;
  --color-text-muted: #86909c;
  --nav-bg: #0e42b3;
  --shadow-card: 0 2px 12px 0 rgba(0, 0, 0, 0.08);
  --shadow-btn: 0 2px 8px rgba(22, 93, 255, 0.2);
}

html {
  font-size: 16px;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  html {
    font-size: 15px;
  }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
}

/* 标题层级 */
.sys-brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}
@media (max-width: 991.98px) {
  .sys-brand-title {
    font-size: 1.25rem;
  }
}

.page-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}
@media (max-width: 991.98px) {
  .page-title {
    font-size: 1rem;
  }
}

.card-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}
@media (max-width: 991.98px) {
  .card-title-text {
    font-size: 0.875rem;
  }
}

.text-muted-custom {
  color: var(--color-text-muted) !important;
  font-size: 0.75rem;
}
@media (max-width: 991.98px) {
  .text-muted-custom {
    font-size: 0.6875rem;
  }
}

/* 顶栏 */
.navbar-kucun {
  background: var(--nav-bg) !important;
  min-height: 60px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
@media (max-width: 991.98px) {
  .navbar-kucun {
    min-height: 50px;
  }
}

.navbar-kucun .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.125rem;
  max-width: 70%;
  white-space: normal;
  line-height: 1.2;
}
@media (min-width: 992px) {
  .navbar-kucun .navbar-brand {
    font-size: 1.25rem;
    max-width: none;
    white-space: nowrap;
  }
}

.navbar-kucun .nav-link {
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 0.875rem;
}

/* 侧边栏 */
.sidebar-kucun {
  position: fixed;
  top: 60px;
  left: 0;
  width: 200px;
  bottom: 0;
  background: #fff;
  border-right: 1px solid var(--color-border);
  padding-top: 12px;
  z-index: 1020;
  overflow-y: auto;
  transition: transform 0.25s ease;
}
@media (max-width: 991.98px) {
  .sidebar-kucun {
    top: 50px;
    width: 80vw;
    max-width: 320px;
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  }
  .sidebar-kucun.show {
    transform: translateX(0);
  }
}

.sidebar-kucun .nav-link {
  color: var(--color-text);
  padding: 0.65rem 1.25rem;
  border-radius: 0;
  font-size: 0.875rem;
}
@media (max-width: 991.98px) {
  .sidebar-kucun .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

.sidebar-kucun .nav-link:hover,
.sidebar-kucun .nav-link.active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1015;
}
@media (max-width: 991.98px) {
  .sidebar-overlay.show {
    display: block;
  }
}

/* 个人中心：无侧栏；桌面可居中，手机壳内必须满宽 */
body.kucun-page-profile .sidebar-kucun,
body.kucun-page-profile #sidebarOverlay {
  display: none !important;
}
@media (min-width: 992px) {
  body.kucun-page-profile:not(.kucun-demo-shell-ready) .main-wrap {
    margin-left: auto;
    margin-right: auto;
    max-width: 560px;
  }
}
body.kucun-demo-shell-ready.kucun-page-profile .kucun-app-shell .main-wrap {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.kucun-demo-shell-ready.kucun-page-profile .kucun-app-shell .card.kucun-card {
  max-width: none !important;
  width: 100%;
}

/* 主内容 */
.main-wrap {
  margin-left: 200px;
  padding: 20px;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}
@media (max-width: 991.98px) {
  .main-wrap {
    margin-left: 0;
    padding: 10px;
    margin-top: 50px;
    min-height: calc(100vh - 50px);
  }
}

/* 表单控件 */
.form-control,
.form-select {
  border-radius: 6px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.875rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(22, 93, 255, 0.15);
  background-color: var(--color-primary-soft);
}
@media (max-width: 991.98px) {
  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 0.8125rem;
  }
}

.form-label {
  color: var(--color-text);
  font-size: 0.875rem;
}
@media (max-width: 991.98px) {
  .form-label {
    font-size: 0.8125rem;
  }
}

/* 按钮 */
.btn {
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
}
.btn-primary-k {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary-k:hover {
  background: #0f4fd4;
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-success-k {
  background: var(--color-success);
  color: #fff;
}
.btn-success-k:hover {
  background: #389e0d;
  color: #fff;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.25);
}
.btn-danger-k {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger-k:hover {
  background: #cf1322;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.25);
}
.btn-outline-k {
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-outline-k:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.btn:active {
  opacity: 0.9 !important;
}

@media (max-width: 991.98px) {
  .btn {
    min-height: 44px;
    min-width: 80px;
    font-size: 0.8125rem;
  }
  .btn-block-mobile {
    width: 100%;
  }
}

/* 卡片 */
.card.kucun-card {
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 15px;
}
@media (max-width: 991.98px) {
  .card.kucun-card {
    padding: 15px;
    margin-bottom: 10px;
  }
}

/* 表格 */
.table-kucun thead th {
  background: var(--color-primary-soft);
  font-weight: 700;
  color: var(--color-text);
  border: none;
  font-size: 0.875rem;
}
.table-kucun tbody td {
  border: none;
  vertical-align: middle;
  font-size: 0.875rem;
}
.table-kucun > :not(caption) > * > * {
  border-bottom-width: 0;
}

/* 表格操作列单字按钮：补 / 改 / 删（正方形） */
.btn.btn-op-mini,
button.btn-op-mini {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.75rem !important;
  height: 1.75rem !important;
  min-width: 1.75rem !important;
  min-height: 0 !important;
  max-height: 1.75rem !important;
  padding: 0 !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  border-radius: 0.35rem !important;
}
@media (max-width: 991.98px) {
  .table-kucun tbody td,
  .table-kucun thead th {
    font-size: 0.8125rem;
  }
}

.table-kucun tbody tr {
  height: 40px;
}
@media (min-width: 992px) {
  .table-kucun tbody tr {
    height: 36px;
  }
}

.table-responsive-sticky {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 991.98px) {
  .table-responsive-sticky table {
    min-width: 980px;
  }
  .table-responsive-sticky th.sticky-action,
  .table-responsive-sticky td.sticky-action {
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.06);
    z-index: 2;
  }
  .table-kucun thead th.sticky-action {
    background: var(--color-primary-soft);
    z-index: 3;
  }
}

/* 统计卡片 */
.stat-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}
.stat-card .num {
  font-size: 1.5rem;
  font-weight: 700;
}
.stat-card .lbl {
  font-size: 0.875rem;
  opacity: 0.95;
}

/* 预警条 */
.warn-pill {
  color: var(--color-danger);
  font-weight: 600;
}

/* 模态框 */
@media (max-width: 991.98px) {
  .modal-dialog {
    max-width: 85vw;
    margin: 1rem auto;
  }
  .modal-content {
    border-radius: 10px;
  }
  .modal-footer .btn {
    flex: 1;
  }
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f5f7fa 0%, #e8f3ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  width: 400px;
  max-width: 85%;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 30px;
}
@media (max-width: 991.98px) {
  .login-card {
    padding: 20px;
    width: 100%;
  }
}

/* 密码框：显示/隐藏按钮叠在输入框内 */
.login-pwd-wrap {
  position: relative;
}
.login-pwd-input {
  padding-right: 3.25rem;
}
.login-pwd-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0 4px;
  font-size: 0.8125rem;
  line-height: 1;
  color: #86909c;
  cursor: pointer;
  user-select: none;
}
.login-pwd-toggle:hover,
.login-pwd-toggle:focus {
  color: #0e42b3;
  outline: none;
}

/* 空状态 */
.empty-hint {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 1rem;
  font-size: 0.875rem;
}

/* 维修领用：审核水印 */
.wm-wrap {
  position: relative;
  overflow: hidden;
}
.wm-stamp {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  transform: rotate(-8deg);
  pointer-events: none;
  opacity: 0.92;
  z-index: 1;
}
.wm-stamp.pending {
  color: #ff4d4f;
  border: 2px solid rgba(255, 77, 79, 0.85);
  background: rgba(255, 77, 79, 0.08);
}
.wm-stamp.done {
  color: #52c41a;
  border: 2px solid rgba(82, 196, 26, 0.85);
  background: rgba(82, 196, 26, 0.1);
}
.wm-stamp.muted {
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  background: #fafafa;
}

/* —— 移动端增强（手机屏幕） —— */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-nav-height: 50px;
  --mobile-bottom-nav-height: 52px;
}

@media (max-width: 991.98px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    -webkit-tap-highlight-color: transparent;
    padding-bottom: var(--safe-bottom);
  }

  body.kucun-has-bottom-nav {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom));
  }

  body.kucun-has-bottom-nav .main-wrap {
    min-height: calc(
      100vh - var(--mobile-nav-height) - var(--mobile-bottom-nav-height) -
        var(--safe-bottom)
    );
    padding-bottom: 12px;
  }

  .navbar-kucun {
    padding-top: var(--safe-top);
    min-height: calc(var(--mobile-nav-height) + var(--safe-top));
  }

  .navbar-kucun .container-fluid {
    min-height: var(--mobile-nav-height);
  }

  .sidebar-kucun {
    top: calc(var(--mobile-nav-height) + var(--safe-top));
    padding-bottom: calc(var(--safe-bottom) + 12px);
  }

  .main-wrap {
    margin-top: calc(var(--mobile-nav-height) + var(--safe-top));
  }

  /* 顶栏：标题居中「仓储管理」，左右为菜单/用户 */
  body.kucun-mobile .navbar-kucun .container-fluid {
    position: relative;
    justify-content: space-between;
  }

  body.kucun-mobile .navbar-kucun .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    max-width: none;
    font-size: 1rem;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    z-index: 1;
  }

  body.kucun-mobile .navbar-kucun .navbar-user-wrap {
    font-size: 0.75rem;
    flex-shrink: 0;
    max-width: 46%;
    text-align: right;
    line-height: 1.2;
    position: relative;
    z-index: 2;
  }

  body.kucun-mobile .navbar-kucun #navUser {
    display: inline-block;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  body.kucun-mobile .navbar-kucun .nav-logout-link {
    white-space: nowrap;
  }

  /* iOS 输入框字号 ≥16px 避免聚焦自动放大 */
  .form-control,
  .form-select {
    font-size: 16px;
  }

  .form-control-sm,
  .form-select-sm {
    font-size: 14px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card .num {
    font-size: 1.375rem;
  }

  /* 底部 Tab 栏（真机窄屏 + 演示壳手机布局都生效） */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: none;
    align-items: stretch;
    height: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom));
    padding: 0;
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid #e5e6eb;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  }

  body.kucun-mobile .mobile-bottom-nav,
  body.kucun-has-bottom-nav .mobile-bottom-nav {
    display: flex;
  }

  .mobile-bottom-nav .mbn-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 6px 2px 4px;
    color: #86909c !important;
    text-decoration: none !important;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.1;
    min-height: var(--mobile-bottom-nav-height);
    touch-action: manipulation;
    border: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav .mbn-item .mbn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 8px;
  }

  .mobile-bottom-nav .mbn-item .mbn-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav .mbn-item.active {
    color: var(--color-primary) !important;
  }

  .mobile-bottom-nav .mbn-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 3px;
    margin-left: -14px;
    border-radius: 0 0 3px 3px;
    background: var(--color-primary);
  }

  .mobile-bottom-nav .mbn-item.active .mbn-icon {
    background: var(--color-primary-soft);
  }

  .mobile-bottom-nav .mbn-item:active {
    opacity: 0.85;
  }

  /* 筛选区按钮纵向铺满 */
  .d-grid.d-lg-flex .btn-block-mobile + .btn-block-mobile {
    margin-top: 0;
  }

  /* 登录页安全区 */
  .login-page {
    padding-top: calc(16px + var(--safe-top));
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  /* 语音助手面板适配窄屏 */
  #kucun-ai-voice-panel {
    width: min(300px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}

@media (min-width: 992px) {
  body:not(.kucun-demo-shell-ready) .mobile-bottom-nav {
    display: none !important;
  }
}

/* 演示壳内强制手机版布局（桌面浏览 demo 时与真机一致） */
body.kucun-demo-shell-ready {
  --mobile-nav-height: 50px;
  --mobile-bottom-nav-height: 52px;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(var(--mobile-nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  z-index: 1040;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun .d-lg-none {
  display: inline-block !important;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun .container-fluid {
  position: relative;
  justify-content: space-between;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun .navbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: none;
  font-size: 1rem;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  z-index: 1;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun .navbar-user-wrap,
body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun .ms-auto.text-white {
  font-size: 0.75rem;
  flex-shrink: 0;
  max-width: 46%;
  text-align: right;
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

body.kucun-demo-shell-ready .kucun-app-shell .navbar-kucun #navUser {
  display: inline-block;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

body.kucun-demo-shell-ready .kucun-app-shell .sidebar-overlay {
  position: absolute;
  z-index: 1050;
}

body.kucun-demo-shell-ready .kucun-app-shell .sidebar-overlay.show {
  display: block;
}

body.kucun-demo-shell-ready .kucun-app-shell .sidebar-kucun {
  position: absolute;
  top: calc(var(--mobile-nav-height) + var(--safe-top));
  left: 0;
  bottom: 0;
  width: min(82%, 300px);
  max-width: 300px;
  transform: translateX(-100%);
  z-index: 1060;
  padding-bottom: calc(var(--safe-bottom) + 12px);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

body.kucun-demo-shell-ready .kucun-app-shell .sidebar-kucun.show {
  transform: translateX(0);
}

body.kucun-demo-shell-ready .kucun-app-shell .sidebar-kucun .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
}

body.kucun-demo-shell-ready .kucun-app-shell .main-wrap {
  flex: 1;
  margin-left: 0 !important;
  margin-top: 0 !important;
  padding: 10px;
  padding-top: calc(var(--mobile-nav-height) + var(--safe-top) + 8px);
  padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 12px);
  min-height: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex !important;
  align-items: stretch;
  z-index: 1040;
  height: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom));
  padding: 0;
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #e5e6eb;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 6px 2px 4px;
  color: #86909c !important;
  text-decoration: none !important;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.1;
  min-height: var(--mobile-bottom-nav-height);
  background: transparent;
  border: 0;
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item .mbn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 8px;
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item .mbn-label {
  display: block;
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item.active {
  color: var(--color-primary) !important;
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 3px;
  margin-left: -14px;
  border-radius: 0 0 3px 3px;
  background: var(--color-primary);
}

body.kucun-demo-shell-ready .kucun-app-shell .mobile-bottom-nav .mbn-item.active .mbn-icon {
  background: var(--color-primary-soft);
}

body.kucun-demo-shell-ready .kucun-app-shell .row > [class*='col-lg-'],
body.kucun-demo-shell-ready .kucun-app-shell .row > [class*='col-md-'] {
  flex: 0 0 100%;
  max-width: 100%;
}

body.kucun-demo-shell-ready .kucun-app-shell .stat-card {
  padding: 16px;
  margin-bottom: 0;
}

body.kucun-demo-shell-ready .kucun-app-shell .stat-card .num {
  font-size: 1.375rem;
}

body.kucun-demo-shell-ready .kucun-app-shell .page-title {
  font-size: 1rem;
}

body.kucun-demo-shell-ready .kucun-app-shell .form-control,
body.kucun-demo-shell-ready .kucun-app-shell .form-select {
  min-height: 44px;
  font-size: 16px;
}

body.kucun-demo-shell-ready .kucun-app-shell .btn {
  min-height: 44px;
}

/* 物资表操作列小方钮不受壳内 44px 按钮高度约束 */
body.kucun-demo-shell-ready .kucun-app-shell .btn.btn-op-mini {
  min-height: 0 !important;
  width: 1.75rem !important;
  height: 1.75rem !important;
  max-height: 1.75rem !important;
  padding: 0 !important;
}

body.kucun-demo-shell-ready .kucun-app-shell .table-responsive,
body.kucun-demo-shell-ready .kucun-app-shell .table-responsive-sticky {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.kucun-demo-shell-ready #kucun-ai-voice-root.kucun-ai-edge-bottom {
  bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 8px);
}

/* 演示壳内：麦克风固定在壳内右下角（底栏上方） */
body.kucun-demo-shell-ready .kucun-app-shell #kucun-ai-voice-root.kucun-ai-in-shell {
  position: absolute !important;
  right: 12px !important;
  left: auto !important;
  top: auto !important;
  bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 10px) !important;
  z-index: 1080;
}

body.kucun-mobile #kucun-ai-voice-root,
body.kucun-has-bottom-nav #kucun-ai-voice-root {
  right: 12px !important;
  left: auto !important;
  top: auto !important;
  bottom: calc(var(--mobile-bottom-nav-height) + var(--safe-bottom) + 10px) !important;
}

/* 物资列表：禁止竖排堆字，横向滑动查看 */
.table-goods-list th,
.table-goods-list td {
  white-space: nowrap;
  word-break: keep-all;
  vertical-align: middle;
}

/* 账号管理表：横向排列，避免手机端竖排堆字 */
.table-admin-list th,
.table-admin-list td {
  white-space: nowrap;
  word-break: keep-all;
  vertical-align: middle;
}
.admin-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.admin-table-wrap .table {
  margin-bottom: 0;
}
.table-admin-list th {
  font-size: 0.8125rem;
}
.table-goods-list th {
  font-size: 0.8125rem;
}
.goods-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.goods-table-wrap .table {
  margin-bottom: 0;
}

/* 新增/编辑物资弹窗适配手机壳 */
.modal-goods-dialog {
  max-width: min(560px, calc(100vw - 24px));
  margin: 0.75rem auto;
}
.modal-goods-dialog .modal-content {
  border-radius: 12px;
  max-height: calc(100dvh - 1.5rem);
}
body.kucun-demo-shell-ready .kucun-app-shell .modal {
  position: absolute;
  inset: 0;
  z-index: 1060;
  overflow-x: hidden;
  overflow-y: auto;
}
body.kucun-demo-shell-ready .kucun-app-shell .modal-dialog {
  max-width: calc(100% - 16px);
  margin: 8px auto;
}
body.kucun-demo-shell-ready .kucun-app-shell .modal-goods-dialog .modal-content {
  max-height: calc(100% - 16px);
}
body.kucun-demo-shell-ready .kucun-app-shell .modal-dialog-scrollable .modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 遮罩只盖住手机壳内部，不罩住壳外背景 */
body.kucun-demo-shell-ready > .modal-backdrop {
  /* 万一没来得及挪进壳，先隐藏全屏遮罩 */
  opacity: 0 !important;
  pointer-events: none !important;
}
body.kucun-demo-shell-ready .kucun-app-shell > .modal-backdrop,
body.kucun-demo-shell-ready .kucun-app-shell > .modal-backdrop.kucun-shell-backdrop {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  z-index: 1050;
  opacity: 0.5 !important;
  pointer-events: auto !important;
}

/* 输入联想 */
.suggest-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 1080;
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.suggest-panel .suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}
.suggest-panel .suggest-item:hover,
.suggest-panel .suggest-item:focus {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  outline: none;
}

/* 物资筛选：关键词 / 分类切换 */
.filter-switch {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  padding: 3px;
  border-radius: 10px;
  background: #f2f3f5;
}
.filter-switch__btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: #86909c;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.filter-switch__btn.is-active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.filter-switch-panel[hidden] {
  display: none !important;
}

/* 配件申请：搜索框内嵌按钮 */
.apply-search-box {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.apply-search-box__input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.apply-search-box select.apply-search-box__input {
  background-image: none;
}
.apply-search-box__btn {
  flex: 0 0 auto;
  border-radius: 0 !important;
  min-height: 44px;
  padding-left: 14px;
  padding-right: 14px;
  box-shadow: none !important;
  white-space: nowrap;
}

/* 审核页：合并日期范围 + 筛选按钮 */
.date-range-query {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.date-range-query__display {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0 12px;
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.date-range-query__text.is-placeholder {
  color: var(--color-text-muted);
}
.date-range-query__filter {
  flex: 0 0 auto;
  border-radius: 0 !important;
  min-height: 44px;
  padding-left: 14px;
  padding-right: 14px;
  box-shadow: none !important;
}
.date-range-query__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: 0;
  bottom: 0;
}

/* 自定义日期范围日历（可显示起始/结束标题） */
.date-pick-panel {
  border-radius: 12px;
  max-width: 360px;
  margin: 0 auto;
}
.date-pick-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.date-pick-nav__btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #f2f3f5;
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.date-pick-nav__label {
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0 8px;
}
.date-pick-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.date-pick-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.date-pick-day {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.date-pick-day.is-muted {
  color: #c9cdd4;
  cursor: default;
}
.date-pick-day.is-today {
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.date-pick-day.is-in-range {
  background: var(--color-primary-soft);
}
.date-pick-day.is-selected {
  background: #4e5969;
  color: #fff;
}
.date-pick-day.is-disabled,
.date-pick-day:disabled.is-disabled {
  color: #c9cdd4;
  cursor: not-allowed;
  background: transparent;
}
.date-pick-day:not([disabled]):hover {
  background: var(--color-primary-soft);
}
.date-pick-day.is-selected:hover {
  background: #4e5969;
}

.goods-thumb-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 6px;
  overflow: hidden;
  vertical-align: middle;
}
.goods-thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #f2f3f5;
}
.goods-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.78);
  cursor: zoom-out;
}
.goods-img-lightbox[hidden] {
  display: none !important;
}
.goods-img-lightbox img {
  max-width: min(92vw, 960px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: default;
}
.goods-img-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1d2129;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cat-cascader {
  position: relative;
  width: 100%;
}
.cat-cascader__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #1d2129;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}
.cat-cascader.is-open .cat-cascader__trigger {
  border-color: #4e5969;
  box-shadow: 0 0 0 2px rgba(78, 89, 105, 0.12);
}
.cat-cascader__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-cascader__arrow {
  flex-shrink: 0;
  color: #86909c;
  font-size: 0.75rem;
}
.cat-cascader__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.cat-cascader__panel[hidden] {
  display: none !important;
}
.cat-cascader__cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  min-height: 220px;
  max-height: 280px;
}
.cat-cascader__col {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  border-right: 1px solid #f0f1f3;
  min-width: 0;
}
.cat-cascader__col:last-child {
  border-right: 0;
}
.cat-cascader__item {
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  color: #1d2129;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-cascader__item:hover {
  background: #f7f8fa;
}
.cat-cascader__item.is-active {
  background: var(--color-primary-soft, #e8f3ff);
  color: #0e42b3;
  font-weight: 600;
}
@media (max-width: 575.98px) {
  .cat-cascader__cols {
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 200px;
    max-height: 240px;
  }
  .cat-cascader__item {
    font-size: 0.8rem;
    padding: 0.4rem 0.45rem;
  }
}

.parts-search-wrap {
  z-index: 5;
}
.parts-search-suggest {
  top: calc(100% + 2px);
  z-index: 30;
  max-height: 260px;
}
.parts-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
}
.parts-suggest-name {
  font-weight: 600;
  color: var(--color-text);
}
.parts-suggest-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* 全局提示：页面正中 */
.kucun-toast-host {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: min(90vw, 360px);
  pointer-events: none;
  padding: 0 12px;
}
body.kucun-demo-shell-ready .kucun-app-shell > .kucun-toast-host {
  position: absolute;
}
.kucun-toast-host .kucun-toast-msg {
  pointer-events: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  min-width: 160px;
  text-align: center;
}