:root {
  color-scheme: dark;
  --bg: #111426;
  --panel: #22263b;
  --panel-strong: #2a2d47;
  --line: rgba(154, 166, 255, 0.22);
  --line-hot: rgba(106, 126, 255, 0.62);
  --text: #f5f7ff;
  --muted: #9ba2bd;
  --accent: #ffd25a;
  --green: #16d97e;
  --red: #ff646a;
  --cyan: #7be7d4;
  --button: #555b76;
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #202544 0, #111426 42%, #0e1020 100%);
  color: var(--text);
}

button,
textarea,
input,
select {
  font: inherit;
}

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

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 168px;
}

.hidden {
  display: none !important;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.login-view {
  min-height: calc(100vh - 96px);
  display: grid;
  place-items: center;
}

.login-card,
.admin-panel {
  background: rgba(38, 42, 64, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.login-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 13px 14px;
  line-height: 1.5;
}

select {
  color: var(--text);
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.eyebrow,
.subtitle,
.section-head p,
#updatedAt {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  font-size: 14px;
  margin-bottom: 10px;
}

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

h1 {
  font-size: clamp(34px, 5vw, 56px);
  color: #b9f1d0;
}

h2 {
  font-size: 28px;
}

.flame {
  color: var(--accent);
}

.subtitle {
  font-size: 18px;
  margin-top: 12px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  min-height: 46px;
  padding: 0 20px;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.link-button {
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, #59617e, #39415d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
}

.summary-band,
.topic-panel,
.platform-card {
  background: rgba(38, 42, 64, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.summary-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 24px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.status-label {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-weight: 700;
}

.pill.ok strong {
  color: var(--green);
}

.pill.failed strong {
  color: var(--red);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.stats {
  display: flex;
  gap: 36px;
  text-align: center;
}

.stats strong {
  display: block;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 14px;
}

.topic-panel {
  border-color: var(--line-hot);
  background: linear-gradient(135deg, rgba(55, 65, 119, 0.92), rgba(50, 38, 86, 0.92));
  margin-top: 24px;
  padding: 28px;
}

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

.section-head.compact {
  margin-bottom: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 132px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.topic-card:hover,
.hot-item:hover {
  border-color: rgba(255, 210, 90, 0.45);
}

.topic-source {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.topic-title {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.heat {
  color: var(--accent);
  font-weight: 800;
}

.board-section {
  margin-top: 28px;
}

.admin-panel {
  margin-top: 24px;
  padding: 28px;
}

.user-table {
  overflow-x: auto;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 100px 90px 180px minmax(220px, 1.4fr) 150px;
  gap: 14px;
  align-items: center;
  min-width: 920px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-head {
  color: var(--muted);
  font-weight: 900;
}

.success {
  color: var(--green);
  font-weight: 900;
}

.danger {
  color: var(--red);
  font-weight: 900;
}

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

.small {
  min-height: 34px;
  padding: 0 12px;
}

.danger-button {
  border-color: rgba(255, 100, 106, 0.28);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.platform-card {
  min-height: 620px;
  padding: 22px;
}

.platform-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

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

.platform-title strong {
  font-size: 24px;
}

.platform-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}

.state {
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
}

.state.ok {
  background: rgba(22, 217, 126, 0.18);
  color: var(--green);
}

.state.failed {
  background: rgba(255, 100, 106, 0.14);
  color: var(--red);
}

.hot-list {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.hot-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rank {
  color: var(--accent);
  font-weight: 900;
  font-size: 20px;
}

.rank.top {
  color: var(--red);
}

.hot-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.error-box,
.empty-box {
  margin-top: 48px;
  padding: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--red);
  text-align: center;
  font-weight: 800;
}

.empty-box {
  color: var(--muted);
}

.keyword-dialog {
  width: min(560px, calc(100% - 32px));
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.keyword-dialog::backdrop {
  background: rgba(5, 7, 14, 0.72);
}

.dialog-card {
  padding: 24px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}

textarea {
  resize: vertical;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 1180px) {
  .related-grid,
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 760px);
    padding-top: 24px;
  }

  .hero,
  .summary-band,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .section-head {
    display: flex;
  }

  .summary-band {
    display: flex;
  }

  .status-row,
  .stats {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    gap: 18px;
    text-align: left;
  }

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

  .hero-actions button {
    flex: 1 1 120px;
  }

  .related-grid,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .platform-card {
    min-height: auto;
  }

  .hot-item {
    grid-template-columns: 34px 1fr;
  }

  .hot-item .heat {
    grid-column: 2;
  }
}
