:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8e0eb;
  --accent: #1463ff;
  --accent-2: #02a88a;
  --danger: #d92d20;
  --warning: #b65c00;
  --good: #087443;
  --sidebar: #162033;
  --sidebar-ink: #edf2f7;
  --shadow: 0 20px 45px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-checking::before {
  content: "正在恢复登录状态...";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--bg);
  font-weight: 800;
  z-index: 50;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.app-locked {
  display: none;
}

.login-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 48px 28px;
  overflow: auto;
  color: #eaf2ff;
  background:
    linear-gradient(rgba(91, 141, 239, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 141, 239, 0.07) 1px, transparent 1px),
    #060b14;
  background-size: 44px 44px;
}

.login-screen::before,
.login-screen::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.login-screen::before {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(63, 214, 198, 0.12) 7% 7.08%, transparent 7.08% 100%),
    linear-gradient(180deg, transparent 0 84%, rgba(91, 141, 239, 0.12) 84% 84.1%, transparent 84.1% 100%);
}

.login-screen::after {
  top: 32px;
  right: 32px;
  width: 86px;
  height: 18px;
  border-top: 2px solid #55dbc9;
  border-right: 2px solid #55dbc9;
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  width: min(1020px, 100%);
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  background: #0c1525;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
}

.login-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, #4c75ff 0 42%, #3fd6c6 42% 74%, #f0b55a 74% 100%);
  content: "";
}

.login-overview {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 42px 48px 38px;
  overflow: hidden;
  background: #0b1424;
}

.login-overview::after {
  position: absolute;
  right: -96px;
  bottom: 74px;
  width: 310px;
  height: 162px;
  border: 1px solid rgba(85, 219, 201, 0.18);
  content: "";
  transform: skewX(-24deg);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand .mark {
  width: 46px;
  height: 46px;
  overflow: hidden;
  padding: 3px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: #f7fbff;
  box-shadow: 0 0 28px rgba(63, 214, 198, 0.2);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  margin-top: 3px;
  color: #8999af;
  font-size: 12px;
}

.login-brand strong {
  color: #f7fbff;
  font-size: 16px;
  letter-spacing: 0;
}

.login-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 82px;
}

.login-copy h1 {
  margin: 0;
  color: #f7fbff;
  font-size: 52px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-copy h1 span {
  color: #67e8d5;
}

.login-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #8ea8ce;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8d5;
  box-shadow: 0 0 0 5px rgba(103, 232, 213, 0.1);
  animation: loginPulse 2.4s ease-in-out infinite;
}

.login-edition {
  margin: 4px 0 0;
  color: #607189;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
}

.login-signal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 42px;
}

.login-signal-track {
  height: 3px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}

.login-signal-track span {
  display: block;
  height: 100%;
  background: #4c75ff;
}

.login-signal-track:nth-child(1) span {
  width: 78%;
}

.login-signal-track:nth-child(2) span {
  width: 52%;
  background: #3fd6c6;
}

.login-signal-track:nth-child(3) span {
  width: 24%;
  background: #f0b55a;
}

.login-signal-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #607189;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
}

.login-signal-labels strong {
  color: #67e8d5;
}

.login-access {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 42px 46px 38px;
  color: #172033;
  background: #f7f9fc;
}

.login-access-index {
  display: flex;
  min-height: 32px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #d8e2ef;
  color: #718096;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 800;
}

.login-access-index strong {
  color: #3f66df;
  font-size: 13px;
}

.login-access-copy {
  display: grid;
  gap: 8px;
  margin-top: 78px;
}

.login-access-copy .eyebrow {
  margin: 0;
  color: #3f66df;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-access-copy h2 {
  margin: 0;
  color: #111827;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-access-copy p:not(.eyebrow) {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.login-field {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid #cfdae9;
  border-radius: 6px;
  background: #ffffff;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536179;
  font-size: 12px;
  font-weight: 800;
}

.login-form label::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fd6c6;
  content: "";
}

.login-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-color: #cbd7e6;
  background: #f8fafc;
}

.login-form .primary-btn {
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 0 52px 0 18px;
  overflow: hidden;
  border: 1px solid #3158cf;
  border-radius: 6px;
  background: #3f66df;
  box-shadow: 0 12px 26px rgba(49, 88, 207, 0.2);
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.login-form .primary-btn::after {
  position: absolute;
  top: 50%;
  right: 18px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  content: "→";
  transform: translateY(-50%);
}

.login-form .primary-btn:hover {
  background: #3158cf;
  box-shadow: 0 16px 34px rgba(49, 88, 207, 0.28);
  transform: translateY(-1px);
}

.login-form .primary-btn:focus-visible,
.login-form select:focus-visible {
  outline: 3px solid rgba(63, 214, 198, 0.28);
  outline-offset: 2px;
}

.login-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
  color: #8793a6;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 9px;
  font-style: normal;
}

.login-security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #17a88c;
}

.login-security i {
  width: 18px;
  height: 1px;
  background: #c9d4e3;
}

.login-footnote {
  position: absolute;
  right: 28px;
  bottom: 18px;
  margin: 0;
  color: #4f6077;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 9px;
}

@keyframes loginPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

@media (max-width: 820px) {
  .login-screen {
    align-items: start;
    padding: 18px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    width: min(560px, 100%);
    min-height: 0;
  }

  .login-overview {
    min-height: 300px;
    padding: 28px;
  }

  .login-copy {
    margin-top: 42px;
  }

  .login-copy h1 {
    font-size: 40px;
  }

  .login-signal {
    padding-top: 36px;
  }

  .login-access {
    min-height: 390px;
    padding: 28px;
  }

  .login-access-copy {
    margin-top: 42px;
  }

  .login-security {
    margin-top: 34px;
  }

  .login-footnote {
    display: none;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 10px;
  }

  .login-overview,
  .login-access {
    padding: 24px 20px;
  }

  .login-overview {
    min-height: 270px;
  }

  .login-copy {
    margin-top: 34px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-access {
    min-height: 380px;
  }

  .login-access-copy {
    margin-top: 34px;
  }

  .login-access-copy h2 {
    font-size: 28px;
  }

  .login-security {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-live-dot {
    animation: none;
  }
}

.login-form select,
.login-form .primary-btn {
  width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  color: var(--sidebar-ink);
  background: var(--sidebar);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  flex: 0 0 auto;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: 0 8px 22px rgba(6, 32, 75, 0.22);
}

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

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.brand-lockup span {
  margin-top: 2px;
  color: #b9c2d0;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #ccd6e5;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer span,
.sidebar-footer strong {
  display: block;
}

.sidebar-footer span {
  color: #b9c2d0;
  font-size: 12px;
}

.sidebar-footer strong {
  margin-top: 5px;
}

.main-content {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 22px;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.54fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 16px;
  border: 1px solid rgba(20, 99, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(20, 99, 255, 0.84)),
    #101827;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.topbar-title {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.topbar-title h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
}

.module-kicker {
  color: rgba(148, 224, 255, 0.92);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.signal-line {
  display: grid;
  grid-template-columns: 42px 72px 28px;
  gap: 6px;
  align-items: center;
}

.signal-line i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #60a5fa);
  opacity: 0.9;
}

.topbar-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.sync-control {
  display: grid;
  width: 230px;
  min-width: 230px;
  gap: 6px;
}

.sync-control[hidden] {
  display: none;
}

.sync-control .primary-btn {
  width: 100%;
}

.sync-progress {
  display: grid;
  min-height: 25px;
  gap: 4px;
  color: #e5eefc;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease;
}

.sync-progress.is-visible {
  opacity: 1;
  visibility: visible;
}

.sync-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
}

.sync-progress-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-progress-meta strong {
  flex: 0 0 auto;
  color: #99f6e4;
}

.sync-progress.is-error .sync-progress-meta strong {
  color: #fecaca;
}

.sync-progress progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
}

.sync-progress progress::-webkit-progress-bar {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
}

.sync-progress progress::-webkit-progress-value {
  border-radius: 6px;
  background: #5eead4;
  transition: width 180ms ease;
}

.sync-progress progress::-moz-progress-bar {
  border-radius: 6px;
  background: #5eead4;
}

.sync-progress.is-error progress::-webkit-progress-value {
  background: #fca5a5;
}

.sync-progress.is-error progress::-moz-progress-bar {
  background: #fca5a5;
}

.topbar select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-color: rgba(191, 219, 254, 0.32);
  color: #e5eefc;
  background: rgba(15, 23, 42, 0.42);
}

.topbar select option {
  color: var(--ink);
  background: #ffffff;
}

.topbar .primary-btn {
  min-height: 42px;
  white-space: nowrap;
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.24);
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

select {
  min-width: 136px;
  padding: 0 34px 0 12px;
}

input {
  width: 260px;
  padding: 0 12px;
}

.primary-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  cursor: pointer;
}

.primary-btn:hover {
  background: #0c54dd;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  border: 1px solid rgba(216, 224, 235, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 30px;
  line-height: 1.08;
}

.metric-card small.up {
  color: var(--good);
}

.metric-card small.down {
  color: var(--danger);
}

