* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  background: #f6f7f9;
  color: #1f2937;
}
header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.muted { color: #6b7280; font-size: 13px; }
button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
button:hover:not(:disabled) { background: #f3f4f6; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover:not(:disabled) { background: #1d4ed8; }
button.success { background: #16a34a; color: #fff; border-color: #16a34a; }
button.success:hover:not(:disabled) { background: #15803d; }

main { display: flex; height: calc(100vh - 73px); }
aside {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 8px 0;
}
.brand-item {
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-item:hover { background: #f3f4f6; }
.brand-item.active { background: #eff6ff; border-left-color: #2563eb; color: #1e40af; font-weight: 500; }
.brand-count { font-size: 12px; color: #6b7280; }
.brand-item.active .brand-count { color: #2563eb; }

section.content { flex: 1; overflow-y: auto; padding: 16px 24px; }
.progress-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar > div {
  height: 100%;
  background: #2563eb;
  transition: width 0.3s;
}
.log {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: #4b5563;
  background: #f9fafb;
  padding: 8px;
  border-radius: 4px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.log .err { color: #dc2626; }
.log .ok { color: #16a34a; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  vertical-align: top;
}
th { background: #f9fafb; font-weight: 600; color: #374151; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tr.group-header td {
  background: #fafbfc;
  font-weight: 500;
  border-top: 2px solid #e5e7eb;
}
.group-header .group-title { display: inline-block; }
.group-header .group-range { float: right; }
.price { color: #dc2626; font-weight: 500; font-family: 'SF Mono', Menlo, Consolas, monospace; }
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}
input[type=text] {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  min-width: 240px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 12px;
  font-size: 11px;
  margin-left: 6px;
}
.empty {
  text-align: center;
  color: #9ca3af;
  padding: 60px 0;
  font-size: 14px;
}
.err-block {
  background: #fef2f2;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
