:root {
  --bg: #f5efe6;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #1d2733;
  --muted: #617182;
  --accent: #d06f3d;
  --accent-strong: #8b3b18;
  --good: #1f8a5b;
  --warn: #c77c11;
  --bad: #bb3f3f;
  --shadow: 0 24px 70px rgba(39, 51, 65, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1180px;
  --topbar-bg: rgba(245, 239, 230, 0.58);
  --topbar-border: rgba(29, 39, 51, 0.06);
  --panel-border: rgba(255, 255, 255, 0.55);
  --panel-bg:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.55)),
    linear-gradient(120deg, rgba(243, 186, 144, 0.18), rgba(88, 143, 170, 0.14));
  --nav-active-bg: rgba(255, 255, 255, 0.68);
  --ghost-bg: rgba(255, 255, 255, 0.6);
  --ghost-border: rgba(29, 39, 51, 0.1);
  --card-border: rgba(255, 255, 255, 0.74);
  --meter-bg: rgba(20, 32, 48, 0.08);
  --chart-bg: linear-gradient(180deg, rgba(17, 24, 39, 0.04), rgba(17, 24, 39, 0.01));
  --chart-grid: rgba(29, 39, 51, 0.08);
  --chart-fill: rgba(208, 111, 61, 0.14);
  --brand-glow: rgba(208, 111, 61, 0.12);
  --brand-core-a: #ffe9c2;
  --brand-core-b: #c56b38;
  --brand-core-c: #7b3215;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(252, 209, 137, 0.5), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(151, 220, 211, 0.4), transparent 26%),
    radial-gradient(circle at bottom right, rgba(198, 168, 221, 0.18), transparent 20%),
    linear-gradient(180deg, #f3ecdf 0%, #eef4f7 100%);
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
}

html[data-theme="dark"] {
  --bg: #121824;
  --surface: rgba(25, 34, 48, 0.82);
  --text: #eef5ff;
  --muted: #93a0b7;
  --accent: #5b78ff;
  --accent-strong: #7d95ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  --topbar-bg: rgba(16, 22, 31, 0.74);
  --topbar-border: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-bg:
    linear-gradient(180deg, rgba(28, 36, 51, 0.94), rgba(18, 24, 34, 0.96)),
    linear-gradient(140deg, rgba(91, 120, 255, 0.14), rgba(32, 192, 143, 0.08));
  --nav-active-bg: rgba(255, 255, 255, 0.07);
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-border: rgba(255, 255, 255, 0.12);
  --card-border: rgba(255, 255, 255, 0.08);
  --meter-bg: rgba(255, 255, 255, 0.08);
  --chart-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-fill: rgba(91, 120, 255, 0.14);
  --brand-glow: rgba(91, 120, 255, 0.16);
  --brand-core-a: #c9d8ff;
  --brand-core-b: #5b78ff;
  --brand-core-c: #3246aa;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(91, 120, 255, 0.16), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(52, 163, 193, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(32, 192, 143, 0.12), transparent 20%),
    linear-gradient(180deg, #161b26 0%, #10151d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 78%);
  opacity: 0.24;
}

html[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  opacity: 0.18;
}

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

.shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
}

.topbar-inner {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, var(--brand-core-a), var(--brand-core-b) 56%, var(--brand-core-c) 100%);
  box-shadow: 0 0 0 6px var(--brand-glow);
}

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

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--nav-active-bg);
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ghost-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--ghost-bg);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-weight: 700;
  transition: 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(39, 51, 65, 0.12);
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.95rem;
}

