:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-strong: rgba(255, 250, 243, 0.88);
  --bg-soft: rgba(255, 255, 255, 0.62);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #fffaf3;
  --text: #1b1610;
  --muted: #6f6556;
  --line: rgba(40, 28, 15, 0.1);
  --line-strong: rgba(40, 28, 15, 0.16);
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.14);
  --danger: #c2410c;
  --success: #047857;
  --shadow: 0 28px 90px rgba(31, 22, 13, 0.12);
  --shadow-soft: 0 12px 40px rgba(31, 22, 13, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --hero-gradient: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(217, 119, 6, 0.16));
  --font-sans: "Avenir Next", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1316;
  --bg-strong: rgba(18, 25, 29, 0.9);
  --bg-soft: rgba(18, 25, 29, 0.62);
  --surface: rgba(15, 22, 25, 0.82);
  --surface-strong: #12191d;
  --text: #f6f1e8;
  --muted: #9ca9ad;
  --line: rgba(246, 241, 232, 0.08);
  --line-strong: rgba(246, 241, 232, 0.16);
  --primary: #3dd6c6;
  --primary-strong: #2ec4b6;
  --accent: #f6a623;
  --accent-soft: rgba(246, 166, 35, 0.16);
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.22);
  --hero-gradient: linear-gradient(135deg, rgba(61, 214, 198, 0.12), rgba(246, 166, 35, 0.12));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 118, 110, 0.18), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(217, 119, 6, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(15, 118, 110, 0.1), transparent 28%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
  opacity: 0.45;
}

body {
  position: relative;
  padding: 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
}

.glass,
.panel,
.card,
.hero-card,
.metric-card,
.chart-card,
.table-shell,
.auth-card,
.notice-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel,
.card,
.hero-card,
.metric-card,
.chart-card,
.table-shell,
.auth-card,
.notice-card {
  padding: 24px;
}

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

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

.compact-brand h1 {
  font-size: 1.05rem;
}

.compact-brand p {
  font-size: 0.92rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.24);
}

.brand h1,
.section-head h2,
.card h3,
.hero-copy h2,
.hero-copy h1 {
  margin: 0;
}

.brand p,
.muted,
.subtle {
  margin: 0;
  color: var(--muted);
}

.toolbar,
.button-row,
.field-grid,
.metrics-grid,
.endpoint-grid,
.chart-grid,
.admin-grid,
.split-grid {
  display: grid;
  gap: 14px;
}

.toolbar {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: end;
}

.hero-grid,
.split-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.9fr);
}

.hero-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%),
    var(--hero-gradient),
    var(--surface);
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy p {
  margin-top: 14px;
  max-width: 680px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

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

.compact-copy {
  display: grid;
  gap: 14px;
}

.compact-copy p {
  margin: 0;
  max-width: 720px;
  line-height: 1.8;
  color: var(--muted);
}

.hero-points,
.mini-grid,
.toggle-grid,
.timeline-list,
.request-list,
.chip-section {
  display: grid;
  gap: 14px;
}

.hero-points,
.mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.mini-stat {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.mini-stat strong {
  font-size: 1.25rem;
}

.eyebrow,
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 700;
}

.eyebrow strong,
.badge strong,
.tag strong {
  font-weight: 800;
}

.badge.method-get {
  color: var(--success);
}

.badge.method-post {
  color: var(--accent);
}

.badge.method-delete {
  color: var(--danger);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(15, 118, 110, 0.3);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.secondary {
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger), #ea580c);
}

.btn.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.btn.icon-only {
  width: 46px;
  min-width: 46px;
  padding: 0;
}

.btn svg,
.icon svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.section {
  margin-top: 18px;
}

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

.section-head p {
  max-width: 780px;
  line-height: 1.7;
}

.auth-card {
  display: grid;
  gap: 18px;
}

.auth-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.auth-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: grid;
  gap: 14px;
}

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

.field-grid.single {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.identity-card,
.notice-card,
.code-card,
.endpoint-card {
  display: grid;
  gap: 14px;
}

.identity-row,
.inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.key-box,
.code-box,
.console-box {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(11, 17, 19, 0.04);
  color: var(--text);
  overflow: auto;
}

[data-theme="dark"] .key-box,
[data-theme="dark"] .code-box,
[data-theme="dark"] .console-box {
  background: rgba(255, 255, 255, 0.04);
}

.mono {
  font-family: var(--font-mono);
}

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

.metric-card {
  display: grid;
  gap: 12px;
}

.metric-card strong {
  font-size: 1.9rem;
  line-height: 1;
}

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

.announcement-item {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface-strong);
}

.announcement-item h3 {
  margin: 0 0 8px;
}

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

.endpoint-card {
  min-height: 100%;
}

.endpoint-card .path {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  word-break: break-all;
}

.endpoint-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.debug-shell {
  display: grid;
  gap: 18px;
}

.debug-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

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

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

.param-note {
  font-size: 0.92rem;
  color: var(--muted);
}

.code-stack {
  display: grid;
  gap: 12px;
}

.button-row.compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.status-bar {
  min-height: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.status-bar.ok {
  color: var(--success);
}

.status-bar.error {
  color: var(--danger);
}

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

.chart-card {
  display: grid;
  gap: 16px;
}

.chart-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
}

.chart-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.donut-svg {
  width: 200px;
  height: 200px;
}

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

.legend-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

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

.toggle-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.stack-form {
  display: grid;
  gap: 16px;
}

.chip-section {
  margin-top: 18px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.chip-empty {
  width: 100%;
  padding: 12px 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.timeline-item strong {
  display: block;
  margin-bottom: 6px;
}

.timeline-index {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
}

.table-shell {
  display: grid;
  gap: 16px;
}

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

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: rgba(15, 118, 110, 0.08);
}

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

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.pill.warn {
  background: rgba(194, 65, 12, 0.12);
  color: var(--danger);
}

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

.admin-focus-grid {
  align-items: start;
}

.user-focus-card {
  min-height: 100%;
}

.user-focus-empty {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.user-focus-panel {
  display: grid;
  gap: 16px;
}

.request-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 19, 22, 0.46);
  backdrop-filter: blur(12px);
}

.overlay.visible {
  display: flex;
}

.overlay-panel {
  width: min(720px, 100%);
  max-height: min(82vh, 920px);
  overflow: auto;
}

.hidden {
  display: none !important;
}

.fade-up {
  animation: fadeUp 0.55s ease both;
}

.fade-up[data-delay="1"] {
  animation-delay: 0.08s;
}

.fade-up[data-delay="2"] {
  animation-delay: 0.16s;
}

.fade-up[data-delay="3"] {
  animation-delay: 0.24s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero-grid,
  .debug-grid,
  .chart-layout,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .endpoint-grid,
  .chart-grid,
  .field-grid,
  .table-tools,
  .param-grid,
  .param-grid.three,
  .hero-points,
  .mini-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .panel,
  .card,
  .hero-card,
  .metric-card,
  .chart-card,
  .table-shell,
  .auth-card,
  .notice-card {
    padding: 18px;
  }

  .topbar,
  .identity-row,
  .inline-row,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
    justify-content: start;
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
  }

  .btn,
  .btn.small {
    width: 100%;
  }

  .button-row.compact {
    display: grid;
  }

  .auth-tabs {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

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

  .overlay {
    padding: 12px;
  }
}