.alert-card strong {
  color: var(--danger);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line {
  width: 22px;
  height: 3px;
  border-radius: 999px;
}

.line.followers {
  background: var(--accent);
}

.line.interactions {
  background: var(--accent-2);
}

canvas {
  width: 100%;
  height: 320px;
}

.brand-list,
.alert-list,
.rule-list {
  display: grid;
  gap: 12px;
}

.brand-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 13px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.brand-row.clickable {
  cursor: pointer;
}

.brand-row.clickable:hover {
  border-bottom-color: transparent;
  background: linear-gradient(90deg, rgba(20, 99, 255, 0.08), rgba(2, 168, 138, 0.05));
  box-shadow: inset 3px 0 0 var(--accent);
}

.brand-row.clickable:focus-visible {
  outline: 2px solid rgba(20, 99, 255, 0.28);
  outline-offset: 2px;
}

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

.brand-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.brand-row-top strong,
.brand-row-top span {
  overflow-wrap: anywhere;
}

.brand-row-top span {
  color: var(--muted);
  font-size: 13px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.account-panel {
  padding-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -18px;
}

.team-results {
  height: clamp(280px, 58vh, 640px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.team-summary-table {
  min-width: 1950px;
  table-layout: fixed;
}

.team-summary-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.team-summary-table td:nth-child(-n+3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.team-summary-table .employee-link-btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.team-empty-state {
  position: sticky;
  left: 18px;
  display: inline-block;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.good {
  color: var(--good);
  background: #e7f6ee;
}

.status.warning {
  color: var(--warning);
  background: #fff1db;
}

.status.pending {
  color: var(--muted);
  background: #e5eaf0;
}

.pending-data-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 12px;
  font-weight: 800;
}

.sync-result-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-result-label.success {
  color: #17613a;
  background: #e7f6ee;
}

.sync-result-label.error {
  color: #b42318;
  background: #fde8e6;
}

.sync-result-message {
  display: block;
  max-width: 220px;
  margin-top: 5px;
  overflow: hidden;
  color: #b42318;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status.danger {
  color: var(--danger);
  background: #fde8e6;
}

.alert-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.alert-item strong {
  font-size: 14px;
}

.alert-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rule-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.rule-list input {
  width: 16px;
  min-height: 16px;
}

@media (max-width: 1120px) {
  .summary-grid,
  .workspace-grid,
  .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .trend-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-center {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .sync-control {
    width: 100%;
    min-width: 0;
  }

  .topbar .primary-btn {
    width: 100%;
  }

  select,
  input,
  .primary-btn,
  .search-wrap {
    width: 100%;
  }

  .summary-grid,
  .workspace-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .main-content {
    padding: 18px;
  }

  h1 {
    font-size: 23px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .panel-heading {
    display: grid;
  }
}

.hot-card strong {
  color: #b65c00;
}

.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.viral-filter-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(20, 99, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.07), transparent 42%),
    linear-gradient(90deg, rgba(2, 168, 138, 0.06), rgba(255, 255, 255, 0.82));
}

.viral-filter-bar > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.viral-filter-bar > div > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(116, 132, 157, 0.22);
  border-radius: 999px;
  color: #4f5f74;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(22, 32, 51, 0.04);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.filter-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 99, 255, 0.35);
  color: var(--accent);
  box-shadow: 0 12px 26px rgba(20, 99, 255, 0.1);
}

.filter-tab.active {
  border-color: rgba(20, 99, 255, 0.55);
  color: white;
  background: linear-gradient(135deg, var(--accent), #02a88a);
  box-shadow: 0 14px 28px rgba(20, 99, 255, 0.2);
}

.viral-time-body {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.viral-time-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.viral-time-tabs {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.viral-time-tabs .filter-tab {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.viral-time-tabs .filter-tab.active {
  background: var(--accent);
}

.viral-date-summary,
.viral-date-message {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.viral-date-message {
  margin: 0;
}

.viral-date-message.error {
  color: #bd3b30;
}

.viral-custom-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 400px);
}

.viral-custom-dates label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.viral-custom-dates input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}

.viral-custom-dates[hidden],
.viral-date-message[hidden] {
  display: none;
}

@media (max-width: 480px) {
  .viral-time-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viral-custom-dates {
    grid-template-columns: minmax(0, 1fr);
  }
}

.viral-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.viral-empty-state {
  grid-column: 1 / -1;
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.viral-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  overflow: hidden;
  min-height: 196px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.viral-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 14px;
  color: white;
  background: linear-gradient(145deg, #1463ff, #02a88a);
}

.viral-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(4, 17, 26, 0.08), rgba(4, 17, 26, 0.5));
}

.viral-cover > :not(.viral-cover-image) {
  position: relative;
  z-index: 1;
}

.viral-card.beauty .viral-cover {
  background: linear-gradient(145deg, #bc4d7b, #6f5cff);
}

.viral-card.medical .viral-cover {
  background: linear-gradient(145deg, #087443, #1463ff);
}

.viral-card.food .viral-cover {
  background: linear-gradient(145deg, #b65c00, #02a88a);
}

.viral-card.tech .viral-cover {
  background: linear-gradient(145deg, #162033, #1463ff);
}

.viral-cover span {
  font-size: 13px;
  font-weight: 800;
}

.viral-cover strong {
  font-size: 38px;
  line-height: 1;
}

.viral-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.viral-meta {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.viral-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
}

.viral-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.viral-stats span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf1f6;
  font-size: 12px;
  font-weight: 700;
}

.viral-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.viral-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.viral-card-actions button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.secondary-btn,
.close-btn {
  border: 0;
  cursor: pointer;
}

.secondary-btn {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
}

.secondary-btn:hover {
  background: #111827;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
}

.modal-backdrop.open {
  display: flex;
}

.content-modal {
  position: relative;
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: white;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 26px;
  line-height: 1;
}

.modal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 58px 26px 24px;
  color: white;
  background: linear-gradient(145deg, #1463ff, #02a88a);
}

.modal-hero .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.modal-hero h2 {
  max-width: 760px;
  font-size: 24px;
  line-height: 1.35;
}

.modal-hero.beauty {
  background: linear-gradient(145deg, #bc4d7b, #6f5cff);
}

.modal-hero.medical {
  background: linear-gradient(145deg, #087443, #1463ff);
}

.modal-hero.food {
  background: linear-gradient(145deg, #b65c00, #02a88a);
}

.modal-hero.tech {
  background: linear-gradient(145deg, #162033, #1463ff);
}

.modal-hero.employee-hero {
  background: linear-gradient(145deg, #0f172a, #2563eb);
}

.score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 0;
}

.metrics-six {
  padding-top: 10px;
}

.detail-card {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.detail-card span {
  color: var(--muted);
  font-size: 12px;
}

.detail-card strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.modal-section {
  padding: 18px;
}

.modal-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.modal-section p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-table {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.two-col article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.binding-transfer-form {
  display: grid;
  gap: 10px;
}

.binding-transfer-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.binding-transfer-form select {
  width: min(360px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-edit-form input:not([type="checkbox"]) {
  width: min(360px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-edit-form #swapAccountFields {
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.account-edit-form #accountEditError {
  color: #b91c1c;
}

.account-status-field {
  width: min(720px, 100%);
  margin: 4px 0;
  padding: 0;
  border: 0;
}

.account-status-field legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-status-toggle {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(480px, 100%);
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.account-status-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.account-status-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: #a8b2c1;
  transition: background 160ms ease;
}

.account-status-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 160ms ease;
}

.account-status-toggle input:checked + .account-status-track {
  background: var(--accent);
}

.account-status-toggle input:checked + .account-status-track i {
  transform: translateX(20px);
}

.account-status-toggle input:focus-visible + .account-status-track {
  outline: 3px solid rgba(20, 99, 255, 0.25);
  outline-offset: 2px;
}

.account-status-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-status-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.account-status-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-row-disabled {
  background: #f8fafc;
}

.account-row-disabled > td:not(:last-child) {
  color: var(--muted);
}

.account-edit-home-url {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: min(720px, 100%);
  min-width: 0;
}

.account-edit-home-url textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  overflow-wrap: anywhere;
  resize: vertical;
}

.account-edit-home-url .account-home-link {
  min-height: 42px;
}

@media (max-width: 600px) {
  .account-edit-home-url { grid-template-columns: minmax(0, 1fr); }
  .account-edit-home-url .account-home-link { justify-self: start; }
}

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

.manual-viral-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manual-viral-form label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}

.manual-viral-form input,
.manual-viral-form select,
.manual-viral-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.manual-viral-form input[readonly] {
  background: #f6f8fb;
}

.manual-viral-form textarea {
  resize: vertical;
}

.viral-title-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viral-title-control button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.manual-viral-form .full-width {
  grid-column: 1 / -1;
}

.nav-item[hidden], .brand-entry-body[hidden] { display: none; }

.manual-viral-form [role="alert"] {
  color: #b91c1c;
}

.manual-viral-evidence img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .manual-viral-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.notice-item {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fffaf0;
}

.employee-link-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  color: var(--accent);
  background: #f8fbff;
  font-weight: 900;
}

.employee-link-btn:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: #edf3ff;
}

.employee-account-block {
  padding-top: 10px;
}

.employee-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.employee-block-meta,
.account-type-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-block-meta > span,
.account-type-summary span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 12px;
  font-weight: 800;
}

.employee-account-table table {
  min-width: 900px;
}

.employee-content-table table {
  min-width: 1180px;
}

.employee-content-title {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-home-link,
.content-work-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.account-home-link:hover,
.content-work-link:hover {
  background: #1d4ed8;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .viral-card {
    grid-template-columns: 1fr;
  }

  .viral-cover {
    min-height: 100px;
  }

  .detail-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .modal-hero {
    display: grid;
    padding-right: 58px;
  }
}
.account-intake-panel {
  border-left: 4px solid var(--accent);
}

.account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.account-form input,
.account-form select {
  width: 100%;
  min-width: 0;
}

.account-form .primary-btn {
  min-width: 120px;
}

.team-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(100%, 430px);
}

.team-panel-tools .search-wrap {
  min-width: 220px;
}

.intake-log {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.intake-empty,
.intake-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.intake-empty {
  color: var(--muted);
  font-size: 13px;
}

.intake-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.intake-item strong {
  font-size: 13px;
}

.intake-item span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.account-grading-section {
  margin-top: 18px;
}

.account-grading-rules {
  margin: 0;
}

.account-grading-rules > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.account-grading-rules dt,
.account-grading-rules dd {
  margin: 0;
  line-height: 1.6;
}

.grading-rule-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.xhs-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 14px;
  align-items: stretch;
}

.xhs-manual-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(20, 99, 255, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 99, 255, 0.05), transparent 38%), #fff;
}

.xhs-manual-form input[type="url"],
.xhs-manual-form input[type="text"],
.xhs-manual-form input[type="number"],
.xhs-manual-form input[type="file"] {
  min-height: 40px;
}

.xhs-manual-form #xhsAccountUrl,
.xhs-manual-form #xhsNoteUrl,
.xhs-manual-form #xhsNoteTitle,
.xhs-manual-form #xhsScreenshotNote,
.xhs-manual-form .primary-btn {
  grid-column: span 2;
}

.xhs-import-grid textarea {
  width: 100%;
  min-height: 188px;
  padding: 14px;
  border: 1px solid rgba(20, 99, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.05), transparent 38%),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.xhs-import-grid textarea:focus {
  border-color: rgba(20, 99, 255, 0.46);
  outline: 3px solid rgba(20, 99, 255, 0.08);
}

.xhs-import-help {
  align-content: start;
}

.xhs-import-help .primary-btn {
  justify-self: start;
  margin-top: 4px;
}

.text-btn {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--danger);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.text-btn:hover {
  background: #fde8e6;
}

@media (max-width: 1120px) {
  .account-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .account-form,
  .xhs-import-grid,
  .team-panel-tools,
  .intake-item {
    grid-template-columns: 1fr;
  }

  .team-panel-tools {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }

  .team-panel-tools .search-wrap {
    min-width: 0;
  }

  .intake-item {
    display: grid;
  }

  .intake-item span {
    text-align: left;
  }
}
.owner-pie-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 260px;
}

.pie-chart {
  position: relative;
  display: grid;
  width: min(240px, 100%);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.08);
}

.pie-chart::after {
  position: absolute;
  inset: 24%;
  content: "";
  border-radius: 50%;
  background: white;
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.12);
}

.pie-chart div {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
}

.pie-chart strong {
  font-size: 24px;
  line-height: 1;
}

.pie-chart span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pie-legend-row:last-child {
  border-bottom: 0;
}

.pie-legend-row i {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 4px;
}

.pie-legend-row strong,
.pie-legend-row span {
  display: block;
  overflow-wrap: anywhere;
}

.pie-legend-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .owner-pie-layout {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    justify-self: center;
  }
}
.sidebar {
  overflow-y: auto;
}

.sidebar-intake {
  display: grid;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.18s ease, border-color 0.18s ease;
}

.sidebar-intake.open {
  max-height: 760px;
  opacity: 1;
  padding: 12px 10px;
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-intake-head {
  display: grid;
  gap: 3px;
}

.sidebar-intake-head strong {
  color: white;
  font-size: 14px;
}

.sidebar-intake-head span {
  color: #b9c2d0;
  font-size: 12px;
}

.sidebar-intake .account-form {
  grid-template-columns: 1fr;
  gap: 8px;
}

.sidebar-intake .account-form select,
.sidebar-intake .account-form input,
.sidebar-intake .account-form .primary-btn {
  width: 100%;
  min-width: 0;
}

.sidebar-intake .account-form select,
.sidebar-intake .account-form input {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.sidebar-intake .intake-log {
  margin-top: 0;
}

.sidebar-intake .intake-empty,
.sidebar-intake .intake-item {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-intake .intake-empty,
.sidebar-intake .intake-item span {
  color: #b9c2d0;
}

.sidebar-intake .intake-item {
  display: grid;
}

.sidebar-intake .intake-item strong {
  color: white;
}

@media (max-width: 820px) {
  .sidebar-intake.open {
    max-height: none;
  }
}
.page-hidden {
  display: none;
}

.main-content.entry-mode > :not(#accountEntryPage) {
  display: none;
}

.main-content.entry-mode {
  align-content: start;
}

.main-content.entry-mode #accountEntryPage {
  display: grid;
}

.account-entry-page {
  min-height: calc(100vh - 56px);
  align-content: start;
  gap: 18px;
  padding-bottom: 18px;
}

.entry-page-heading {
  align-items: center;
}

.entry-page-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.65fr);
  gap: 16px;
}

.entry-page-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.entry-page-form .primary-btn {
  min-width: 140px;
}

.auth-bind-btn {
  min-height: 40px;
  border-radius: 8px;
}

.entry-help {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.entry-help strong {
  font-size: 15px;
}

.entry-help p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-bind-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.5;
}

.auth-bind-status.success {
  color: var(--good);
  border-color: rgba(8, 116, 67, 0.22);
  background: #e7f6ee;
}

.auth-bind-status.failed {
  color: var(--danger);
  border-color: rgba(217, 45, 32, 0.22);
  background: #fde8e6;
}

.oauth-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--good);
  background: #e7f6ee;
  font-size: 11px;
  font-weight: 800;
}

.entry-log-section {
  display: grid;
  gap: 12px;
}

.compact-heading {
  margin-bottom: 0;
}

@media (max-width: 1120px) {
  .entry-page-body,
  .entry-page-form {
    grid-template-columns: 1fr;
  }
}
.page-section {
  display: none;
}

.page-section.active {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 22px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.secondary-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-brand-rank,
.overview-focus-list,
.overview-list {
  display: grid;
  gap: 12px;
}

.overview-rank-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.overview-rank-row:hover {
  border-color: #afc0f5;
  background: #fbfcff;
  box-shadow: 0 8px 22px rgba(33, 50, 94, 0.08);
}

.overview-rank-row:focus-visible {
  outline: 3px solid rgba(67, 105, 245, 0.24);
  outline-offset: 2px;
  border-color: var(--accent);
}

.rank-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.overview-rank-row.risk .rank-index {
  background: var(--warning);
}

.rank-main {
  display: grid;
  gap: 8px;
}

.rank-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rank-title span {
  color: var(--muted);
  font-weight: 800;
}

.rank-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.rank-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.rank-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.rank-meta strong {
  font-size: 18px;
}

.rank-meta span,
.overview-mini-row span,
.overview-focus-item p {
  color: var(--muted);
  font-size: 13px;
}

.overview-focus-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.overview-focus-item > span {
  display: inline-grid;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.overview-focus-item strong,
.overview-focus-item p {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
}

.overview-focus-item p {
  margin-top: 4px;
  line-height: 1.5;
}

.overview-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.overview-mini-row:last-child {
  border-bottom: 0;
}

.overview-mini-row strong,
.overview-mini-row span {
  display: block;
  overflow-wrap: anywhere;
}

.overview-mini-row span {
  margin-top: 4px;
}

.monthly-score-list {
  gap: 0;
}

.monthly-score-panel .panel-heading {
  flex-wrap: wrap;
  gap: 12px;
}

.overview-score-month-control {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.overview-score-month-control select {
  width: 170px;
  min-width: 0;
  max-width: 100%;
  height: 36px;
  font-size: 13px;
}

.overview-score-period {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.overview-score-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.overview-score-row:last-child {
  border-bottom: 0;
}

.score-rank {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.overview-score-row:nth-child(-n + 3) .score-rank {
  color: white;
  background: var(--accent);
}

.overview-score-person,
.overview-score-value {
  min-width: 0;
}

.overview-score-person strong,
.overview-score-person span,
.overview-score-value strong,
.overview-score-value span {
  display: block;
}

.overview-score-person strong,
.overview-score-person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-score-person span,
.overview-score-value span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.overview-score-value {
  text-align: right;
}

.overview-score-value strong {
  color: var(--warning);
  font-size: 18px;
}

.mini-value {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.mini-value > span {
  display: block;
  width: 100%;
  max-width: 112px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-2);
}

.platform-score {
  display: grid;
  min-width: 44px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.platform-score.good {
  color: var(--good);
  background: #e7f6ee;
}

.platform-score.risk {
  color: var(--warning);
  background: #fff1db;
}

@media (max-width: 1120px) {
  .overview-grid,
  .secondary-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .overview-rank-row,
  .overview-mini-row {
    grid-template-columns: 1fr;
  }

  .rank-meta,
  .mini-value {
    justify-items: start;
  }
}
.overview-viral-spotlight {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
  gap: 14px;
}

.overview-viral-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  overflow: hidden;
  height: 196px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.viral-play-surface {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  overflow: hidden;
  min-height: 100%;
  padding: 12px;
  border: 0;
  color: white;
  background: linear-gradient(145deg, #1463ff, #02a88a);
  cursor: pointer;
  text-decoration: none;
}

.viral-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viral-play-surface::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(15, 23, 42, 0.24);
}

.viral-play-surface > :not(.viral-cover-image) {
  position: relative;
  z-index: 1;
}

.overview-viral-card.beauty .viral-play-surface,
.modal-player.beauty {
  background: linear-gradient(145deg, #103e55, #167566);
}

.overview-viral-card.medical .viral-play-surface,
.modal-player.medical {
  background: linear-gradient(145deg, #087443, #1463ff);
}

.overview-viral-card.food .viral-play-surface,
.modal-player.food {
  background: linear-gradient(145deg, #b65c00, #02a88a);
}

.overview-viral-card.tech .viral-play-surface,
.modal-player.tech {
  background: linear-gradient(145deg, #162033, #1463ff);
}

.play-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 18px;
  line-height: 1;
}

.play-icon.large {
  width: 76px;
  height: 76px;
  font-size: 32px;
}

.viral-play-surface strong {
  font-size: 15px;
  text-align: center;
}

.overview-viral-info {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  padding: 10px 12px;
}

.viral-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.viral-meta-line span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.overview-viral-info h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-viral-info p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.overview-viral-info > .secondary-btn {
  align-self: end;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.modal-player {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  padding: 22px;
  color: white;
  background: linear-gradient(145deg, #1463ff, #02a88a);
}

.player-frame {
  display: grid;
  min-height: 320px;
  place-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  text-align: center;
}

.player-frame.has-video {
  padding: 0;
  overflow: hidden;
  background: #05070b;
}

.viral-video-player {
  display: block;
  width: 100%;
  max-height: 68vh;
  min-height: 320px;
  object-fit: contain;
  background: #05070b;
}

.viral-video-player[hidden] {
  display: none;
}

.player-media-fallback {
  display: grid;
  width: 100%;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
}

.player-media-fallback[hidden] {
  display: none;
}

.player-media-fallback p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.player-cover-preview {
  width: min(100%, 280px);
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
}

.player-open-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  color: #162033;
  background: white;
  font-weight: 800;
  text-decoration: none;
}

.player-frame strong,
.player-frame span {
  display: block;
}

.player-frame strong {
  max-width: 620px;
  font-size: 22px;
  line-height: 1.42;
}

.player-frame span,
.player-side p {
  color: rgba(255, 255, 255, 0.82);
}

.player-side {
  display: grid;
  align-content: center;
  gap: 12px;
}

.player-side .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.player-side h2,
.player-side p {
  margin: 0;
}

@media (max-width: 920px) {
  .modal-player {
    grid-template-columns: 1fr;
  }

  .overview-viral-card {
    grid-template-columns: 108px minmax(0, 1fr);
    height: 196px;
  }

  .viral-video-player,
  .player-media-fallback {
    min-height: 220px;
  }
}

.sync-log-panel {
  display: grid;
  gap: 18px;
}

.sync-log-heading {
  align-items: center;
}

.sync-log-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.sync-log-summary article {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.sync-log-summary article:last-child {
  border-right: 0;
}

.sync-log-summary span,
.sync-log-summary small,
.sync-log-run-title span,
.sync-log-counts span,
.sync-log-run-meta span,
.sync-log-run-note,
.sync-log-detail-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.sync-log-summary strong {
  font-size: 24px;
  line-height: 1.1;
}

.sync-log-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.sync-log-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sync-log-toolbar select {
  min-height: 38px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.sync-log-toolbar > span {
  margin-left: auto;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sync-log-list {
  display: grid;
  gap: 10px;
}

.sync-log-run {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid #64748b;
  border-radius: 8px;
  background: #ffffff;
}

.sync-log-run.success { border-left-color: var(--good); }
.sync-log-run.partial { border-left-color: var(--warning); }
.sync-log-run.failed { border-left-color: var(--danger); }
.sync-log-run.running { border-left-color: var(--accent); }

.sync-log-run > summary {
  display: grid;
  grid-template-columns: 86px minmax(190px, 1.3fr) minmax(210px, 1fr) minmax(120px, 0.5fr) 18px;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.sync-log-run > summary::-webkit-details-marker { display: none; }

.sync-log-run > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.sync-log-run[open] > summary::after { content: "−"; }

.sync-log-run[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.sync-log-state,
.sync-log-item-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #475569;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sync-log-state.success,
.sync-log-item-state.success {
  color: #065f46;
  background: #dcfce7;
}

.sync-log-state.partial {
  color: #92400e;
  background: #fef3c7;
}

.sync-log-state.failed,
.sync-log-item-state.failed {
  color: #991b1b;
  background: #fee2e2;
}

.sync-log-state.running {
  color: #1d4ed8;
  background: #dbeafe;
}

.sync-log-run-title,
.sync-log-counts,
.sync-log-run-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sync-log-run-title strong,
.sync-log-counts strong,
.sync-log-run-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-log-run-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.sync-log-run-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.55;
}

.sync-log-items-wrap {
  max-height: 480px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sync-log-items {
  min-width: 980px;
}

.sync-log-items th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.sync-log-items td {
  vertical-align: top;
}

.sync-log-items td small,
.sync-log-items td time {
  display: block;
  max-width: 320px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-log-detail-placeholder,
.sync-log-empty {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #f8fafc;
  text-align: center;
}

.sync-log-detail-placeholder.error,
.sync-log-empty.error {
  color: var(--danger);
  border-color: rgba(217, 45, 32, 0.28);
  background: #fff7f6;
}

@media (max-width: 1100px) {
  .sync-log-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sync-log-summary article:nth-child(3) { border-right: 0; }
  .sync-log-summary article:nth-child(n + 4) { border-top: 1px solid var(--line); }

  .sync-log-run > summary {
    grid-template-columns: 82px minmax(170px, 1fr) minmax(180px, 1fr) 18px;
  }

  .sync-log-run-meta { display: none; }
}

@media (max-width: 720px) {
  .sync-log-heading,
  .sync-log-toolbar,
  .sync-log-run-note {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-log-summary {
    grid-template-columns: 1fr 1fr;
  }

  .sync-log-summary article,
  .sync-log-summary article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .sync-log-summary article:nth-child(-n + 2) { border-top: 0; }
  .sync-log-summary article:nth-child(even) { border-right: 0; }
  .sync-log-toolbar label { min-width: 0; }
  .sync-log-toolbar > span { margin-left: 0; padding-bottom: 0; }

  .sync-log-run > summary {
    grid-template-columns: 74px 1fr 18px;
    gap: 10px;
  }

  .sync-log-counts { display: none; }
}
.grade-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grade-pill,
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.grade-badge {
  min-width: 34px;
}

.grade-S {
  color: #7c2d12;
  background: #ffedd5;
}

.grade-A {
  color: var(--good);
  background: #e7f6ee;
}

.grade-B {
  color: var(--accent);
  background: #edf3ff;
}

.grade-C {
  color: var(--warning);
  background: #fff1db;
}

.grade-D {
  color: var(--danger);
  background: #fde8e6;
}

.grade-待同步 {
  color: var(--muted);
  background: #edf1f6;
}
.ding-config {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.ding-config span {
  color: var(--muted);
  font-size: 13px;
}

.ding-config strong {
  font-size: 14px;
}

.ding-alert-list {
  display: grid;
  gap: 12px;
}

.ding-alert-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.ding-alert-card.sent {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ding-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ding-alert-head span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #9a3412;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 800;
}

.ding-alert-card.sent .ding-alert-head span {
  color: var(--good);
  background: #dcfce7;
}

.ding-alert-card h3,
.ding-alert-card p {
  margin: 0;
}

.ding-alert-card h3 {
  font-size: 16px;
  line-height: 1.4;
}

.ding-alert-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ding-alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ding-alert-meta span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.ding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ding-actions .primary-btn:disabled {
  cursor: default;
  background: #98a2b3;
}
.base-comment-list {
  display: grid;
  gap: 12px;
}

.base-comment-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.base-comment-card.pending {
  border-color: #fed7aa;
  background: #fff7ed;
}

.base-comment-card.missed {
  border-color: #fecaca;
  background: #fef2f2;
}

.base-comment-card.passed {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.base-comment-card h3,
.base-comment-card p {
  margin: 0;
}

.base-comment-card h3 {
  font-size: 16px;
  line-height: 1.4;
}

.base-comment-card p,
.base-comment-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.base-comment-message {
  padding: 10px 12px;
  border: 1px dashed rgba(102, 112, 133, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.base-comment-card .text-btn:disabled,
.base-comment-card .primary-btn:disabled {
  cursor: default;
  opacity: 0.62;
}
.brand-entry-page {
  border-top: 4px solid #10b981;
}

.brand-entry-body .brand-entry-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.brand-entry-form .primary-btn {
  grid-column: span 2;
  min-height: 44px;
}

.brand-entry-help {
  border-color: rgba(16, 185, 129, 0.24);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(240, 253, 250, 0.78));
}

.brand-maintenance-section {
  margin-top: 18px;
}

.text-btn.danger {
  border-color: rgba(206, 50, 37, 0.24);
  color: var(--danger);
}

.brand-maintenance-tree {
  display: grid;
  gap: 12px;
}

.brand-maintenance-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-maintenance-head,
.brand-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-maintenance-title,
.brand-product-head > div:first-child {
  display: grid;
  gap: 4px;
}

.brand-maintenance-title strong,
.brand-product-head > div:first-child strong {
  color: var(--ink);
}

.brand-maintenance-title span,
.brand-product-head > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.brand-manager-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  margin-left: auto;
  min-width: fit-content;
}

.brand-manager-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 36px;
  white-space: nowrap;
}

.brand-manager-tools label,
.brand-manager-bound {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand-manager-bound strong {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  line-height: 18px;
}

.brand-manager-tools select {
  min-width: 132px;
  min-height: 34px;
}

.brand-product-list {
  display: grid;
  gap: 10px;
}

.brand-product-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 99, 255, 0.12);
  border-radius: 8px;
  background: #f8fafc;
}

.owner-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.owner-chip small {
  color: var(--muted);
}

.owner-chip button {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(206, 50, 37, 0.2);
  border-radius: 50%;
  color: var(--danger);
  background: #fff;
  cursor: pointer;
  line-height: 16px;
}

.owner-chip > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.owner-chip .supervisor-toggle {
  width: auto;
  height: auto;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--accent);
  font: inherit;
  line-height: 1.3;
}

.owner-chip .supervisor-toggle.danger {
  color: var(--danger);
  border-color: rgba(206, 50, 37, 0.24);
}

.owner-chip .supervisor-toggle:disabled {
  opacity: 0.5;
  cursor: wait;
}

.product-supervisor-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  background: #e6f5ee;
  color: #166447;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.brand-intake-item strong {
  color: #065f46;
}

.brand-detail-page {
  background: var(--panel);
  min-width: 0;
  padding: 24px;
}

.brand-detail-heading,
.brand-detail-section-heading,
.brand-detail-product > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-detail-title h2 {
  margin: 0;
  font-size: 26px;
  overflow-wrap: anywhere;
}

.brand-back-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
}

.brand-detail-page label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.brand-detail-page select {
  min-width: 0;
  width: 170px;
  max-width: 100%;
}

.brand-detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.brand-detail-metrics > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.brand-detail-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.brand-detail-metrics strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.brand-detail-section {
  padding-top: 10px;
  min-width: 0;
}

.brand-detail-section h3 {
  margin: 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.brand-detail-owners {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.brand-pie-figure {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0;
}

.brand-viral-pie {
  width: min(260px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.brand-pie-figure figcaption,
.brand-viral-pie span {
  color: var(--muted);
  font-size: 13px;
}

.brand-owner-contribution {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 95px 65px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.brand-owner-contribution i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.brand-owner-contribution strong {
  overflow-wrap: anywhere;
}

.brand-owner-contribution span,
.brand-owner-contribution b {
  text-align: right;
}

.brand-detail-product {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.brand-detail-product > header {
  align-items: flex-start;
  padding-bottom: 14px;
}

.brand-detail-product header p,
.brand-product-supervisor {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.brand-content-table {
  min-width: 0;
  table-layout: fixed;
}

.brand-content-table th,
.brand-content-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 12px 9px;
  line-height: 1.5;
  vertical-align: top;
  font-size: 12px;
}

.brand-content-table a {
  color: var(--accent);
}

.brand-detail-empty {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .brand-detail-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .brand-detail-page {
    padding: 18px;
  }

  .brand-detail-heading,
  .brand-detail-section-heading,
  .brand-detail-product > header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-detail-owners {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .brand-viral-pie {
    width: min(220px, 100%);
  }

  .brand-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-content-table,
  .brand-content-table tbody,
  .brand-content-table tr,
  .brand-content-table td {
    display: block;
    width: 100%;
  }

  .brand-content-table thead,
  .brand-content-table colgroup {
    display: none;
  }

  .brand-content-table tr {
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  .brand-content-table td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    border: 0;
    padding: 4px 0;
  }

  .brand-content-table td::before {
    content: attr(data-label);
    color: var(--muted);
  }
}

@media (max-width: 820px) {
  .brand-entry-body .brand-entry-form,
  .brand-entry-form .primary-btn {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .brand-maintenance-head,
  .brand-product-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-manager-tools {
    display: grid;
    justify-content: stretch;
    margin-left: 0;
    min-width: 0;
  }

  .brand-manager-control {
    display: grid;
    justify-content: stretch;
    white-space: normal;
  }

  .brand-manager-tools label,
  .brand-manager-tools select,
  .brand-manager-control .secondary-btn,
  .brand-manager-control .text-btn,
  .brand-manager-bound,
  .brand-manager-tools .secondary-btn {
    width: 100%;
  }
}
.platform-status-cell {
  min-width: 260px;
  white-space: normal;
}

.platform-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-status-list.compact .platform-status-card {
  min-width: 110px;
  padding: 7px 9px;
}

.platform-status-card {
  display: grid;
  gap: 5px;
  min-width: 122px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.platform-status-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.platform-status-card b {
  min-width: 26px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #0f172a;
  background: #ffffff;
  font-size: 12px;
}

.platform-status-card > span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.platform-status-card.good {
  border-color: rgba(24, 138, 90, 0.22);
  background: #f0fdf4;
}

.platform-status-card.warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fffbeb;
}

.platform-status-card.danger {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
}

.platform-status-card.pending {
  border-color: rgba(100, 116, 139, 0.24);
  background: #f1f5f9;
}

.platform-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.platform-status-chip.good {
  color: var(--good);
  background: #dff7eb;
}

.platform-status-chip.warning {
  color: var(--warning);
  background: #fff1db;
}

.platform-status-chip.danger {
  color: var(--danger);
  background: #fde8e6;
}

.platform-empty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf1f6;
  font-size: 12px;
  font-weight: 800;
}
.platform-status-chip.pending {
  color: var(--muted);
  background: #e5eaf0;
}

.team-viral-cell {
  min-width: 260px;
  white-space: normal;
}

.team-viral-links {
  display: grid;
  gap: 7px;
}

.team-viral-link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: #f8fbff;
}

.team-viral-link span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.team-viral-link a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.team-viral-link a:hover {
  text-decoration: underline;
}

.text-btn.mini {
  min-height: 24px;
  padding: 0 7px;
  font-size: 12px;
}

.viral-link-empty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf1f6;
  font-size: 12px;
  font-weight: 800;
}
.brand-viral-panel {
  margin-top: 18px;
}

.brand-viral-list {
  display: grid;
  gap: 12px;
}

.brand-viral-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.brand-viral-score {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  color: #7c2d12;
  background: #ffedd5;
}

.brand-viral-score strong {
  font-size: 26px;
  line-height: 1;
}

.brand-viral-score span {
  font-size: 11px;
  font-weight: 800;
}

.brand-viral-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.brand-viral-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.brand-viral-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-viral-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-viral-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.brand-viral-actions a:hover {
  text-decoration: underline;
}

.brand-viral-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.product-dashboard-page {
  gap: 18px;
}

.product-dashboard-heading {
  align-items: center;
}

.product-dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.product-dashboard-brand-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.product-dashboard-brand-filter select {
  min-width: 180px;
}

.product-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 -18px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-dashboard-metrics > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.product-dashboard-metrics > div:last-child {
  border-right: 0;
}

.product-dashboard-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-dashboard-metrics strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
}

.product-dashboard-summary-wrap,
.product-dashboard-daily-wrap,
.product-dashboard-viral-wrap {
  scrollbar-gutter: stable;
}

.product-dashboard-summary-table {
  min-width: 760px;
  table-layout: fixed;
}

.product-dashboard-summary-table th:nth-child(1) {
  width: 150px;
}

.product-dashboard-summary-table th:nth-child(2) {
  width: 210px;
}

.product-dashboard-summary-table th:nth-child(n+3) {
  width: 180px;
}

.product-period-cell {
  background: #ffffff;
}

.product-period-cell.selected {
  background: #f0f6ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.product-period-cell > div {
  display: grid;
  gap: 4px;
}

.product-period-cell strong {
  font-size: 17px;
}

.product-period-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-dashboard-period-tabs {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.product-dashboard-period-tabs .filter-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.product-dashboard-period-tabs .filter-tab:last-child {
  border-right: 0;
}

.product-dashboard-period-tabs .filter-tab.active {
  background: var(--accent);
}

.product-dashboard-daily-table {
  table-layout: fixed;
}

.product-dashboard-daily-table th:first-child,
.product-dashboard-daily-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 140px;
  min-width: 140px;
  background: #ffffff;
}

.product-dashboard-daily-table th:nth-child(2),
.product-dashboard-daily-table td:nth-child(2) {
  position: sticky;
  left: 140px;
  z-index: 2;
  width: 190px;
  min-width: 190px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.product-dashboard-daily-table thead th:first-child,
.product-dashboard-daily-table thead th:nth-child(2) {
  z-index: 4;
  background: #f8fafc;
}

.product-dashboard-daily-table th:nth-child(n+3),
.product-dashboard-daily-table td:nth-child(n+3) {
  width: 82px;
  min-width: 82px;
  padding-right: 8px;
  padding-left: 8px;
  text-align: center;
}

.product-dashboard-daily-table th span,
.product-dashboard-daily-table th small {
  display: block;
}

.product-dashboard-daily-table th small {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
}

.product-day-count {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 46px;
  color: #94a3b8;
}

.product-day-count.has-content {
  border: 1px solid rgba(20, 99, 255, 0.18);
  border-radius: 6px;
  color: var(--ink);
  background: #f0f6ff;
}

.product-day-count strong {
  font-size: 16px;
}

.product-day-count small {
  color: var(--warning);
  font-size: 10px;
  font-weight: 800;
}

.product-dashboard-viral-table {
  min-width: 1120px;
  table-layout: fixed;
}

.product-dashboard-viral-table th:nth-child(1) { width: 120px; }
.product-dashboard-viral-table th:nth-child(2) { width: 190px; }
.product-dashboard-viral-table th:nth-child(3) { width: 210px; }
.product-dashboard-viral-table th:nth-child(4) { width: 360px; }
.product-dashboard-viral-table th:nth-child(5) { width: 140px; }
.product-dashboard-viral-table th:nth-child(6) { width: 110px; }

.product-dashboard-viral-table td span,
.product-dashboard-viral-table td strong {
  display: block;
}

.product-dashboard-viral-table td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.product-dashboard-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(20, 99, 255, 0.22);
  border-radius: 6px;
  color: var(--accent);
  background: #f0f6ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.product-dashboard-link:hover {
  background: #e5efff;
}

.product-dashboard-link.disabled {
  color: var(--muted);
  border-color: var(--line);
  background: #f8fafc;
}

.product-dashboard-empty {
  display: block;
  padding: 20px 18px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 820px) {
  .brand-viral-item {
    grid-template-columns: 1fr;
  }

  .brand-viral-actions {
    justify-content: flex-start;
  }

  .product-dashboard-heading {
    display: grid;
  }

  .product-dashboard-brand-filter,
  .product-dashboard-brand-filter select {
    width: 100%;
  }

  .product-dashboard-brand-filter {
    display: grid;
  }

  .product-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-dashboard-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .product-dashboard-metrics > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .product-dashboard-period-tabs {
    width: 100%;
  }

  .product-dashboard-period-tabs .filter-tab {
    flex: 1;
  }
}
.auth-widget {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}

.auth-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #c7f9ff;
  background: rgba(8, 145, 178, 0.24);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ding-login-btn {
  min-height: 32px;
  padding: 0 10px;
  color: #0f172a;
  background: #e2e8f0;
  white-space: nowrap;
}

.backend-widget {
  display: grid;
  gap: 4px;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}

.backend-widget strong {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0 8px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(180, 83, 9, 0.28);
  font-size: 12px;
  font-weight: 800;
}

.backend-widget strong.online {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.32);
}

.backend-widget strong.offline {
  color: #fecaca;
  background: rgba(153, 27, 27, 0.34);
}

.backend-widget span {
  color: rgba(226, 232, 240, 0.78);
  font-size: 12px;
  white-space: nowrap;
}

.permission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 99, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 99, 255, 0.08), rgba(2, 168, 138, 0.06)),
    #ffffff;
}

.permission-banner div {
  display: grid;
  gap: 4px;
}

.permission-banner strong {
  font-size: 14px;
}

.permission-banner span,
.permission-banner small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.permission-banner small {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent);
  background: #edf3ff;
  font-weight: 800;
  white-space: nowrap;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 8px;
  color: #14532d;
  background: rgba(240, 253, 244, 0.98);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 900;
  animation: toastIn 0.18s ease-out both;
}

.toast-message.leaving {
  animation: toastOut 0.55s ease-in both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 920px) {
  .auth-widget {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .backend-widget {
    width: 100%;
  }

  .permission-banner {
    display: grid;
  }
}

.collaboration-panel { min-width: 0; }
.collaboration-records-heading { flex-wrap: wrap; gap: 16px; }
.collaboration-today-count { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.collaboration-records-tools { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.collaboration-records-tools label { flex-shrink: 0; color: var(--muted); font-size: 14px; }
.collaboration-records-tools select { width: 220px; max-width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: white; color: var(--ink); }
.collaboration-records-tools #refreshCollaborationsBtn { flex: 0 0 36px; width: 36px; height: 36px; padding: 0; }
.collaboration-modes { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.collaboration-modes button { border: 0; border-radius: 0; background: white; color: var(--muted); padding: 10px 14px; font: inherit; cursor: pointer; }
.collaboration-modes button[aria-pressed="true"] { background: var(--accent); color: white; }
.collaboration-modes button:disabled { cursor: wait; }
.collaboration-record-periods { flex-basis: 100%; width: 100%; max-width: 100%; box-sizing: border-box; }
.collaboration-record-periods button { flex: 1; min-width: 0; padding: 10px 4px; font-size: 14px; white-space: nowrap; }
.collaboration-form [hidden] { display: none; }
.collaboration-batch-area { grid-column: 1 / -1; min-width: 0; }
.collaboration-batch-area p { margin: 0 0 12px; color: var(--muted); }
.collaboration-batch-preview { max-height: 320px; overflow: auto; }
.collaboration-batch-preview table { width: 100%; min-width: 650px; table-layout: fixed; }
.collaboration-batch-preview th:first-child { width: 60px; }
.collaboration-batch-preview th:nth-child(2) { width: 20%; }
.collaboration-batch-preview td { overflow-wrap: anywhere; white-space: normal; vertical-align: top; }
.collaboration-batch-preview tr[data-state="failed"] td:last-child { color: var(--danger); }
.collaboration-batch-preview tr[data-state="created"] td:last-child { color: var(--good); }
.collaboration-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 24px 24px; }
.collaboration-form label { display: grid; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; }
.collaboration-form input, .collaboration-form select, .collaboration-form textarea { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #d6deea; border-radius: 6px; background: white; padding: 12px; font: inherit; color: #222b38; }
.collaboration-form textarea { resize: vertical; }
.collaboration-url { grid-column: span 2; }
.collaboration-status { grid-column: span 2; margin: 0; align-self: center; overflow-wrap: anywhere; }
.collaboration-table { min-width: 1040px; width: 100%; table-layout: fixed; }
.collaboration-table td { overflow-wrap: anywhere; white-space: normal; vertical-align: top; }
.collaboration-table th:nth-child(4) { width: 20%; }
.collaboration-table th:last-child { width: 78px; }
.collaboration-work-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.5; max-height: 3em; overflow-wrap: anywhere; white-space: normal; }
.collaboration-error { display: block; margin-top: 6px; color: #b93828; }
.collaboration-badge { display: inline-block; background: #e1f3ee; color: #166751; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 4px; margin: 3px 6px 3px 0; }
@media (max-width: 700px) {
  .collaboration-records-heading { grid-template-columns: minmax(0, 1fr); }
  .collaboration-form { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .collaboration-url, .collaboration-status { grid-column: auto; }
  .collaboration-records-tools { width: 100%; }
  .collaboration-records-tools select { flex: 1; width: auto; }
}

/* 旺店通销售数据 */
.sales-page { display: none; gap: 20px; }
.sales-page.active { display: grid; }
.sales-page-heading, .sales-page-actions { align-items: center; }
.sales-page-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.segmented-control { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(74px, 1fr); border: 1px solid #d7dfed; border-radius: 6px; overflow: hidden; background: #fff; }
.segmented-control button { min-height: 42px; padding: 0 16px; border: 0; border-right: 1px solid #d7dfed; background: #fff; color: #5d687d; font: inherit; font-weight: 700; cursor: pointer; }
.segmented-control button:last-child { border-right: 0; }
.segmented-control button.active { background: #4169e1; color: #fff; }
.sales-sync-status { min-height: 42px; margin: 4px 0 18px; padding: 11px 14px; border-left: 4px solid #55a68f; background: #f2f8f6; color: #45536b; line-height: 1.5; }
.sales-sync-status.loading { border-color: #4169e1; background: #f2f5ff; }
.sales-sync-status.warning { border-color: #c78322; background: #fff8ec; color: #7c5218; }
.sales-sync-status.error { border-color: #c9483d; background: #fff2f0; color: #9f3028; }
.sales-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #dce3ee; border-radius: 6px; overflow: hidden; }
.sales-metrics article { min-width: 0; padding: 20px; border-right: 1px solid #dce3ee; background: #fff; }
.sales-metrics article:last-child { border-right: 0; }
.sales-metrics span, .sales-metrics strong { display: block; }
.sales-metrics span { color: #758198; font-size: 14px; }
.sales-metrics strong { margin-top: 8px; color: #17243d; font-size: 26px; }
.sales-range, .sales-mapping-count { color: #68758c; font-size: 14px; font-weight: 700; }
.sales-brand-list { display: grid; gap: 16px; }
.sales-brand-group { border: 1px solid #d8e0ec; border-radius: 6px; overflow: hidden; background: #fff; }
.sales-brand-group > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; background: #f7f9fc; }
.sales-brand-group > header span, .sales-brand-group > header h3, .sales-brand-total strong { display: block; }
.sales-brand-group > header span { color: #78849a; font-size: 13px; }
.sales-brand-group > header h3 { margin: 4px 0 0; font-size: 21px; }
.sales-brand-total { text-align: right; }
.sales-brand-total strong { color: #17243d; font-size: 22px; }
.sales-platforms { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid #e4e9f2; border-bottom: 1px solid #e4e9f2; }
.sales-platforms span { display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid #dbe3ef; border-radius: 5px; color: #5f6b81; font-size: 13px; }
.sales-platforms b { color: #284e9f; }
.sales-product-table, .sales-mapping-table { width: 100%; border-collapse: collapse; }
.sales-product-table th, .sales-product-table td, .sales-mapping-table th, .sales-mapping-table td { padding: 13px 16px; border-bottom: 1px solid #e2e8f1; text-align: left; vertical-align: middle; }
.sales-product-table th, .sales-mapping-table th { color: #68758c; background: #fbfcfe; font-size: 13px; }
.sales-product-table tr:last-child td, .sales-mapping-table tr:last-child td { border-bottom: 0; }
.sales-mapping-help { margin: -4px 0 16px; color: #6a768b; font-size: 14px; }
.sales-mapping-table { min-width: 980px; }
.sales-mapping-table td:nth-child(1) { max-width: 300px; }
.sales-mapping-table td span, .sales-mapping-table td small { display: block; }
.sales-mapping-table td small { margin-top: 4px; color: #8a94a6; }
.sales-mapping-table select { width: 100%; min-width: 190px; height: 40px; padding: 0 10px; border: 1px solid #cfd8e7; border-radius: 5px; background: #fff; color: #27354f; }
.sales-empty { padding: 24px; color: #768298; }

@media (max-width: 960px) {
  .sales-page-heading { align-items: flex-start; }
  .sales-page-actions { justify-content: flex-start; }
  .sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-metrics article:nth-child(2) { border-right: 0; }
  .sales-metrics article:nth-child(-n+2) { border-bottom: 1px solid #dce3ee; }
}

@media (max-width: 600px) {
  .sales-page-actions, .segmented-control, #syncWdtSalesBtn { width: 100%; }
  .sales-metrics { grid-template-columns: 1fr; }
  .sales-metrics article { border-right: 0; border-bottom: 1px solid #dce3ee; }
  .sales-metrics article:last-child { border-bottom: 0; }
  .sales-brand-group > header { align-items: flex-start; flex-direction: column; }
  .sales-brand-total { text-align: left; }
}

/* ===== 2026 visual system refresh ===== */
:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #dfe5ea;
  --line-strong: #cbd5df;
  --accent: #315be8;
  --accent-2: #14856f;
  --fox: #e66a35;
  --danger: #c73b32;
  --warning: #a85c13;
  --good: #08745d;
  --sidebar: #111827;
  --soft-blue: #edf2ff;
  --soft-teal: #eaf6f2;
  --soft-orange: #fff1e9;
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.07);
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(24, 34, 48, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 34, 48, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(49, 91, 232, 0.2);
  outline-offset: 2px;
}

.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  gap: 22px;
  padding: 24px 16px 18px;
  color: #f8fafc;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.brand-lockup {
  gap: 12px;
  min-width: 0;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-lockup .mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;
}

.brand-lockup strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.35;
}

.brand-lockup span {
  margin-top: 3px;
  color: #91a0b6;
  font-size: 11px;
}

.nav-list {
  gap: 4px;
}

.nav-item {
  position: relative;
  gap: 10px;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aeb9c9;
  font-size: 14px;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-item::before {
  position: absolute;
  left: -1px;
  top: 11px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
  transition: background-color 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(2px);
}

.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active::before {
  background: var(--fox);
}

.nav-item .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: currentColor;
  background: transparent;
  font-size: 13px;
}

.nav-item .icon svg,
.nav-item > svg.icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.sidebar-footer span {
  color: #8391a7;
  font-size: 11px;
}

.sidebar-footer strong {
  margin-top: 5px;
  color: #f8fafc;
  font-size: 14px;
}

.main-content {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 22px 28px 48px;
  gap: 18px;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 30;
  grid-template-columns: minmax(150px, 0.75fr) minmax(360px, 1.35fr) minmax(210px, 0.8fr);
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(203, 213, 223, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
}

.module-kicker {
  color: #728096;
  font-size: 10px;
  font-weight: 800;
}

.topbar-title h1 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.2;
}

.signal-line {
  margin-top: 9px;
  gap: 5px;
}

.signal-line i {
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.signal-line i:nth-child(2) {
  width: 38px;
  background: var(--accent-2);
}

.signal-line i:nth-child(3) {
  width: 16px;
  background: var(--fox);
}

.topbar-center {
  gap: 10px;
  min-width: 0;
}

.topbar .auth-widget,
.topbar .backend-widget {
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #f8fafb;
  box-shadow: none;
}

.topbar .auth-widget {
  flex: 1 1 230px;
  padding: 7px;
}

.topbar .auth-badge {
  min-width: 0;
  max-width: 100%;
  color: #174f45;
  background: var(--soft-teal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .ding-login-btn {
  min-height: 38px;
  flex: 0 0 auto;
  color: #344054;
  background: #ffffff;
  border-color: var(--line-strong);
}

.topbar .backend-widget {
  flex: 1 1 220px;
  padding: 9px 12px;
}

.topbar .backend-widget strong {
  color: #196653;
  background: var(--soft-teal);
}

.topbar .backend-widget strong.offline {
  color: #a2352c;
  background: #fcecea;
}

.topbar .backend-widget span {
  color: #667085;
  font-size: 11px;
}

.topbar-actions,
.sync-control {
  min-width: 0;
}

.topbar .primary-btn {
  min-height: 46px;
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(49, 91, 232, 0.16);
}

.topbar .primary-btn:hover {
  background: #244bce;
}

.sync-progress-meta {
  color: #5d6879;
}

.permission-banner {
  min-height: 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--fox);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.permission-banner strong {
  color: var(--ink);
}

.permission-banner small {
  color: #244bce;
  background: var(--soft-blue);
}

.page-section.active {
  animation: workspaceEnter 240ms ease-out both;
}

@keyframes workspaceEnter {
  from { transform: translateY(5px); }
  to { transform: translateY(0); }
}

.summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.035);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.metric-card:nth-child(2)::before { background: var(--accent-2); }
.metric-card:nth-child(3)::before { background: var(--fox); }
.metric-card:nth-child(4)::before { background: #8759c5; }
.metric-card:nth-child(5)::before { background: var(--danger); }

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.metric-card span,
.metric-card small {
  color: #667085;
}

.metric-card strong {
  margin: 10px 0 6px;
  color: #101828;
  font-size: clamp(27px, 2vw, 34px);
  line-height: 1;
}

.metric-card small.up { color: var(--good); }
.metric-card small.down { color: var(--danger); }

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.035);
}

.panel-heading {
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-top: 4px;
  color: #101828;
  font-size: 18px;
  line-height: 1.3;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.pill-tabs {
  gap: 6px;
}

.pill-tabs span {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #667085;
  background: #ffffff;
  font-size: 12px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
  gap: 16px;
}

.secondary-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-brand-rank,
.overview-focus-list,
.overview-list {
  gap: 2px;
}

.overview-rank-row {
  min-height: 66px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.overview-rank-row:last-child {
  border-bottom-color: transparent;
}

.overview-rank-row:hover {
  border-color: #d8e1f8;
  border-radius: 6px;
  background: #f7f9ff;
  transform: translateX(3px);
  box-shadow: none;
}

.rank-index {
  border-radius: 6px;
}

.overview-focus-item,
.overview-score-row,
.overview-mini-row {
  transition: background-color 150ms ease;
}

.overview-focus-item:hover,
.overview-score-row:hover,
.overview-mini-row:hover {
  background: #f8fafb;
}

.overview-viral-panel {
  overflow: hidden;
}

.overview-viral-spotlight {
  grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr));
  gap: 14px;
}

.overview-viral-spotlight:has(.overview-viral-card:only-child) {
  grid-template-columns: minmax(0, 760px);
}

.overview-viral-card {
  min-height: 204px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.overview-viral-card:hover {
  border-color: #c8d3df;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.viral-play-surface {
  min-width: 146px;
  background: #252b3a;
}

.overview-viral-info {
  padding: 16px;
}

.overview-viral-info h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  line-height: 1.45;
}

.overview-viral-info p {
  margin: 8px 0;
  color: #667085;
  font-size: 13px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.filter-tab,
.segmented-control button,
.collaboration-modes button {
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active,
.danger-btn:active {
  transform: translateY(0);
}

.primary-btn {
  background: var(--accent);
  border-color: var(--accent);
}

.primary-btn:hover {
  background: #244bce;
  box-shadow: 0 7px 16px rgba(49, 91, 232, 0.16);
}

.secondary-btn {
  color: #344054;
  background: #ffffff;
  border-color: var(--line-strong);
}

.secondary-btn:hover {
  color: #244bce;
  border-color: #9fb0dc;
  background: #f7f9ff;
}

.table-wrap,
.detail-table-wrap,
.collaboration-batch-preview {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

table th {
  color: #667085;
  background: #f7f9fa;
  font-size: 12px;
  font-weight: 750;
}

table td {
  color: #344054;
  border-color: #e7ebef;
}

table tbody tr {
  transition: background-color 140ms ease;
}

table tbody tr:hover {
  background: #f8fafb;
}

input,
select,
textarea {
  border-color: var(--line-strong);
  background: #ffffff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aab8c7;
}

.filter-tab.active,
.segmented-control button.active,
.collaboration-modes button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--accent);
}

.modal-backdrop {
  padding: 22px;
  background: rgba(12, 18, 28, 0.58);
  backdrop-filter: blur(8px);
}

.content-modal {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(12, 18, 28, 0.28);
}

.close-btn {
  border-radius: 6px;
  transition: transform 140ms ease, background-color 140ms ease;
}

.close-btn:hover {
  background: #f1f4f7;
  transform: rotate(3deg);
}

.toast-message {
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.15);
}

.login-screen {
  background-color: #eef2f4;
  background-image:
    linear-gradient(rgba(24, 34, 48, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 34, 48, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
}

.login-screen::before,
.login-screen::after {
  display: none;
}

.login-panel {
  border: 1px solid #cfd8df;
  border-radius: 8px;
  box-shadow: 0 26px 72px rgba(17, 24, 39, 0.15);
}

.login-panel::before {
  background: var(--fox);
}

.login-overview {
  background: #111827;
}

.login-access {
  background: #ffffff;
}

.login-form .primary-btn {
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: minmax(145px, 0.65fr) minmax(340px, 1.35fr) minmax(190px, 0.7fr);
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand-lockup strong {
    font-size: 13px;
  }

  .main-content {
    padding-inline: 20px;
  }

  .summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .summary-grid .metric-card {
    grid-column: span 2;
  }

  .summary-grid .metric-card:nth-child(4),
  .summary-grid .metric-card:nth-child(5) {
    grid-column: span 3;
  }

  .topbar {
    position: relative;
    top: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }

  .overview-grid,
  .secondary-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary-overview-grid > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 9px 12px;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand-lockup {
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .brand-lockup .mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-lockup > div:last-child,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 3px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    padding: 0 9px;
    font-size: 12px;
  }

  .nav-item::before {
    inset: auto 8px -1px;
    width: auto;
    height: 2px;
    border-radius: 2px 2px 0 0;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .nav-item .icon svg,
  .nav-item > svg.icon {
    width: 15px;
    height: 15px;
  }

  .main-content {
    max-width: none;
    padding: 14px 14px 36px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .topbar-center,
  .topbar-actions {
    grid-column: auto;
  }

  .topbar .auth-widget,
  .topbar .backend-widget {
    min-height: 50px;
  }

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

  .summary-grid .metric-card,
  .summary-grid .metric-card:nth-child(4),
  .summary-grid .metric-card:nth-child(5) {
    grid-column: auto;
  }

  .summary-grid .metric-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .overview-grid,
  .secondary-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .secondary-overview-grid > :last-child {
    grid-column: auto;
  }

  .panel {
    padding: 16px;
  }
}

@media (max-width: 620px) {
  body {
    background-image: none;
  }

  .sidebar {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .main-content {
    padding: 10px 10px 28px;
    gap: 12px;
  }

  .topbar {
    border-radius: 7px;
  }

  .topbar-title h1 {
    font-size: 21px;
  }

  .topbar-center {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .permission-banner {
    padding: 11px 12px;
  }

  .summary-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 108px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .panel {
    padding: 14px;
  }

  .panel-heading {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .panel-heading h2 {
    font-size: 17px;
  }

  .overview-viral-card {
    grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
    min-height: 220px;
  }

  .viral-play-surface {
    min-width: 0;
  }

  .overview-viral-info {
    padding: 13px;
  }

  .overview-viral-info h3 {
    font-size: 15px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .content-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .login-panel {
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Midnight operations console ===== */
:root {
  --bg: #061522;
  --panel: #0b2638;
  --panel-strong: #0d2d42;
  --ink: #f2f8ff;
  --muted: #91aabd;
  --line: rgba(90, 177, 218, 0.24);
  --line-strong: rgba(91, 194, 234, 0.48);
  --accent: #42a5e8;
  --accent-2: #45d6ad;
  --fox: #ff6b32;
  --danger: #ff6b60;
  --warning: #f0bd62;
  --good: #45d6ad;
  --sidebar: #071c2f;
  --soft-blue: rgba(66, 165, 232, 0.14);
  --soft-teal: rgba(69, 214, 173, 0.13);
  --soft-orange: rgba(255, 107, 50, 0.14);
  --shadow: 0 18px 42px rgba(0, 8, 18, 0.26);
}

html,
body {
  color-scheme: dark;
  background: var(--bg);
}

body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(63, 163, 208, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 163, 208, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 58% -12%, rgba(18, 113, 153, 0.22), transparent 38%);
  background-size: 32px 32px, 32px 32px, auto;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline-color: rgba(69, 214, 173, 0.38);
}

.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  gap: 18px;
  padding: 24px 16px 18px;
  color: #dceaf4;
  background:
    linear-gradient(rgba(69, 214, 173, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 214, 173, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #0a2b45 0%, #071c2f 50%, #061827 100%);
  background-size: 48px 48px, 48px 48px, auto;
  border-right-color: rgba(90, 177, 218, 0.24);
  box-shadow: 18px 0 42px rgba(0, 8, 18, 0.18);
}

.brand-lockup {
  padding-bottom: 18px;
  border-bottom-color: rgba(92, 181, 221, 0.22);
}

.brand-lockup .mark {
  border-color: rgba(100, 199, 236, 0.34);
  background: rgba(5, 26, 42, 0.72);
  box-shadow: 0 0 24px rgba(66, 165, 232, 0.12);
}

.brand-lockup strong { color: #f5fbff; }
.brand-lockup span { color: #7ea2ba; }

.nav-item {
  color: #aac1d1;
  border-color: transparent;
}

.nav-item:hover {
  color: #f5fbff;
  background: rgba(73, 167, 210, 0.09);
  border-color: rgba(87, 180, 221, 0.18);
}

.nav-item.active {
  color: #fff4ed;
  background: linear-gradient(90deg, rgba(255, 107, 50, 0.22), rgba(255, 107, 50, 0.09));
  border-color: rgba(255, 123, 69, 0.32);
  box-shadow: inset 0 0 22px rgba(255, 107, 50, 0.06);
}

.nav-item.active::before {
  background: var(--fox);
  box-shadow: 0 0 12px rgba(255, 107, 50, 0.72);
}

.sidebar-footer {
  border-color: rgba(87, 180, 221, 0.24);
  background: rgba(12, 45, 66, 0.68);
}

.sidebar-footer span { color: #7899af; }
.sidebar-footer strong { color: #eaf7ff; }

.main-content {
  max-width: 1760px;
  padding: 0 24px 44px;
  gap: 16px;
}

.topbar {
  position: relative;
  grid-template-columns: minmax(280px, 0.85fr) minmax(440px, 1.3fr) minmax(200px, 0.6fr);
  gap: 14px;
  min-height: 96px;
  padding: 16px 8px 14px;
  color: var(--ink);
  background: rgba(5, 24, 39, 0.76);
  border: 0;
  border-bottom: 1px solid rgba(75, 171, 216, 0.32);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.topbar::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(69, 214, 173, 0.7), rgba(66, 165, 232, 0.45), transparent);
  content: "";
  transform: translateX(-55%);
  animation: consoleScan 7s linear infinite;
}

@keyframes consoleScan {
  to { transform: translateX(55%); }
}

.module-kicker { display: none; }

.topbar-title {
  display: grid;
  align-content: center;
  min-width: 0;
}

.topbar-heading-line {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  color: #f6fbff;
  font-size: 27px;
  white-space: nowrap;
}

.current-date {
  padding-left: 16px;
  border-left: 1px solid rgba(123, 194, 225, 0.32);
  color: #8faabd;
  font-size: 12px;
  white-space: nowrap;
}

.signal-line {
  display: flex;
  width: 94px;
  height: 20px;
  margin: 5px 0 0 auto;
  align-items: center;
  gap: 3px;
  opacity: 0.92;
}

.signal-line i {
  width: 24px;
  height: 2px;
  border-radius: 0;
  background: #42a5e8;
  box-shadow: 0 0 9px rgba(66, 165, 232, 0.6);
  animation: signalPulse 1.8s ease-in-out infinite alternate;
}

.signal-line i:nth-child(2) {
  width: 36px;
  height: 4px;
  background: #45d6ad;
  animation-delay: -0.6s;
}

.signal-line i:nth-child(3) {
  width: 16px;
  height: 7px;
  background: #42a5e8;
  animation-delay: -1.1s;
}

@keyframes signalPulse {
  from { opacity: 0.42; transform: scaleY(0.6); }
  to { opacity: 1; transform: scaleY(1.2); }
}

.topbar-center {
  justify-content: flex-end;
  gap: 8px;
}

.topbar .auth-widget,
.topbar .backend-widget {
  min-height: 48px;
  color: var(--ink);
  background: rgba(11, 42, 61, 0.76);
  border-color: rgba(82, 177, 219, 0.28);
  box-shadow: inset 0 0 20px rgba(39, 139, 184, 0.04);
}

.topbar .auth-widget {
  flex: 0 1 260px;
}

.topbar .auth-badge {
  color: #dff8ef;
  background: rgba(69, 214, 173, 0.13);
}

.topbar .ding-login-btn,
.secondary-btn {
  color: #c4d9e6;
  background: rgba(8, 31, 47, 0.82);
  border-color: rgba(103, 181, 216, 0.32);
}

.topbar .backend-widget {
  position: relative;
  flex: 0 1 250px;
  padding-left: 30px;
}

.topbar .backend-widget::before {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(69, 214, 173, 0.09), 0 0 14px rgba(69, 214, 173, 0.65);
  content: "";
  transform: translateY(-50%);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  50% { opacity: 0.5; box-shadow: 0 0 0 9px rgba(69, 214, 173, 0); }
}

.topbar .backend-widget strong {
  color: #7ff1cc;
  background: transparent;
}

.topbar .backend-widget strong.offline { color: #ff8277; background: transparent; }
.topbar .backend-widget span { color: #7897ac; }

.topbar .primary-btn,
.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #ff7a3d, #e94f1c);
  border-color: #ff7a3d;
  box-shadow: 0 8px 22px rgba(255, 89, 31, 0.22), inset 0 1px rgba(255, 255, 255, 0.2);
}

.topbar .primary-btn:hover,
.primary-btn:hover {
  background: linear-gradient(135deg, #ff8a4f, #f05c25);
  box-shadow: 0 10px 28px rgba(255, 89, 31, 0.3);
}

.page-section.active {
  gap: 14px;
  animation: midnightEnter 240ms ease-out both;
}

@keyframes midnightEnter {
  from { transform: translateY(5px); }
  to { transform: translateY(0); }
}

.page-section[data-page="overview"].active {
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 0.72fr);
  align-items: stretch;
}

.page-section[data-page="overview"] > .summary-grid,
.page-section[data-page="overview"] > .secondary-overview-grid {
  grid-column: 1 / -1;
}

.page-section[data-page="overview"] > .overview-viral-panel {
  grid-column: 1;
  grid-row: 2;
}

.page-section[data-page="overview"] > .overview-grid:not(.secondary-overview-grid) {
  display: contents;
}

.page-section[data-page="overview"] .overview-hero-panel {
  grid-column: 1;
  grid-row: 3;
}

.page-section[data-page="overview"] .overview-side-column {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.page-section[data-page="overview"] > .secondary-overview-grid {
  grid-row: 4;
}

.summary-grid {
  counter-reset: console-metric;
  gap: 10px;
}

.summary-grid > .overview-snapshot-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 14px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.metric-card,
.panel {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(17, 54, 77, 0.94), rgba(8, 34, 51, 0.95)),
    var(--panel);
  border-color: var(--line);
  box-shadow: inset 0 1px rgba(162, 222, 247, 0.035), 0 12px 34px rgba(0, 7, 15, 0.16);
}

.metric-card {
  counter-increment: console-metric;
  min-height: 142px;
  padding: 20px 18px 16px 72px;
  overflow: hidden;
}

.metric-card::before {
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(66, 165, 232, 0.7);
}

.metric-card:nth-child(2)::before,
.metric-card:nth-child(3)::before { background: var(--accent-2); }
.metric-card:nth-child(4)::before { background: var(--accent); }
.metric-card:nth-child(5)::before { background: var(--fox); }

.metric-card::after {
  display: none;
}

.metric-card:hover,
.panel:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 1px rgba(162, 222, 247, 0.05), 0 16px 38px rgba(0, 7, 15, 0.24);
}

.metric-symbol {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid rgba(81, 183, 228, 0.35);
  border-radius: 50%;
  color: #79c9f1;
  background: rgba(66, 165, 232, 0.12);
  box-sizing: border-box;
}

.metric-card:nth-child(3) .metric-symbol { color: #69e4ba; background: rgba(69, 214, 173, 0.13); }
.metric-card:nth-child(5) .metric-symbol { color: #ff8a5d; background: rgba(255, 107, 50, 0.13); }

.metric-card span,
.metric-card small { color: #9bb2c2; }

.metric-card > span,
.metric-card > strong,
.metric-card > small {
  position: relative;
  z-index: 1;
}

.metric-card > span {
  box-sizing: border-box;
  width: 100%;
  padding-right: 0;
  white-space: nowrap;
}

.metric-card > small {
  width: 100%;
  white-space: nowrap;
}

.metric-card strong {
  margin: 14px 0 9px;
  color: #f7fbff;
  font-size: clamp(32px, 2.5vw, 44px);
  text-shadow: 0 0 22px rgba(118, 203, 244, 0.08);
}

.metric-card small.up { color: #5ee2b6; }
.metric-card small.down { color: #ff8177; }

.panel {
  padding: 20px;
  overflow: hidden;
}

.panel-heading {
  position: relative;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(93, 173, 210, 0.22);
}

.panel-heading::before {
  position: absolute;
  left: -20px;
  top: 0;
  width: 3px;
  height: 30px;
  background: var(--fox);
  box-shadow: 0 0 12px rgba(255, 107, 50, 0.55);
  content: "";
}

.panel-heading h2,
.brand-detail-title h2,
.brand-detail-section h3 {
  color: #f4f9fc;
}

.eyebrow { color: #67c9ee; }

.pill-tabs span {
  color: #9bb5c7;
  background: rgba(8, 30, 46, 0.74);
  border-color: rgba(92, 177, 217, 0.28);
}

.overview-viral-spotlight,
.overview-viral-spotlight:has(.overview-viral-card:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.overview-viral-card {
  grid-template-columns: minmax(220px, 39%) minmax(0, 1fr);
  min-height: 190px;
  color: var(--ink);
  background: rgba(6, 27, 42, 0.62);
  border-color: rgba(83, 176, 218, 0.28);
}

.overview-viral-card:hover {
  border-color: rgba(85, 210, 220, 0.48);
  box-shadow: 0 16px 36px rgba(0, 6, 14, 0.34), inset 0 0 28px rgba(66, 165, 232, 0.04);
}

.viral-play-surface {
  min-width: 220px;
  background: #061722;
}

.viral-play-surface::after {
  background: linear-gradient(180deg, rgba(4, 17, 26, 0.06), rgba(4, 17, 26, 0.48));
}

.overview-viral-info h3 { color: #f4f9fc; }
.overview-viral-info p { color: #90a9ba; }

.viral-filter-bar {
  background:
    linear-gradient(135deg, rgba(66, 165, 232, 0.1), transparent 42%),
    linear-gradient(90deg, rgba(12, 46, 66, 0.86), rgba(6, 27, 42, 0.78));
  border-color: rgba(91, 181, 220, 0.26);
}

.viral-time-tabs {
  background: rgba(5, 25, 39, 0.9);
  border-color: rgba(91, 181, 220, 0.28);
}

.viral-card {
  color: var(--ink);
  background: rgba(6, 27, 42, 0.88);
  border-color: rgba(83, 176, 218, 0.28);
  box-shadow: inset 0 1px rgba(190, 232, 249, 0.025);
}

.viral-card:hover {
  border-color: rgba(85, 210, 220, 0.48);
  box-shadow: 0 14px 30px rgba(0, 6, 14, 0.28), inset 0 0 24px rgba(66, 165, 232, 0.035);
}

.viral-body {
  color: var(--ink);
  background: rgba(6, 27, 42, 0.88);
}

.viral-body h3 { color: #f4f9fc; }
.viral-meta { color: #70c9f0; }

.viral-stats span {
  color: #a8c3d4;
  background: rgba(32, 75, 99, 0.72);
  border: 1px solid rgba(91, 181, 220, 0.16);
}

.viral-body p { color: #91aabb; }

.viral-empty-state {
  color: #9db5c5;
  background: rgba(6, 27, 42, 0.78);
  border-color: rgba(91, 181, 220, 0.26);
}

.overview-rank-row,
.overview-focus-item {
  color: var(--ink);
  background: rgba(5, 25, 39, 0.45);
  border-color: transparent;
  border-bottom-color: rgba(90, 170, 207, 0.23);
}

.overview-rank-row:hover,
.overview-focus-item:hover,
.overview-score-row:hover,
.overview-mini-row:hover {
  color: var(--ink);
  background: rgba(34, 93, 120, 0.16);
  border-color: rgba(88, 188, 220, 0.28);
}

.rank-index {
  color: #dff5ff;
  background: rgba(66, 165, 232, 0.16);
  border: 1px solid rgba(83, 186, 229, 0.48);
}

.overview-rank-row.risk .rank-index {
  color: #ffd7c8;
  background: rgba(255, 107, 50, 0.15);
  border-color: rgba(255, 124, 71, 0.44);
}

.rank-bar { background: rgba(130, 176, 199, 0.17); }

.rank-bar i {
  background: linear-gradient(90deg, #45d6ad, #5fafd7);
  box-shadow: 0 0 12px rgba(69, 214, 173, 0.28);
}

.rank-title span,
.rank-meta span,
.overview-mini-row span,
.overview-focus-item p,
.overview-score-person span,
.overview-score-value span { color: #8fa8b9; }

.overview-focus-item > span {
  color: #70e3bd;
  background: rgba(69, 214, 173, 0.12);
  border: 1px solid rgba(69, 214, 173, 0.24);
}

.overview-focus-item:nth-child(3) > span {
  color: #ff8b73;
  background: rgba(255, 107, 80, 0.12);
  border-color: rgba(255, 107, 80, 0.24);
}

.overview-score-row,
.overview-mini-row { border-color: rgba(90, 170, 207, 0.2); }

.score-rank,
.overview-score-row:nth-child(-n + 3) .score-rank {
  color: #8cd7f7;
  background: rgba(66, 165, 232, 0.13);
  border: 1px solid rgba(66, 165, 232, 0.3);
}

.platform-score.good { color: #73e8c0; background: rgba(69, 214, 173, 0.12); }
.platform-score.risk { color: #f4ca7e; background: rgba(240, 189, 98, 0.13); }

.secondary-btn:hover {
  color: #e4f5ff;
  background: rgba(33, 94, 122, 0.28);
  border-color: rgba(103, 202, 234, 0.52);
}

.table-wrap,
.detail-table-wrap,
.collaboration-batch-preview,
.brand-detail-section,
.brand-detail-product,
.brand-maintenance-card,
.brand-product-item,
.sales-brand-group,
.sales-metrics article,
.product-dashboard-metrics > div {
  color: var(--ink);
  background: rgba(6, 27, 42, 0.74);
  border-color: var(--line);
}

table th,
.sales-product-table th,
.sales-mapping-table th {
  color: #8eabbf;
  background: rgba(13, 47, 68, 0.9);
  border-color: rgba(90, 170, 207, 0.22);
}

table td,
.sales-product-table td,
.sales-mapping-table td {
  color: #c9dbe7;
  border-color: rgba(87, 164, 199, 0.18);
}

table tbody tr:hover { background: rgba(37, 103, 132, 0.16); }

.product-period-cell,
.product-dashboard-daily-table td:first-child,
.product-dashboard-daily-table td:nth-child(2) {
  color: #c9dbe7;
  background: rgba(6, 27, 42, 0.96);
}

.product-period-cell.selected {
  background: rgba(23, 75, 102, 0.78);
  box-shadow: inset 3px 0 0 var(--accent);
}

.product-dashboard-period-tabs {
  background: rgba(5, 25, 39, 0.9);
  border-color: rgba(91, 181, 220, 0.3);
}

.product-dashboard-daily-table th:first-child,
.product-dashboard-daily-table th:nth-child(2),
.product-dashboard-daily-table thead th:first-child,
.product-dashboard-daily-table thead th:nth-child(2) {
  color: #9db8c9;
  background: rgba(13, 47, 68, 0.98);
}

.product-day-count.has-content {
  color: #eaf7ff;
  background: rgba(34, 113, 129, 0.28);
  border-color: rgba(69, 214, 173, 0.34);
}

.progress {
  background: rgba(112, 162, 190, 0.2);
}

.viral-meta-line span,
.viral-stats span,
.team-viral-link span,
.ding-alert-meta span {
  color: #9edcff;
  background: rgba(66, 165, 232, 0.12);
  border-color: rgba(66, 165, 232, 0.24);
}

.brand-viral-item,
.entry-page-form,
.entry-help,
.auth-bind-status,
.viral-time-tabs,
.viral-empty-state,
.sync-log-summary,
.sync-log-toolbar,
.sync-log-run,
.sync-log-detail-placeholder,
.sync-log-empty,
.ding-config,
.intake-empty,
.base-comment-card,
.base-comment-message,
.brand-product-item,
.owner-chip,
.platform-status-card,
.team-viral-link {
  color: var(--ink);
  background: rgba(6, 27, 42, 0.86);
  border-color: rgba(91, 181, 220, 0.24);
}

.brand-viral-score,
.grade-S {
  color: #ffb08b;
  background: rgba(255, 107, 50, 0.15);
  border-color: rgba(255, 107, 50, 0.28);
}

.brand-viral-actions a {
  color: #a8ddff;
  background: rgba(66, 165, 232, 0.12);
  border-color: rgba(66, 165, 232, 0.28);
}

.text-btn,
.owner-chip button,
.owner-chip .supervisor-toggle {
  color: #b8e5fb;
  background: rgba(7, 29, 44, 0.92);
  border-color: rgba(91, 181, 220, 0.3);
}

.text-btn:hover,
.owner-chip button:hover,
.owner-chip .supervisor-toggle:hover {
  color: #f2fbff;
  background: rgba(37, 103, 132, 0.34);
}

.text-btn.danger,
.owner-chip .supervisor-toggle.danger {
  color: #ff9991;
  border-color: rgba(255, 107, 96, 0.34);
}

.auth-bind-status.success {
  color: #73e8c0;
  background: rgba(69, 214, 173, 0.1);
  border-color: rgba(69, 214, 173, 0.28);
}

.auth-bind-status.failed {
  color: #ff9991;
  background: rgba(255, 107, 96, 0.1);
  border-color: rgba(255, 107, 96, 0.28);
}

.platform-status-card b,
.platform-empty,
.pending-data-label,
.viral-link-empty {
  color: #a9c4d5;
  background: rgba(113, 151, 174, 0.13);
}

.platform-status-card.good,
.platform-status-chip.good,
.status.good,
.grade-A {
  color: #73e8c0;
  background: rgba(69, 214, 173, 0.11);
  border-color: rgba(69, 214, 173, 0.28);
}

.platform-status-card.warning,
.platform-status-chip.warning,
.status.warning,
.grade-C {
  color: #f4ca7e;
  background: rgba(240, 189, 98, 0.11);
  border-color: rgba(240, 189, 98, 0.28);
}

.platform-status-card.danger,
.platform-status-chip.danger,
.status.danger,
.grade-D {
  color: #ff9991;
  background: rgba(255, 107, 96, 0.11);
  border-color: rgba(255, 107, 96, 0.28);
}

.platform-status-card.pending,
.platform-status-chip.pending,
.status.pending,
.grade-待同步 {
  color: #9db5c5;
  background: rgba(113, 151, 174, 0.12);
  border-color: rgba(113, 151, 174, 0.24);
}

.grade-B {
  color: #9edcff;
  background: rgba(66, 165, 232, 0.12);
}

.sync-log-toolbar select,
.sync-log-run[open] > summary,
.sync-log-items th {
  color: #dcecf5;
  background: rgba(13, 47, 68, 0.94);
  border-color: rgba(91, 181, 220, 0.24);
}

.sync-log-state,
.sync-log-item-state {
  color: #a9c4d5;
  background: rgba(113, 151, 174, 0.13);
}

.sync-log-state.success,
.sync-log-item-state.success {
  color: #73e8c0;
  background: rgba(69, 214, 173, 0.12);
}

.sync-log-state.partial { color: #f4ca7e; background: rgba(240, 189, 98, 0.12); }
.sync-log-state.failed,
.sync-log-item-state.failed { color: #ff9991; background: rgba(255, 107, 96, 0.12); }
.sync-log-state.running { color: #9edcff; background: rgba(66, 165, 232, 0.12); }

.sync-log-detail-placeholder.error,
.sync-log-empty.error {
  color: #ff9991;
  background: rgba(255, 107, 96, 0.08);
  border-color: rgba(255, 107, 96, 0.3);
}

.ding-alert-card,
.base-comment-card.pending,
.base-comment-card.missed,
.base-comment-card.passed {
  color: var(--ink);
  background: rgba(8, 34, 50, 0.9);
}

.ding-alert-card,
.base-comment-card.pending { border-color: rgba(240, 189, 98, 0.3); }
.ding-alert-card.sent,
.base-comment-card.passed { border-color: rgba(69, 214, 173, 0.3); }
.base-comment-card.missed { border-color: rgba(255, 107, 96, 0.3); }

.base-comment-message {
  background: rgba(3, 18, 30, 0.56);
  border-color: rgba(107, 167, 195, 0.28);
}

input,
select,
textarea,
.manual-viral-form input,
.manual-viral-form input[readonly],
.manual-viral-form select,
.manual-viral-form textarea,
.binding-transfer-form select,
.account-edit-form input:not([type="checkbox"]),
.account-edit-home-url textarea,
.collaboration-records-tools select,
.collaboration-form input,
.collaboration-form select,
.collaboration-form textarea,
.sales-mapping-table select {
  color: #e8f5fb;
  background: rgba(5, 25, 39, 0.92);
  border-color: rgba(91, 181, 220, 0.34);
}

.manual-viral-form input:focus,
.manual-viral-form select:focus,
.manual-viral-form textarea:focus,
.binding-transfer-form select:focus,
.account-edit-form input:not([type="checkbox"]):focus,
.account-edit-home-url textarea:focus {
  border-color: rgba(101, 207, 231, 0.82);
  box-shadow: 0 0 0 3px rgba(66, 165, 232, 0.12), inset 0 1px rgba(190, 232, 249, 0.04);
  outline: none;
}

.manual-viral-form input[readonly] {
  color: #a9c4d5;
  background: rgba(10, 37, 54, 0.72);
}

.manual-viral-form select option,
.binding-transfer-form select option,
.brand-manager-tools select option {
  color: #e8f5fb;
  background: #0a2639;
}

.brand-manager-bound strong {
  color: #dff4ff;
  background: rgba(8, 31, 47, 0.92);
  border-color: rgba(91, 181, 220, 0.34);
  box-shadow: inset 0 1px rgba(190, 232, 249, 0.04);
}

input::placeholder,
textarea::placeholder { color: #6f8ba0; }

input:hover,
select:hover,
textarea:hover { border-color: rgba(101, 207, 231, 0.62); }

.filter-tab,
.segmented-control,
.segmented-control button,
.collaboration-modes,
.collaboration-modes button {
  color: #9db5c5;
  background: rgba(5, 25, 39, 0.86);
  border-color: rgba(91, 181, 220, 0.28);
}

.filter-tab.active,
.segmented-control button.active,
.collaboration-modes button[aria-pressed="true"] {
  color: #eafff9;
  background: rgba(25, 135, 136, 0.58);
  box-shadow: inset 0 0 18px rgba(69, 214, 173, 0.12);
}

.sales-sync-status {
  color: #a8c3d2;
  background: rgba(69, 214, 173, 0.08);
  border-color: var(--accent-2);
}

.sales-sync-status.loading { background: rgba(66, 165, 232, 0.1); border-color: var(--accent); }
.sales-sync-status.warning { color: #efcb8d; background: rgba(240, 189, 98, 0.1); border-color: var(--warning); }
.sales-sync-status.error { color: #ff9991; background: rgba(255, 107, 96, 0.1); border-color: var(--danger); }

.sales-brand-group > header,
.sales-product-table th,
.sales-mapping-table th { background: rgba(12, 45, 65, 0.9); }

.sales-brand-group > header h3,
.sales-brand-total strong,
.sales-metrics strong { color: #f1f8fc; }

.sales-platforms,
.sales-brand-group > header { border-color: rgba(88, 167, 204, 0.22); }
.sales-platforms span { color: #a8c0cf; border-color: rgba(88, 167, 204, 0.24); }
.sales-platforms b { color: #69daba; }

.brand-detail-heading {
  padding: 16px 18px;
  background: rgba(10, 38, 56, 0.8);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.brand-detail-metrics {
  background: rgba(7, 29, 44, 0.78);
  border: 1px solid var(--line);
}

.brand-detail-metrics > div { border-color: rgba(91, 174, 211, 0.2); }
.brand-detail-metrics span { color: #8ba7b9; }
.brand-detail-metrics strong { color: #f4f9fc; }

.brand-owner-contribution { border-color: rgba(91, 174, 211, 0.2); }
.brand-owner-contribution span,
.brand-owner-contribution b,
.brand-detail-product header p { color: #9ab2c1; }

.modal-backdrop {
  z-index: 100;
  background: rgba(1, 8, 15, 0.78);
  backdrop-filter: blur(9px);
}

.content-modal {
  color: var(--ink);
  background: #0a2639;
  border-color: rgba(89, 186, 226, 0.34);
  box-shadow: 0 30px 90px rgba(0, 3, 9, 0.56);
}

.content-modal .detail-card {
  color: #dcecf5;
  background: rgba(7, 29, 44, 0.88);
  border-color: rgba(91, 181, 220, 0.28);
  box-shadow: inset 0 1px rgba(190, 232, 249, 0.035);
}

.content-modal .detail-card span { color: #8faabd; }
.content-modal .detail-card strong { color: #f1f8fc; }

.content-modal .employee-block-meta > span,
.content-modal .account-type-summary span {
  color: #a9c1d0;
  background: rgba(17, 53, 75, 0.9);
  border: 1px solid rgba(91, 181, 220, 0.2);
}

.content-modal .platform-status-card {
  color: #d9eaf3;
  background: rgba(10, 36, 53, 0.9);
  border-color: rgba(91, 181, 220, 0.28);
}

.content-modal .employee-account-table tbody tr.account-row-disabled,
.content-modal .employee-account-table tbody tr.account-row-disabled:hover,
.content-modal .employee-account-table tbody tr.account-row-disabled > td {
  color: #7793a6;
  background: rgba(10, 31, 46, 0.94);
}

.content-modal .employee-account-table tbody tr.account-row-disabled strong {
  color: #90aabd;
}

.close-btn {
  color: #d8edf8;
  background: rgba(7, 29, 44, 0.9);
  border-color: rgba(95, 183, 222, 0.3);
}

.close-btn:hover { background: rgba(32, 91, 117, 0.58); }

.toast-message {
  color: #e9f7fd;
  background: #0e3348;
  border-color: rgba(95, 195, 226, 0.38);
  box-shadow: 0 18px 44px rgba(0, 5, 12, 0.48);
}

@media (max-width: 1180px) {
  .page-section[data-page="overview"].active {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-section[data-page="overview"] > .summary-grid,
  .page-section[data-page="overview"] > .overview-viral-panel,
  .page-section[data-page="overview"] > .overview-grid:not(.secondary-overview-grid),
  .page-section[data-page="overview"] > .secondary-overview-grid {
    grid-column: 1;
    grid-row: auto;
  }

  .page-section[data-page="overview"] > .overview-grid:not(.secondary-overview-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-section[data-page="overview"] .overview-hero-panel,
  .page-section[data-page="overview"] .overview-side-column {
    grid-column: auto;
    grid-row: auto;
  }

  .topbar {
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    background: rgba(5, 24, 39, 0.97);
    border-bottom-color: rgba(90, 177, 218, 0.24);
    box-shadow: 0 10px 30px rgba(0, 7, 14, 0.28);
  }

  .main-content { padding: 0 14px 34px; }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 4px;
  }

  .topbar-heading-line { flex-wrap: wrap; gap: 8px 12px; }
  .topbar-title h1 { font-size: 23px; }
  .signal-line { display: none; }

  .page-section[data-page="overview"] > .overview-grid:not(.secondary-overview-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  body {
    background-image:
      linear-gradient(rgba(63, 163, 208, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(63, 163, 208, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
  }

  .summary-grid { gap: 8px; }

  .metric-card {
    min-height: 122px;
    padding: 14px 10px 12px 48px;
  }

  .metric-symbol {
    left: 12px;
    top: 14px;
    width: 28px;
    height: 28px;
    padding: 6px;
  }

  .metric-card::after {
    display: none;
  }

  .metric-card > small { width: 100%; }

  .metric-card strong { font-size: 29px; }
  .panel { padding: 14px; }
  .panel-heading::before { left: -14px; }

  .overview-viral-card {
    grid-template-columns: minmax(104px, 36%) minmax(0, 1fr);
  }

  .viral-play-surface { min-width: 0; }
}

.competitor-panel { min-width: 0; }
.competitor-heading { align-items: flex-start; }
.competitor-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 24px 24px;
}
.competitor-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.competitor-form input,
.competitor-form select,
.competitor-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(91, 181, 220, 0.34);
  border-radius: 6px;
  padding: 12px;
  color: #e8f5fb;
  background: rgba(5, 25, 39, 0.92);
  font: inherit;
}
.competitor-form textarea { resize: vertical; }
.competitor-url { grid-column: span 2; }
.competitor-status {
  grid-column: span 2;
  align-self: center;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.competitor-records-heading { flex-wrap: wrap; gap: 16px; }
.competitor-count { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.competitor-table { min-width: 1160px; width: 100%; table-layout: fixed; }
.competitor-table th:nth-child(1) { width: 13%; }
.competitor-table th:nth-child(2) { width: 13%; }
.competitor-table th:nth-child(4) { width: 20%; }
.competitor-table th:nth-child(6) { width: 13%; }
.competitor-table th:nth-child(9) { width: 120px; }
.competitor-table td { vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.competitor-table td > small { display: block; margin-top: 5px; color: var(--muted); }
.competitor-table a { color: #8bcfff; }
.competitor-work-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 3em;
  line-height: 1.5;
}
.competitor-error { display: block; margin-top: 6px; color: #ff9991; }
.competitor-actions { display: flex; align-items: center; gap: 6px; }
.competitor-actions .text-btn { white-space: nowrap; }

.overview-side-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.overview-side-column > .panel { min-width: 0; margin: 0; }
.overview-side-column > .overview-focus-panel { flex: 0 0 auto; }
.douyin-hot-panel { flex: 1 0 auto; padding: 22px; }
.douyin-hot-panel .panel-heading { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 18px; }
.douyin-hot-panel h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.douyin-hot-panel h2 svg { width: 20px; height: 20px; color: #ff915a; flex: none; }
.hot-refresh {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 6px;
}
.hot-refresh svg { width: 17px; height: 17px; }
.hot-refresh.is-loading svg { animation: hotRefreshSpin 1s linear infinite; }
@keyframes hotRefreshSpin { to { transform: rotate(360deg); } }
.douyin-hot-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.hot-mode-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 22px; }
.hot-mode-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 0 10px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.hot-mode-tabs button[aria-pressed="true"] { color: #7fe0c1; border-bottom-color: #6cdbb8; }
.douyin-hot-controls select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #102635;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  color-scheme: dark;
}
.douyin-hot-controls select:disabled { opacity: 0.5; }
.douyin-hot-controls select option { background: #102635; color: #e9f4fa; }
.douyin-hot-status { margin: 14px 0 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.douyin-hot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 690px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3e6072 transparent;
}
.douyin-hot-row { border-bottom: 1px solid var(--line); }
.douyin-hot-row:last-child { border-bottom: 0; }
.douyin-hot-row a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: start;
  padding: 15px 2px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 160ms ease;
}
.douyin-hot-row a:hover { background: rgba(89, 173, 209, 0.07); }
.douyin-hot-row a:focus-visible,
.hot-mode-tabs button:focus-visible,
.hot-refresh:focus-visible { outline: 2px solid #7fe0c1; outline-offset: 2px; }
.hot-topic-index { padding-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.douyin-hot-row:nth-child(-n+3) .hot-topic-index { color: #ffb280; }
.hot-topic-content { display: grid; gap: 6px; min-width: 0; }
.hot-topic-content strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}
.hot-topic-source { font-size: 11px; line-height: 1.5; color: var(--muted); }
.hot-topic-match { color: #80cdb8; font-size: 11px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-topic-heat { padding-top: 2px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: #f1bc86; }
.hot-topic-heat small { display: block; margin-top: 6px; font-size: 10px; color: var(--muted); }
.hot-topic-empty { padding: 30px 8px; color: var(--muted); font-size: 13px; line-height: 1.8; text-align: center; }
@media (max-width: 760px) {
  .douyin-hot-panel { padding: 18px; }
  .douyin-hot-panel h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .hot-refresh.is-loading svg { animation: none; }
  .douyin-hot-row a { transition: none; }
}

@media (max-width: 760px) {
  .competitor-form { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .competitor-url,
  .competitor-status { grid-column: auto; }
  .competitor-heading .pill-tabs { width: 100%; }
}

