/* 驳船动态查询（web-2.0）—— 照线上站「动态表数据整理系统」一比一复刻。
   色板取自包内 DESIGN.md + 线上站 globals.css / Tailwind slate 值：
     背景 slate-50 #f8fafc / 卡片白 / 边框 slate-200 #e2e8f0
     主蓝 blue-600 #2563eb / 上水 #dbeafe+#1e40af / 下水 #dcfce7+#166534
     港口状态 红 #dc2626 黄 #ca8a04 绿 #16a34a 灰 #94a3b8
   所有选择器一律 bd- 前缀，跟原报计划页面的样式互不干扰。 */

[hidden] { display: none !important; }

/* ---------------- 顶层两个站点选项卡（红框处） ---------------- */
.site-switch { display: flex; gap: 10px; align-items: stretch; }

.site-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 152px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #d9dfe9;
  border-radius: 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.site-tab b { font-size: 15px; font-weight: 700; line-height: 1.45; color: #5f6673; }
.site-tab small { font-size: 12px; line-height: 1.5; color: #8b93a1; }
.site-tab:hover { background: #fff; border-color: #b9c3d4; }
.site-tab.active {
  background: #fff;
  border-color: #3c4c6b;
  box-shadow: 0 2px 8px rgba(24, 34, 60, .09);
}
.site-tab.active b { color: #14161a; }
.site-tab.active small { color: #5f6673; }

/* ---------------- 站点切换：整页换内容 ---------------- */
.bd-root { display: none; }
body.site-barge { background: #f8fafc; }
body.site-barge .bd-root { display: block; }
body.site-barge .view { display: none !important; }
body.site-barge .topbar { max-width: 1600px; }

.bd-root {
  min-height: calc(100vh - 92px);
  background: #f8fafc;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------------- 顶部标题栏 ---------------- */
.bd-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.bd-header-inner,
.bd-main {
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.bd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.bd-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.bd-header-right { display: flex; align-items: center; gap: 16px; }
.bd-header-right span { font-size: 14px; color: #64748b; }
.bd-header-right b { font-weight: 600; }
.bd-header-right button {
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  color: #dc2626;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.bd-header-right button:hover { background: #fef2f2; }

.bd-main { padding-top: 24px; padding-bottom: 48px; }

/* ---------------- 上传拖拽区 ---------------- */
.bd-upload {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.bd-upload:hover { border-color: #94a3b8; background: #f8fafc; }
.bd-upload.dragging { border-color: #3b82f6; background: #eff6ff; }
.bd-cloud { width: 32px; height: 32px; color: #94a3b8; margin-bottom: 6px; }
.bd-upload-main { font-size: 14px; color: #475569; }
.bd-upload-sub { font-size: 13px; color: #94a3b8; margin-top: 3px; }
.bd-upload-busy { font-size: 13px; color: #2563eb; margin-top: 8px; }

/* ---------------- 卡片 / 错误条 ---------------- */
.bd-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.bd-search { margin-top: 24px; padding: 16px; }
.bd-errors {
  margin-top: 16px;
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 14px;
}
.bd-errors h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #991b1b; }
.bd-errors p { margin: 2px 0; font-size: 14px; }

/* ---------------- 搜索区 ---------------- */
.bd-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.bd-label { font-size: 14px; font-weight: 500; color: #334155; white-space: nowrap; }
.bd-select, .bd-input {
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}
.bd-select:focus, .bd-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, .25); }
.bd-flex { flex: 1; min-width: 200px; }
.bd-input.bd-flex { width: 100%; }
textarea.bd-input { resize: none; }
.bd-found { font-size: 14px; color: #64748b; white-space: nowrap; }

.bd-btn {
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.bd-btn-ghost { background: #f1f5f9; color: #475569; }
.bd-btn-ghost:hover { background: #e2e8f0; }
.bd-btn-ghost.active, .bd-btn-primary { background: #2563eb; color: #fff; }
.bd-btn-primary:hover { background: #1d4ed8; }
.bd-btn-mini {
  padding: 4px 10px;
  font-size: 13px;
  background: #fff;
  color: #475569;
  border-color: #e2e8f0;
}
.bd-btn-mini:hover { background: #f8fafc; }
.bd-btn-mini.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.bd-btn-mini:disabled { opacity: .3; cursor: not-allowed; }

.bd-batch-nav { margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.bd-batch-pairs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bd-batch-pairs > span.bd-batch-lab { font-size: 12px; font-weight: 500; color: #64748b; margin-right: 4px; }
.bd-batch-arrow { color: #cbd5e1; cursor: pointer; font-size: 16px; }
.bd-batch-arrow:hover { color: #3b82f6; }
.bd-batch-pill {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}
.bd-batch-pill:hover { background: #f1f5f9; }
.bd-batch-pill.active { background: #2563eb; color: #fff; font-weight: 500; border-color: #2563eb; }
.bd-batch-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: #64748b; }

.bd-dir { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.bd-mark-note { margin-top: 12px; margin-left: 8px; font-size: 12px; color: #94a3b8; }
.bd-note { margin: 8px 0 0; font-size: 12px; color: #64748b; }

/* ---------------- 结果表格 ---------------- */
.bd-table-card { margin-top: 24px; overflow: hidden; }
.bd-table-scroll { overflow-x: auto; }
.bd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bd-table thead { background: #f8fafc; }
.bd-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.bd-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
  vertical-align: middle;
}
.bd-table tbody tr:hover { background: #f8fafc; }
.bd-table tbody tr.bd-row-red { opacity: .5; }
.bd-col-ports { min-width: 300px; }
.bd-center { text-align: center !important; }
.bd-col-mark { width: 56px; }
.bd-col-note { width: 80px; }

.bd-company { font-weight: 500; color: #1e293b; }
.bd-company-sub { font-size: 12px; color: #64748b; }
.bd-shipname { font-weight: 500; color: #1e293b; white-space: nowrap; }
.bd-star { color: #ef4444; font-size: 18px; margin-right: 4px; }
.bd-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
}
.bd-badge-up { background: #dbeafe; color: #1e40af; }
.bd-badge-down { background: #dcfce7; color: #166534; }
.bd-ports { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bd-hit-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #facc15;
  margin-right: 2px;
  flex-shrink: 0;
}
.bd-port { font-weight: 500; }
.bd-port.red { color: #dc2626; }
.bd-port.yellow { color: #ca8a04; }
.bd-port.green { color: #16a34a; }
.bd-port.grey { color: #94a3b8; }
.bd-arrow { color: #cbd5e1; margin: 0 4px; }
.bd-status { white-space: nowrap; }

.bd-mark-btns { display: flex; align-items: center; justify-content: center; gap: 4px; }
.bd-mark {
  width: 20px; height: 20px;
  border: 0;
  border-radius: 4px;
  background: #f1f5f9;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}
.bd-mark:hover { background: #dcfce7; color: #16a34a; }
.bd-mark.bd-mark-x:hover { background: #fee2e2; color: #dc2626; }
.bd-mark.on-green { background: #22c55e; color: #fff; }
.bd-mark.on-red { background: #ef4444; color: #fff; }

.bd-note-btn {
  padding: 2px 8px;
  font: inherit;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
}
.bd-note-btn.has { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.bd-note-edit { display: flex; align-items: center; gap: 4px; justify-content: center; }
.bd-note-edit input {
  width: 96px;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
}
.bd-note-edit button { font: inherit; font-size: 12px; border: 0; background: transparent; cursor: pointer; }
.bd-note-edit .bd-note-save { color: #2563eb; }
.bd-note-edit .bd-note-cancel { color: #94a3b8; }

.bd-empty { text-align: center; padding: 48px 0; color: #64748b; font-size: 14px; }

/* ---------------- 作用域隔离 ----------------
   原站 app.css 有全局 `input[type=text], select, textarea { width:100%; padding:11px 14px;
   font-size:15px; border-radius:10px }`，会串进本页把「搜索类型」下拉撑满一整行、
   把输入框撑成 48px 高（线上站只有 ~36px）。这里用 .bd-root 前缀把优先级压回去，
   不影响报计划页面本身。 */
.bd-root select.bd-select,
.bd-root select.bd-input,
.bd-root input.bd-input,
.bd-root textarea.bd-input {
  width: auto;
  min-width: 0;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.bd-root select.bd-select { min-width: 108px; }
.bd-root select.bd-input.bd-flex,
.bd-root input.bd-input.bd-flex,
.bd-root textarea.bd-input.bd-flex { width: 100%; }
.bd-root select.bd-select:focus,
.bd-root select.bd-input:focus,
.bd-root input.bd-input:focus,
.bd-root textarea.bd-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .25);
}
.bd-root textarea.bd-input { resize: none; }
.bd-root .bd-note-edit input {
  width: 96px;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  box-shadow: none;
}
.bd-root button { font: inherit; line-height: 1.6; }
.bd-root .bd-note-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
