/* ===== 全局滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ===== 全局搜索下拉菜单美化 ===== */
.global-search-dropdown .ant-select-item {
  padding: 10px 16px;
  border-radius: 6px;
  margin: 4px 8px;
  transition: all 0.2s;
}
.global-search-dropdown .ant-select-item:hover {
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f7ff 100%);
  transform: translateX(4px);
}
.global-search-dropdown .ant-select-item-option-selected {
  background: linear-gradient(135deg, #e8f0fe 0%, #d6e9ff 100%);
  font-weight: 500;
}
.global-search-dropdown .rc-virtual-list {
  padding: 4px 0;
}

.shell-top-tools {
  align-items: center;
  line-height: normal;
}

.shell-search-slot {
  height: 28px;
  display: flex;
  align-items: center;
}

.shell-search-autocomplete.ant-select {
  display: flex;
  align-items: center;
  height: 28px;
  line-height: 28px;
}

.shell-search-input.ant-input-affix-wrapper {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fcfdff;
  border: 1px solid #d8e3f2;
  box-shadow: none;
}

.shell-search-input.ant-input-affix-wrapper .ant-input-prefix {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

.shell-search-input.ant-input-affix-wrapper .ant-input {
  height: 26px;
  padding: 0;
  font-size: 13px;
  line-height: 26px;
  color: #24344d;
}

.shell-search-input.ant-input-affix-wrapper .ant-input::placeholder {
  color: #adb7c8;
}

.shell-user-entry {
  height: 28px;
  display: flex;
  align-items: center;
}

.shell-user-name {
  font-size: 13px;
  line-height: 28px;
  color: #28374f;
  font-weight: 600;
}

/* ===== 全局移动端响应式适配 ===== */

@media screen and (max-width: 767px) {
  /* --- Modal: 限制最大宽度 --- */
  .ant-modal {
    max-width: calc(100vw - 32px) !important;
    margin: 16px auto !important;
  }
  .ant-modal .ant-modal-body {
    max-height: 70vh;
    overflow-y: auto;
  }

  /* --- Descriptions: 强制单列 --- */
  .ant-descriptions .ant-descriptions-row {
    display: flex;
    flex-direction: column;
  }
  .ant-descriptions .ant-descriptions-row > th,
  .ant-descriptions .ant-descriptions-row > td {
    display: block;
    width: 100% !important;
    padding: 8px 12px !important;
  }
  .ant-descriptions .ant-descriptions-item {
    display: flex;
    flex-direction: column;
  }
  .ant-descriptions .ant-descriptions-item-label {
    font-weight: 600;
    color: #666;
  }
  /* bordered descriptions */
  .ant-descriptions-bordered .ant-descriptions-row > th,
  .ant-descriptions-bordered .ant-descriptions-row > td {
    border-right: none !important;
  }

  /* --- Table: 横向滚动 --- */
  .ant-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ant-table {
    min-width: max-content;
  }
  /* 紧凑表格单元格 */
  .ant-table-cell {
    padding: 8px 6px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
  .ant-table-cell .ant-typography {
    font-size: 13px !important;
  }

  /* --- Form: 紧凑间距 --- */
  .ant-form-item {
    margin-bottom: 12px;
  }

  /* --- Card: 紧凑内边距 --- */
  .ant-card-body {
    padding: 12px !important;
  }
  .ant-card-head {
    padding: 0 12px !important;
    min-height: 40px !important;
  }
  .ant-card-head-title {
    font-size: 14px !important;
  }

  /* --- Tabs: 可滚动 --- */
  .ant-tabs-nav {
    margin-bottom: 8px !important;
  }

  /* --- Statistic: 紧凑 --- */
  .ant-statistic-title {
    font-size: 12px !important;
    margin-bottom: 2px !important;
  }
  .ant-statistic-content {
    font-size: 20px !important;
  }

  /* --- Space.Compact / flex layouts: 允许换行 --- */
  .ant-space-compact {
    flex-wrap: wrap;
  }

  /* --- Drawer: 不超过屏幕宽度 --- */
  .ant-drawer-content-wrapper {
    max-width: 85vw !important;
  }

  /* --- 通用工具类 --- */
  /* 隐藏手机端不需要的元素 */
  .hide-on-mobile {
    display: none !important;
  }

  /* Grid三栏布局适配(PMC等) */
  .mobile-stack {
    grid-template-columns: 1fr !important;
  }
}

/* 桌面端隐藏 */
@media screen and (min-width: 768px) {
  .hide-on-desktop {
    display: none !important;
  }
}
