@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* COINPUD light mode */
    --background: 220 14% 96%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;
    --primary: 221 83% 53%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 40% 96%;
    --secondary-foreground: 222 47% 11%;
    --muted: 210 40% 96%;
    --muted-foreground: 215 16% 47%;
    --accent: 221 83% 95%;
    --accent-foreground: 221 83% 40%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 221 83% 53%;
    --radius: 0.5rem;
  }

  .dark {
    /* COINPUD dark mode — #1a1a28 base */
    --background: 240 20% 12%;
    --foreground: 213 31% 91%;
    --card: 240 18% 15%;
    --card-foreground: 213 31% 91%;
    --popover: 240 18% 15%;
    --popover-foreground: 213 31% 91%;
    --primary: 217 91% 60%;
    --primary-foreground: 0 0% 100%;
    --secondary: 240 18% 19%;
    --secondary-foreground: 213 31% 91%;
    --muted: 240 18% 19%;
    --muted-foreground: 217 10% 55%;
    --accent: 221 83% 18%;
    --accent-foreground: 217 91% 75%;
    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --border: 240 14% 22%;
    --input: 240 14% 22%;
    --ring: 217 91% 60%;
  }

  /* 深色模式下内容区强制浅色 */
  .dark .light-panel {
    color-scheme: light;
    color: hsl(222 47% 11%);
    --background: 220 14% 96%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;
    --primary: 221 83% 53%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 40% 96%;
    --secondary-foreground: 222 47% 11%;
    --muted: 210 40% 96%;
    --muted-foreground: 215 16% 47%;
    --accent: 221 83% 95%;
    --accent-foreground: 221 83% 40%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 221 83% 53%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  html, body {
    height: 100%;
    overflow: hidden;
  }
  #root {
    height: 100%;
    overflow: hidden;
  }
  body {
    @apply bg-background text-foreground;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  }
}

@layer components {
  .ai-bot-border {
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.2) 0%, rgba(96, 165, 250, 0.95) 22%, rgba(224, 242, 254, 0.95) 34%, rgba(29, 78, 216, 0.82) 48%, rgba(14, 165, 233, 0.28) 62%, rgba(96, 165, 250, 0.9) 78%, rgba(224, 242, 254, 0.85) 88%, rgba(56, 189, 248, 0.18) 100%);
    background-size: 220% 100%;
    animation: ai-bot-border-flow 3.2s linear infinite;
  }

  .table-header {
    @apply font-semibold;
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
  }
  .table-row-hover:hover {
    background-color: hsl(var(--accent));
  }
  .card-hover:hover {
    @apply shadow-sm transition-shadow duration-200;
  }
}

@keyframes ai-bot-border-flow {
  0% {
    background-position: 200% 50%;
  }

  100% {
    background-position: -20% 50%;
  }
}
