/* JUMAIK CRM 自定义样式 */

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.15s;
}
.form-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px #334155;
}

/* 导航按钮激活状态 */
.nav-btn.active {
  background-color: #1e293b;
  color: #fff;
  border-left: 3px solid #fff;
  padding-left: 1.25rem;
}
.nav-btn:not(.active) {
  border-left: 3px solid transparent;
}

/* 侧边栏 AI 提问框的占位文字（深底上用浅灰，默认的灰色看不清） */
.ai-quick-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.ai-quick-input::-webkit-input-placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* 等级标签 */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.grade-a { background: #fef3c7; color: #92400e; }
.grade-b { background: #dbeafe; color: #1e40af; }
.grade-c { background: #f1f5f9; color: #64748b; }
.grade-s { background: #1e293b; color: #fbbf24; }

/* 表格行hover */
tbody tr {
  transition: background 0.1s;
}
tbody tr:hover {
  background: #f8fafc;
}

/* 模态框动画 */
.modal-show {
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Toast 动画 */
#toast.show {
  display: block;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== 移动端适配 ==================== */

/* 平板及以下 */
@media (max-width: 768px) {
  /* 页面内边距缩小 */
  .page {
    padding: 1rem !important;
  }

  /* 页面标题缩小 */
  .page h2 {
    font-size: 1.25rem;
  }

  /* 筛选栏：占满宽度，自动换行 */
  .page .flex.flex-wrap {
    gap: 0.5rem !important;
  }
  .page .flex.flex-wrap input,
  .page .flex.flex-wrap select {
    width: calc(50% - 0.25rem);
    min-width: 0;
  }
  .page .flex.flex-wrap input#searchInput {
    width: 100%;
  }

  /* 表格横向滚动 */
  .bg-white.rounded-xl.shadow-sm.overflow-hidden {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 800px;
  }

  /* 模态框全屏 */
  #customerModal > div,
  #detailModal > div,
  #followupModal > div,
  #userModal > div,
  #pwdModal > div {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }
  #customerModal,
  #detailModal,
  #followupModal,
  #userModal,
  #pwdModal {
    padding: 0 !important;
  }

  /* 表单网格单列 */
  #customerForm .grid {
    grid-template-columns: 1fr !important;
  }

  /* 模态框内容内边距缩小 */
  #customerForm {
    padding: 1rem !important;
  }

  /* 登录页调整 */
  #loginPage > div {
    padding: 0 1rem;
  }

  /* 数据看板卡片单列 */
  #statsContent .grid {
    grid-template-columns: 1fr !important;
  }

  /* 看板统计卡片间距缩小 */
  #statsContent > * {
    margin-bottom: 0.75rem;
  }
}

/* 手机端（小屏） */
@media (max-width: 480px) {
  /* 筛选栏每个占满一行 */
  .page .flex.flex-wrap input,
  .page .flex.flex-wrap select {
    width: 100%;
  }

  /* 按钮全宽 */
  .page .flex.items-center.justify-between {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .page .flex.items-center.justify-between button {
    width: 100%;
  }
}

/* ==================== 2026-08-27 修复新增 ==================== */

/* 移动端表格优化（审查报告#15 轻量方案）：收紧字号与内边距，减少横向滚动幅度 */
@media (max-width: 768px) {
  table th,
  table td {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  table {
    min-width: 640px; /* 原800px收紧，降低横向滚动距离 */
  }
  /* 分页控件：小屏时统计信息与按钮上下排列 */
  #customerPagination > div,
  #productPagination > div,
  #orderPagination > div {
    flex-direction: column;
    align-items: stretch;
  }
  #customerPagination span,
  #productPagination span,
  #orderPagination span {
    text-align: center;
  }
}

/* 分页控件基础样式（配合 app.js renderPaginationHTML） */
#customerPagination button,
#productPagination button,
#orderPagination button {
  cursor: pointer;
  background: #fff;
}
#customerPagination button:not(:disabled):hover,
#productPagination button:not(:disabled):hover,
#orderPagination button:not(:disabled):hover {
  background: #f1f5f9;
}
#customerPagination button:disabled,
#productPagination button:disabled,
#orderPagination button:disabled {
  cursor: not-allowed;
}


/* ── 目录册规格编辑 ──────────────────────────────────────────
   纯图款（原表只有编号+图片）也要能补规格，所以编辑态会给一张
   空表：空格子必须看得见、点得到，光标才有的放。 */
.catalog-spec-cell {
  min-width: 5rem;
  min-height: 2.25rem;
  cursor: text;
}
/* 只有编辑态才提示，只读浏览时别满屏「点这里填写」 */
.catalog-spec-cell[contenteditable="true"]:empty::before {
  content: '点这里填写';
  color: #cbd5e1;
  font-size: 11px;
  pointer-events: none;
}
.catalog-spec-cell[contenteditable="true"]:focus {
  outline: 2px solid #334155;
  outline-offset: -2px;
  background: #fff;
}
/* 人工补录的行：左边一道橙色，和原表的行区分开 */
.catalog-spec-cell--new {
  box-shadow: inset 2px 0 0 #f59e0b;
}
