/* Shared controls, typography and utility compatibility. Palette: light-system.css. */
html {
  background: var(--pa-bg);
}

body.pa-light-theme {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--pa-text-soft);
  background: var(--pa-surface) !important;
  font-family: var(--pa-font-ui);
  letter-spacing: 0;
  color-scheme: light;
}

body.pa-light-theme::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background: var(--pa-surface);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 76%);
}

body.pa-light-theme::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: var(--pa-surface);
}

body.pa-light-theme a {
  text-underline-offset: 4px;
}

body.pa-light-theme svg {
  flex-shrink: 0;
}

body.pa-light-theme img,
body.pa-light-theme video,
body.pa-light-theme canvas {
  max-width: 100%;
}

body.pa-light-theme .pa-page-shell {
  background: transparent !important;
}

body.pa-light-theme > nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-color: var(--pa-border) !important;
  background: var(--pa-surface) !important;
  box-shadow: none;
  backdrop-filter: blur(18px);
}

body.pa-light-theme main {
  width: min(100%, 1536px);
}

body.pa-light-theme footer {
  border-color: var(--pa-border) !important;
  background: var(--pa-surface) !important;
}

body.pa-light-theme .pa-brand-en {
  color: var(--pa-gold);
  font-family: var(--pa-font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

body.pa-light-theme .pa-brand-cn {
  color: var(--pa-text);
  font-family: var(--pa-font-title);
  font-size: 1.55rem;
  font-weight: 700;
}

body.pa-light-theme .pa-top-nav {
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

body.pa-light-theme .pa-top-nav::-webkit-scrollbar {
  display: none;
}

body.pa-light-theme .pa-top-nav-sep {
  background: var(--pa-border);
}

body.pa-light-theme .pa-top-nav-item {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--pa-radius);
  color: var(--pa-text-soft);
  font-family: var(--pa-font-ui);
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

body.pa-light-theme .pa-top-nav-item::after {
  display: none;
}

body.pa-light-theme .pa-top-nav-item:hover,
body.pa-light-theme .pa-top-nav-item:focus-visible {
  border-color: var(--pa-border);
  background: var(--pa-bg-soft);
  color: var(--pa-text);
  transform: none;
}

body.pa-light-theme .pa-hero,
body.pa-light-theme .pa-card,
body.pa-light-theme .pa-agent-sidebar,
body.pa-light-theme .pa-agent-stage,
body.pa-light-theme .pa-brand-panel,
body.pa-light-theme .pa-card-like {
  border: 1px solid var(--pa-border) !important;
  border-radius: var(--pa-radius) !important;
  background: var(--pa-surface) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px);
}

body.pa-light-theme .pa-hero {
  position: relative;
  overflow: hidden;
}

body.pa-light-theme .pa-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: var(--pa-surface);
}

body.pa-light-theme .pa-hero > * {
  position: relative;
}

body.pa-light-theme .pa-card-hover:hover {
  border-color: var(--pa-border-strong) !important;
  box-shadow: none !important;
  transform: translateY(-1px);
}

body.pa-light-theme .pa-page-title,
body.pa-light-theme .pa-section-title {
  color: var(--pa-text) !important;
  font-family: var(--pa-font-title);
  letter-spacing: 0;
}

body.pa-light-theme .pa-page-subtitle {
  color: var(--pa-text-soft) !important;
}

body.pa-light-theme .pa-badge,
body.pa-light-theme .pill,
body.pa-light-theme [class*="rounded-full"][class*="bg-indigo"],
body.pa-light-theme [class*="rounded-full"][class*="bg-slate"],
body.pa-light-theme [class*="rounded-full"][class*="border"]:not([style*="conic-gradient"]) {
  border-color: var(--pa-border) !important;
  background: var(--pa-bg-soft) !important;
  color: var(--pa-text-soft) !important;
}

body.pa-light-theme .pa-btn-primary,
body.pa-light-theme .solid-button,
body.pa-light-theme button[type="submit"].bg-indigo-600,
body.pa-light-theme a.bg-indigo-600,
body.pa-light-theme .bg-indigo-600 {
  border: 1px solid var(--pa-border) !important;
  border-radius: var(--pa-radius) !important;
  background: var(--pa-surface) !important;
  color: var(--pa-text) !important;
  font-weight: 750;
  box-shadow: none !important;
}

body.pa-light-theme .pa-btn-primary:hover,
body.pa-light-theme button[type="submit"].bg-indigo-600:hover,
body.pa-light-theme a.bg-indigo-600:hover {
  filter: brightness(1.05);
}

body.pa-light-theme .pa-btn-secondary,
body.pa-light-theme .ghost-button,
body.pa-light-theme a.border,
body.pa-light-theme button.border {
  border-color: var(--pa-border) !important;
  border-radius: var(--pa-radius) !important;
  background: var(--pa-bg-soft) !important;
  color: var(--pa-text-soft) !important;
  box-shadow: none !important;
}

body.pa-light-theme .pa-btn-secondary:hover,
body.pa-light-theme .ghost-button:hover,
body.pa-light-theme a.border:hover,
body.pa-light-theme button.border:hover {
  border-color: var(--pa-border-strong) !important;
  background: rgba(44, 62, 48, .035) !important;
  color: var(--pa-text) !important;
}

body.pa-light-theme .bg-white,
body.pa-light-theme .bg-white\/70,
body.pa-light-theme .bg-white\/72,
body.pa-light-theme .bg-white\/75,
body.pa-light-theme .bg-white\/82,
body.pa-light-theme .bg-white\/84,
body.pa-light-theme .bg-white\/85,
body.pa-light-theme .bg-white\/88,
body.pa-light-theme .bg-white\/90,
body.pa-light-theme .bg-white\/95,
body.pa-light-theme .bg-white\/96,
body.pa-light-theme [class*="from-white"],
body.pa-light-theme [class*="to-white"],
body.pa-light-theme [class*="via-white"] {
  background: var(--pa-bg-panel) !important;
}

body.pa-light-theme .bg-slate-50,
body.pa-light-theme .bg-slate-100,
body.pa-light-theme .bg-slate-200,
body.pa-light-theme .bg-gray-50,
body.pa-light-theme .bg-gray-100,
body.pa-light-theme .bg-indigo-50,
body.pa-light-theme .bg-indigo-100,
body.pa-light-theme .bg-sky-50,
body.pa-light-theme .bg-violet-50 {
  background: var(--pa-bg-soft) !important;
}

body.pa-light-theme .bg-emerald-50,
body.pa-light-theme .bg-emerald-100,
body.pa-light-theme .bg-emerald-400,
body.pa-light-theme .bg-emerald-500 {
  background: var(--pa-positive-soft) !important;
}

body.pa-light-theme .bg-rose-50,
body.pa-light-theme .bg-rose-100,
body.pa-light-theme .bg-red-50,
body.pa-light-theme .bg-red-100,
body.pa-light-theme .bg-rose-400,
body.pa-light-theme .bg-rose-500 {
  background: var(--pa-negative-soft) !important;
}

body.pa-light-theme .bg-amber-50,
body.pa-light-theme .bg-amber-100,
body.pa-light-theme .bg-yellow-50,
body.pa-light-theme .bg-yellow-100 {
  background: var(--pa-gold-soft) !important;
}

body.pa-light-theme .border,
body.pa-light-theme .border-t,
body.pa-light-theme .border-b,
body.pa-light-theme .border-l,
body.pa-light-theme .border-r,
body.pa-light-theme [class*="border-slate"],
body.pa-light-theme [class*="border-gray"],
body.pa-light-theme [class*="border-indigo"],
body.pa-light-theme [class*="border-white"] {
  border-color: var(--pa-border) !important;
}

body.pa-light-theme .text-gray-500,
body.pa-light-theme .text-gray-600,
body.pa-light-theme .text-gray-700,
body.pa-light-theme .text-gray-800,
body.pa-light-theme .text-slate-400,
body.pa-light-theme .text-slate-500,
body.pa-light-theme .text-slate-600,
body.pa-light-theme .text-slate-700 {
  color: var(--pa-muted) !important;
}

body.pa-light-theme .text-slate-800,
body.pa-light-theme .text-slate-900,
body.pa-light-theme .text-gray-900 {
  color: var(--pa-text) !important;
}

body.pa-light-theme .text-indigo-600,
body.pa-light-theme .text-indigo-700,
body.pa-light-theme .text-sky-600,
body.pa-light-theme .text-sky-700,
body.pa-light-theme .text-cyan-700 {
  color: var(--pa-accent) !important;
}

body.pa-light-theme .text-emerald-500,
body.pa-light-theme .text-emerald-600,
body.pa-light-theme .text-emerald-700 {
  color: var(--pa-positive) !important;
}

body.pa-light-theme .text-rose-500,
body.pa-light-theme .text-rose-600,
body.pa-light-theme .text-rose-700,
body.pa-light-theme .text-red-500,
body.pa-light-theme .text-red-600 {
  color: var(--pa-negative) !important;
}

body.pa-light-theme .text-amber-500,
body.pa-light-theme .text-amber-600,
body.pa-light-theme .text-amber-700,
body.pa-light-theme .text-yellow-600,
body.pa-light-theme .text-yellow-700 {
  color: var(--pa-gold) !important;
}

body.pa-light-theme input:not([type="checkbox"]):not([type="radio"]),
body.pa-light-theme select,
body.pa-light-theme textarea {
  border-color: var(--pa-border) !important;
  border-radius: var(--pa-radius) !important;
  background: var(--pa-surface) !important;
  color: var(--pa-text) !important;
  box-shadow: none !important;
}

body.pa-light-theme input::placeholder,
body.pa-light-theme textarea::placeholder {
  color: var(--pa-faint) !important;
}

body.pa-light-theme input:focus,
body.pa-light-theme select:focus,
body.pa-light-theme textarea:focus,
body.pa-light-theme button:focus-visible,
body.pa-light-theme a:focus-visible {
  border-color: var(--pa-border-strong) !important;
  outline: 2px solid rgba(84, 220, 199, 0.18) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

body.pa-light-theme input[type="checkbox"],
body.pa-light-theme input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-content: center;
  border-color: var(--pa-border-strong) !important;
  background-color: var(--pa-surface) !important;
  color: var(--pa-text) !important;
  cursor: pointer;
}

body.pa-light-theme input[type="checkbox"] {
  border-radius: .28rem !important;
}

body.pa-light-theme input[type="radio"] {
  border-radius: 999px !important;
}

body.pa-light-theme input[type="checkbox"]:checked,
body.pa-light-theme input[type="radio"]:checked {
  border-color: var(--pa-accent) !important;
  background-color: var(--pa-accent) !important;
}

body.pa-light-theme input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.1 8.2 6.35 11.3 12.9 4.8' fill='none' stroke='%23fff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: .82rem .82rem;
}

