/* 平台总控 · 优雅金色主题
   升级为现代优雅的金色设计系统：更精致的色彩、流畅的动效、立体的层次感。
   保持控制台的紧凑布局，但提升整体视觉品质和交互体验。 */

:root {
  /* 优化后的色彩系统 */
  --paper: linear-gradient(135deg, #FDFBF5 0%, #F8F3E8 100%);
  --paper-solid: #F8F3E8;
  --paper-2: #F5EFE0;
  --panel: #FFFDF8;
  --panel-2: #FDFAF2;
  --panel-strong: rgba(255, 255, 255, 0.95);
  --ink: #1F1B18;
  --muted: #8B8378;
  --gold: #C9A449;
  --gold-soft: #E4D6A8;
  --gold-dark: #A67C2F;
  --gold-bright: #E6C965;
  --gold-line: #DEC890;
  --seal: #9c3a2b;
  --green: #4f6b52;
  --dai: #2b4a6f;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  
  /* 阴影系统 */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 2px 8px rgba(201, 164, 73, 0.35), 0 6px 20px rgba(201, 164, 73, 0.15);
  --shadow-gold-hover: 0 4px 12px rgba(201, 164, 73, 0.45), 0 8px 28px rgba(201, 164, 73, 0.25);
}
* { box-sizing: border-box; }
/* hidden 属性必须压过组件自己的 display —— 否则 .gate{display:grid}/.drawer{display:flex}
   会让隐藏的登录卡和抽屉一直画在页面上（踩过一次） */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper-solid);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
h1, h2, strong { font-family: var(--serif); font-weight: 650; }
button { font: inherit; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
input, select, textarea { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---------- 登录闸门 ---------- */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #FDFBF5 0%, #F8F3E8 50%, #F5EFE0 100%);
  padding: 24px;
}
.gate-card {
  width: min(440px, 100%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 249, 243, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  padding: 32px 32px 24px;
  box-shadow: var(--shadow-gold);
  backdrop-filter: blur(20px);
}
.lockup { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin-bottom: 24px;
}
.lockup small { 
  display: block; 
  font-size: 10px; 
  letter-spacing: 0.28em; 
  color: var(--gold-dark); 
  font-weight: 850; 
}
.lockup strong { 
  font-size: 22px; 
  letter-spacing: 0.08em;
  font-weight: 700;
}
.seal {
  width: 38px; 
  height: 38px; 
  border-radius: 10px; 
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
  color: #FFFFFF;
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  font-family: var(--serif); 
  font-size: 20px; 
  font-weight: 800; 
  flex: none;
  box-shadow: 0 4px 12px rgba(201, 164, 73, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
}
.seal.big { 
  width: 52px; 
  height: 52px; 
  font-size: 28px; 
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(201, 164, 73, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.gate-note { 
  color: var(--muted); 
  font-size: 13.5px; 
  margin: 0 0 20px; 
  line-height: 1.75;
}
label { 
  display: block; 
  margin-bottom: 14px; 
  font-size: 12.5px; 
  color: var(--muted); 
  font-weight: 650;
}
input, select, textarea {
  display: block; 
  width: 100%; 
  margin-top: 6px; 
  padding: 10px 13px;
  background: rgba(255, 253, 248, 0.85); 
  border: 1px solid var(--gold-line); 
  border-radius: 10px;
  color: var(--ink); 
  font: inherit;
}
input:focus, select:focus, textarea:focus { 
  outline: none; 
  border-color: var(--gold); 
  background: #FFFDF8;
  box-shadow: 0 0 0 3px rgba(201, 164, 73, 0.15);
}
.error { 
  color: var(--seal); 
  font-size: 13px; 
  min-height: 20px; 
  margin-bottom: 8px; 
  font-weight: 600;
}
code { 
  font-family: ui-monospace, Consolas, monospace; 
  background: var(--paper-2); 
  padding: 2px 6px; 
  border-radius: 5px; 
  font-size: 12.5px;
  color: var(--gold-dark);
  font-weight: 600;
}
.gate-foot { 
  color: var(--muted); 
  font-size: 12px; 
  text-align: center; 
  margin: 18px 0 0; 
}

/* ---------- 按钮 ---------- */
.primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-dark));
  color: #FFFFFF;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(201, 164, 73, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}
.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}
.primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark), #8B6B2D);
  box-shadow: 0 6px 18px rgba(201, 164, 73, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.primary:hover::before {
  left: 100%;
}
.primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(201, 164, 73, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.primary.wide {
  width: 100%;
  padding: 12px;
}
.ghost {
  background: transparent;
  border: 1px solid var(--gold-line);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 15px;
  font-weight: 600;
}
.ghost:hover {
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.12), rgba(230, 201, 101, 0.06));
  border-color: var(--gold);
  color: var(--gold-dark);
}
.ghost:active {
  background: rgba(230, 201, 101, 0.18);
}
.mini {
  background: transparent;
  border: 1px solid var(--gold-line);
  color: var(--muted);
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12.5px;
  height: 24px;
  line-height: 22px;
  vertical-align: top;
  font-weight: 600;
}
.mini:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
  background: rgba(230, 201, 101, 0.08);
}

