* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", sans-serif; font-size: 14px; background: #f5f6fa; color: #333; }
header { background: #2c3e50; color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
header h1 { font-size: 18px; }
header span { font-size: 12px; opacity: .8; }
.nav { background: #34495e; padding: 0 20px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.nav a { display: inline-block; color: #ecf0f1; padding: 10px 16px; text-decoration: none; }
.nav a.active { background: #1abc9c; color: #fff; }
.container { padding: 16px 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { padding: 8px 20px; border: 1px solid #ccc; background: #fff; cursor: pointer; font-size: 14px; min-height: 38px; }
.tabs button.active { background: #1abc9c; color: #fff; border-color: #1abc9c; }
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 6px 10px; border: 1px solid #ccc; min-height: 36px; font-size: 16px; }
.toolbar input { width: 240px; }
.btn { padding: 6px 14px; border: none; cursor: pointer; font-size: 14px; min-height: 34px; }
.btn-primary { background: #1abc9c; color: #fff; }
.btn-edit { background: #3498db; color: #fff; padding: 3px 10px; }
.btn-release { background: #e67e22; color: #fff; padding: 3px 10px; }
.btn[disabled] { background: #bdc3c7; cursor: not-allowed; }
#tableBox { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 900px; border-collapse: collapse; background: #fff; }
th, td { border: 1px solid #e0e0e0; padding: 7px 10px; text-align: left; }
th { background: #f0f3f5; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.badge-草稿 { background: #ecf0f1; color: #555; }
.badge-已下达 { background: #d6eaf8; color: #1f618d; }
.badge-外协生产中 { background: #fdebd0; color: #a04000; }
.badge-部分回货 { background: #fcf3cf; color: #7d6608; }
.badge-全部回货 { background: #d5f5e3; color: #196f3d; }
.badge-已结案 { background: #d2b4de; color: #4a235a; }
.status-正常 { color: #27ae60; font-weight: bold; }
.status-停用 { color: #95a5a6; }
.negative { color: #e74c3c; font-weight: bold; background: #fdecea; }
dialog { border: 1px solid #ccc; border-radius: 6px; padding: 20px; width: 480px; max-width: 92vw; }
dialog h3 { margin-bottom: 14px; }
.form-row { margin-bottom: 10px; }
.form-row label { display: inline-block; width: 140px; }
.form-row input, .form-row select, .form-row textarea { padding: 6px; border: 1px solid #ccc; width: 270px; max-width: 100%; font-size: 16px; min-height: 36px; }
.form-row textarea { vertical-align: top; height: 50px; }
.form-row input:disabled, .form-row select:disabled { background: #f0f0f0; color: #888; }
.msg { color: #e74c3c; margin: 8px 0; min-height: 18px; }
.tip { color: #7f8c8d; font-size: 12px; margin-bottom: 10px; }
.empty { padding: 30px; text-align: center; color: #999; }
/* ===== H5 手机端适配（V1.1 硬性载体约束） ===== */
@media (max-width: 768px) {
  header { padding: 10px 12px; }
  header h1 { font-size: 16px; }
  .nav { padding: 0 4px; display: flex; flex-wrap: wrap; overflow-x: visible; white-space: normal; }
  .nav a { padding: 10px 12px; flex: 1 1 30%; text-align: center; }
  .container { padding: 12px 10px; }
  .tabs { gap: 6px; }
  .tabs button { flex: 1 1 44%; padding: 8px 6px; }
  .toolbar input { flex: 1 1 100%; width: 100%; }
  .toolbar select { flex: 1 1 45%; }
  .btn { min-height: 40px; }
  .btn-edit, .btn-release { min-height: 32px; padding: 4px 10px; }
  .form-row label { display: block; width: auto; margin-bottom: 4px; }
  .form-row input, .form-row select, .form-row textarea { width: 100%; }
  dialog { padding: 16px; }
}

/* ===== Excel 导入组件（V2.5 §2.6） ===== */
.imp-drop { border: 2px dashed #b2bec3; border-radius: 8px; padding: 16px; text-align: center; background: #fbfcfd; cursor: pointer; transition: .15s; }
.imp-drop:hover, .imp-drop.imp-drag { border-color: #1abc9c; background: #eafaf6; }
.imp-drop .imp-link { color: #1abc9c; text-decoration: underline; cursor: pointer; }
.imp-tip { color: #95a5a6; font-size: 12px; margin-top: 6px; }
.imp-msg { white-space: pre-line; margin-top: 8px; font-size: 13px; }
.imp-info { color: #555; font-size: 13px; margin-bottom: 10px; }
.imp-map { max-height: 50vh; overflow-y: auto; }
.imp-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eee; }
.imp-fl { width: 130px; flex-shrink: 0; font-size: 14px; }
.imp-row select { flex: 1; padding: 6px; border: 1px solid #ccc; min-height: 36px; font-size: 15px; }
.imp-note { width: 130px; flex-shrink: 0; color: #95a5a6; font-size: 12px; }
.imp-msg2 { white-space: pre-line; margin-top: 10px; font-size: 13px; max-height: 30vh; overflow-y: auto; }

/* ===== 移动端表格自适应（卡片式，配合 auth-guard.js 注入的 data-label） ===== */
@media (max-width: 768px) {
  #tableBox { overflow-x: visible; }
  table.resp-table { min-width: 0 !important; width: 100%; border: none; background: transparent; display: block; }
  table.resp-table thead { display: none; }
  table.resp-table tr.resp-head { display: none; }
  table.resp-table tbody { display: block; }
  table.resp-table tr { display: block; border: 1px solid #e2e6e9; border-radius: 8px; margin: 0 0 10px; background: #fff; overflow: hidden; }
  table.resp-table td { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border: none; border-bottom: 1px solid #f0f2f4; padding: 8px 12px; text-align: right; word-break: break-word; }
  table.resp-table tr td:last-child { border-bottom: none; }
  table.resp-table td::before { content: attr(data-label); font-weight: 600; color: #555; text-align: left; flex: 0 0 auto; }
  table.resp-table td.empty { display: block; text-align: center; color: #999; }
  table.resp-table td.empty::before { content: ''; }
}