.page {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.section,
.coming-card {
  position: relative;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.hero {
  padding: 52px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.section,
.coming-card {
  margin-top: 28px;
  padding: 30px;
  border-radius: var(--radius-lg);
}

.eyebrow,
.tile-badge,
.status-pill,
.mini-label,
.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .tile-badge,
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .mini-label,
html[data-theme="dark"] .stat-label {
  color: #dbe6ff;
  background: linear-gradient(135deg, rgba(125, 149, 255, 0.22), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(125, 149, 255, 0.2);
}

.hero h1,
.hero h2,
.coming-card h1,
.tile h3,
.section-head h2 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.hero h1,
.hero h2 {
  max-width: 9.6em;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
}

.coming-card h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
}

.tile h3,
.section-head h2 {
  font-size: clamp(1.5rem, 2.7vw, 2.4rem);
}

.hero p,
.tile p,
.section-head p,
.supporting-text,
.page-note,
.muted,
.stat-meta {
  color: var(--muted);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.72;
}

.hero-actions,
.timeline,
.stats-grid,
.panel-grid,
.data-grid {
  display: grid;
  gap: 16px;
}

.hero-actions {
  grid-auto-flow: column;
  justify-content: start;
  margin-top: 26px;
}

.hero p {
  margin: 18px 0 0;
  max-width: 680px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.tile,
.stat-card,
.wide-card,
.status-line,
.data-item {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--card-border);
}

.tile {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(39, 51, 65, 0.09);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.tile-actions {
  align-content: start;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(39, 51, 65, 0.14);
  border-color: rgba(208, 111, 61, 0.32);
}

.tile-link,
.hero-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-weight: 700;
}

.tile-link,
.hero-link {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 30px rgba(139, 59, 24, 0.22);
}

.ghost-link {
  color: var(--text);
  border: 1px solid var(--ghost-border);
  background: var(--ghost-bg);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ghost-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--ghost-bg);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.status-pill-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: 180ms ease;
}

.status-pill-button:hover {
  color: var(--text);
  transform: translateY(-1px);
}

html[data-theme="dark"] .status-pill-button {
  color: #dbe6ff;
  background: linear-gradient(135deg, rgba(125, 149, 255, 0.22), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(125, 149, 255, 0.2);
}

.tile-action-row,
.hero-actions-wrap,
.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tile-action-row {
  margin-top: auto;
}

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

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

.service-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.service-card-top p {
  margin-bottom: 0;
}

.service-meta {
  display: grid;
  gap: 10px;
}

.service-meta span {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

html[data-theme="dark"] .service-meta span {
  background: rgba(255, 255, 255, 0.04);
}

.service-card-actions {
  gap: 12px;
}

.service-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ghost-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--ghost-bg);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.service-button.is-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 30px rgba(139, 59, 24, 0.22);
}

.service-button.is-danger {
  color: var(--bad);
  border-color: rgba(187, 63, 63, 0.18);
  background: rgba(187, 63, 63, 0.08);
}

.service-button:hover {
  transform: translateY(-1px);
}

.service-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

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

.stat-card,
.wide-card,
.status-line,
.data-item {
  padding: 22px;
}

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

.stat-value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.panel-grid {
  grid-template-columns: 1.55fr 1fr;
  margin-top: 16px;
}

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

.meter {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--meter-bg);
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #d06f3d);
  width: 0;
  transition: width 380ms ease;
}

.chart svg {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  background: var(--chart-bg);
}

.chart-grid line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-fill {
  fill: var(--chart-fill);
}

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

.data-item strong,
.status-line strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.timeline {
  gap: 12px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 6px rgba(97, 113, 130, 0.12);
}

.status-dot.is-good {
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(31, 138, 91, 0.12);
}

.status-dot.is-warn {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(199, 124, 17, 0.12);
}

.status-dot.is-bad {
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(187, 63, 63, 0.12);
}

.code-block {
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 16px;
  background: #17222d;
  color: #e7f1f8;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: rgba(208, 111, 61, 0.78) rgba(255, 255, 255, 0.08);
}

.summary-block {
  white-space: pre-wrap;
  word-break: break-word;
}

.log-block {
  min-height: 420px;
  max-height: 70vh;
}

.code-block::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.code-block::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.code-block::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 214, 168, 0.92), rgba(208, 111, 61, 0.96)) padding-box;
  background-clip: padding-box;
}

.code-block::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(255, 228, 189, 0.98), rgba(224, 123, 69, 1)) padding-box;
  background-clip: padding-box;
}

.code-block::-webkit-scrollbar-corner {
  background: transparent;
}

html[data-theme="dark"] .code-block {
  scrollbar-color: rgba(125, 149, 255, 0.88) rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .code-block::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .code-block::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(173, 191, 255, 0.95), rgba(91, 120, 255, 0.96)) padding-box;
  background-clip: padding-box;
}

html[data-theme="dark"] .code-block::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(198, 211, 255, 0.98), rgba(111, 138, 255, 1)) padding-box;
  background-clip: padding-box;
}

.detail-grid {
  margin-top: 18px;
}

.service-summary-card {
  margin-top: 18px;
}

.inline-status {
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

.footer {
  width: min(calc(100% - 32px), var(--container));
  margin: 18px auto 0;
  padding: 0 0 26px;
  color: var(--muted);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 0.94rem;
}

.center-shell {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
}

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

.is-auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(10px);
}

.auth-dialog {
  position: relative;
  width: min(calc(100% - 24px), 460px);
  margin: min(12vh, 88px) auto 0;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.auth-dialog h2 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.auth-copy,
.auth-status,
.auth-field span {
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

.auth-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field span {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ghost-border);
  border-radius: 14px;
  color: var(--text);
  background: var(--ghost-bg);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(91, 120, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(91, 120, 255, 0.12);
}

.auth-submit {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.auth-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.auth-status[data-tone="error"] {
  color: #ff8798;
}

.auth-status[data-tone="success"] {
  color: #7ee3be;
}

.page-note[data-tone="error"] {
  color: var(--bad);
}

.page-note[data-tone="success"] {
  color: var(--good);
}

.page-note[data-tone="pending"] {
  color: var(--warn);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ghost-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--ghost-bg);
  font-size: 1.2rem;
}

@media (max-width: 980px) {
  .button-grid,
  .stats-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

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

  .section-head,
  .status-line {
    align-items: start;
    justify-content: start;
  }
}

@media (max-width: 720px) {
  .topbar-inner,
  .page,
  .footer {
    width: min(calc(100% - 22px), var(--container));
  }

  .hero,
  .section,
  .coming-card {
    padding: 24px;
  }

  .topbar-inner,
  .topbar-actions {
    align-items: start;
    flex-direction: column;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .data-grid,
  .hero-actions {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }

  .service-card-top {
    flex-direction: column;
  }
}