/* ---------- 顶栏 ---------- */
/* ---------- 一屏布局 ----------
   页面本身不滚：顶栏 + 内容区撑满视口，长表格各自带滚动条、表头吸在顶上。
   原来是一整页滚动，看指令队列要往下拉很久，设备状态和批次就滚出屏幕了。 */
#app { height: 100vh; min-height: 560px; display: flex; flex-direction: column; }
.topbar { flex: 0 0 auto; }
main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 20px 14px; display: flex; flex-direction: column; }
.page { flex: 0 0 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.page > .panel { min-height: 0; display: flex; flex-direction: column; }
/* 表格自己的滚动区（.panel 里：panel-head 固定，表格滚） */
.scroll { flex: 1 1 auto; min-height: 88px; overflow: auto; }
.scroll > .table th { position: sticky; top: 0; z-index: 1; }
/* 一条数据都没有时表格是 hidden 的，别留个空滚动框 */
.scroll:has(> .table[hidden]) { display: none; }

.topbar {
  display: flex; 
  align-items: center; 
  gap: 16px;
  padding: 12px 20px; 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 249, 243, 0.98));
  border-bottom: 2px solid var(--gold-line); 
  position: sticky; 
  top: 0; 
  z-index: 5;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.brand strong { 
  display: block; 
  font-size: 17px; 
  letter-spacing: 0.06em;
  font-weight: 700;
}
.brand small { 
  color: var(--gold-dark); 
  font-size: 10.5px; 
  letter-spacing: 0.24em; 
  font-weight: 850;
}
.topbar nav { 
  display: flex; 
  gap: 8px; 
  margin-left: 12px; 
}
.nav {
  background: transparent; 
  border: 0; 
  border-bottom: 3px solid transparent;
  color: var(--muted); 
  padding: 8px 16px; 
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav:hover { 
  color: var(--gold-dark);
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.08), rgba(230, 201, 101, 0.04));
  border-radius: 8px 8px 0 0;
}
.nav.on { 
  color: var(--gold-dark); 
  border-bottom-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.12), rgba(230, 201, 101, 0.06));
  border-radius: 8px 8px 0 0;
}
.who { 
  margin-left: auto; 
  color: var(--muted); 
  font-size: 13px; 
  font-weight: 600;
}
/* 自动刷新指示：只在设备中心/档案库显示，其它页面留空 */
.sync-note { 
  color: var(--gold); 
  font-size: 12.5px; 
  white-space: nowrap; 
  font-weight: 650;
}

