:root {
  color-scheme: light dark;
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-raised: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #0ea5e9;
  --brand-hover: #0284c7;
  --brand-soft: #e0f2fe;
  --header-bg: #ffffff;
  --header-text: #1f2937;
  --side-bg: #ffffff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #0284c7;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --header-hover: rgba(15, 23, 42, 0.05);
  --header-active: rgba(14, 165, 233, 0.12);
  --header-line: rgba(15, 23, 42, 0.1);
  --contrast-text: #ffffff;
  --login-bg: #05070b;
  --login-mask: linear-gradient(90deg, rgba(4, 8, 14, 0.82), rgba(4, 8, 14, 0.58) 48%, rgba(4, 8, 14, 0.76)), rgba(0, 0, 0, 0.26);
  --login-panel-border: color-mix(in srgb, #ffffff 18%, transparent);
  --modal-backdrop: rgba(15, 23, 42, 0.46);
  --doc-code-bg: #f8fafc;
  --doc-code-text: #1f2937;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b23;
    --surface-soft: #101722;
    --surface-raised: #1b2430;
    --text: #e5edf5;
    --muted: #9aa7b7;
    --line: #2a3442;
    --line-strong: #3a4656;
    --brand: #38bdf8;
    --brand-hover: #7dd3fc;
    --brand-soft: rgba(56, 189, 248, 0.15);
    --header-bg: #070a0f;
    --header-text: #f8fafc;
    --side-bg: #111821;
    --green: #4ade80;
    --amber: #fbbf24;
    --red: #fb7185;
    --blue: #38bdf8;
    --shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
    --header-hover: rgba(255, 255, 255, 0.08);
    --header-active: rgba(56, 189, 248, 0.14);
    --header-line: rgba(255, 255, 255, 0.1);
    --contrast-text: #ffffff;
    --login-bg: #05070b;
    --login-mask: linear-gradient(90deg, rgba(4, 8, 14, 0.82), rgba(4, 8, 14, 0.58) 48%, rgba(4, 8, 14, 0.76)), rgba(0, 0, 0, 0.26);
    --login-panel-border: color-mix(in srgb, #ffffff 18%, transparent);
    --modal-backdrop: rgba(0, 0, 0, 0.58);
    --doc-code-bg: #0f172a;
    --doc-code-text: #e5e7eb;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-raised: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #0ea5e9;
  --brand-hover: #0284c7;
  --brand-soft: #e0f2fe;
  --header-bg: #ffffff;
  --header-text: #1f2937;
  --side-bg: #ffffff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #0284c7;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --header-hover: rgba(15, 23, 42, 0.05);
  --header-active: rgba(14, 165, 233, 0.12);
  --header-line: rgba(15, 23, 42, 0.1);
  --contrast-text: #ffffff;
  --login-bg: #f2f3f5;
  --login-mask: linear-gradient(90deg, rgba(248, 250, 252, 0.72), rgba(248, 250, 252, 0.54) 48%, rgba(248, 250, 252, 0.7)), rgba(255, 255, 255, 0.18);
  --login-panel-border: color-mix(in srgb, var(--line) 82%, transparent);
  --modal-backdrop: rgba(15, 23, 42, 0.34);
  --doc-code-bg: #f8fafc;
  --doc-code-text: #1f2937;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #151b23;
  --surface-soft: #101722;
  --surface-raised: #1b2430;
  --text: #e5edf5;
  --muted: #9aa7b7;
  --line: #2a3442;
  --line-strong: #3a4656;
  --brand: #38bdf8;
  --brand-hover: #7dd3fc;
  --brand-soft: rgba(56, 189, 248, 0.15);
  --header-bg: #070a0f;
  --header-text: #f8fafc;
  --side-bg: #111821;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #38bdf8;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  --header-hover: rgba(255, 255, 255, 0.08);
  --header-active: rgba(56, 189, 248, 0.14);
  --header-line: rgba(255, 255, 255, 0.1);
  --contrast-text: #ffffff;
  --login-bg: #05070b;
  --login-mask: linear-gradient(90deg, rgba(4, 8, 14, 0.82), rgba(4, 8, 14, 0.58) 48%, rgba(4, 8, 14, 0.76)), rgba(0, 0, 0, 0.26);
  --login-panel-border: color-mix(in srgb, #ffffff 18%, transparent);
  --modal-backdrop: rgba(0, 0, 0, 0.58);
  --doc-code-bg: #0f172a;
  --doc-code-text: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-height: 100%;
  margin: 0;
  background-color: var(--bg);
  background-image: url("../img/console-bg.svg");
  background-position: right 32px top 70px;
  background-repeat: no-repeat;
  background-size: min(720px, 58vw) auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration: none;
}

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

button {
  border: 0;
}

.console-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 50px 1fr;
}

.console-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 228px minmax(320px, 1fr) minmax(220px, 360px) auto;
  align-items: center;
  min-width: 0;
  height: 50px;
  background: var(--side-bg);
  color: var(--header-text);
  box-shadow: 0 1px 0 var(--header-line);
}

.console-user {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-left: 1px solid var(--header-line);
  color: var(--header-text);
}

.console-user-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand);
  color: var(--contrast-text);
  font-size: 13px;
  font-weight: 900;
}

.console-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.console-user-meta {
  min-width: 0;
  display: grid;
  line-height: 1.2;
}

.console-user-meta strong,
.console-user-meta small {
  overflow: hidden;
  max-width: 120px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-user-meta strong {
  color: var(--header-text);
  font-size: 13px;
}

.console-user-meta small {
  color: color-mix(in srgb, var(--header-text) 56%, transparent);
  font-size: 11px;
}

.logout-link {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: var(--radius);
  background: var(--header-active);
  color: var(--header-text);
  font-size: 12px;
  font-weight: 800;
}

.logout-link:hover {
  background: var(--header-hover);
  color: var(--header-text);
}

.console-brand {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--header-text);
  border-right: 1px solid var(--header-line);
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-block;
  object-fit: contain;
  object-position: center;
}