body.pa-light-theme input[type="radio"]:checked {
  background-image: radial-gradient(circle, #fff 0 28%, transparent 32%) !important;
}

body.pa-light-theme input[type="file"]::file-selector-button {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--pa-accent-soft);
  color: var(--pa-accent);
}

body.pa-light-theme label {
  color: var(--pa-text-soft);
}

body.pa-light-theme table {
  width: 100%;
  border-color: var(--pa-border) !important;
}

body.pa-light-theme th {
  color: var(--pa-faint) !important;
  font-family: var(--pa-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

body.pa-light-theme td {
  color: var(--pa-text-soft) !important;
}

body.pa-light-theme tr:hover {
  background: var(--pa-bg-soft) !important;
}

body.pa-light-theme .shadow,
body.pa-light-theme .shadow-sm,
body.pa-light-theme .shadow-md,
body.pa-light-theme .shadow-lg,
body.pa-light-theme .shadow-xl,
body.pa-light-theme .shadow-2xl,
body.pa-light-theme [class*="shadow-"] {
  box-shadow: none !important;
}

body.pa-light-theme .rounded-3xl,
body.pa-light-theme .rounded-2xl,
body.pa-light-theme .rounded-xl,
body.pa-light-theme [class*="rounded-["] {
  border-radius: var(--pa-radius) !important;
}

body.pa-light-theme .divide-y > :not([hidden]) ~ :not([hidden]),
body.pa-light-theme .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
body.pa-light-theme .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--pa-border) !important;
}

