/* l288 Console Brand Layer — l288.com / New-API v1.0.0-rc.37
   Keep this file separate from the bundled app CSS so upgrades remain reversible. */
:root,
html[data-theme-preset] {
  --radius: 0.875rem;
  --background: #FAFBFC;
  --foreground: #0F172A;
  --card: #FFFFFF;
  --card-foreground: #0F172A;
  --popover: #FFFFFF;
  --popover-foreground: #0F172A;
  --primary: #765CFF;
  --primary-foreground: #FFFFFF;
  --secondary: #EEF0FF;
  --secondary-foreground: #4B38C7;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #F4F2FF;
  --accent-foreground: #4B38C7;
  --success: #12B8D6;
  --success-foreground: #FFFFFF;
  --info: #0891B2;
  --info-foreground: #FFFFFF;
  --warning: #D97706;
  --warning-foreground: #FFFFFF;
  --border: #E2E8F0;
  --input: #CBD5E1;
  --ring: #35D7FF;
  --chart-1: #765CFF;
  --chart-2: #06B6D4;
  --chart-3: #2563EB;
  --chart-4: #8B5CF6;
  --chart-5: #F59E0B;
  --sidebar: #FFFFFF;
  --sidebar-foreground: #334155;
  --sidebar-primary: #765CFF;
  --sidebar-primary-foreground: #FFFFFF;
  --sidebar-accent: #F4F2FF;
  --sidebar-accent-foreground: #4B38C7;
  --sidebar-border: #E2E8F0;
  --sidebar-ring: #35D7FF;
  --table-row: #FFFFFF;
  --table-header: #F1F5F9;
  --skeleton-base: #F1F5F9;
  --skeleton-highlight: #FFFFFF;
  --font-body: var(--font-sans);
}

html.dark,
html.dark[data-theme-preset] {
  --background: #080D1B;
  --foreground: #EEF0FF;
  --card: #0D1426;
  --card-foreground: #EEF0FF;
  --popover: #0D1426;
  --popover-foreground: #EEF0FF;
  --primary: #8B7BFF;
  --primary-foreground: #0A0D1A;
  --secondary: #201B4A;
  --secondary-foreground: #D6D0FF;
  --muted: #12182A;
  --muted-foreground: #94A3B8;
  --accent: #201B4A;
  --accent-foreground: #D6D0FF;
  --border: #273052;
  --input: #3A4674;
  --ring: #35D7FF;
  --sidebar: #0B1020;
  --sidebar-foreground: #E7E9FF;
  --sidebar-primary: #8B7BFF;
  --sidebar-primary-foreground: #0A0D1A;
  --sidebar-accent: #201B4A;
  --sidebar-accent-foreground: #D6D0FF;
  --sidebar-border: #273052;
  --sidebar-ring: #35D7FF;
  --table-row: #0D1426;
  --table-header: #12182A;
  --skeleton-base: #12182A;
  --skeleton-highlight: #1A2340;
}

html, body {
  background: var(--background);
  color: var(--foreground);
}

/* Consistent l288 surfaces: quiet borders, soft depth, violet-blue accent. */
button, [role="button"], a, input, textarea, select {
  transition-duration: 180ms;
}

button:not([data-slot="icon"]):not(.size-icon),
[role="button"]:not([data-slot="icon"]) {
  border-radius: var(--radius);
}

header, nav {
  border-color: var(--border) !important;
}

