/* 一级总账户 · 跨账号广告户总览 */

.ma-page {
  max-width: 1500px;
  margin: 0 auto;
}

.ma-topbar {
  align-items: flex-end;
  gap: 14px;
}

.ma-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #f2f4f7;
}

.ma-tabs button {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ma-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px -4px rgba(20, 24, 35, 0.34);
}

.ma-total-row td {
  background: #fff9f4;
  font-weight: 650;
}

.ma-total-row td:first-child {
  background: #fff9f4;
}

.ma-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 8px;
}

.ma-kpi {
  min-height: 94px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 24, 35, 0.05);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ma-kpi.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ff8a3d 0%, #ff4d1f 52%, #ff2b4e 100%);
  box-shadow: 0 16px 28px -20px rgba(255, 61, 46, 0.8);
}

.ma-kpi > span {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.1px;
}

.ma-kpi.primary > span {
  color: rgba(255, 255, 255, 0.76);
}

.ma-kpi > b {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
}

.ma-kpi > b small {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ma-kpi > em {
  display: block;
  margin-top: 7px;
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--ink-3);
  font-style: normal;
}

.ma-kpi.primary > em {
  color: rgba(255, 255, 255, 0.78);
}

.ma-kpi.ma-skeleton {
  overflow: hidden;
  background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 37%, #eef0f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.ma-filter-card {
  padding: 14px;
}

.ma-filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ma-filter-head b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
}

.ma-filter-head span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.ma-local-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  margin-top: 0 !important;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue) !important;
  font-size: 9.5px;
  font-weight: 600;
}

.ma-filter-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.ma-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 600;
}

.ma-refresh-btn .i {
  width: 12px;
  height: 12px;
}

.ma-refresh-btn:hover {
  border-color: #ffd1c4;
  color: var(--brand-deep);
}

.ma-refresh-btn.busy .i {
  animation: spin 0.8s linear infinite;
}

.ma-periods {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-top: 12px;
  border-radius: 12px;
  background: #f0f2f5;
  overflow-x: auto;
  scrollbar-width: none;
}

.ma-periods::-webkit-scrollbar {
  display: none;
}

.ma-periods button {
  flex: 1 0 auto;
  min-width: 58px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ma-periods button.active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 2px 8px rgba(20, 24, 35, 0.08);
}

.ma-report-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e9ecf1;
}

.ma-report-toolbar[hidden],
.ma-dim-tabs[hidden] {
  display: none !important;
}

.ma-report-kinds,
.ma-dim-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #f4f5f7;
}

.ma-report-kinds button,
.ma-dim-tabs button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ma-report-kinds button.active,
.ma-dim-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 7px -4px rgba(20, 24, 35, 0.36);
}

.ma-report-export {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.ma-report-export .i {
  width: 12px;
  height: 12px;
}

.ma-report-export:disabled {
  opacity: 0.45;
}

.ma-report-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 14px 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff4ed;
  color: var(--brand-deep);
  font-size: 10px;
  line-height: 1.5;
}

.ma-report-alert.info {
  background: #f3f6ff;
  color: var(--blue);
}

.ma-report-alert b {
  flex: 0 0 auto;
  font-size: 10.5px;
}

.ma-report-alert span {
  color: var(--ink-3);
}

.ma-report-table {
  min-width: 1030px;
}

.ma-report-table th:first-child,
.ma-report-table td:first-child {
  width: 94px;
  min-width: 94px;
}

.ma-report-table.is-audience th:first-child,
.ma-report-table.is-audience td:first-child {
  width: 128px;
  min-width: 128px;
}

.ma-report-table.is-province td:nth-child(2) {
  min-width: 76px;
  text-align: left;
}

