* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #f5f7fa;
  color: #1f2329;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

a {
  color: #0052d9;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #e7e7e7;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 20px;
  flex: 1;
}

.nav a {
  color: #333;
  padding: 17px 0;
  border-bottom: 2px solid transparent;
}

.nav a.active {
  color: #0052d9;
  border-bottom-color: #0052d9;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.page-sub {
  margin-top: 4px;
  color: #8b8b8b;
  font-size: 12px;
}

.card {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.muted {
  color: #8b8b8b;
  font-size: 12px;
}

.strong {
  font-weight: 600;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.green {
  color: #2ba471;
}

.red {
  color: #d54941;
}

.yellow {
  color: #e37318;
}

.gray {
  color: #8b8b8b;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat {
  padding: 16px 20px;
  margin: 0;
}

.stat-label {
  color: #666;
  font-size: 14px;
}

.stat-num {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.sync-line {
  margin-bottom: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap .t-table {
  min-width: 1520px;
}

/* 总览采集机列表按页面宽度排，不再横向拉动（12-03） */
.table-wrap.fit .t-table {
  min-width: 0;
}

.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap .t-table th {
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.action-disabled {
  display: inline-flex;
}

.table-wrap.alert-table .t-table {
  min-width: 900px;
}

.table-wrap.arrival-table .t-table {
  min-width: 760px;
}

.machine-filter {
  width: 220px;
  max-width: 100%;
}

.cell-main {
  font-weight: 600;
}

.cell-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.error-box {
  margin-bottom: 16px;
}

.center {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.empty-wrap {
  padding: 24px 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #666;
  font-size: 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.version-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.supplier-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.supplier-search {
  width: 280px;
  max-width: 100%;
}

.supplier-list {
  display: block;
  max-height: 420px;
  overflow: auto;
  padding: 4px 12px;
  border: 1px solid #e7e7e7;
  border-radius: 6px;
}

.supplier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
}

.supplier-row:last-child {
  border-bottom: none;
}

.supplier-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.extras-title {
  padding: 12px 0 4px;
  color: #666;
  font-size: 12px;
  font-weight: 600;
}

.manual-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.manual-input {
  width: 260px;
  max-width: 100%;
}

.batch-add {
  margin-top: 16px;
}

.batch-add .t-textarea {
  width: 100%;
}

.batch-missing {
  margin-top: 8px;
}

.ambiguous-item {
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f2;
}

.ambiguous-item:last-child {
  border-bottom: none;
}

.vgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.vitem .k {
  margin-bottom: 4px;
  color: #666;
  font-size: 12px;
}

.vitem .v {
  font-size: 14px;
  word-break: break-all;
}

.bottom-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.t-dialog {
  max-width: calc(100vw - 32px);
}

.code-box {
  padding: 16px;
  margin-bottom: 16px;
  background: #f2f7ff;
  border: 1px dashed #0052d9;
  border-radius: 6px;
}

.activation-code {
  margin: 8px 0 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 2px;
  word-break: break-all;
}

.hint {
  margin: 8px 0 0;
  color: #8b8b8b;
  font-size: 12px;
}

.kv {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  flex-wrap: wrap;
}

.kv .k {
  min-width: 84px;
  color: #666;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.row-open td {
  background: #fff1f0;
}

.row-closed td {
  color: #8b8b8b;
}

@media (max-width: 768px) {
  .topbar {
    gap: 8px;
    padding: 0 12px;
    min-height: 52px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 14px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
  }

  .nav a {
    padding: 6px 0 10px;
  }

  .top-actions {
    margin-left: auto;
  }

  .page {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .field-grid,
  .vgrid {
    grid-template-columns: 1fr;
  }

  .supplier-search,
  .manual-input {
    width: 100%;
  }

  .dialog-footer {
    justify-content: stretch;
  }
}

/* 安装包下载链接：整段可选中、自动换行 */
.setup-box {
  padding: 12px 16px;
  margin: 12px 0;
  background: #f7f8fa;
  border-radius: 6px;
}

.setup-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.setup-url {
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