.brand-text {
  overflow: hidden;
  color: var(--header-text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.header-nav-group {
  display: none;
  align-items: center;
  height: 100%;
  gap: 2px;
  padding: 0 8px;
}

.header-nav-group.active {
  display: flex;
}

.header-nav a {
  position: relative;
  height: calc(100% - 10px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  padding: 0 12px;
  border-radius: var(--radius);
  color: color-mix(in srgb, var(--header-text) 78%, transparent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.header-nav a:hover {
  background: var(--header-hover);
  color: var(--header-text);
}

.header-nav a.active {
  background: var(--header-active);
  color: var(--header-text);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.topnav-icon,
.button-icon,
.sidebar-title-icon,
.status-label-icon,
.page-title-icon,
.metric-icon,
.panel-title-icon,
.row-icon,
.guide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: currentColor;
}

.topnav-icon,
.button-icon {
  width: 16px;
  height: 16px;
}

.topnav-icon svg,
.button-icon svg,
.sidebar-title-icon svg,
.status-label-icon svg,
.page-title-icon svg,
.metric-icon svg,
.panel-title-icon svg,
.row-icon svg,
.guide-icon svg,
.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.global-search {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  padding: 0 0 0 10px;
  border: 1px solid var(--header-line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--header-text) 4%, transparent);
}

.global-search:focus-within {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.global-search input {
  min-width: 0;
  height: 32px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--header-text);
  font-size: 13px;
}

.global-search input::placeholder {
  color: color-mix(in srgb, var(--header-text) 52%, transparent);
}

.global-search button,
.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.global-search button {
  height: 30px;
  padding: 0 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}

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

.global-search button:hover,
.refresh-button:hover {
  background: var(--brand-hover);
}

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

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results.visible {
  display: block;
}

.search-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

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

.search-item:hover,
.search-item.active {
  background: var(--brand-soft);
}

.search-item-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.search-item-snippet {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.search-result-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.search-result-icon .feature-icon,
.search-result-icon .feature-icon svg {
  width: 18px;
  height: 18px;
}

.console-body {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 50px;
  align-self: start;
  min-height: calc(100dvh - 50px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--side-bg);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--surface) 68%, transparent);
}

.sidebar-title {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-title-icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.sidebar-nav {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.sidebar-section {
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-section[open] {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 55%, transparent);
}

.sidebar-section summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-section summary > span:not(.nav-icon) {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-section summary::-webkit-details-marker {
  display: none;
}

.sidebar-section summary::after {
  content: "+";
  flex: 0 0 20px;
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.sidebar-section[open] summary::after {
  content: "-";
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-subnav {
  display: grid;
  gap: 4px;
  padding: 6px 8px 10px;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px 0 18px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.sidebar-section summary:hover,
.sidebar-section.selected summary,
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
  opacity: 1;
  transform: scale(1.15);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-section[open] summary .nav-icon,
.sidebar-section.selected summary .nav-icon,
.sidebar-section summary:hover .nav-icon,
.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

.sidebar-status {
  margin: auto 12px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sidebar-status[hidden] {
  display: none;
}

.status-label,
.metric-card span,
.panel-head p,
.status-row span,
.guide-grid p,
.feature-card p {
  color: var(--muted);
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}

.status-label-icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

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

.sidebar-status strong {
  font-size: 18px;
  line-height: 1.3;
}

.sidebar-status strong.ok,
.status-ok {
  color: var(--green);
}

.sidebar-status strong.bad,
.status-bad {
  color: var(--red);
}

#serviceMeta {
  margin-top: 6px;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 18px 22px 34px;
}

.breadcrumb {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 82%, transparent) 58%, transparent 100%), url("../img/console-bg.svg");
  background-position: center, right -120px center;
  background-repeat: no-repeat;
  background-size: auto, 520px auto;
  box-shadow: var(--shadow);
}

.page-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
}

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

.page-title-icon {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand);
}

.page-title-icon svg {
  width: 22px;
  height: 22px;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 108px;
  padding: 16px;
}

.metric-card span,
.metric-card small {
  display: block;
  font-size: 12px;
}

.metric-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.metric-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  color: var(--brand);
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.ready-metric {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
}

.planned-metric {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  color: var(--amber);
}

.api-metric {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}

.metric-card strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.18;
}

.service-card strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  margin-top: 14px;
}

.page-view > .panel:first-child {
  margin-top: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.panel-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.panel-title-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--brand);
}

.panel-title-icon svg {
  width: 20px;
  height: 20px;
}

.match-console {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.match-query-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px auto;
  gap: 12px;
  align-items: end;
}

.match-query-form button {
  min-height: 36px;
  padding: 0 18px;
}

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

.match-summary-grid article {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.match-summary-grid span,
.match-empty span {
  color: var(--muted);
  font-size: 12px;
}

.match-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.match-empty {
  display: grid;
  gap: 5px;
  min-height: 120px;
  align-content: center;
  justify-items: center;
  padding: 22px;
  border: 1px dashed color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  text-align: center;
}

.match-empty strong {
  color: var(--text);
  font-size: 14px;
}

.match-page-shell {
  display: grid;
  gap: 14px;
}

.match-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 118px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--brand) 14%, var(--surface)) 0%, color-mix(in srgb, var(--surface) 94%, transparent) 56%, color-mix(in srgb, var(--green) 9%, var(--surface)) 100%);
  box-shadow: var(--shadow);
}

.match-hero.mine {
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--blue) 14%, var(--surface)) 0%, color-mix(in srgb, var(--surface) 94%, transparent) 58%, color-mix(in srgb, var(--amber) 10%, var(--surface)) 100%);
}

.match-hero-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.match-hero-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.match-hero-title p {
  margin: 6px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
}

.match-hero-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
}