.ma-report-table .ma-report-first,
.ma-report-table .ma-report-province {
  text-align: left;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.ma-report-table .ma-report-province b {
  color: var(--ink);
}

.ma-report-more {
  padding: 10px 14px;
  color: var(--ink-3);
  font-size: 9.5px;
}

.ma-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.ma-control > span {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
}

.ma-control .input {
  height: 40px;
  border-radius: 11px;
  font-size: 12.5px;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #9aa1b0 50%), linear-gradient(135deg, #9aa1b0 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.ma-search-box {
  position: relative;
}

.ma-search-box .i {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.ma-search-box .input {
  padding-left: 36px;
}

.ma-filter-meta {
  align-self: end;
  padding: 0 2px 10px;
  font-size: 10px;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ma-table-card {
  padding: 0;
  overflow: hidden;
}

.ma-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 11px;
}

.ma-table-head b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
}

.ma-table-head span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.ma-generated {
  flex: 0 0 auto;
  padding-top: 1px;
  font-size: 9.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ma-table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.ma-table {
  width: 100%;
  min-width: 1170px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.ma-table th,
.ma-table td {
  height: 48px;
  padding: 0 7px;
  border-bottom: 1px solid #f0f2f5;
  text-align: right;
  white-space: nowrap;
}

.ma-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 34px;
  background: #f8f9fb;
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.ma-table th:first-child,
.ma-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 220px;
  min-width: 220px;
  text-align: left;
  background: #fff;
  box-shadow: 8px 0 12px -14px rgba(20, 24, 35, 0.5);
}

.ma-table th:first-child {
  z-index: 4;
  background: #f8f9fb;
}

.ma-table tbody tr:last-child td {
  border-bottom: 0;
}

.ma-table tbody tr:hover td {
  background: #fbfcfd;
}

.ma-table tbody tr:hover td:first-child {
  background: #fbfcfd;
}

.ma-balance {
  min-width: 104px;
  font-weight: 650;
}

.ma-balance-error {
  color: var(--red);
  font-size: 10.5px;
  font-weight: 600;
}

.ma-balance-muted {
  color: var(--ink-3);
}

.ma-col-advertiser {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.ma-account-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 196px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ma-account-badge span {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.ma-advertiser-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 3px;
}

.ma-advertiser-name {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 182px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.ma-advertiser-name:hover {
  color: var(--brand-deep);
}

.ma-advertiser-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-advertiser-name .i {
  width: 11px;
  height: 11px;
  color: #b4bac5;
  opacity: 0;
  transition: opacity 0.15s;
}

.ma-table tr:hover .ma-advertiser-name .i,
.ma-advertiser-name:focus .i {
  opacity: 1;
}

.ma-advertiser-id,
.ma-platform-name {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 8.5px;
  letter-spacing: 0.1px;
}

.ma-platform-name {
  color: #b0b6c1;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ma-row-warning {
  color: var(--amber);
}

.ma-row-warning .i {
  width: 13px;
  height: 13px;
}

.ma-money {
  font-weight: 650;
}

.ma-strong {
  color: var(--ink);
  font-weight: 700;
}

.ma-deep,
.ma-valid {
  color: var(--green);
}

.ma-col-action {
  width: 64px;
  min-width: 64px;
}

.ma-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.ma-open-btn:hover {
  border-color: #ffd1c4;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.ma-open-btn .i {
  width: 11px;
  height: 11px;
}

.ma-table-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 14px 13px;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.55;
}

.ma-table-note .i {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.ma-table-note code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f3f6;
  color: var(--ink-2);
  font-size: 9.5px;
}

.ma-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 230px;
  text-align: center;
  color: var(--ink-2);
}

.ma-loading b {
  font-size: 12px;
  font-weight: 600;
}

.ma-loading small {
  font-size: 10px;
  color: var(--ink-3);
}

.ma-empty {
  min-height: 270px;
}

.ma-error-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  color: var(--red);
}

.ma-error-box > .i {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.ma-error-box > div {
  flex: 1;
}

.ma-error-box b {
  display: block;
  font-size: 12px;
}

.ma-error-box span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.ma-rename-body {
  display: grid;
  gap: 13px;
}

.ma-rename-target {
  padding: 12px;
  border-radius: 12px;
  background: #f7f8fa;
}

.ma-rename-target span,
.ma-rename-target em {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  font-style: normal;
}

.ma-rename-target b {
  display: block;
  margin: 3px 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ma-rename-field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
}

.ma-rename-field small {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 10px;
}

.ma-rename-sheet .notice {
  margin-top: 0;
}

@media (min-width: 620px) {
  .ma-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ma-filter-row {
    grid-template-columns: minmax(200px, 0.8fr) minmax(240px, 1.2fr);
  }

  .ma-filter-meta {
    grid-column: 1 / -1;
    padding-bottom: 0;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .ma-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .ma-kpi {
    min-height: 100px;
  }

  .ma-filter-row {
    grid-template-columns: 240px minmax(260px, 1fr) auto;
    align-items: end;
  }

  .ma-filter-meta {
    grid-column: auto;
    padding-bottom: 10px;
    text-align: right;
  }

  .ma-table th,
  .ma-table td {
    height: 52px;
  }

  .ma-table th:first-child,
  .ma-table td:first-child {
    width: 220px;
    min-width: 220px;
  }

  .ma-advertiser-name {
    font-size: 12.5px;
  }

  .ma-table {
    font-size: 12px;
  }
}

@media (min-width: 1280px) {
  .ma-summary-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 389px) {
  .ma-kpi {
    padding: 11px 11px;
  }

  .ma-kpi > b {
    font-size: 19px;
  }
}

/* ── 总账户 · 广告账户报表 ─────────────────────────────── */

.ma-topbar {
  flex-wrap: wrap;
}

.ma-topbar .ma-tabs {
  margin-left: auto;
}

.ar-crumb {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: 9.5px;
}

.ar-crumb a {
  color: var(--ink-3);
}

.ar-crumb a:hover {
  color: var(--brand);
}

.ar-crumb b {
  color: var(--ink-2);
  font-weight: 600;
}

.ar-tabs {
  width: fit-content;
  margin-top: 2px;
}

.ar-tabs button {
  min-width: 106px;
}

.ar-date-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ar-quick {
  flex: 0 0 auto;
  min-width: 168px;
  margin-top: 0;
}

.ar-quick button {
  flex: 0 0 auto;
  padding: 0 16px;
}

.ar-date-nav {
  display: flex;
  flex: 1 1 230px;
  align-items: center;
  gap: 6px;
}

.ar-date-nav .date-input {
  flex: 1;
  max-width: 220px;
}

.ar-date-step {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
}

.ar-date-step:hover {
  border-color: #ffc5b1;
  background: #fffaf7;
  color: var(--brand-deep);
}

.ar-date-step .i {
  width: 14px;
  height: 14px;
}

.ar-query {
  height: 40px;
  align-self: end;
  white-space: nowrap;
}

.ar-filter-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 10px;
}

.ar-filter-meta b {
  color: var(--ink-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ar-filter-meta em {
  color: var(--red);
  font-style: normal;
}

.ar-kpi-grid {
  margin-top: 10px;
}

.ar-report-card,
.ar-account-card {
  margin-top: 10px;
  padding: 14px;
}

.ar-report-card .card-head {
  margin-bottom: 5px;
}

.ar-total-row {
  margin-top: 2px;
  border-top: 1px solid rgba(255, 77, 31, 0.14);
  background: #fff9f4;
}

.ar-total-row .rt-name b {
  color: var(--brand-deep);
}

.ar-sort {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.ar-sort:hover,
.ar-sort.active {
  color: var(--ink);
}

.ar-sort.active {
  font-weight: 700;
}

.ar-account-count {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ar-account-list {
  margin-top: 9px;
  border-top: 1px solid var(--line);
}

.ar-account-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ar-account-row:last-child {
  border-bottom: 0;
}

.ar-account-main {
  flex: 1 1 200px;
  min-width: 0;
}

.ar-account-main b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-account-main span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-account-metric {
  flex: 0 0 58px;
  text-align: right;
}

.ar-account-metric span {
  display: block;
  color: var(--ink-3);
  font-size: 9px;
}

.ar-account-metric b {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ar-account-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f2f4f7;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 600;
}

.ar-account-status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.ar-account-status.failed {
  background: var(--red-soft);
  color: var(--red);
}

.ar-account-error {
  flex: 1 1 220px;
  overflow: hidden;
  color: var(--red);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 620px) {
  .ar-account-row {
    flex-wrap: nowrap;
  }
}

@media (min-width: 1024px) {
  .ar-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ar-report-table .rt-head,
  .ar-report-table .rt-row {
    min-width: 0;
  }
}
