* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #222;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
}
.topnav .brand { font-weight: 600; }
.topnav .navlinks a {
  color: #cbd5e1;
  text-decoration: none;
  margin-right: 20px;
  font-size: 14px;
}
.topnav .navlinks a:hover { color: #fff; }
.topnav .navuser { font-size: 13px; color: #cbd5e1; }
.topnav .navuser a { color: #93c5fd; }

.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
}

h1 { font-size: 22px; margin-bottom: 16px; }
h2 { font-size: 17px; margin-top: 28px; }

.login-box {
  max-width: 320px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.login-box h1 { text-align: center; font-size: 18px; }
.login-box label { display: block; margin-top: 12px; font-size: 13px; color: #555; }
.login-box input { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ccc; border-radius: 4px; }
.login-box button { width: 100%; margin-top: 20px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.page-actions { margin-bottom: 20px; }
.page-actions .btn { margin-right: 8px; }

.stat-cards { display: flex; gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 24px;
  flex: 1;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-num { font-size: 28px; font-weight: 700; color: #1f2937; }
.stat-label { font-size: 13px; color: #777; margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #222;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: #f0f0f0; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.link-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}

.search-bar { margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-bar input, .search-bar select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.data-table th { background: #fafafa; color: #555; font-weight: 600; }
.data-table tr[onclick] { cursor: pointer; }
.data-table tr[onclick]:hover { background: #f8fafc; }
.data-table .empty { text-align: center; color: #999; padding: 24px; }
.row-actions a, .row-actions .link-btn { margin-right: 10px; font-size: 13px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: #e5e7eb;
  color: #374151;
}
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-credit { background: #ede9fe; color: #5b21b6; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}
.form-row { display: flex; flex-direction: column; }
.form-row-wide { grid-column: 1 / -1; }
.form-row label { font-size: 13px; color: #555; margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.form-row textarea { min-height: 60px; }
.form-actions { margin-top: 16px; }
.form-actions .btn { margin-right: 8px; }

.order-total {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  margin-top: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  font-size: 14px;
}

.flash-wrap { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

@media (max-width: 700px) {
  /* 容器与整体间距 */
  .container { margin: 12px auto; padding: 0 10px; }
  h1 { font-size: 19px; }
  h2 { font-size: 16px; }

  /* 表单/详情/卡片：竖排（原有，保留） */
  .form-grid { grid-template-columns: 1fr; padding: 14px; }
  .detail-grid { grid-template-columns: 1fr 1fr; padding: 12px; font-size: 13px; }
  .stat-cards { flex-direction: column; gap: 10px; }
  .stat-num { font-size: 24px; }

  /* 顶部导航：允许横向滑动，避免菜单挤成一坨 */
  .topnav { padding: 10px 12px; flex-wrap: wrap; }
  .topnav .navlinks {
    width: 100%;
    margin-top: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .topnav .navlinks a { margin-right: 14px; font-size: 13px; }
  .topnav .navuser { font-size: 12px; }

  /* 页头：标题与按钮竖排，按钮不被截断 */
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* 手机端表格改为卡片式（见下方 max-width:1024px 卡片网格），
     不再横向滚动，也不再强制 min-width，避免宽度超出手机屏。 */
  .data-table th, .data-table td { padding: 9px 10px; font-size: 13px; }

  /* 搜索栏：换行排列，输入框不溢出 */
  .search-bar { flex-wrap: wrap; }
  .search-bar input, .search-bar select { flex: 1 1 auto; min-width: 120px; }

  /* 按钮在手机上更好点按 */
  .btn { padding: 9px 14px; }
  .page-actions .btn, .form-actions .btn { margin-bottom: 6px; }

  /* 登录框适配窄屏 */
  .login-box { margin: 40px auto; padding: 24px; }
}

/* 新增：库存/报表/员工相关 */
.hint { color: #777; font-size: 13px; margin: 8px 0 16px; }
/* 长链接/长网址在手机上换行，避免撑破页面宽度 */
.hint a, .data-table a { overflow-wrap: anywhere; word-break: break-word; }
.row-inactive { opacity: 0.5; }
.row-warn { background: #fef2f2; }
.txt-green { color: #166534; font-weight: 600; }
.txt-red { color: #991b1b; font-weight: 600; }
.data-table tfoot td { background: #fafafa; border-top: 2px solid #ddd; }
.data-table select, .data-table input { padding: 6px; border: 1px solid #ccc; border-radius: 4px; }

/* 商品模糊搜索选择器 */
.picker-cell { position: relative; }
.product-search { width: 100%; box-sizing: border-box; font-family: inherit; font-size: inherit; resize: vertical; }
.picker-dropdown {
  display: none; position: absolute; z-index: 50; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid #ccc; border-top: none;
  max-height: 260px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.picker-item { padding: 8px 10px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.picker-item:hover { background: #e8f5e9; }


/* 浮动式搜索下拉菜单：避免被表格、卡片、overflow 或手机布局裁掉 */
.floating-picker-dropdown {
  position: absolute;
  z-index: 99999;
  display: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}
.floating-picker-dropdown .picker-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  border-bottom: 1px solid #f1f5f9;
  white-space: normal;
}
.floating-picker-dropdown .picker-item:hover,
.floating-picker-dropdown .picker-item.active {
  background: #e8f5e9;
}
@media (max-width: 700px) {
  .floating-picker-dropdown {
    max-height: 55vh;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
  }
}


/* ===== 双语显示 Bilingual display ===== */
/* 导航：中文在上，英文在下，整体不换行 */
.topnav .navlinks a, .topnav .brand { white-space: nowrap; }
.topnav .navlinks a .nz, .topnav .brand .nz { display: block; line-height: 1.15; }
.topnav .navlinks a .ne, .topnav .brand .ne {
  display: block; font-size: 10px; line-height: 1.15; opacity: .72;
  letter-spacing: .01em; font-weight: 400;
}
.topnav .navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; }
.topnav .navlinks a { margin-right: 0; }
/* 正文里的英文副行 */
.en { display: block; color: #6b7280; font-size: 12px; line-height: 1.55; margin-top: 2px; }
p.hint .en, .hint .en { font-size: 12px; }
@media (max-width: 1024px) {
  .topnav .navlinks { gap: 2px 12px; }
  .topnav .navlinks a .ne, .topnav .brand .ne { font-size: 9px; }
}
@media print { .en { color: #444; } }

/* ==========================================================
   功能方块 Tiles（首页）
   ========================================================== */
.tile-grid {
  display: grid; gap: 12px; margin: 12px 0 22px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; min-height: 96px; padding: 14px 10px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  text-decoration: none; color: #1f2937; text-align: center;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.10); border-color: #cbd5e1; }
.tile:active { transform: translateY(0); }
.tile-icon { font-size: 26px; line-height: 1.1; }
.tile-zh { font-size: 15px; font-weight: 600; line-height: 1.25; }
.tile-en { font-size: 11px; color: #6b7280; line-height: 1.25; }
.tile-primary { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.tile-primary .tile-en { color: #c7d2fe; }
.tile-badge {
  position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff;
  font-size: 12px; line-height: 20px; font-weight: 600;
}

/* ==========================================================
   待办面板 To-do panel（待批/待审并入主页面）
   ========================================================== */
.todo-panel {
  border: 1px solid #fbbf24; background: #fffbeb; border-radius: 10px;
  padding: 14px 16px; margin: 0 0 20px;
}
.todo-panel .todo-title { margin: 0 0 6px; font-size: 17px; }
.todo-panel .hint { margin-top: 0; }
.todo-panel .data-table { background: #fff; }

/* 横向可滚动表格容器 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================
   移动端 Mobile (≤768px)
   ========================================================== */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .container, .page { padding-left: 12px; padding-right: 12px; }

  /* 导航：横向滚动，不再挤成多行 */
  .topnav { padding: 8px 10px; }
  .topnav .navlinks {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 0 14px; width: 100%; padding-bottom: 4px; scrollbar-width: none;
  }
  .topnav .navlinks::-webkit-scrollbar { display: none; }
  .topnav .navlinks a { flex: 0 0 auto; padding: 4px 0; }
  .topnav .brand .ne { display: none; }

  /* 方块：一行两个，指头点得到 */
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { min-height: 88px; }

  /* 页头与按钮竖排、占满宽度 */
  .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-header > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-header .btn, .page-actions .btn { flex: 1 1 auto; text-align: center; }
  .btn { padding: 10px 14px; min-height: 40px; }

  /* 搜索/筛选条竖排 */
  .search-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-bar input, .search-bar select, .search-bar .btn { width: 100%; }

  /* 表单控件占满、字号16px 防 iOS 自动放大 */
  input, select, textarea { width: 100%; font-size: 16px; }
  .form-row { flex-direction: column !important; gap: 10px !important; }
  .form-row > div { width: 100%; }

  /* 统计卡一行两个 */
  .stat-cards { grid-template-columns: repeat(2, 1fr); }

  /* 待办面板贴边一点 */
  .todo-panel { padding: 12px; }
}

/* 数据表 → 卡片式：手机与平板都卡片化。
   tbody 变网格容器，每行 tr 变一张卡；列数随屏宽自适应（手机1 / 平板2~3）。 */
@media (max-width: 1024px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table { white-space: normal; overflow-x: visible; }
  .data-table tbody {
    display: grid; gap: 10px;
    grid-template-columns: minmax(0, 1fr);   /* 默认（窄屏/手机）：一行一张 */
  }
  .data-table tr {
    margin: 0; min-width: 0; border: 1px solid #e2e8f0; border-radius: 10px;
    background: #fff; padding: 6px 10px;
  }
  .data-table td {
    border: none; border-bottom: 1px dashed #eef2f7; padding: 7px 0;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    text-align: right; min-width: 0; overflow-wrap: anywhere; word-break: break-word;
  }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before {
    content: attr(data-th); flex: 0 0 42%; text-align: left;
    color: #64748b; font-size: 12px; line-height: 1.35; font-weight: 500;
  }
  .data-table td:not([data-th]) { text-align: left; }
  .data-table td:not([data-th])::before { content: ""; flex: 0; }
  .data-table td.row-actions { flex-wrap: wrap; justify-content: flex-start; }
  /* 空状态占满整行 */
  .data-table tr:has(.empty) { grid-column: 1 / -1; }
  .data-table .empty { text-align: center; }

  /* 可编辑明细表（报价行）：手机端标签在上、输入框占满整行，
     避免多个数字输入框并排被挤压，导致看不清/填不到单价。 */
  #lines td { flex-direction: column; align-items: stretch; text-align: left; gap: 4px; }
  #lines tbody { grid-template-columns: minmax(0, 1fr); }
  #lines td::before { content: attr(data-th); flex: none; }
  #lines td:not([data-th])::before { content: ""; }
  #lines td input, #lines td select { width: 100%; box-sizing: border-box; }
  #lines td.lt { flex-direction: row; justify-content: space-between; align-items: center; text-align: right; }
}

/* 平板：一行两张卡 */
@media (min-width: 641px) and (max-width: 1024px) {
  .data-table tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 较宽平板（iPad 横屏等）：一行三张卡 */
@media (min-width: 900px) and (max-width: 1024px) {
  .data-table tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .tile-zh { font-size: 14px; }
}

/* ==========================================================
   订单开单：可视化商品选择器 + 商品行卡片
   （手机开单优化：图片网格找商品，卡片式明细行，替代原来纯文字表格）
   ========================================================== */
.order-lines { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.order-line-empty {
  text-align: center; color: #9ca3af; padding: 28px 12px; border: 1px dashed #d1d5db;
  border-radius: 10px; font-size: 13px; margin: 10px 0;
}
.order-line-card { border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 10px 12px; }
.order-line-head { display: flex; align-items: center; gap: 10px; }
.order-line-thumb {
  width: 48px; height: 48px; border-radius: 8px; background: #f3f4f6;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: #b0b8c4; font-size: 20px; overflow: hidden;
}
.order-line-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-line-info { flex: 1; min-width: 0; }
.order-line-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.order-line-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.order-line-body { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.order-line-field { flex: 1 1 120px; min-width: 100px; }
.order-line-field label { display: block; font-size: 11px; color: #6b7280; margin-bottom: 3px; }
.order-line-field input, .order-line-field select {
  width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
.qty-stepper { display: flex; align-items: stretch; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; }
.qty-stepper button {
  width: 34px; border: none; background: #f3f4f6; font-size: 17px; line-height: 1;
  cursor: pointer; color: #374151;
}
.qty-stepper button:active { background: #e5e7eb; }
.qty-stepper input {
  border: none !important; width: 100%; text-align: center; padding: 8px 2px !important;
  font-size: 14px; border-radius: 0 !important;
}
.order-line-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eef2f7;
}
.order-line-total { font-weight: 700; color: #166534; }

/* 商品选择弹层：底部抽屉式，图片网格 + 搜索 + 分类筛选 */
.picker-modal {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.picker-modal-inner {
  background: #fff; width: 100%; max-width: 720px; height: 90vh; max-height: 90vh;
  border-radius: 14px 14px 0 0; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
}
.picker-modal-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #eee; }
.picker-modal-header input[type=text] {
  flex: 1; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; box-sizing: border-box;
}
.picker-close-btn { background: none; border: none; font-size: 20px; color: #555; cursor: pointer; padding: 4px 8px; }
.picker-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid #f0f0f0;
  -webkit-overflow-scrolling: touch;
}
.picker-chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid #d1d5db;
  background: #f9fafb; color: #374151; font-size: 12.5px; white-space: nowrap; cursor: pointer;
}
.picker-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.picker-grid {
  flex: 1; overflow-y: auto; padding: 12px; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: start;
}
.picker-card {
  position: relative; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px; background: #fff;
  cursor: pointer; display: flex; flex-direction: column; gap: 5px; text-align: left;
}
.picker-card:active { background: #eff6ff; border-color: #93c5fd; }
.picker-card-img {
  width: 100%; aspect-ratio: 1/1; border-radius: 8px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center; color: #b0b8c4; font-size: 26px; overflow: hidden;
}
.picker-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.picker-card-meta { font-size: 11px; color: #6b7280; }
.picker-card-price { font-size: 12.5px; color: #166534; font-weight: 600; }
.picker-card-badge {
  position: absolute; top: 6px; right: 6px; background: #2563eb; color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.picker-empty { grid-column: 1 / -1; text-align: center; color: #9ca3af; padding: 40px 10px; font-size: 13px; }
.picker-cart-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-top: 1px solid #eee; background: #f9fafb;
  font-size: 13px; color: #374151;
}

/* 扫码弹层：视频取景框 + 状态提示 + 匹配到商品后的确认卡 */
.scan-video-wrap {
  position: relative; background: #000; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle {
  position: absolute; left: 8%; right: 8%; top: 36%; height: 26%;
  border: 3px solid #22c55e; border-radius: 10px; box-shadow: 0 0 0 2000px rgba(0,0,0,0.35);
  pointer-events: none;
}
.scan-status {
  padding: 10px 14px; font-size: 13px; color: #374151; background: #f9fafb;
  border-top: 1px solid #eee; text-align: center; flex: 0 0 auto;
}
.scan-status.scan-error { color: #b91c1c; background: #fef2f2; }
.scan-match-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-top: 1px solid #eee; background: #fff; flex-wrap: wrap; flex: 0 0 auto;
}
.scan-match-info { flex: 1; min-width: 130px; }
.scan-match-qty { width: 112px; flex: 0 0 auto; }
@media (min-width: 480px) {
  .picker-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) {
  .picker-grid { grid-template-columns: repeat(4, 1fr); }
  .picker-modal-inner { height: 80vh; max-height: 80vh; border-radius: 14px; margin-bottom: 5vh; }
}

/* 打印时恢复正常表格 */
@media print {
  .data-table thead { display: table-header-group; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: revert; }
  .data-table td::before { content: none; }
  .tile-grid, .todo-panel { display: none; }
  .picker-modal, #open-picker-btn, #open-scan-btn { display: none !important; }
}

/* ==========================================================
   设置页分区标签 Settings tabs
   ========================================================== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid #e2e8f0; margin: 4px 0 18px; }
.tab-btn {
  appearance: none; background: none; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; padding: 9px 16px; cursor: pointer; font: inherit; color: #475569;
  display: flex; flex-direction: column; align-items: center; line-height: 1.2; border-radius: 6px 6px 0 0;
}
.tab-btn:hover { background: #f1f5f9; color: #1e293b; }
.tab-btn.active { color: #1e3a8a; border-bottom-color: #1e3a8a; font-weight: 600; }
.tab-btn .tab-en { font-size: 10px; color: #94a3b8; font-weight: 400; }
.tab-btn.active .tab-en { color: #64748b; }
.tab-panel > h2:first-child { margin-top: 0; }
@media (max-width: 768px) {
  .tabs { gap: 2px; }
  .tab-btn { flex: 1 1 auto; padding: 9px 8px; font-size: 14px; }
}
@media print { .tabs { display: none; } .tab-panel { display: block !important; } }

/* ==========================================================
   待审供应商详情弹窗 Pending supplier detail modal
   ========================================================== */
.sd-backdrop {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 23, 42, 0.55);
  padding: 24px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.sd-backdrop.open { display: flex; align-items: flex-start; justify-content: center; }
.sd-modal {
  display: none; background: #fff; border-radius: 10px; width: 100%; max-width: 640px;
  margin: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25); overflow: hidden;
}
.sd-modal.open { display: block; }
.sd-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
}
.sd-head h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.sd-head .sd-sub { color: #777; font-size: 13px; margin-top: 2px; }
.sd-close {
  appearance: none; border: none; background: #f1f5f9; color: #475569; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1; flex: 0 0 auto;
}
.sd-close:hover { background: #e2e8f0; color: #1e293b; }
.sd-body { padding: 16px 20px; }
.sd-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #64748b; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #f1f5f9;
}
.sd-section-title:first-child { margin-top: 0; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.sd-field { min-width: 0; }
.sd-field.sd-wide { grid-column: 1 / -1; }
.sd-label { font-size: 12px; color: #94a3b8; margin-bottom: 2px; }
.sd-value { font-size: 14px; color: #1e293b; overflow-wrap: anywhere; word-break: break-word; }
.sd-value.sd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.sd-foot {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 14px 20px; border-top: 1px solid #e2e8f0; background: #fafafa;
}
@media (max-width: 700px) {
  .sd-backdrop { padding: 12px; }
  .sd-grid { grid-template-columns: 1fr; }
}