.match-hero-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.match-state-pill {
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.match-state-pill.ok {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.match-state-pill.bad {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.match-state-pill.loading {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.match-search-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.match-search-bar input {
  min-width: 0;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}

.match-search-bar input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

.match-search-bar button,
.match-secondary-button,
.match-pagination button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.match-search-bar button:hover,
.match-secondary-button:hover,
.match-pagination button:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.match-secondary-button {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--surface);
  color: var(--brand);
}

.match-secondary-button:hover {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.match-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.match-stat-strip.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.match-stat-strip article {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.match-stat-strip span,
.match-player-card span,
.match-section-head p,
.match-card-main small,
.match-mini-card small,
.match-detail-title small,
.match-detail-time,
.match-card-stats,
.match-card-mvp {
  color: var(--muted);
  font-size: 12px;
}

.match-stat-strip strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.match-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.25fr);
  gap: 14px;
  align-items: start;
}

.match-results-panel,
.match-detail-panel,
.match-player-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.match-results-panel {
  overflow: hidden;
}

.match-detail-panel {
  overflow: hidden;
}

.match-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.match-section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.match-section-head p {
  margin: 4px 0 0;
}

.match-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.match-card {
  position: relative;
  width: 100%;
  min-height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.match-card.with-background::before,
.match-detail-card.with-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 96%, transparent) 0%, color-mix(in srgb, var(--surface) 82%, transparent) 55%, color-mix(in srgb, var(--surface) 58%, transparent) 100%),
    var(--match-bg);
  background-position: center;
  background-size: cover;
  opacity: 0.9;
  pointer-events: none;
}

.match-card > *,
.match-detail-content {
  position: relative;
  z-index: 1;
}

.match-card:hover,
.match-card.active {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  transform: translateY(-1px);
}

.match-card.winner-ct {
  border-left-color: var(--blue);
}

.match-card.winner-t {
  border-left-color: var(--amber);
}

.match-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.match-card-main strong,
.match-detail-title strong,
.match-player-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.match-card-main small {
  display: block;
  margin-top: 4px;
}

.match-map-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.match-map-icon.large {
  width: 52px;
  height: 52px;
}

.match-map-icon img,
.match-score-side img,
.match-team-title img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.match-card-score {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.match-card-score strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.match-card-score span {
  padding: 3px 8px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--line) 55%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.match-card-score span.ct {
  background: color-mix(in srgb, var(--blue) 13%, var(--surface));
  color: var(--blue);
}

.match-card-score span.t {
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
  color: var(--amber);
}

.match-card-stats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-card-stats span,
.match-card-mvp {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  font-weight: 800;
}

.match-card-mvp {
  grid-column: 1 / -1;
  width: fit-content;
  color: var(--amber);
}

.match-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.match-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.match-detail-card {
  position: relative;
  min-height: 320px;
  background: var(--surface);
}

.match-detail-content {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.match-detail-head,
.match-detail-title,
.match-score-board,
.match-score-side,
.match-team-head,
.match-player-row,
.match-mini-card {
  display: flex;
  align-items: center;
}

.match-detail-head {
  justify-content: space-between;
  gap: 12px;
}

.match-detail-title {
  min-width: 0;
  gap: 12px;
}

.match-detail-title small {
  display: block;
  margin-top: 5px;
  word-break: break-all;
}

.match-score-board {
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.match-score-side {
  gap: 8px;
  min-width: 120px;
}

.match-score-side.right {
  justify-content: flex-end;
}

.match-score-side img {
  width: 40px;
  height: 40px;
}

.match-score-side span {
  color: var(--muted);
  font-weight: 900;
}

.match-score-side strong,
.match-score-vs strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.match-score-vs {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.match-score-vs span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.match-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.match-detail-stats article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.match-detail-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.match-detail-stats strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-team-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.match-team-card.ct {
  border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
}

.match-team-card.t {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
}

.match-team-card.loser {
  opacity: 0.78;
}

.match-team-head {
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.match-team-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.match-team-title img {
  width: 28px;
  height: 28px;
}

.match-team-head strong {
  color: var(--muted);
  font-size: 12px;
}

.match-player-table {
  display: grid;
}

.match-player-row {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) repeat(6, minmax(38px, auto));
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--text);
  font-size: 12px;
}

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

.match-player-row.head {
  min-height: 30px;
  color: var(--muted);
  font-weight: 900;
}

.match-player-row.empty {
  display: block;
  color: var(--muted);
}

.match-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.match-player-name em {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: var(--radius);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.match-player-name em.gold {
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: var(--amber);
}

.match-player-name em.silver {
  background: color-mix(in srgb, var(--blue) 13%, var(--surface));
  color: var(--blue);
}

.match-player-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
}

.match-player-card {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 96px;
  padding: 16px;
}

.match-player-card strong {
  font-size: 22px;
}

.match-player-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.match-mini-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.match-mini-card {
  gap: 10px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.match-mini-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.match-mini-card small {
  display: block;
  margin-top: 3px;
}

.match-empty.compact {
  min-height: 280px;
  border: 0;
  background: transparent;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 0;
}

.feature-card {
  position: relative;
  min-height: 170px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.feature-card:nth-child(4n) {
  border-right: 0;
}

.feature-card:hover {
  background: var(--surface-soft);
}

.feature-card.ready::before,
.feature-card.planned::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.feature-card.ready::before {
  background: var(--green);
}

.feature-card.planned::before {
  background: var(--amber);
}

.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.ready {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.badge.planned {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  color: var(--amber);
}

.feature-card h3,
.guide-grid h3 {
  margin: 0;
  line-height: 1.35;
  letter-spacing: 0;
}

.feature-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feature-icon-box {
  width: 38px;
  height: 38px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.feature-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.feature-icon-match {
  color: var(--brand);
}

.feature-icon-report {
  color: var(--blue);
}

.feature-icon-vc {
  color: var(--amber);
}

.feature-icon-music {
  color: #9333ea;
}

.feature-icon-admin {
  color: var(--green);
}

.feature-icon-docs {
  color: var(--green);
}

.feature-card h3 {
  font-size: 15px;
}

.feature-card p {
  margin: 0;
  font-size: 13px;
}

.feature-action {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.feature-action.disabled {
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 96px;
  align-content: center;
  text-align: center;
}

.status-table {
  display: grid;
}

.status-row {
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr) minmax(260px, 1.2fr);
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

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

.status-row > * {
  min-width: 0;
  padding: 0 16px;
}

.status-row strong {
  font-size: 14px;
}

.status-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.row-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--brand);
}

.row-icon svg {
  width: 15px;
  height: 15px;
}

.api-row-icon {
  color: var(--blue);
}

.config-row-icon {
  color: var(--brand);
}

.time-row-icon {
  color: var(--green);
}

.status-header {
  min-height: 40px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.quick-grid a {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.quick-card-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  color: var(--brand);
}

.quick-card-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.quick-card-icon.status-icon {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}

.quick-card-icon.guide-icon {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
}

.quick-grid a:hover {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.quick-grid strong {
  font-size: 15px;
}

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

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

.guide-grid h3 {
  font-size: 15px;
}

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

.guide-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--brand);
}

.guide-icon svg {
  width: 18px;
  height: 18px;
}

.config-guide-icon {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

.docs-guide-icon {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: var(--green);
}

.guide-grid p {
  margin: 8px 0 0;
  font-size: 13px;
}

code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.toast-notification {
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 1000;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(110%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-notification.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.toast-notification.success {
  border-left-color: var(--green);
}

.toast-notification.error {
  border-left-color: var(--red);
}

.toast-title {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 800;
}

.toast-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: var(--login-bg);
  background-image: none;
  background-attachment: initial;
}

.login-bg-video,
.login-bg-mask {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-bg-video {
  z-index: 0;
  object-fit: cover;
  background: var(--login-bg);
}

.login-toast {
  top: 16px;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.login-bg-mask {
  z-index: 1;
  background: var(--login-mask);
}

.login-shell {
  width: min(420px, 100%);
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
  transform: translate(-50%, -50%);
}

.login-panel {
  padding: 24px;
  border: 1px solid var(--login-panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
}

.login-loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(3, 7, 18, 0.74);
  color: #fff;
  text-align: center;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.login-loader[hidden] {
  display: grid;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  width: 50px;
  height: 50px;
  display: inline-block;
  object-fit: contain;
  object-position: center;
}

.loader-line {
  width: min(260px, 64vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.loader-line span {
  width: 42%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--brand);
  animation: login-loader-line 1.1s ease-in-out infinite;
}

.login-loader strong {
  font-size: 18px;
  line-height: 1.35;
}

.login-loader p {
  max-width: 320px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.login-loader.is-error .loader-line span {
  background: var(--red);
}

@keyframes login-loader-line {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(80%);
  }
  100% {
    transform: translateX(250%);
  }
}

.auth-loading .login-shell {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 8px));
  filter: blur(4px);
  pointer-events: none;
}

.auth-loading .oauth-button,
.auth-loading .login-form button,
.auth-loading .login-form input {
  pointer-events: none;
}

.auth-ready .login-shell {
  opacity: 1;
  transform: translate(-50%, -50%);
  filter: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

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

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.login-success {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

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

.login-panel-title {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.login-panel-title strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.login-panel-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.login-form label,
.match-query-form label,
.music-upload-form label,
.music-toolbar label,
.admin-toolbar label,
.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-form input,
.match-query-form input,
.match-query-form select,
.music-upload-form input,
.music-upload-form select,
.music-toolbar input,
.music-toolbar select,
.profile-form input,
.profile-form textarea,
.admin-toolbar input,
.admin-toolbar select,
.admin-form input,
.admin-form select,
.admin-form textarea {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.admin-form textarea {
  min-height: 76px;
  padding: 8px 10px;
  resize: vertical;
}

.login-form button,
.match-query-form button,
.music-upload-form button,
.music-actions button,
.music-applied button,
.profile-form button,
.profile-action-button,
.oauth-account-card button,
.profile-device-card-item button,
.admin-form-actions button,
.admin-secondary-button,
.admin-user-card button,
.admin-group-card button,
.admin-node-list button,
.screenshot-player-list button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.login-form button {
  min-height: 40px;
}

.login-form button.secondary {
  min-height: 36px;
  padding: 0 12px;
  background: var(--brand-soft);
  color: var(--brand-hover);
  white-space: nowrap;
}

.login-recovery-secret {
  display: grid;
  gap: 12px;
}

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

.bind-qq-shell {
  width: min(480px, calc(100vw - 32px));
}

.bind-qq-panel {
  overflow: hidden;
  padding: 22px;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--login-panel-border));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.bind-hero {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.bind-hero-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.bind-hero-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.bind-hero-copy {
  min-width: 0;
}

.bind-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

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

.bind-status-pill {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.bind-status-pill[data-state="ok"] {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.bind-status-pill[data-state="error"] {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.bind-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 18px;
}

.bind-progress span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bind-progress span.active {
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.bind-progress span.done {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  color: var(--green);
}

.bind-main-card {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.bind-stage-viewport {
  position: relative;
  overflow: hidden;
  min-height: 198px;
  transition: height 0.34s ease;
}

.bind-stage-track {
  display: flex;
  align-items: stretch;
  width: 100%;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.bind-stage {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 0;
  opacity: 1;
  pointer-events: none;
}

.bind-stage-current {
  pointer-events: auto;
}

.bind-stage-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 0 0 4px;
}

.bind-stage-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-size: 12px;
  font-weight: 900;
}

.bind-stage-head strong,
.bind-stage-head small {
  display: block;
  min-width: 0;
}

.bind-stage-head strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.bind-stage-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.bind-stage-head em {
  color: var(--brand-hover);
  font-style: normal;
}

.bind-qq-form .bind-field {
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.bind-qq-form .bind-field > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.bind-input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.bind-input-row input {
  min-height: 46px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.bind-input-row button.secondary {
  min-height: 44px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
}

.bind-input-row button.secondary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.bind-send-button,
.bind-home-button {
  width: 100%;
  min-height: 40px;
}

.bind-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.bind-home-button:hover {
  background: var(--brand-hover);
  color: #fff;
}

.bind-finish-card .bind-stage-index {
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
  color: var(--green);
}

.bind-required-note {
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface-soft));
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.bind-required-note strong {
  color: var(--brand-hover);
}

.bind-actions {
  display: flex;
  justify-content: flex-end;
}

.bind-logout-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bind-logout-link:hover {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.login-mode-tabs button {
  min-height: 38px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.login-mode-tabs button:hover:not(.active) {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  color: var(--text);
}

.login-mode-tabs button.active {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: var(--surface);
  color: var(--brand-hover);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.login-mode-tabs button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 42%, transparent);
  outline-offset: 2px;
}

.login-mode-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

html[data-theme="dark"] .login-mode-tabs button.active {
  background: var(--surface-raised);
}

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

.login-helper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-helper-links button {
  min-height: 30px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-helper-links button:hover,
.login-helper-links button.active {
  border-color: color-mix(in srgb, var(--brand) 22%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  align-items: center;
}

.qq-verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.qq-verify-state {
  margin-top: -2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qq-verify-state[data-state="pending"] {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.qq-verify-state[data-state="ok"] {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.qq-verify-state[data-state="error"] {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
  color: var(--red);
}

.qq-verify-command {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
  word-break: break-all;
}

.captcha-row img {
  width: 120px;
  height: 40px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.oauth-login {
  display: grid;
  gap: 8px;
}

.oauth-embed-panel {
  display: block;
  background: transparent;
}

.oauth-frame-stage {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.oauth-frame-stage iframe {
  width: 100%;
  min-height: 260px;
  display: block;
  border: 0;
  background: transparent;
}

.oauth-frame-fallback {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.oauth-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--oauth-accent, var(--brand));
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.oauth-button:hover {
  border-color: color-mix(in srgb, var(--oauth-accent, var(--brand)) 38%, var(--line));
  background: color-mix(in srgb, var(--oauth-accent, var(--brand)) 8%, var(--surface));
  color: var(--text);
}

.oauth-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--oauth-accent, var(--brand));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.oauth-mark svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.oauth-empty {
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.music-console {
  display: grid;
  gap: 14px;
  padding: 16px;
}

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

.profile-console {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1fr);
  grid-template-areas:
    "identity edit"
    "switch edit"
    "switch oauth"
    "devices devices";
  align-items: start;
  gap: 14px;
  padding: 16px;
}

.profile-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-identity {
  grid-area: identity;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
}

.profile-edit-card {
  grid-area: edit;
}

.profile-switch-card {
  grid-area: switch;
}

.profile-oauth-card {
  grid-area: oauth;
}

.profile-device-card {
  grid-area: devices;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 12px;
  background: transparent;
  color: var(--brand);
  font-size: 26px;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.profile-bio-display {
  min-height: 38px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-bio-display.empty {
  color: var(--muted);
}

.profile-identity-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-meta-grid span {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-meta-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-badges,
.oauth-bind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-form {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.profile-form textarea {
  min-height: 116px;
  padding: 10px 11px;
  resize: vertical;
}

.profile-action-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.oauth-account-list,
.profile-device-list {
  display: grid;
  gap: 10px;
}

.oauth-account-card,
.profile-device-card-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-device-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-weight: 900;
}

.profile-device-card-item strong,
.profile-device-card-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-device-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.profile-device-card-item small {
  color: var(--muted);
  font-size: 12px;
}

.profile-device-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile-device-detail-grid span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.profile-device-detail-grid b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.profile-device-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-device-status.active {
  background: color-mix(in srgb, #16a34a 12%, var(--surface));
  color: #15803d;
}

.profile-device-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-oauth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
}

.launcher-oauth-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.launcher-oauth-brand,
.launcher-oauth-user,
.launcher-oauth-request {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.launcher-oauth-brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.launcher-oauth-brand p,
.launcher-oauth-user small,
.launcher-oauth-status span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.launcher-oauth-user,
.launcher-oauth-request {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.launcher-oauth-request {
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
}

.launcher-oauth-request span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.launcher-oauth-request strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher-oauth-avatar {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
}

.launcher-oauth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launcher-oauth-user strong,
.launcher-oauth-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher-oauth-status {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.launcher-oauth-status[data-state="ok"] {
  border-color: color-mix(in srgb, #16a34a 26%, var(--line));
  background: color-mix(in srgb, #16a34a 8%, var(--surface));
}

.launcher-oauth-status[data-state="error"] {
  border-color: color-mix(in srgb, #dc2626 30%, var(--line));
  background: color-mix(in srgb, #dc2626 8%, var(--surface));
}

.launcher-oauth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.launcher-oauth-actions button,
.launcher-oauth-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.launcher-oauth-actions a {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.oauth-account-avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-weight: 900;
}

.oauth-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oauth-account-card strong,
.oauth-account-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oauth-account-card small {
  color: var(--muted);
  font-size: 12px;
}

.profile-oauth-frame-panel {
  width: min(560px, calc(100vw - 32px));
}

.profile-oauth-frame-stage {
  min-height: 360px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.profile-oauth-frame-stage iframe {
  min-height: 360px;
}

.music-summary-grid article,
.music-control-panel,
.music-card,
.music-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.music-summary-grid article {
  min-height: 84px;
  padding: 14px;
}

.music-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.music-summary-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

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

.music-control-panel {
  padding: 14px;
}

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

.music-section-head h3 {
  margin: 0;
  font-size: 15px;
}

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

.music-applied {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.music-applied strong {
  font-size: 15px;
}

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

.music-player {
  width: 100%;
  margin-top: 12px;
}

.music-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.music-upload-form button {
  grid-column: 1 / -1;
}

.music-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 12px;
  align-items: end;
}

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

.music-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.music-cover {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
}

.music-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-info {
  min-width: 0;
}

.music-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.music-title-row h3 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.music-actions button,
.music-applied button {
  min-width: 64px;
  padding: 0 10px;
  font-size: 12px;
}

.music-actions button.danger {
  background: var(--red);
}

.music-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.admin-console {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.admin-summary-grid article,
.admin-list-panel,
.admin-permission-catalog,
.admin-user-card,
.admin-group-card,
.admin-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-summary-grid article {
  min-height: 76px;
  padding: 12px 14px;
}

.admin-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.admin-subpage {
  display: none;
  gap: 12px;
}

.admin-subpage.active {
  display: grid;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 190px 220px auto;
  gap: 12px;
  align-items: end;
}

.admin-toolbar-compact {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.admin-management-grid,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.admin-list-panel,
.admin-permission-catalog {
  padding: 12px;
}

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

.admin-section-head h3 {
  margin: 0;
  font-size: 15px;
}

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

.compact-head {
  margin-bottom: 8px;
}

.admin-user-list,
.admin-group-list {
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.admin-user-card,
.admin-group-card {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

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

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

.admin-user-card.active,
.admin-group-card.active {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.admin-card-avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-size: 14px;
  font-weight: 900;
}

.admin-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-card-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.admin-card-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-main span,
.admin-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.admin-chip {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.admin-hidden-field {
  display: none;
}

.admin-wide,
.admin-form-actions {
  grid-column: 1 / -1;
}

.admin-temp-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-temp-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.admin-temp-head .admin-checkbox {
  min-height: 34px;
}

.admin-temp-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-temp-duration {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}

.admin-temp-duration label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.admin-temp-duration span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-temp-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.admin-temp-grid .admin-picker-panel {
  min-width: 0;
  background: var(--surface);
}

.admin-picker-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 10px;
  align-items: end;
}

.admin-picker-head strong,
.admin-picker-head span {
  display: block;
}

.admin-picker-head strong {
  color: var(--text);
  font-size: 14px;
}

.admin-picker-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-selection-strip {
  display: flex;
  min-height: 30px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-selection-strip span {
  color: var(--muted);
  font-size: 12px;
}

.admin-selection-strip button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.admin-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.admin-check-grid.compact {
  max-height: 188px;
  overflow: auto;
}

.admin-picker-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-picker-item input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.admin-picker-item strong,
.admin-picker-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-picker-item strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

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

.admin-node-picker {
  display: grid;
  max-height: 260px;
  gap: 8px;
  overflow: auto;
}

.admin-node-picker.compact {
  max-height: 188px;
}

.admin-node-picker-category {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-node-picker-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 0 2px;
}

.admin-node-picker-category-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.admin-node-picker-category-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-node-picker-category-list {
  display: grid;
  gap: 7px;
}

.admin-node-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-node-picker-item strong,
.admin-node-picker-item span {
  display: block;
  min-width: 0;
}

.admin-node-picker-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-node-picker-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-node-picker-item > div:last-child {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-node-picker-item button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.admin-node-picker-item button:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-oauth-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.admin-oauth-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-oauth-item input {
  width: 16px;
  min-height: 16px;
}

.admin-oauth-item strong,
.admin-oauth-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-oauth-item small {
  color: var(--muted);
  font-size: 12px;
}

.admin-checkbox {
  min-height: 36px;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-self: end;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-checkbox input {
  width: auto;
  min-height: 0;
}

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

.admin-form-actions button,
.admin-secondary-button,
.admin-user-card button,
.admin-group-card button,
.admin-node-list button {
  min-width: 72px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-secondary-button,
.admin-user-card button,
.admin-group-card button,
.admin-node-list button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.admin-secondary-button:hover,
.admin-user-card button:hover,
.admin-group-card button:hover,
.admin-node-list button:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-form-actions button.danger,
.admin-form-actions .danger,
.admin-card-actions .danger {
  background: var(--red);
  color: #fff;
}

.admin-card-actions .danger {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
}

.admin-card-actions .danger:hover {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  color: var(--red);
}

.admin-form-actions button:disabled,
.admin-secondary-button:disabled,
.admin-user-card button:disabled,
.admin-group-card button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-node-list {
  display: grid;
  gap: 12px;
}

.admin-node-list button {
  min-height: 30px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.admin-node-category {
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.admin-node-category[open] {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 8%, transparent);
}

.admin-node-category-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
  list-style: none;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease;
}

.admin-node-category:not([open]) > .admin-node-category-head {
  background: var(--surface-soft);
}

.admin-node-category-head::-webkit-details-marker,
.admin-node-summary::-webkit-details-marker,
.admin-node-source summary::-webkit-details-marker {
  display: none;
}

.admin-node-category-head::after {
  content: "+";
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.admin-node-category[open] .admin-node-category-head::after {
  content: "-";
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-node-category-head:hover,
.admin-node-category[open] > .admin-node-category-head {
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-node-category-head strong {
  color: inherit;
  font-size: 14px;
  font-weight: 900;
}

.admin-node-category-head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-node-category-list {
  display: grid;
  gap: 7px;
  padding: 8px 10px 10px 30px;
}

.admin-node-category-list.catalog {
  grid-template-columns: 1fr;
}

.admin-node-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-node-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 11px 12px;
}

.admin-node-summary::after {
  content: "+";
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.admin-node-card[open] .admin-node-summary::after {
  content: "-";
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-node-summary:hover {
  background: var(--brand-soft);
}

.admin-node-card[open] .admin-node-summary {
  border-bottom: 1px solid var(--line);
}

.admin-node-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-node-title code {
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-node-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-node-card-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.admin-node-source {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-node-source summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 8px 9px;
}

.admin-node-source summary span {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.admin-node-source summary strong {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}

.admin-node-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0 9px 9px;
  list-style: none;
}

.admin-node-source-list li {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-node-source-empty {
  margin: 0;
  padding: 0 9px 9px;
  color: var(--muted);
  font-size: 12px;
}

.screenshot-browser {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
}

.screenshot-player-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.screenshot-player-list button {
  display: grid;
  justify-content: flex-start;
  gap: 2px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.screenshot-player-list button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.screenshot-player-list button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.screenshot-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.screenshot-thumb {
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-card strong,
.screenshot-card span:not(.screenshot-thumb) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-page-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-page-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.admin-page-actions button:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}

.admin-page-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  cursor: default;
  background: var(--modal-backdrop);
  backdrop-filter: blur(2px);
}

.admin-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.admin-modal-panel.compact {
  width: min(860px, calc(100vw - 32px));
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.admin-modal-head h3 {
  margin: 0;
  font-size: 17px;
}

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

.admin-modal-close {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.admin-modal-close:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  color: var(--brand);
}

.admin-modal .admin-form {
  overflow: auto;
  padding: 16px 18px 18px;
}

body.modal-open {
  overflow: hidden;
}

.doc-page {
  background: var(--bg);
}

.doc-shell {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.doc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  color: var(--brand);
  font-weight: 800;
}

.doc-shell h1 {
  margin: 0 0 18px;
  letter-spacing: 0;
}

.doc-content {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--doc-code-bg);
  color: var(--doc-code-text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

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

  .feature-card:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .feature-card:nth-child(2n) {
    border-right: 0;
  }

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

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

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

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

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

  .music-workspace-grid,
  .match-workspace,
  .match-player-overview,
  .admin-management-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .match-team-grid,
  .match-mine-grid {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(140px, auto));
  }

  .admin-toolbar-compact {
    grid-template-columns: minmax(180px, 1fr) auto;
  }
}

@media (max-width: 820px) {
  body {
    background-size: 520px auto;
    background-position: right -180px top 130px;
  }

  .console-shell {
    grid-template-rows: auto 1fr;
  }

  .console-header {
    position: static;
    grid-template-columns: 1fr;
    height: auto;
    gap: 0;
  }

  .console-brand {
    min-height: 48px;
    border-right: 0;
    border-bottom: 1px solid var(--header-line);
  }

  .header-nav {
    min-height: 42px;
    border-bottom: 1px solid var(--header-line);
  }

  .header-nav-group {
    padding: 0 8px;
  }

  .header-nav a {
    height: 32px;
    margin: 5px 0;
  }

  .global-search {
    margin: 8px;
  }

  .console-user {
    min-height: 48px;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid var(--header-line);
  }

  .console-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--side-bg);
    box-shadow: none;
  }

  .sidebar-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(152px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    padding: 10px;
  }

  .sidebar-section {
    min-width: 152px;
  }

  .sidebar-subnav {
    padding: 6px 8px 8px;
  }

  .sidebar-nav a {
    white-space: nowrap;
  }

  .sidebar-status,
  .sidebar-title {
    display: none;
  }

  .workspace {
    padding: 14px 12px 28px;
  }

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

  .status-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }

  .status-header {
    display: none;
  }

  .status-row > * {
    padding: 0 14px;
  }

  .music-card {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
  }

  .music-cover {
    width: 64px;
    height: 64px;
  }

  .music-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .admin-temp-grid,
  .admin-temp-duration {
    grid-template-columns: 1fr;
  }

  .admin-toolbar label:first-child,
  .admin-toolbar .admin-secondary-button {
    grid-column: 1 / -1;
  }

  .admin-user-list,
  .admin-group-list {
    max-height: none;
  }

  .admin-node-list,
  .admin-node-category-list.catalog {
    grid-template-columns: 1fr;
  }

  .profile-console,
  .screenshot-browser {
    grid-template-columns: 1fr;
  }

  .profile-console {
    grid-template-areas:
      "identity"
      "edit"
      "switch"
      "oauth"
      "devices";
  }

  .match-hero,
  .match-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-search-bar,
  .match-stat-strip,
  .match-stat-strip.compact {
    grid-template-columns: 1fr 1fr;
  }

  .match-search-bar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    background-image: none;
  }

  .metrics-grid,
  .feature-grid,
  .match-query-form,
  .match-summary-grid,
  .match-search-bar,
  .match-stat-strip,
  .match-stat-strip.compact,
  .match-detail-stats,
  .music-summary-grid,
  .admin-summary-grid,
  .music-toolbar,
  .music-upload-form,
  .profile-console,
  .captcha-row,
  .screenshot-browser,
  .admin-toolbar,
  .admin-management-grid,
  .admin-form,
  .admin-picker-head,
  .admin-node-picker-item {
    grid-template-columns: 1fr;
  }

  .match-search-bar button,
  .match-secondary-button {
    width: 100%;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .match-card-score {
    justify-items: start;
  }

  .match-score-board {
    align-items: stretch;
    flex-direction: column;
  }

  .match-score-side,
  .match-score-side.right {
    justify-content: space-between;
    width: 100%;
  }

  .match-player-table {
    overflow-x: auto;
  }

  .match-player-row {
    min-width: 560px;
  }

  .admin-user-card,
  .admin-group-card,
  .oauth-account-card,
  .profile-device-card-item {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    grid-template-columns: 1fr;
  }

  .profile-avatar {
    width: 76px;
    height: 76px;
  }

  .profile-meta-grid {
    grid-template-columns: 1fr;
  }

  .profile-device-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-device-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .admin-user-card .admin-card-actions {
    grid-column: 1 / -1;
  }

  .admin-card-actions,
  .admin-pagination {
    justify-content: flex-start;
  }

  .admin-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-modal {
    padding: 10px;
  }

  .admin-modal-panel,
  .admin-modal-panel.compact {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .admin-modal .admin-form {
    padding: 12px;
  }

  .feature-card,
  .feature-card:nth-child(2n),
  .feature-card:nth-child(4n) {
    border-right: 0;
  }

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

  .global-search {
    grid-template-columns: 1fr;
    padding-right: 8px;
  }

  .global-search button {
    display: none;
  }

  .login-page {
    padding: 12px;
  }

  .bind-qq-shell {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .bind-qq-panel {
    padding: 18px;
  }

  .bind-hero-icon {
    width: 36px;
    height: 36px;
  }

  .bind-hero h1 {
    font-size: 20px;
  }

  .bind-input-row {
    grid-template-columns: 1fr;
  }

  .bind-input-row button {
    width: 100%;
  }
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  img,
  video,
  canvas,
  iframe {
    max-width: 100%;
  }

  .console-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand user"
      "nav nav"
      "search search";
    align-items: stretch;
  }

  .console-brand {
    grid-area: brand;
    min-width: 0;
  }

  .header-nav {
    grid-area: nav;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav-group.active {
    min-width: max-content;
  }

  .global-search {
    grid-area: search;
    min-width: 0;
    margin: 8px 10px 10px;
  }

  .search-results {
    max-height: min(360px, calc(100dvh - 170px));
    overflow-y: auto;
  }

  .console-user {
    grid-area: user;
    min-width: 0;
    border-top: 0;
    border-left: 1px solid var(--header-line);
  }

  .console-user-meta small {
    display: none;
  }

  .console-body,
  .workspace,
  .page-view,
  .panel,
  .music-console,
  .admin-console,
  .match-page-shell,
  .profile-console {
    min-width: 0;
  }

  .sidebar {
    overflow-x: hidden;
  }

  .sidebar-nav {
    -webkit-overflow-scrolling: touch;
  }

  .workspace {
    padding: 14px 12px 30px;
  }

  .breadcrumb {
    overflow-x: auto;
    max-width: 100%;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .page-head,
  .panel-head,
  .music-section-head,
  .admin-section-head,
  .match-section-head,
  .doc-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head,
  .music-console,
  .admin-console,
  .profile-console {
    padding: 14px;
  }

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

  .music-toolbar,
  .music-upload-form,
  .admin-picker-head,
  .screenshot-browser {
    grid-template-columns: 1fr;
  }

  .music-section-head span,
  .admin-section-head span {
    max-width: 100%;
  }

  .music-actions,
  .admin-card-actions,
  .admin-form-actions,
  .admin-page-actions,
  .oauth-bind-actions {
    flex-wrap: wrap;
  }

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

  .admin-toolbar label:first-child {
    grid-column: 1 / -1;
  }

  .admin-picker-panel,
  .admin-node-picker,
  .admin-check-grid.compact {
    max-height: min(360px, 54dvh);
  }

  .admin-modal {
    align-items: stretch;
    padding: 12px;
  }

  .admin-modal-panel,
  .admin-modal-panel.compact {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .profile-oauth-frame-panel {
    width: calc(100vw - 24px);
  }

  .profile-oauth-frame-stage,
  .profile-oauth-frame-stage iframe {
    min-height: min(360px, 70dvh);
  }

  .screenshot-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .doc-shell {
    width: calc(100% - 24px);
    margin: 14px auto;
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .console-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .console-brand,
  .console-user {
    min-height: 44px;
    padding: 0 10px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .console-user {
    gap: 8px;
  }

  .console-user-meta {
    display: none;
  }

  .logout-link {
    min-height: 28px;
    padding: 0 8px;
  }

  .header-nav {
    min-height: 40px;
  }

  .header-nav-group {
    gap: 4px;
    padding: 0 8px;
  }

  .header-nav a {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .global-search {
    margin: 8px;
    padding: 0 8px;
  }

  .global-search input {
    min-width: 0;
  }

  .search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: min(420px, calc(100dvh - 150px));
  }

  .sidebar-nav {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    gap: 8px;
    padding: 8px;
  }

  .sidebar-section {
    min-width: 0;
  }

  .sidebar-section[open] {
    grid-column: 1 / -1;
  }

  .sidebar-section summary {
    min-height: 38px;
    padding: 0 9px;
    font-size: 13px;
  }

  .sidebar-subnav {
    grid-template-columns: 1fr;
    padding: 6px 7px 8px;
  }

  .sidebar-nav a {
    min-height: 34px;
    padding: 0 9px 0 16px;
    white-space: normal;
  }

  .workspace {
    padding: 12px 10px 28px;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .page-head p,
  .panel-head p,
  .match-hero-title p {
    font-size: 12px;
  }

  .panel-head {
    gap: 10px;
    padding: 13px;
  }

  .metrics-grid,
  .guide-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .quick-grid a,
  .guide-grid article,
  .feature-card {
    min-height: auto;
  }

  .toast-notification,
  .login-toast {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    transform: translateY(-130%);
  }

  .toast-notification.show,
  .login-toast.show {
    transform: translateY(0);
  }

  .login-page {
    place-items: center;
    min-height: 100svh;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .login-shell {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }

  .login-panel {
    padding: 18px;
  }

  .login-brand {
    align-items: center;
  }

  .login-brand h1 {
    font-size: 20px;
  }

  .login-form {
    gap: 12px;
  }

  .qq-verify-row,
  .captcha-row {
    grid-template-columns: 1fr;
  }

  .qq-verify-row button,
  .captcha-row img {
    width: 100%;
  }

  .oauth-frame-stage,
  .oauth-frame-stage iframe {
    min-height: min(260px, 48dvh);
  }

  .bind-progress {
    grid-template-columns: 1fr;
  }

  .bind-hero {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .profile-card,
  .music-control-panel,
  .admin-list-panel,
  .admin-permission-catalog {
    padding: 12px;
  }

  .profile-identity {
    justify-items: start;
  }

  .profile-avatar {
    border-radius: var(--radius);
  }

  .oauth-account-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .oauth-account-card button,
  .profile-form button,
  .profile-action-button,
  .profile-action-link {
    width: 100%;
  }

  .music-console,
  .admin-console,
  .profile-console {
    gap: 12px;
    padding: 12px;
  }

  .music-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .music-cover {
    width: 58px;
    height: 58px;
    font-size: 20px;
  }

  .music-title-row {
    flex-wrap: wrap;
  }

  .music-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .music-actions button,
  .music-applied button {
    width: 100%;
    min-width: 0;
  }

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

  .admin-toolbar,
  .admin-toolbar-compact,
  .admin-temp-head,
  .admin-temp-duration,
  .admin-temp-grid,
  .admin-picker-head,
  .admin-node-picker-item,
  .admin-oauth-item {
    grid-template-columns: 1fr;
  }

  .admin-user-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .admin-group-card,
  .admin-node-summary {
    grid-template-columns: 1fr;
  }

  .admin-card-actions,
  .admin-form-actions,
  .admin-node-picker-item > div:last-child,
  .admin-page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .admin-card-actions button,
  .admin-form-actions button,
  .admin-page-actions button,
  .admin-node-picker-item button {
    width: 100%;
    min-width: 0;
  }

  .admin-check-grid,
  .admin-check-grid.compact {
    grid-template-columns: 1fr;
  }

  .admin-node-source-list li,
  .admin-node-title code,
  .admin-node-title small {
    white-space: normal;
    word-break: break-all;
  }

  .admin-modal {
    padding: 8px;
  }

  .admin-modal-panel,
  .admin-modal-panel.compact {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
  }

  .admin-modal-head {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .admin-modal-close {
    flex: 0 0 auto;
  }

  .admin-modal .admin-form {
    padding: 12px;
  }

  .screenshot-player-list {
    max-height: 220px;
    overflow-y: auto;
  }

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

  .match-hero {
    min-height: auto;
    padding: 16px;
  }

  .match-hero-title {
    align-items: flex-start;
  }

  .match-hero-title h2 {
    font-size: 20px;
  }

  .match-hero-icon {
    width: 40px;
    height: 40px;
  }

  .match-hero-icon svg {
    width: 24px;
    height: 24px;
  }

  .match-list,
  .match-detail-content,
  .match-mini-list {
    padding: 10px;
  }

  .match-card {
    min-height: auto;
    padding: 12px;
  }

  .match-card-main {
    align-items: flex-start;
  }

  .match-card-stats span,
  .match-card-mvp {
    max-width: 100%;
  }

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

  .match-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .match-pagination button {
    width: 100%;
  }

  .doc-shell {
    width: calc(100% - 20px);
    padding: 12px;
  }

  .doc-content {
    padding: 12px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .brand-text {
    font-size: 14px;
  }

  .console-user-avatar {
    width: 26px;
    height: 26px;
  }

  .header-nav a {
    padding: 0 8px;
  }

  .topnav-icon {
    width: 15px;
    height: 15px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .sidebar-section[open] {
    grid-column: auto;
  }

  .workspace {
    padding-inline: 8px;
  }

  .panel-title-wrap,
  .match-hero-title {
    gap: 9px;
  }

  .panel-title-icon,
  .match-hero-icon {
    width: 36px;
    height: 36px;
  }

  .panel-title-icon svg,
  .match-hero-icon svg {
    width: 21px;
    height: 21px;
  }

  .admin-summary-grid,
  .match-detail-stats {
    grid-template-columns: 1fr;
  }

  .music-card {
    grid-template-columns: 1fr;
  }

  .music-cover {
    width: 64px;
    height: 64px;
  }

  .music-actions,
  .admin-card-actions,
  .admin-form-actions,
  .admin-page-actions,
  .admin-node-picker-item > div:last-child {
    grid-template-columns: 1fr;
  }

  .match-map-icon {
    width: 36px;
    height: 36px;
  }

  .match-map-icon.large {
    width: 44px;
    height: 44px;
  }

  .match-score-side strong,
  .match-score-vs strong {
    font-size: 24px;
  }

  .match-player-row {
    min-width: 500px;
  }

  .login-panel {
    padding: 16px;
  }

  .login-mode-tabs button {
    min-height: 36px;
    font-size: 12px;
  }

  .bind-qq-panel {
    padding: 16px;
  }
}
