:root {
  color-scheme: light;
  --yt-font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --yt-canvas: #f7f7f8;
  --yt-surface: rgba(255, 255, 255, .72);
  --yt-surface-strong: rgba(255, 255, 255, .88);
  --yt-ink: #202123;
  --yt-muted: #6b7280;
  --yt-brand: #4f46e5;
  --yt-brand-hover: #4338ca;
  --yt-brand-active: #3730a3;
  --yt-brand-soft: rgba(79, 70, 229, .10);
  --yt-brand-focus: rgba(79, 70, 229, .20);
  --yt-line: rgba(32, 33, 35, .12);
  --yt-shadow: 0 22px 64px rgba(31, 35, 48, .08), inset 0 1px 0 rgba(255, 255, 255, .78);
  --yt-control-radius: 14px;
  --yt-card-radius: 28px;

  /* Compatibility aliases keep every legacy page on the same YutoGPT palette. */
  --page-bg: var(--yt-canvas);
  --text-main: var(--yt-ink);
  --text-sub: var(--yt-muted);
  --ink: var(--yt-ink);
  --card-bg: var(--yt-surface);
  --card-border: var(--yt-line);
  --chip-bg: var(--yt-brand-soft);
  --blue: var(--yt-brand);
  --accent: var(--yt-brand);
  --accent-dark: var(--yt-brand-active);
  --muted: var(--yt-muted);
  --line: var(--yt-line);
  --surface: var(--yt-surface);
  --color-primary: var(--yt-brand);
  --color-primary-light: #6366f1;
  --color-primary-dark: var(--yt-brand-active);
  --color-accent: var(--yt-brand);
  --color-accent-dark: var(--yt-brand-hover);
  --color-accent-rgb: 79, 70, 229;
  --color-text-primary: var(--yt-ink);
  --color-text-secondary: #4b5563;
  --color-text-light: var(--yt-muted);
  --color-text-lighter: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f0f1f3;
  --color-bg-gray: #f7f7f8;
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--yt-font);
}

html { background: var(--yt-canvas); }

body {
  color: var(--yt-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a { -webkit-tap-highlight-color: transparent; }

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

.home-page a.bg-gray-800,
.price-page a.bg-gray-800 {
  color: #fff;
  background: var(--yt-brand);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .22);
}
.home-page a.bg-gray-800:hover,
.price-page a.bg-gray-800:hover {
  color: #fff;
  background: var(--yt-brand-hover);
}

/* Compact public pages use the same glass shell, spacing, type and surfaces. */
body.content-page,
body.not-found-page {
  background:
    radial-gradient(circle at 12% 4%, rgba(224, 231, 255, .72), transparent 32rem),
    radial-gradient(circle at 86% 16%, rgba(199, 210, 254, .46), transparent 34rem),
    var(--yt-canvas);
}

.content-page > header {
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 18px auto 0;
  padding: 10px 16px 10px 20px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 22px;
  background: rgba(255, 255, 255, .70);
  box-shadow: 0 20px 60px rgba(31, 35, 48, .10), inset 0 1px 0 rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

.content-page > header .brand {
  color: var(--yt-ink);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.035em;
  text-decoration: none;
}

.content-page .lang-toggle { gap: 4px; }
.content-page .lang-toggle button {
  min-height: 40px;
  padding: 0 13px;
  border-color: transparent;
  color: var(--yt-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.content-page .lang-toggle button:hover { color: var(--yt-ink); background: rgba(255, 255, 255, .72); }
.content-page .lang-toggle button.active {
  border-color: transparent;
  color: #fff;
  background: var(--yt-brand);
}

.content-page main { width: min(1180px, 100%); margin: 0 auto; }

.content-page :where(.hero-card, .card, .case-card, .cite-box, .panel, .support-panel, .faq-panel, .grid .item) {
  border-color: rgba(255, 255, 255, .82);
  background: var(--yt-surface);
  box-shadow: var(--yt-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
}

.content-page :where(.hero-card h1, h1, h2, h3) {
  color: var(--yt-ink);
  letter-spacing: -.035em;
}

.content-page .hero-card h1 { margin-top: 0; }

.content-page :where(.hero-links, .quick-links, .cite-links, .support-links) a {
  min-height: 44px;
  border-color: var(--yt-line);
  color: var(--yt-brand);
  background: rgba(255, 255, 255, .64);
  font-weight: 650;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.content-page :where(.hero-links, .quick-links, .cite-links, .support-links) a:hover {
  border-color: rgba(79, 70, 229, .28);
  color: var(--yt-brand-hover);
  background: rgba(255, 255, 255, .92);
  transform: translateY(-1px);
}

.content-page .card .icon,
.content-page .grid .item .grid-icon { background: var(--yt-brand); }
.content-page .card a { color: var(--yt-brand); font-weight: 650; }

.content-page > footer {
  margin-top: 4rem;
  border-color: transparent;
  color: #999;
  background: #1a1a2e;
}
.content-page > footer a { color: #999; }
.content-page > footer a:hover { color: #fff; }

/* Pricing keeps its rich layout while sharing the same brand buttons and shell. */
.price-page {
  background:
    radial-gradient(circle at 12% 4%, rgba(224, 231, 255, .62), transparent 32rem),
    radial-gradient(circle at 86% 16%, rgba(199, 210, 254, .38), transparent 34rem),
    var(--yt-canvas);
}

.price-page .main-nav {
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 22px;
  background: rgba(255, 255, 255, .70);
  box-shadow: 0 20px 60px rgba(31, 35, 48, .10), inset 0 1px 0 rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}

.price-page .pricing-toggle-button.active,
.price-page .subscribe-button:not(.secondary),
.price-page .pricing-card.highlight .subscribe-button {
  border-color: var(--yt-brand);
  color: #fff;
  background: var(--yt-brand);
  box-shadow: 0 12px 28px rgba(79, 70, 229, .24);
}

.price-page .pricing-toggle-button.active:hover,
.price-page .subscribe-button:not(.secondary):hover,
.price-page .pricing-card.highlight .subscribe-button:hover {
  border-color: var(--yt-brand-hover);
  color: #fff;
  background: var(--yt-brand-hover);
  box-shadow: 0 16px 34px rgba(79, 70, 229, .30);
}

.price-page .subscribe-button.secondary {
  border-color: var(--yt-line);
  color: var(--yt-brand);
  background: rgba(255, 255, 255, .72);
}
.price-page .subscribe-button.secondary:hover {
  border-color: rgba(79, 70, 229, .26);
  color: var(--yt-brand-hover);
  background: #fff;
}
.price-page .comparison-table .fa-check,
.price-page .feature-list li .fa-check-circle { color: var(--yt-brand); }

.not-found-page {
  display: grid;
  min-height: 100vh;
  margin: 0;
  place-items: center;
}
.not-found-card {
  width: min(520px, calc(100% - 40px));
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--yt-card-radius);
  background: var(--yt-surface);
  box-shadow: var(--yt-shadow);
  text-align: center;
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
}
.not-found-card h1 { margin: 0 0 10px; font-size: clamp(42px, 9vw, 72px); letter-spacing: -.055em; }
.not-found-card p { margin: 0 0 26px; color: var(--yt-muted); }
.not-found-card a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: var(--yt-control-radius);
  color: #fff;
  background: var(--yt-brand);
  font-weight: 700;
  text-decoration: none;
}
.not-found-card a:hover { background: var(--yt-brand-hover); }

@media (max-width: 768px) {
  .content-page > header { width: calc(100% - 24px); margin-top: 8px; border-radius: 18px; }
  .content-page main { padding-right: 12px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
