:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f0f2f5;
  --ink: #151821;
  --muted: #667085;
  --line: #d9dde5;
  --accent: #0f6dff;
  --accent-soft: #eaf2ff;
  --accent-strong: #0b57d0;
  --accent-hover: #0847b8;
  --focus-ring: rgba(15, 109, 255, 0.28);
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(15, 24, 40, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(15, 109, 255, 0.1) 49%, transparent 56%),
    #f7f9fc;
  overflow: hidden;
  animation: introFade 1.4s ease forwards;
}

.intro-screen.skip,
.intro-screen.done {
  display: none;
}

.intro-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(100deg, transparent 35%, rgba(15, 109, 255, 0.18), transparent 65%);
  transform: translateX(-55%);
  animation: introSweep 1.1s ease-out forwards;
}

.intro-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--ink);
  text-align: center;
  animation: introRise 1s ease-out forwards;
}

.intro-mark {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 109, 255, 0.22);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  filter: blur(5px);
  animation: introFocus 0.8s ease-out forwards;
}

.intro-name {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
}

.intro-copy {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

@keyframes introFocus {
  to {
    filter: blur(0);
  }
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  35%,
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introSweep {
  to {
    transform: translateX(55%);
  }
}

@keyframes introFade {
  0%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-screen {
    display: none;
  }

  .intro-screen,
  .intro-screen::before,
  .intro-card,
  .intro-mark {
    animation: none;
  }
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(245, 245, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark,
.model-logo,
.card-logo,
.detail-logo {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 8px;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav {
  justify-content: center;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.main-nav a.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.top-actions {
  justify-content: flex-end;
}

.live-pill,
.updated-at,
.eyebrow,
.model-meta,
.tutorial-meta,
.comment-meta {
  color: var(--muted);
  font-size: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.live-pill.online {
  color: var(--accent-strong);
  border-color: #b8d0ff;
}

.ghost-button,
.primary-button,
.scope-tab,
.select-input,
.search-input,
textarea,
.auth-dialog input {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ghost-button,
.primary-button,
.scope-tab {
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}

.ghost-button:hover,
.ghost-button:focus-visible,
.scope-tab:hover,
.scope-tab:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #b8d0ff;
  box-shadow: 0 8px 22px rgba(15, 109, 255, 0.14);
}

.primary-button:hover,
.primary-button:focus-visible {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 10px 26px rgba(15, 109, 255, 0.24);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-button:disabled:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: none;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.full {
  width: 100%;
}

.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 26px clamp(14px, 3vw, 30px) 44px;
}

.hero-band,
.controls-band,
.leaderboard-band,
.series-band,
.comments-band,
.page-view,
.auth-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-band {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 32px;
  line-height: 1.18;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 17px;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.intro-video-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

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

.intro-video-head div {
  display: grid;
  gap: 3px;
}

.intro-video-head strong {
  font-size: 15px;
}

.intro-video-head span {
  color: var(--muted);
  font-size: 13px;
}

.intro-video {
  width: 100%;
  max-height: min(62vh, 560px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
  object-fit: contain;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.intro-video::cue {
  color: #ffffff;
  background: transparent;
  text-shadow:
    -1px -1px 0 #000000,
    1px -1px 0 #000000,
    -1px 1px 0 #000000,
    1px 1px 0 #000000;
  outline: none;
}

.intro-video-panel.collapsed .intro-video {
  display: none;
}

.leaderboard-note,
.ranking-note {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.home-view,
.page-view {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.controls-band {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px);
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.scope-tabs {
  display: inline-flex;
  gap: 8px;
}

.scope-tab {
  font-weight: 700;
}

.scope-tab.active {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.scope-tab.active:hover,
.scope-tab.active:focus-visible {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.search-wrap {
  display: grid;
  gap: 6px;
}

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

.search-input,
.select-input,
textarea,
.auth-dialog input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  background: #fcfdff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.leaderboard-band,
.series-band,
.comments-band,
.page-view {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.table-shell,
.version-table-shell {
  overflow-x: auto;
}

.rank-table,
.version-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.rank-table th,
.rank-table td,
.version-table th,
.version-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.rank-table th,
.version-table th {
  color: var(--muted);
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 700;
}

.rank-table tbody tr {
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.rank-table tbody tr:hover,
.rank-table tbody tr.selected {
  background: var(--accent-soft);
}

.rank-table tbody tr:hover .model-name,
.rank-table tbody tr:hover .score {
  color: var(--accent-strong);
}

.inline-detail-row td {
  padding: 0;
  background: #fbfcfe;
}

.inline-detail-row,
.inline-detail-row:hover {
  cursor: default;
  background: #fbfcfe;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-logo {
  width: 40px;
  height: 40px;
}

.card-logo,
.detail-logo {
  width: 52px;
  height: 52px;
}

.model-logo img,
.card-logo img,
.detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.model-name,
.score {
  font-weight: 800;
}

.score {
  font-variant-numeric: tabular-nums;
}

.source-badge,
.vpn-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.rank-cards {
  display: none;
  padding: 12px;
}

.rank-card {
  cursor: pointer;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  transition:
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.rank-card:last-child {
  border-bottom: 0;
}

.rank-card.selected {
  background: var(--accent-soft);
}

.rank-card:hover,
.rank-card:focus-visible {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.rank-card:hover strong,
.rank-card:focus-visible strong {
  color: var(--accent-strong);
}

.rank-card-detail {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.rank-card-main,
.rank-card-meta,
.series-intro,
.series-main,
.series-actions,
.toolbar,
.toolbar-actions,
.comment-head,
.comment-actions,
.reply-banner,
.auth-mode {
  display: flex;
  align-items: center;
}

.rank-card-main {
  gap: 12px;
}

.rank-index {
  width: 28px;
  text-align: center;
  font-weight: 800;
}

.rank-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.rank-card-score {
  font-variant-numeric: tabular-nums;
}

.rank-card-meta {
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.series-summary,
.version-list,
.inline-version-panel,
.comment-compose,
.comment-thread,
.tutorial-compose,
.prompt-tool,
.admin-content {
  padding: 18px;
}

.series-intro {
  justify-content: space-between;
  gap: 18px;
}

.series-main {
  gap: 14px;
  align-items: flex-start;
}

.series-main p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.inline-version-panel {
  display: grid;
  gap: 14px;
}

.inline-version-table {
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toolbar {
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar > * {
  flex: 1 1 0;
}

.directory-grid {
  display: grid;
  gap: 0;
}

.learning-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
}

.learning-path article {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.learning-path strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 8px;
}

.learning-path span {
  color: var(--ink);
  line-height: 1.5;
}

.directory-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.directory-item:hover {
  background: #fbfcfe;
}

.directory-item:last-child {
  border-bottom: 0;
}

.directory-item strong,
.directory-item a {
  display: block;
}

.directory-item strong {
  margin-bottom: 6px;
}

.directory-item a {
  font-weight: 700;
  text-decoration: none;
}

.directory-item a:hover,
.directory-item a:focus-visible,
.video-title-row a:hover,
.video-title-row a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.directory-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tutorial-video-form,
.prompt-tool {
  display: grid;
  gap: 12px;
}

.video-post {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.news-digest,
.news-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.fx-banner {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  color: var(--ink);
  background: #f2f7ff;
  border-bottom: 1px solid var(--line);
}

.fx-banner span {
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 800;
}

.fx-banner small {
  color: var(--muted);
  line-height: 1.55;
}

.subscription-list {
  display: grid;
}

.subscription-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.subscription-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--accent-strong);
  font-weight: 800;
  background: var(--accent-soft);
  border-radius: 8px;
}

.subscription-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.subscription-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.subscription-plan {
  display: grid;
  gap: 3px;
  min-width: 154px;
  padding: 10px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.subscription-plan span {
  color: var(--accent-strong);
  font-weight: 800;
}

.subscription-plan small {
  color: var(--muted);
}

.news-digest {
  border-bottom: 1px solid var(--line);
}

.news-digest-card,
.news-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.news-digest-card p,
.news-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.news-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.news-item-head a {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.news-item-head a:hover,
.news-item-head a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-title-button,
.news-highlight-button,
.inline-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.news-title-button {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  line-height: 1.45;
}

.news-title-button:hover,
.news-title-button:focus-visible,
.news-highlight-button:hover,
.news-highlight-button:focus-visible,
.inline-link-button:hover,
.inline-link-button:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.inline-link-button {
  justify-self: start;
  color: var(--accent-strong);
  font-size: 14px;
}

.plain-language {
  padding: 10px 12px;
  border-left: 3px solid var(--accent-strong);
  background: var(--accent-soft);
}

.news-detail {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #b8d0ff;
  border-radius: 8px;
  background: #f5f8ff;
}

.news-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.news-detail strong {
  color: var(--ink);
}

.news-tags,
.news-highlights,
.llm-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.news-tags span,
.news-highlights div,
.llm-suggestions span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.news-highlights {
  display: grid;
}

.news-highlights div,
.llm-suggestions {
  display: grid;
}

.compact-tabs {
  flex: 2 1 360px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.video-post-main {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
}

.video-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.video-title-row a {
  font-weight: 800;
  text-decoration: none;
}

.useful-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #b8d0ff;
  font-size: 12px;
  font-weight: 800;
}

.video-comments {
  display: grid;
  gap: 10px;
  margin-left: 66px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tutorial-comment {
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tutorial-comment strong {
  margin-right: 8px;
}

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

.tutorial-comment p {
  margin: 6px 0 0;
}

.tutorial-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.empty-state.compact {
  padding: 0;
}

.comment-form {
  display: grid;
  gap: 12px;
}

.reply-banner {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.login-tip,
.empty-state,
.admin-note {
  color: var(--muted);
  line-height: 1.7;
}

.source-status-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.catalog-admin-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.catalog-admin-list {
  display: grid;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.catalog-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.catalog-admin-item:last-child {
  border-bottom: 0;
}

.catalog-admin-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-admin-item p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.moderation-admin-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.moderation-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.check-row input {
  margin-top: 3px;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.danger-button {
  color: #b42318;
  border-color: #f4b4ae;
  background: #fff7f6;
}

.small-select {
  min-height: 36px;
}

.mini-admin-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-source-list {
  max-height: 320px;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.source-status-head,
.source-status-item {
  display: grid;
  gap: 4px;
}

.source-status-head span,
.source-status-item span {
  color: var(--muted);
  font-size: 13px;
}

.source-status-item {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comment-thread {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.comment-item {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comment-item p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.comment-head {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-actions {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.comment-replies {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.depth-1 {
  margin-left: 16px;
}

.depth-2,
.depth-3,
.depth-4 {
  margin-left: 24px;
}

.ghost-button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #b8d0ff;
}

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

.metric {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.admin-note {
  margin: 16px 0;
}

.error-page {
  padding: 48px 18px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.42);
}

.auth-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 22px;
}

.auth-dialog form {
  display: grid;
  gap: 12px;
}

.auth-dialog label {
  display: grid;
  gap: 6px;
}

.auth-mode {
  gap: 18px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.site-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
}

.legal-view {
  max-width: 840px;
  margin: 0 auto;
  line-height: 1.8;
}

.email-code-row span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.load-more-button {
  justify-self: center;
  margin: 12px 0;
}

.api-price-group {
  display: grid;
  gap: 10px;
  padding: 8px 0 18px;
}

.api-price-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.api-price-item {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .main-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .controls-band,
  .series-intro,
  .toolbar,
  .learning-path,
  .admin-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .toolbar-actions {
    flex-wrap: wrap;
  }

  .video-post-main {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .video-comments {
    margin-left: 0;
  }

  .tutorial-comment-form {
    grid-template-columns: 1fr;
  }

  .catalog-admin-item {
    grid-template-columns: 1fr;
  }

  .news-item-head,
  .mini-admin-grid {
    grid-template-columns: 1fr;
  }

  .toggle-row {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .rank-table {
    display: none;
  }

  .rank-cards {
    display: grid;
  }

  .hero-band {
    padding: 22px 18px;
  }

  .intro-video-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-video {
    justify-self: center;
    width: min(100%, 380px);
    max-height: 72vh;
    aspect-ratio: 9 / 16;
  }

  h1 {
    font-size: 28px;
  }
}
