/* 华蜜供应链协同平台 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #303133;
}

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f3a5f 0%, #2d5a8e 50%, #3a7bd5 100%);
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 700; color: #1f3a5f; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: #909399; margin-bottom: 28px; }
.login-form { text-align: left; }
.login-btn { width: 100%; margin-top: 8px; }
.login-hint { margin-top: 18px; font-size: 11px; color: #c0c4cc; line-height: 1.6; }

/* ===== 主布局 ===== */
.layout { height: 100vh; }
.sidebar {
  background: #1f2d3d;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { font-size: 28px; }
.brand-name { color: #fff; font-size: 15px; font-weight: 600; }
.brand-org { color: #8a97a8; font-size: 11px; margin-top: 2px; }
.side-menu { border-right: none; background: transparent; flex: 1; }
.side-menu .el-menu-item {
  color: #a7b3c3;
  height: 48px;
}
.side-menu .el-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-menu .el-menu-item.is-active {
  background: rgba(64, 158, 255, .2);
  color: #fff;
  border-right: 3px solid #409EFF;
}
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }

.header {
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.header-title { font-size: 17px; font-weight: 600; color: #1f3a5f; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-chip { cursor: pointer; color: #606266; font-size: 14px; }

.main { background: #f5f7fa; overflow-y: auto; padding: 20px; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #1f3a5f; }

/* ===== 统计卡片 ===== */
.stat-row { margin-bottom: 20px; }
.stat-card { text-align: center; padding: 8px 0; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: #909399; margin-top: 4px; }

.welcome-card { margin-top: 8px; }
.welcome-card h3 { font-size: 16px; margin-bottom: 10px; }
.welcome-list { padding-left: 20px; line-height: 2; color: #606266; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.pager { margin-top: 14px; display: flex; justify-content: flex-end; }

/* ===== 表格内 ===== */
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.form-tip { font-size: 11px; color: #c0c4cc; margin-top: 2px; }

/* 产品卡片（客户/供应商视图） */
.cat-product-card { padding: 0; overflow: hidden; }
.cat-product-card .el-card__body { padding: 0 12px 12px; }
.cat-product-img { width: 100%; height: 120px; margin: 0 -12px 10px; overflow: hidden; background: #f5f7fa; }
.cat-product-img .el-image { width: 100%; height: 100%; }
.cat-product-img-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #c0c4cc; }
.cat-product-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.cat-product-sku { font-size: 12px; color: #909399; margin-bottom: 4px; }
.cat-product-oe { font-size: 12px; color: #E6A23C; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-product-price { font-size: 16px; color: #f56c6c; font-weight: 700; margin-top: 8px; }
.cat-product-inquiry { font-size: 13px; color: #409EFF; font-weight: 600; margin-top: 8px; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 分类筛选 ===== */
.cat-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cat-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f0f2f5;
  color: #606266;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
}
.cat-chip.active {
  background: #409EFF;
  color: #fff;
  font-weight: 600;
}
.cat-chip:active { transform: scale(.95); }

/* ===== 产品详情弹窗 ===== */
.pd-body { display: flex; gap: 16px; }
.pd-img {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f7fa;
  border: 1px solid #ebeef5;
}
.pd-info { flex: 1; min-width: 0; }
.pd-name { font-size: 17px; font-weight: 700; color: #303133; margin-bottom: 4px; }
.pd-sku { font-size: 13px; color: #909399; margin-bottom: 12px; }
.pd-rows { display: flex; flex-direction: column; gap: 8px; }
.pd-row { display: flex; font-size: 13px; color: #606266; line-height: 1.5; }
.pd-label { color: #909399; width: 70px; flex-shrink: 0; }
.pd-oe { color: #E6A23C; font-weight: 600; }
.pd-inquiry { color: #409EFF; font-weight: 600; }

@media (max-width: 768px) {
  .pd-body { flex-direction: column; }
  .pd-img { width: 100%; height: 200px; }
}

/* ===== 订单详情产品列 ===== */
.detail-prod { display: flex; align-items: center; gap: 8px; }
.detail-prod-img { width: 36px; height: 36px; border-radius: 4px; flex-shrink: 0; background: #f5f7fa; }
.detail-prod-img-fb { display: flex; align-items: center; justify-content: center; font-size: 16px; color: #c0c4cc; }
.detail-prod-info { min-width: 0; }
.detail-prod-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-prod-sku { font-size: 11px; color: #909399; }
.detail-prod-oe { font-size: 11px; color: #E6A23C; }

/* ===== 报价对话框 ===== */
.quote-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #606266;
  padding: 8px 12px;
  background: #f5f7fa;
  border-radius: 6px;
}
.quote-no { font-weight: 700; color: #303133; }
.quote-total {
  margin-top: 12px;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  color: #f56c6c;
}

/* ===== 产品选择器 ===== */
.picker-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.picker-cats { margin-bottom: 10px; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}
.picker-item {
  border: 2px solid #ebeef5;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  background: #fff;
}
.picker-item:active { transform: scale(.96); }
.picker-item.selected { border-color: #409EFF; background: #ecf5ff; }
.picker-img { width: 100%; height: 80px; border-radius: 6px; background: #f5f7fa; }
.picker-img-fb { display: flex; align-items: center; justify-content: center; font-size: 28px; color: #c0c4cc; }
.picker-name { font-size: 12px; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-sku { font-size: 11px; color: #909399; margin-top: 2px; }
.picker-oe { font-size: 11px; color: #E6A23C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #409EFF;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.picker-pager { margin-top: 10px; display: flex; justify-content: center; }
.picker-footer { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.picker-count { font-size: 13px; color: #909399; margin-right: auto; }

@media (max-width: 768px) {
  .picker-grid { grid-template-columns: repeat(3, 1fr); max-height: 55vh; }
  .picker-img { height: 70px; }
}

/* ===== 下单明细行 ===== */
.item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.item-prod {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px dashed #dcdfe6;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  background: #fafafa;
}
.item-prod:active { background: #ecf5ff; border-color: #409EFF; }
.item-prod-img { width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0; background: #f0f2f5; }
.item-prod-img-fb { display: flex; align-items: center; justify-content: center; font-size: 20px; color: #c0c4cc; }
.item-prod-info { min-width: 0; flex: 1; }
.item-prod-name { font-size: 13px; font-weight: 600; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-prod-sku { font-size: 11px; color: #909399; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 移动端卡片流 ===== */
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: 1px solid #ebeef5;
}
.m-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f2f5;
}
.m-card-title { font-size: 14px; font-weight: 600; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 8px; }
.m-card-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; color: #606266; }
.m-label { color: #909399; flex-shrink: 0; margin-right: 12px; }
.m-amount { color: #f56c6c; font-weight: 600; }
.m-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ebeef5; flex-wrap: wrap; }
.m-card-actions .el-button { flex: 1; min-width: 88px; height: 32px; }

/* ===== 移动端底部导航 ===== */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #e4e7ed;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  z-index: 100;
}
.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #909399;
  cursor: pointer;
  padding: 4px 0;
}
.mobile-tab.active { color: #409EFF; }
.mobile-tab-icon { font-size: 20px; line-height: 1.2; }
.mobile-tab-label { font-size: 10px; margin-top: 2px; }

/* ===== 响应式适配 ===== */
/* 更多菜单：默认隐藏，手机显示 */
.mobile-more-menu { display: none; }

@media (max-width: 768px) {
  /* 隐藏侧边栏，改用顶部简化头部 */
  .sidebar { display: none; }
  .mobile-more-menu { display: block; }
  .layout { height: 100vh; }
  .header { height: 48px !important; padding: 0 12px; }
  .header-title { font-size: 16px; }
  .main { padding: 12px; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 17px; margin-bottom: 12px; }

  /* 底部导航显示 + 安全区 */
  .mobile-tabbar { display: flex; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-tab-icon { font-size: 22px; }
  .mobile-tab-label { font-size: 11px; }

  /* 统计卡片更紧凑 */
  .stat-card { padding: 6px 0; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 12px; }

  /* 表格横向滚动（桌面功能备用） */
  .el-table { width: 100%; }
  .el-table__body-wrapper { overflow-x: auto; }

  /* 登录页适配 */
  .login-card { width: 92%; max-width: 400px; padding: 36px 24px 28px; }
  .login-title { font-size: 20px; }
  .login-sub { font-size: 11px; }

  /* 弹窗全屏化 + 底部抽屉式 */
  .el-dialog {
    --el-dialog-width: 100% !important;
    --el-dialog-margin-top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .el-dialog__header { padding: 16px 16px 8px; }
  .el-dialog__body { padding: 12px 16px; overflow-y: auto; flex: 1; }
  .el-dialog__footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #f0f2f5; }
  .el-dialog__footer .el-button { height: 44px; font-size: 15px; }

  /* 表单控件加大 */
  .el-input__inner, .el-textarea__inner { font-size: 15px !important; }
  .el-input__wrapper { min-height: 40px; }
  .el-select { width: 100% !important; }

  /* 主操作按钮大尺寸 */
  .toolbar .el-button { height: 40px; font-size: 14px; }
  .el-button--large { height: 46px !important; font-size: 16px !important; }

  /* 弹窗内按钮全宽 */
  .el-dialog__footer .el-button { flex: 1; }
  .el-dialog__footer { display: flex; gap: 10px; }

  /* 分页紧凑 */
  .el-pagination { flex-wrap: wrap; justify-content: center !important; }
  .el-pagination__total { display: none; }

  /* 隐藏部分表格列(手机上) */
  .el-table .hide-mobile { display: none; }
}

/* 平板中等屏幕 */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 180px !important; }
  .stat-value { font-size: 22px; }
}
