:root {
  --ink: #172033;
  --muted: #718096;
  --line: #e7ecf3;
  --paper: #ffffff;
  --wash: #f5f8fc;
  --blue: #3489d8;
  --blue-deep: #1d6fb9;
  --mint: #36b99a;
  --danger: #e25764;
  --shadow: 0 18px 50px rgba(37, 67, 101, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(93, 174, 238, .18), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(83, 207, 175, .13), transparent 24rem),
    var(--wash);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 10px;
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 460px;
}

.language-switcher button {
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.language-switcher button:hover,
.language-switcher button.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, .9);
  color: var(--blue-deep);
}

.hero-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.release-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(23, 32, 51, .16);
  transition: transform .16s ease, background .16s ease;
}

.release-link:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

.release-link:focus-visible {
  outline: 3px solid rgba(52, 137, 216, .42);
  outline-offset: 3px;
}

.release-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

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

.brand img {
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(34, 111, 177, .22);
}

.eyebrow, .section-kicker {
  margin: 0 0 6px;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 24px; letter-spacing: -.02em; }
.subtitle { margin-bottom: 0; color: var(--muted); }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(38, 63, 91, .07);
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f2ad4f;
  box-shadow: 0 0 0 4px rgba(242, 173, 79, .14);
}

.connection.live .connection-dot {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(54, 185, 154, .14);
}

.connection.offline .connection-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(226, 87, 100, .14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.page-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .82);
}

.page-tab {
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.page-tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 7px 18px rgba(23, 32, 51, .18);
}

.page-view[hidden] { display: none; }
.ranking-note { margin: 0; color: var(--muted); font-size: 12px; }
.rank { color: #93a0b2; font-weight: 800; }
.keyword { color: var(--blue-deep); }
.ranking-number {
  display: inline-flex;
  min-width: 42px;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(220, 229, 240, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.metric-card.accent::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -35px;
  top: -42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(52, 137, 216, .22), rgba(54, 185, 154, .15));
}

.metric-label, .metric-note { display: block; }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-card strong {
  display: block;
  margin: 9px 0 7px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.035em;
}
.metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric-pair strong {
  margin-bottom: 5px;
  font-size: 28px;
}
.metric-note { color: #9aa6b6; font-size: 12px; }

.panel {
  overflow: hidden;
  border: 1px solid rgba(220, 229, 240, .95);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.analytics-section + .analytics-section {
  border-top: 1px solid var(--line);
}

.analytics-table {
  min-height: 180px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(310px, 100%);
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}

.search:focus-within {
  border-color: rgba(52, 137, 216, .7);
  box-shadow: 0 0 0 3px rgba(52, 137, 216, .11);
}

.search svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.table-wrap { position: relative; min-height: 330px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; vertical-align: middle; }
th {
  color: #8a96a8;
  background: #fbfcfe;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
tbody tr { border-top: 1px solid var(--line); transition: background .16s ease; }
tbody tr:hover { background: #f8fbfe; }

.account { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, #dff1ff, #dff8f2);
  color: var(--blue-deep);
  font-weight: 800;
}
.avatar::before { content: attr(data-initial); }
.display-name, .username { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display-name { font-size: 13px; }
.username { margin-top: 3px; color: var(--muted); font-size: 11px; }
.reason {
  display: inline-block;
  max-width: 250px;
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf6ff;
  color: var(--blue-deep);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content {
  display: block;
  max-width: 340px;
  overflow: hidden;
  color: #5f6d80;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blocked-at { color: var(--muted); font-size: 12px; white-space: nowrap; }

.empty {
  position: absolute;
  inset: 54px 0 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.empty[hidden] { display: none; }
.empty-icon { margin-bottom: 10px; font-size: 36px; }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.empty p { font-size: 13px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pager button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-deep); }
.pager button:disabled { cursor: not-allowed; opacity: .42; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(18, 125, 199, .22);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), var(--blue-deep));
  color: #fff;
  box-shadow: 0 10px 28px rgba(26, 140, 216, .28);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(26, 140, 216, .34); }
.back-to-top:focus-visible { outline: 3px solid rgba(29, 155, 240, .28); outline-offset: 3px; }
.back-to-top svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 780px) {
  .shell { width: min(100% - 24px, 1240px); padding-top: 24px; }
  .hero, .toolbar { align-items: stretch; flex-direction: column; }
  .hero-actions { align-items: stretch; }
  .language-switcher { justify-content: flex-start; }
  .hero-status-row { justify-content: flex-start; }
  .metrics { grid-template-columns: 1fr; }
  .connection { align-self: flex-start; }
  .search { width: 100%; }
  .ban-table th:nth-child(3), .ban-table td:nth-child(3) { display: none; }
  .back-to-top { right: 14px; bottom: 16px; }
}
