/* 商业投放报告 */
#bdBrandReport {
  width: 100%;
  min-height: calc(100vh - var(--bd-topbar-h, 56px));
}

html.bd-view-brand-report .bd-main,
.bd-main:has(> #bdBrandReport:not([hidden])) {
  padding: 16px 20px 32px;
  overflow: auto;
  max-height: calc(100vh - var(--bd-topbar-h, 56px));
}

.bcr-root {
  max-width: 920px;
  margin: 0 auto;
  font-size: 13px;
  color: #334155;
}

.bcr-card {
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  padding: 28px 32px 32px;
}

.bcr-hero {
  text-align: center;
  margin-bottom: 20px;
}

.bcr-hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef2ff, #dbe4ff);
  color: var(--bd-primary, #3c66ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.bcr-hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.bcr-hero p {
  margin: 0 auto;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.bcr-sample {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 22px;
  background: #f5f8ff;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
}

.bcr-sample a {
  color: var(--bd-primary, #3c66ff);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.bcr-sample a:hover {
  text-decoration: underline;
}

.bcr-section {
  margin-bottom: 22px;
}

.bcr-section-title {
  margin: 0 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--bd-primary, #3c66ff);
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.bcr-section-hint {
  margin: -4px 0 10px;
  font-size: 12px;
  color: #94a3b8;
}

.bcr-search-row {
  display: flex;
  gap: 8px;
}

.bcr-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

.bcr-input:focus {
  outline: none;
  border-color: #93b0ff;
  box-shadow: 0 0 0 3px rgba(60, 102, 255, 0.12);
}

.bcr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bcr-btn-primary {
  border-color: var(--bd-primary, #3c66ff);
  background: var(--bd-primary, #3c66ff);
  color: #fff;
}

.bcr-btn-primary:hover {
  background: var(--bd-primary-dark, #2952e6);
}

.bcr-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bcr-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e8ecf3;
  border-radius: 10px;
  background: #fafbff;
}

.bcr-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.bcr-brand-logo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.bcr-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.bcr-brand-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.bcr-brand-clear {
  margin-left: auto;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
}

.bcr-brand-clear:hover {
  color: #3c66ff;
}

.bcr-collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.bcr-collapse-head .bcr-section-title {
  margin-bottom: 0;
}

.bcr-collapse-body {
  margin-top: 10px;
}

.bcr-collapse-body[hidden] {
  display: none;
}

.bcr-kw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bcr-kw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bcr-kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}

.bcr-kw-tag button {
  border: none;
  background: none;
  color: #6366f1;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.bcr-date-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.bcr-chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e8ecf3;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.bcr-chip.is-active {
  border-color: #93b0ff;
  background: #eef2ff;
  color: var(--bd-primary, #3c66ff);
  font-weight: 600;
}

.bcr-date-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bcr-date-inputs input[type="date"] {
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #334155;
}

.bcr-consume {
  font-size: 13px;
  color: #475569;
}

.bcr-consume strong {
  color: var(--bd-primary, #3c66ff);
  font-size: 15px;
}

.bcr-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.bcr-actions .bcr-btn-primary {
  min-width: 200px;
  height: 42px;
  font-size: 15px;
}

.bcr-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--bd-down, #f53f3f);
  font-size: 12px;
}

.bcr-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bcr-modal[hidden] {
  display: none;
}

.bcr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.bcr-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(70vh, 640px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bcr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.bcr-modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.bcr-modal-close {
  border: none;
  background: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
}

.bcr-modal-search {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
}

.bcr-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.bcr-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #f8fafc;
}

.bcr-modal-item:last-child {
  border-bottom: none;
}

.bcr-modal-item .bcr-brand-logo {
  width: 40px;
  height: 40px;
}

.bcr-modal-item-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #0f172a;
}

.bcr-modal-empty {
  padding: 32px 16px;
  text-align: center;
  color: #94a3b8;
}

/* 报告结果 */
.bcr-result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bcr-result-toolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.bcr-result-actions {
  display: flex;
  gap: 8px;
}

.bcr-result {
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  padding: 24px;
}

.bcr-cover {
  text-align: center;
  padding: 12px 0 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 18px;
}

.bcr-cover-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.bcr-cover-brand img,
.bcr-cover-brand .bcr-brand-logo-ph {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.bcr-cover h1 {
  margin: 0;
  font-size: 22px;
  color: #0f172a;
}

.bcr-cover-meta {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

.bcr-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .bcr-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bcr-kpi {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.bcr-kpi-val {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.bcr-kpi-lbl {
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.bcr-block {
  margin-bottom: 20px;
}

.bcr-block h3 {
  margin: 0 0 10px;
  padding-left: 8px;
  border-left: 3px solid var(--bd-primary, #3c66ff);
  font-size: 14px;
  font-weight: 600;
}

.bcr-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .bcr-split {
    grid-template-columns: 1fr;
  }
}

.bcr-chart {
  width: 100%;
  height: 220px;
}

.bcr-chart svg {
  width: 100%;
  height: 100%;
}

.bcr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bcr-table th,
.bcr-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}

.bcr-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
}

.bcr-note-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 180px;
}

.bcr-note-cover {
  width: 36px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.bcr-status {
  padding: 40px 16px;
  text-align: center;
  color: #64748b;
}

@media print {
  .bd-sidebar,
  .bd-topbar,
  .bcr-result-toolbar,
  .bcr-modal {
    display: none !important;
  }

  .bcr-result {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .bd-main:has(> #bdBrandReport:not([hidden])) {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
}