/* ---------- 页面 ---------- */
main { padding: 12px 20px 14px; }
.page-head { flex: 0 0 auto; }
.page-head {
  display: flex; 
  align-items: center; 
  gap: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(252, 249, 243, 0.95));
  border: 1px solid var(--gold-line); 
  border-radius: 12px;
  padding: 14px 18px; 
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.ph-copy small { 
  color: var(--gold-dark); 
  font-size: 10.5px; 
  letter-spacing: 0.24em; 
  font-weight: 850; 
}
.ph-copy h1 { 
  margin: 3px 0 0; 
  font-size: 22px; 
  letter-spacing: 0.06em;
  font-weight: 700;
}
.ph-stats { 
  display: flex; 
  gap: 12px; 
  margin-left: auto; 
}
.ph-stats span {
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.12), rgba(230, 201, 101, 0.06));
  border: 1px solid var(--gold-line); 
  border-radius: 10px;
  padding: 6px 14px; 
  font-size: 13px; 
  color: var(--muted);
  font-weight: 600;
  transition: all 0.25s ease;
}
.ph-stats span:hover {
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.18), rgba(230, 201, 101, 0.09));
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(201, 164, 73, 0.15);
}
.ph-stats b { 
  color: var(--gold-dark); 
  font-size: 16px; 
  margin-right: 5px; 
  font-weight: 800;
}

/* panel 一律做成纵向 flex：里面的 .scroll 才能吃掉剩余高度、表头才能吸住 */
.panel { 
  background: var(--panel-strong); 
  border: 1px solid var(--gold-line); 
  border-radius: 12px; 
  overflow: hidden; 
  display: flex; 
  flex-direction: column; 
  min-height: 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.table { 
  width: 100%; 
  border-collapse: collapse; 
}
.table th {
  text-align: left; 
  font-size: 12px; 
  letter-spacing: 0.08em; 
  color: var(--muted);
  background: linear-gradient(135deg, var(--paper-2), rgba(245, 239, 224, 0.8));
  padding: 10px 14px; 
  border-bottom: 2px solid var(--gold-line);
  white-space: nowrap;
  font-weight: 750;
}
.table td { 
  padding: 11px 14px; 
  border-bottom: 1px solid rgba(222, 200, 144, 0.4); 
  vertical-align: middle; 
  line-height: 24px;
  transition: background 0.2s ease;
}
.table tr:last-child td { 
  border-bottom: 0; 
}
.table tr:hover td { 
  background: linear-gradient(90deg, rgba(230, 201, 101, 0.1), rgba(230, 201, 101, 0.05), transparent);
}
.table .name { 
  font-weight: 750; 
  color: var(--ink);
}
.table .actions { 
  text-align: right; 
  white-space: nowrap; 
}
.empty { 
  padding: 32px; 
  text-align: center; 
  color: var(--muted); 
  font-size: 14px;
}

/* 行高固定住的表格里，chip/mini 要单独定高并 top 对齐：
   否则它们的行内盒比正文行盒高，会把整行撑到 46px（表格行高就参差不齐了） */
.chip { 
  display: inline-block; 
  padding: 3px 11px; 
  border-radius: 999px; 
  font-size: 12px; 
  line-height: 18px; 
  background: var(--paper-2); 
  color: var(--muted); 
  vertical-align: top;
  font-weight: 650;
  transition: all 0.2s ease;
}
.chip.on { 
  background: linear-gradient(135deg, #EEF2E8, #E0E8DC); 
  color: var(--green); 
  font-weight: 700;
}
.chip.off { 
  background: linear-gradient(135deg, #F8ECE5, #F0DFD5); 
  color: var(--seal); 
  font-weight: 700;
}
.chip.dai { 
  background: linear-gradient(135deg, #E9EEF5, #DBE3F0); 
  color: var(--dai); 
  font-weight: 700;
}
.muted { 
  color: var(--muted); 
}
.num { 
  font-variant-numeric: tabular-nums; 
  font-weight: 650;
}

/* ---------- 抽屉 ---------- */
.drawer-mask { 
  position: fixed; 
  inset: 0; 
  background: rgba(31, 27, 24, 0.4); 
  z-index: 20;
  backdrop-filter: blur(4px);
}
.drawer {
  position: fixed; 
  top: 0; 
  right: 0; 
  bottom: 0; 
  width: min(500px, 100%);
  background: var(--panel-strong);
  border-left: 2px solid var(--gold-line);
  display: flex; 
  flex-direction: column; 
  z-index: 21;
  box-shadow: -20px 0 60px rgba(36, 31, 26, 0.2);
  backdrop-filter: blur(20px);
}
.drawer header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 16px 20px; 
  border-bottom: 2px solid var(--gold-line); 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 249, 243, 0.98));
}
.drawer header small { 
  color: var(--gold-dark); 
  font-size: 10.5px; 
  letter-spacing: 0.24em;
  font-weight: 850;
}
.drawer header h2 { 
  margin: 3px 0 0; 
  font-size: 19px; 
  letter-spacing: 0.06em;
  font-weight: 700;
}
.drawer-body { 
  flex: 1; 
  overflow-y: auto; 
  padding: 18px 20px; 
}
.drawer footer {
  display: flex; 
  align-items: center; 
  gap: 14px;
  padding: 14px 20px; 
  border-top: 2px solid var(--gold-line); 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 249, 243, 0.98));
}
.drawer-error { 
  flex: 1; 
  color: var(--seal); 
  font-size: 13px; 
  font-weight: 650;
}
.field-row { 
  display: flex; 
  gap: 14px; 
}
.field-row > label { 
  flex: 1; 
}
.checks { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  margin-top: 8px; 
}
.checks label {
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  margin: 0;
  background: linear-gradient(135deg, var(--paper-2), rgba(245, 239, 224, 0.8));
  border: 1px solid var(--gold-line); 
  border-radius: 999px;
  padding: 5px 13px; 
  font-size: 13px; 
  color: var(--ink); 
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}
.checks label:hover {
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.15), rgba(230, 201, 101, 0.08));
  border-color: var(--gold);
  transform: translateY(-1px);
}
.checks input { 
  width: auto; 
  margin: 0; 
}
.hint { 
  color: var(--muted); 
  font-size: 12px; 
  margin: -4px 0 14px;
  line-height: 1.6;
}