body.pa-light-theme .pa-terminal-kicker {
  color: var(--pa-faint);
  font-family: var(--pa-font-mono);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.pa-light-theme .pa-terminal-metric {
  font-family: var(--pa-font-mono);
  font-variant-numeric: tabular-nums;
}

body.pa-light-theme .pa-terminal-divider {
  border-color: var(--pa-border) !important;
}

body.pa-light-theme .pa-terminal-subpanel {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--pa-bg-soft);
}

body.pa-light-theme .pa-footer-contact-link {
  color: var(--pa-text-soft);
}

body.pa-light-theme .pa-footer-contact-icon {
  border: 1px solid var(--pa-border);
  background: var(--pa-bg-soft) !important;
  color: var(--pa-accent) !important;
}

body.pa-light-theme .pa-agent-shell::before,
body.pa-light-theme .pa-agent-stage > .absolute {
  background: transparent !important;
}

body.pa-light-theme .pa-agent-richtext h1,
body.pa-light-theme .pa-agent-richtext h2,
body.pa-light-theme .pa-agent-richtext h3,
body.pa-light-theme .pa-agent-richtext strong {
  color: var(--pa-text) !important;
}

body.pa-light-theme .pa-agent-richtext code {
  background: var(--pa-bg-soft) !important;
  color: var(--pa-accent) !important;
}

