@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

@custom-variant dark (&:is(.dark *));

:root {
  --brand: #0a3a78;
  --brand-dark: #062b5c;
  --brand-mid: #1a5ca8;
  --brand-light: #ebf2fc;
  --cyan: #0891b2;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --soft: #9ca3af;
  --line: #e5e7eb;
  --line-dark: #d1d5db;
  --bg: #f9fafb;
  --white: #ffffff;
  --gold: #b8860b;
  --gold-light: #fef9ec;
  --green: #059669;
  --amber: #d97706;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --radius: 0.375rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

@theme inline {
  --color-brand: var(--brand);
  --color-brand-dark: var(--brand-dark);
  --color-brand-light: var(--brand-light);
  --color-ink: var(--ink);
  --color-text-body: var(--text);
  --color-muted: var(--muted);
  --color-soft: var(--soft);
  --color-line: var(--line);
  --color-line-dark: var(--line-dark);
  --color-bg: var(--bg);
  --color-gold: var(--gold);
  --color-green: var(--green);
  --color-amber: var(--amber);
  --font-sans: var(--font-sans);
  --font-heading: var(--font-sans);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

[data-reveal] {
  opacity: 0;
  translate: 0 26px;
  scale: 1;
  transition:
    opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
    translate 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
    scale 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 250ms ease,
    border-color 250ms ease,
    background-color 250ms ease;
  will-change: opacity, translate, scale;
}

[data-reveal='fade'] {
  translate: 0 0;
}

[data-reveal='left'] {
  translate: -28px 0;
}

[data-reveal='right'] {
  translate: 28px 0;
}

[data-reveal='lift'] {
  translate: 0 34px;
  scale: 0.985;
}

[data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.logo-marquee {
  animation: logo-marquee 28s linear infinite;
}

.logo-marquee:hover {
  animation-play-state: paused;
}

@keyframes logo-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    translate: 0 0;
    scale: 1;
    transition: none;
  }

  .logo-marquee {
    animation: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--soft); }

.admin-shell-main {
  color: var(--ink);
}

.admin-compact {
  font-size: 13px;
  line-height: 1.45;
}

.admin-compact :is(h2, h3) {
  line-height: 1.25;
}

.admin-compact [class~="text-sm"] {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.admin-compact [class~="text-base"] {
  font-size: 0.875rem;
  line-height: 1.3;
}

.admin-compact [class~="text-lg"] {
  font-size: 1rem;
  line-height: 1.25;
}

.admin-compact [class~="text-xl"] {
  font-size: 1.125rem;
  line-height: 1.2;
}

.admin-compact :is(input, select, button, a)[class~="h-10"],
.admin-compact :is(input, select, button, a)[class~="h-9"] {
  height: 2rem;
  min-height: 2rem;
}

.admin-compact :is(input, select, textarea) {
  font-size: 0.75rem;
}

.admin-compact textarea {
  padding: 0.5rem;
}

.admin-compact [class~="gap-4"] {
  gap: 0.75rem;
}

.admin-compact [class~="gap-3"] {
  gap: 0.625rem;
}

.admin-compact [class~="gap-2.5"] {
  gap: 0.5rem;
}

.admin-compact [class~="px-5"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

.admin-compact [class~="px-4"] {
  padding-left: 0.875rem;
  padding-right: 0.875rem;
}

.admin-compact [class~="px-3"] {
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.admin-compact [class~="py-8"] {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.admin-compact [class~="py-6"] {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.admin-compact [class~="py-5"] {
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.admin-compact [class~="py-4"] {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.admin-compact [class~="py-3"] {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.admin-compact [class~="py-2"] {
  padding-top: 0.4375rem;
  padding-bottom: 0.4375rem;
}

.admin-compact [class~="py-2.5"] {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.admin-compact [class~="mt-4"] {
  margin-top: 0.75rem;
}

.admin-compact [class~="mt-3"] {
  margin-top: 0.625rem;
}

.admin-compact [class~="mt-2"] {
  margin-top: 0.5rem;
}

.admin-compact [class~="mb-4"] {
  margin-bottom: 0.75rem;
}

.admin-compact [class~="mb-3"] {
  margin-bottom: 0.625rem;
}

.admin-compact [class~="space-y-4"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
}

.admin-compact [class~="space-y-3"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.625rem * var(--tw-space-y-reverse));
}

.admin-compact [class~="space-y-2"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.4375rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.4375rem * var(--tw-space-y-reverse));
}

.admin-compact [class~="space-y-2.5"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  html {
    @apply font-sans;
  }
}