.toast {
  position: fixed; 
  left: 50%; 
  bottom: 32px; 
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-dark), #8B6B2D);
  color: #FFFFFF;
  padding: 11px 22px; 
  border-radius: 999px;
  font-size: 13.5px; 
  z-index: 30;
  box-shadow: 0 6px 20px rgba(201, 164, 73, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ---------- 设备中心 ---------- */
.lead { 
  color: var(--muted); 
  font-size: 13.5px; 
  margin: 0;
  line-height: 1.7;
}
.devices { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 14px; 
  flex: 0 0 auto; 
}
.device { 
  background: var(--panel-strong);
  border: 1px solid var(--gold-line); 
  border-radius: 12px; 
  padding: 16px 18px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}
.device:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
.device header { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}
.device header strong { 
  font-size: 17px; 
  letter-spacing: 0.04em;
  font-weight: 750;
}
.device header small { 
  margin-left: auto;
  font-weight: 650;
}
.device dl { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 10px 16px; 
  margin: 0; 
}
.device dt { 
  color: var(--muted); 
  font-size: 12px;
  font-weight: 650;
}
.device dd { 
  margin: 3px 0 0; 
  font-size: 13.5px;
  font-weight: 600;
}
.device p { 
  margin: 0; 
  font-size: 13px;
  line-height: 1.6;
}
.device .primary { 
  align-self: flex-start; 
}
.device.is-alert {
  border-color: var(--seal, #9c3a2b);
}
.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.device-actions .primary { align-self: auto; }
.shot-thumb {
  max-width: 130px;
  max-height: 74px;
  border-radius: 6px;
  border: 1px solid var(--gold-line);
  display: block;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted, #78716c); flex: none; display: inline-block;
}
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.status-dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
.status-dot.dai { background: var(--gold); }
.dev-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.two-col { 
  display: grid; 
  grid-template-columns: 1.25fr .75fr; 
  gap: 14px; 
  align-items: start; 
}
@media (max-width: 1000px) { 
  .two-col { 
    grid-template-columns: 1fr; 
  } 
}
.panel-head { 
  display: flex; 
  align-items: baseline; 
  gap: 12px; 
  padding: 12px 16px; 
  border-bottom: 2px solid var(--gold-line); 
  background: linear-gradient(135deg, var(--paper-2), rgba(245, 239, 224, 0.8));
}
.panel-head h2 { 
  margin: 0; 
  font-size: 16px;
  letter-spacing: 0.04em;
  font-weight: 750;
}
.panel-head .muted { 
  font-size: 12.5px;
  font-weight: 600;
}
.plan { 
  padding: 12px 16px; 
  border-top: 1px solid rgba(222, 200, 144, 0.5);
  transition: background 0.2s ease;
}
.plan:hover {
  background: linear-gradient(90deg, rgba(230, 201, 101, 0.08), transparent);
}
.plan h3 { 
  margin: 0 0 8px; 
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.plan p { 
  margin: 3px 0; 
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- 采集计划 ---------- */
.plan-panel { 
  margin-top: 14px; 
}
.plan-list { 
  padding: 6px 0; 
}
.plan-row { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  padding: 11px 16px; 
  border-bottom: 1px solid rgba(222, 200, 144, 0.4);
  transition: background 0.2s ease;
}
.plan-row:hover {
  background: linear-gradient(90deg, rgba(230, 201, 101, 0.1), rgba(230, 201, 101, 0.05), transparent);
}
.plan-row:last-child { 
  border-bottom: 0; 
}
.plan-row strong { 
  font-size: 17px;
  font-weight: 800;
  font-family: var(--serif);
  letter-spacing: 0.05em;
}
.plan-row > span:first-of-type { 
  color: var(--ink);
  font-weight: 650;
}
.plan-row .chip { 
  margin-left: auto; 
}
.plan-add { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 14px 16px; 
  border-top: 2px solid var(--gold-line); 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 249, 243, 0.98));
  flex-wrap: wrap; 
}
.plan-add-label { 
  color: var(--muted); 
  font-size: 13px;
  font-weight: 650;
}
.plan-add select { 
  width: auto; 
  margin: 0; 
  padding: 7px 10px;
  font-weight: 600;
}
.plan-colon { 
  font-weight: 800; 
  color: var(--gold-dark);
  font-size: 16px;
}
.plan-ch { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  margin: 0; 
  font-size: 13px; 
  color: var(--ink); 
  background: linear-gradient(135deg, var(--paper-2), rgba(245, 239, 224, 0.8));
  border: 1px solid var(--gold-line); 
  border-radius: 999px; 
  padding: 5px 13px;
  transition: all 0.2s ease;
  font-weight: 650;
}
.plan-ch:hover {
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.15), rgba(230, 201, 101, 0.08));
  border-color: var(--gold);
}
.plan-ch input { 
  width: auto; 
  margin: 0; 
}