body.pa-light-theme .pa-model-item-selected {
  border-color: var(--pa-border) !important;
  background: var(--pa-accent-soft) !important;
  color: var(--pa-accent) !important;
}

body.pa-light-theme #pa-fb-panel {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius) !important;
  background: var(--pa-bg-panel-solid);
  box-shadow: none !important;
}

body.pa-light-theme #pa-fb-body {
  background: var(--pa-bg-panel-solid) !important;
}

body.pa-light-theme #pa-fb-panel svg path[fill="#f8f9fb"] {
  fill: var(--pa-bg-panel-solid);
}

body.pa-light-theme .prose,
body.pa-light-theme .prose :where(p, li, td) {
  color: var(--pa-text-soft);
}

body.pa-light-theme .prose :where(h1, h2, h3, h4, strong) {
  color: var(--pa-text);
}

body.pa-light-theme .overflow-x-auto,
body.pa-light-theme .table-scroll {
  scrollbar-color: rgba(145, 171, 178, 0.42) transparent;
}

body.pa-light-theme ::selection {
  background: var(--pa-primary-soft);
  color: var(--pa-text);
}

@media (max-width: 768px) {
  body.pa-light-theme main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.pa-light-theme > nav .max-w-screen-2xl {
    align-items: flex-start;
    gap: 0.75rem;
  }

  body.pa-light-theme .pa-brand-cn {
    font-size: 1.25rem;
  }

  body.pa-light-theme .pa-brand-en {
    font-size: 0.7rem;
  }

  body.pa-light-theme .pa-top-nav {
    width: 100%;
    order: 3;
  }

  body.pa-light-theme .pa-hero,
  body.pa-light-theme .pa-card {
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pa-light-theme *,
  body.pa-light-theme *::before,
  body.pa-light-theme *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
