:root {
  --bg: #f5f7fc;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --ink: #14215c;
  --muted: #6f7798;
  --line: rgba(15, 32, 112, 0.12);
  --green: #0f2070;
  --green-2: #091654;
  --green-3: #f37308;
  --gold: #f37308;
  --red: #b42318;
  --shadow: 0 18px 60px rgba(15, 32, 112, 0.12);
  --soft-shadow: 0 10px 28px rgba(15, 32, 112, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "DIN Alternate", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 16% 0%, rgba(15, 32, 112, 0.12), transparent 28%),
    radial-gradient(circle at 84% 6%, rgba(243, 115, 8, 0.12), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 52%, #eef1fa 100%);
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 32, 112, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 32, 112, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

main {
  width: min(1480px, calc(100% - 32px));
  margin: auto;
  padding: 22px 0 34px;
}

h1, h2, h3, h4, p { margin-top: 0; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -8px 12px;
  padding: 10px 8px 12px;
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0;
  color: var(--green-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

header h1 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
}

.dashboard-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.brand-logo {
  display: inline-block;
  width: 180px;
  height: 36px;
  flex: 0 0 auto;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.unlock-brand {
  width: 220px;
  height: 44px;
  margin-bottom: 20px;
}

.unlock-brand img {
  width: 100%;
}

.official-site-link,
.official-site-pending {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.official-site-pending {
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #24b35b;
  box-shadow: 0 0 0 5px rgba(36, 179, 91, 0.14);
}

.status small {
  color: var(--muted);
  font-weight: 700;
}

.status.stale {
  color: #a96512;
}

.status.stale i {
  background: #d7933d;
  box-shadow: 0 0 0 5px rgba(215, 147, 61, 0.16);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  overflow: hidden;
  min-height: 150px;
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  color: white;
  background:
    radial-gradient(circle at 82% 34%, rgba(255, 255, 255, 0.16), transparent 23%),
    linear-gradient(135deg, #091654 0%, #0f2070 55%, #243b9a 100%);
  box-shadow: var(--shadow);
}

.hero:after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.hero p {
  margin-bottom: 6px;
  color: #cbd2ed;
  font-size: 12px;
  font-weight: 800;
}

.hero h2 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero span {
  color: #d7ddf4;
  font-size: 13px;
  font-weight: 700;
}

.hero > strong {
  align-self: end;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 22px;
  letter-spacing: 0.04em;
}

.panel, .unlock {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.panel {
  margin-top: 14px;
  padding: 20px;
}

.title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.title h3 {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.title > span, .title > b {
  max-width: 45%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.title > .title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--green);
  background: #e7f2e8;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.main-business-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.1fr 0.8fr 0.8fr 0.8fr 1.35fr;
  gap: 10px;
}

.business-metric {
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdfb, #f4f8f3);
}

.business-metric.primary {
  color: white;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  box-shadow: 0 16px 34px rgba(23, 107, 58, 0.22);
}

.business-metric.wide {
  background: linear-gradient(135deg, #f7fbf4, #e7f2e5);
}

.business-metric span, .business-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.business-metric strong {
  display: block;
  margin: 18px 0 7px;
  color: var(--ink);
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.business-metric.primary span,
.business-metric.primary small {
  color: #d6eadc;
}

.business-metric.primary strong {
  color: white;
}

.main-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.main-score-grid span,
.store-score-inline span,
.ad-summary span,
.live-ad-metrics span {
  border: 1px solid rgba(23, 107, 58, 0.07);
  border-radius: 15px;
  background: #f7faf6;
}

.main-score-grid span {
  display: block;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.main-score-grid b {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.main-score-grid .danger,
.store-score-inline .danger,
.live-ad-metrics .live-missing {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff1ef;
  color: var(--red);
}

.main-score-grid .danger b,
.store-score-inline .danger b {
  color: var(--red);
}

.stores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.store {
  padding: 15px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 18px;
  background: #f7faf6;
}

.store.warn {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff8f7;
}

.store-head {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.store h4 {
  min-height: 0;
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.03em;
}

.store-score-inline {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.store-score-inline span {
  display: block;
  padding: 7px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.store-score-inline b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.store-metrics {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.store-metrics span {
  display: block;
  padding: 9px 10px;
  border-radius: 13px;
  color: var(--muted);
  background: white;
  font-size: 11px;
  font-weight: 800;
}

.store-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  text-align: left;
}

.multi-platform-empty {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(23, 107, 58, 0.18);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.multi-platform-stale {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(169, 101, 18, 0.22);
  border-radius: 15px;
  color: #a96512;
  background: #fff8ee;
  font-size: 13px;
  font-weight: 850;
}

.multi-platform-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(23, 107, 58, 0.14);
}

.multi-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.multi-platform-head strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.multi-platform-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.store.multi-platform {
  border-style: dashed;
  background: linear-gradient(180deg, #fbfdf9, #f4f8f2);
}

.multi-platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e7f2e8;
  font-size: 11px;
  font-weight: 950;
}

.multi-platform-badge.danger {
  color: var(--red);
  background: #fff1ef;
}

.store-metrics .error-wide {
  grid-column: 1 / -1;
}

.store-metrics .danger {
  color: var(--red);
}

.top-level-ads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.top-level-ads > .ad-account-panel {
  grid-column: 1 / -1;
}

.ads-empty {
  padding: 14px;
  border: 1px solid rgba(176, 78, 62, 0.2);
  border-radius: 8px;
  background: #fff7f5;
  color: #a34834;
  font-size: 13px;
  font-weight: 750;
}

.ad-top-panel {
  margin-top: 0;
}

.ad-placement {
  padding: 14px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbf7, #f1f7f0);
}

.compact-ad-strip {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
}

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

.ad-placement-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ad-placement-head strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.ad-placement-head span {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e7f2e8;
  font-size: 11px;
  font-weight: 900;
}

.ad-summary {
  display: grid;
  grid-template-columns: 1.18fr 1.18fr 1.08fr 0.72fr 0.78fr 1.02fr;
  gap: 8px;
  margin-top: 0;
}

.ad-summary span {
  display: block;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ad-summary b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
}

.ad-account-panel {
  margin-top: 0;
  background: var(--panel-solid);
}

.ad-account-panel summary {
  cursor: pointer;
  list-style: none;
  color: var(--green);
  font-size: 17px;
  font-weight: 950;
}

.ad-account-panel summary::-webkit-details-marker {
  display: none;
}

.ad-account-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.ad-account {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 15px;
  background: #f8fbf7;
}

.ad-account span strong,
.ad-account span small,
.ad-account > small {
  display: block;
}

.ad-account span strong {
  font-size: 13px;
}

.ad-account span small,
.ad-account > small {
  color: var(--muted);
  font-size: 11px;
}

.ad-account b {
  font-size: 21px;
}

.ad-account em {
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.ad-account-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ad-account-panel-title p {
  margin: 0;
  color: var(--green);
  font-size: 17px;
  font-weight: 950;
}

.ad-account-panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.live-ad-account {
  padding: 14px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 18px;
  background: #f8fbf7;
}

.live-ad-account.not-live {
  background: #fbfaf6;
}

.live-ad-name {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.live-ad-name strong {
  font-size: 18px;
}

.live-ad-name small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.live-ad-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.live-ad-metrics span {
  display: block;
  padding: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.live-ad-metrics b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
}

.live-ad-metrics .live-match {
  color: var(--green);
  background: #eef8ef;
}

.live-ad-metrics .live-match b {
  color: var(--green);
}

.price-empty {
  padding: 16px;
  border-radius: 16px;
  color: var(--muted);
  background: #f7faf6;
  font-size: 13px;
  font-weight: 800;
}

.violations {
  display: none;
}

footer {
  padding: 18px 0 0;
  color: #87938a;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.unlock {
  width: min(520px, 100%);
  margin: 12vh auto;
  padding: 38px;
}

.unlock h1 {
  margin: 10px 0;
}

.unlock > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.unlock form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 24px;
}

.unlock input, .unlock button {
  height: 48px;
  border-radius: 14px;
  font: inherit;
}

.unlock input {
  min-width: 0;
  padding: 0 14px;
  border: 1px solid rgba(23, 107, 58, 0.18);
  background: white;
}

.unlock button {
  padding: 0 20px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  font-weight: 950;
  cursor: pointer;
}

#error {
  display: block;
  margin-top: 12px;
  color: var(--red);
  font-size: 13px;
}

.douyin-video-panel {
  margin-top: 14px;
}

.douyin-video-empty {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(23, 107, 58, 0.18);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.douyin-video-empty.compact {
  margin: 0;
  padding: 12px;
  font-size: 12px;
}

.douyin-video-stale {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(169, 101, 18, 0.22);
  border-radius: 15px;
  color: #a96512;
  background: #fff8ee;
  font-size: 13px;
  font-weight: 850;
}

.douyin-video-accounts {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.douyin-video-account {
  padding: 16px;
  border: 1px solid rgba(23, 107, 58, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdf9, #f3f8f2);
}

.douyin-video-account.failed {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff9f7;
}

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

.douyin-video-head h4 {
  margin: 0 0 4px;
  font-size: 17px;
}

.douyin-video-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.douyin-video-failed-tag {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--red);
  background: #fff1ef;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.douyin-video-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.douyin-video-metric {
  padding: 12px;
  border: 1px solid rgba(23, 107, 58, 0.08);
  border-radius: 13px;
  background: white;
}

.douyin-video-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.douyin-video-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
}

.douyin-video-error {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--red);
  background: #fff1ef;
  font-size: 12px;
  font-weight: 800;
}

.douyin-video-list {
  margin-top: 14px;
  border-top: 1px dashed rgba(23, 107, 58, 0.16);
}

.douyin-video-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.douyin-video-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 11px 2px;
  border-top: 1px solid rgba(23, 107, 58, 0.08);
}

.douyin-video-row strong {
  display: block;
  max-width: 620px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.douyin-video-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.douyin-video-row > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 1240px) {
  .main-business-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .business-metric.wide {
    grid-column: span 2;
  }

  .stores-grid,
  .live-ad-grid {
    grid-template-columns: 1fr;
  }

  .ad-account-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .douyin-video-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .douyin-video-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 760px) {
  main {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  header {
    align-items: flex-start;
    position: static;
    flex-wrap: wrap;
  }

  .dashboard-brand {
    width: 100%;
  }

  .status {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
    border-radius: 16px;
  }

  .status i {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 24px 22px;
  }

  .hero > strong {
    align-self: start;
  }

  .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .title {
    margin-bottom: 12px;
  }

  .title > span {
    max-width: 42%;
  }

  .main-business-grid,
  .main-score-grid,
  .store-metrics,
  .ad-summary,
  .ad-account-grid,
  .live-ad-metrics {
    grid-template-columns: 1fr;
  }

  .compact-ad-strip {
    grid-template-columns: 1fr;
  }

  .business-metric.wide {
    grid-column: span 1;
  }

  .store-score-inline {
    grid-template-columns: repeat(2, 1fr);
  }
}