/* ---------- 表格列宽（原来列宽没管，状态被挤成竖排、时间折两行） ---------- */
/* 指令队列独占左列，所以列宽按"最短够用"给：时间/领取各 19 字符、来源最长 feishu-menu */
.collect-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-rows: minmax(0, 1fr); gap: 12px; align-items: stretch; flex: 0 0 auto; height: 440px; }
.collect-grid > .panel, .collect-side, .collect-side > .panel { min-width: 0; min-height: 0; }
/* 右列：批次表吃掉剩余高度，采集计划按内容高（计划多了自己滚） */
.collect-side { display: grid; gap: 12px; grid-template-rows: minmax(0, 1fr) auto; }
.collect-side .plan-panel { margin-top: 0; }
.plan-list { max-height: 168px; overflow: auto; }
@media (max-width: 1100px) { .collect-grid { grid-template-columns: 1fr; } }

#col-cmd-table { table-layout: fixed; }
#col-cmd-table th, #col-cmd-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#col-batch-table { table-layout: fixed; }
#col-batch-table th, #col-batch-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#col-cmd-table th:nth-child(1) { width: 170px; }
#col-cmd-table th:nth-child(2) { width: 76px; }
#col-cmd-table th:nth-child(3) { width: 84px; }
#col-cmd-table th:nth-child(4) { width: 162px; }
#col-cmd-table th:nth-child(5) { width: 170px; }
#col-cmd-table th:nth-child(6) { width: auto; }
#col-cmd-table th:nth-child(7) { width: 78px; }
/* 计划行：按钮别再被推到最右边（中间空一大截） */
.plan-row .chip { margin-left: 6px; }
.plan-row [data-plan-del] { margin-left: auto; }