/* Primary actions match the violet-to-cyan l288 signal. */
.bg-primary,
button.bg-primary {
  background-image: linear-gradient(135deg, #765CFF 0%, #4B38C7 58%, #12B8D6 140%);
}

.bg-primary:hover,
button.bg-primary:hover {
  filter: brightness(1.04) saturate(1.04);
}

/* Do not let utility variants such as data-checked:bg-primary or
   hover:bg-primary/5 inherit the primary-button gradient. */
[data-slot="switch"] {
  background: #CBD5E1 !important;
  border: 1px solid #94A3B8 !important;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

[data-slot="switch"][data-checked] {
  background: #4B38C7 !important;
  border-color: #4B38C7 !important;
}

[data-slot="switch"] [data-slot="switch-thumb"] {
  background: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.34);
}

[data-slot="switch"]:focus-visible {
  outline: 3px solid rgba(118, 92, 255, 0.28) !important;
  outline-offset: 2px;
}

/* The public-facing console should not expose the New-API build/update chip. */
button[aria-label^="System updates"],
button[aria-label^="系统更新"],
button[title^="System updates"],
button[title^="系统更新"] {
  display: none !important;
}

/* Provider cards in Create Channel stay light and readable. Their hover
   utilities work normally now that the broad bg-primary override is gone. */
[role="dialog"] [class*="cursor-pointer"][class*="border"][class*="rounded"] {
  background: var(--card) !important;
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

[role="dialog"] [class*="cursor-pointer"][class*="border"][class*="rounded"]:hover {
  background: var(--accent) !important;
  border-color: #A8A0FF;
  box-shadow: 0 8px 22px rgba(118, 92, 255, 0.14);
}

/* Cards and data panels */
.rounded-lg, .rounded-xl, .rounded-2xl {
  border-color: var(--border);
}

.shadow-sm, .shadow, .shadow-md, .shadow-lg {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.dark .shadow-sm, .dark .shadow, .dark .shadow-md, .dark .shadow-lg {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.20);
}

/* Active navigation uses a soft violet wash instead of the old green. */
a[aria-current="page"],
[data-state="active"],
[data-active="true"] {
  color: var(--primary);
}

/* Catch bundled utility classes that bypass the semantic theme variables. */
[class*="text-green-"],
[class*="text-emerald-"],
[class*="text-teal-"] {
  color: var(--primary) !important;
}

[class*="bg-green-"],
[class*="bg-emerald-"],
[class*="bg-teal-"] {
  background-color: #12B8D6 !important;
}

[class*="border-green-"],
[class*="border-emerald-"],
[class*="border-teal-"] {
  border-color: #35D7FF !important;
}

/* Keep every console table header readable in its current theme and hover state. */
/* Cover both normal and split/sticky table headers. The bundled grid defaults
   --table-header-hover to --foreground, which can turn the header black. */
:root,
html[data-theme-preset] {
  --table-header-bg: var(--table-header);
  --table-header-hover: var(--table-header);
}

html.dark,
html.dark[data-theme-preset] {
  --table-header-bg: var(--table-header);
  --table-header-hover: var(--table-header);
}

[data-slot="table-header"],
[data-slot="table-header"] > tr,
[data-slot="table-header"] > tr:hover,
[data-slot="table-header"] th,
[data-slot="table-header"] th *,
[data-slot="table-header"] [data-slot="table-head"] {
  background-color: var(--table-header-bg, var(--table-header)) !important;
  color: var(--foreground) !important;
}

.ama-api-endpoint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
}

.ama-api-endpoint-row.ama-api-endpoint-inline {
  flex: 0 1 400px;
  min-width: 280px;
  margin-left: auto;
}

.ama-api-endpoint-label {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.ama-api-endpoint-row code {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--foreground);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ama-api-endpoint-copy {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

@media (max-width: 640px) {
  .ama-api-endpoint-row {
    width: 100%;
  }
}

/* Brand mark / logo presentation without changing the source asset. */
img[alt*="logo" i], img[alt="ama"], img[alt="New API"] {
  object-fit: contain;
}

/* Unified l288 mark in the console header and sign-in shell. */
a[href="/"] img[alt="徽标"],
a[href="/"] img[src*="ama-console-icon"],
a[href="/"] img[src*="logo.png"] {
  content: url("/assets/l288-mark-v1.png");
  object-fit: contain !important;
  border-radius: 10px !important;
  background: #080D1B !important;
}

a[href="/"] h1 {
  font-size: 0 !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em !important;
  color: #0F172A !important;
}

a[href="/"] h1::before {
  content: "l288";
  font-size: 20px;
  color: #0F172A;
}

a[href="/"] h1::after {
  content: ".ai";
  font-size: 20px;
  color: #12AFCB;
}

html.dark a[href="/"] h1,
html.dark a[href="/"] h1::before {
  color: #EEF0FF;
}

/* Keep the console usable on narrow screens. */
@media (max-width: 640px) {
  :root { --radius: 0.75rem; }
}
/* Fixed console typography: readable on large screens without viewport scaling. */
html, body { font-size: 16px !important; }
body, button, input, textarea, select { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.5; letter-spacing: 0; }
button, [role="button"], input, textarea, select { font-size: 15px; }
table, th, td { font-size: 14px; }
[data-slot="switch"] { min-width: 38px; min-height: 22px; }
@media (max-width: 640px) {
  html, body { font-size: 15px !important; }
  button, [role="button"], input, textarea, select { font-size: 16px; }
}