/* ---------- 历史档案库 ---------- */
.arc-filter-panel { 
  flex: 0 0 auto; 
}
.arc-filter { 
  display: flex; 
  align-items: flex-end; 
  gap: 14px; 
  padding: 14px 16px; 
  flex-wrap: wrap; 
}
.arc-filter label { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  margin: 0; 
  color: var(--muted); 
  font-size: 12.5px;
  font-weight: 650;
}
.arc-filter .grow { 
  flex: 1 1 240px; 
  min-width: 200px; 
}
.arc-filter select, .arc-filter input { 
  margin: 0;
  font-weight: 600;
}
.arc-filter .ghost { 
  align-self: flex-end; 
}
.arc-last { 
  padding: 12px 16px; 
  border-top: 2px solid var(--gold-line); 
  background: linear-gradient(135deg, rgba(230, 201, 101, 0.08), rgba(230, 201, 101, 0.04));
  font-size: 13px;
  line-height: 1.6;
}
.arc-last a { 
  color: var(--dai); 
  font-weight: 750;
  text-decoration: none;
  transition: color 0.2s ease;
}
.arc-last a:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}
.arc-note { 
  padding: 10px 16px; 
  border-top: 1px solid rgba(222, 200, 144, 0.5);
  color: var(--muted); 
  font-size: 12.5px;
  line-height: 1.7;
}
.arc-pick { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  color: var(--muted); 
  font-size: 13px; 
  margin: 0;
  font-weight: 650;
}
.arc-pick select { 
  width: auto; 
  margin: 0; 
  padding: 7px 10px;
  font-weight: 600;
}
#arc-table { table-layout: fixed; }
#arc-table th, #arc-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#arc-table th:nth-child(1) { width: 168px; }
#arc-table th:nth-child(2) { width: 122px; }
#arc-table th:nth-child(3) { width: 78px; }
#arc-table th:nth-child(4) { width: 130px; }
#arc-table th:nth-child(5) { width: 74px; }
#arc-table th:nth-child(6) { width: auto; }
#arc-table th:nth-child(7) { width: 108px; }
#arc-table .actions { white-space: nowrap; }

/* ===== 手机调试台 ===== */
.debug-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.debug-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 360px; max-height: 620px; overflow: auto;
  background: #1c1917; border-radius: 10px; padding: 8px;
}
.debug-screen .debug-shot { max-width: 100%; max-height: 600px; border-radius: 8px; cursor: crosshair; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.debug-screen .debug-hint { color: #a8a29e; font-size: 13px; text-align: center; padding: 40px 20px; }
.debug-body { display: flex; flex-direction: column; gap: 10px; }
.debug-body label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted, #78716c); }
.debug-body input, .debug-body select {
  height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--gold-line, #e7e5e4); background: #fff; color: #1c1917; font: inherit;
}
.debug-row { display: flex; flex-wrap: wrap; gap: 6px; }
.debug-result {
  margin: 0; padding: 8px 10px; border-radius: 8px; background: #fafaf9;
  border: 1px solid var(--gold-line, #e7e5e4); font-size: 12px; color: #44403c;
  white-space: pre-wrap; word-break: break-all; max-height: 120px; overflow: auto;
}
