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

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

/* 深色主题（默认） */
:root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  font-size: 14px; /* 笔记本适配：默认16px缩小到14px，约等于90%缩放效果 */

  color-scheme: dark;
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a 0%, #020617 100%);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #1e293b;
  --color-accent: #0ea5e9;
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text-primary: #ffffff;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #06b6d4;
  --color-status-success: #22c55e;
  --color-status-warning: #f59e0b;
  --color-status-error: #ef4444;
}

/* 浅色主题 */
[data-theme="light"] {
  color-scheme: light;
  color: #1e293b;
  background-color: #f8fafc;

  --color-primary: #2563eb;
  --color-secondary: #e2e8f0;
  --color-accent: #0284c7;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
}

[data-theme="light"] .scrollbar-thin::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

[data-theme="light"] .scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .big-screen-gradient {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

#root {
  min-height: 100vh;
}

@layer utilities {
  .scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
  }
  
  .scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  .scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .scrollbar-thin::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 3px;
  }

  .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  }

  .glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
  }

  .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
  }

  .btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
  }

  .icon-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    display: inline-block;
  }

  .status-dot-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  }

  .shine-effect {
    position: relative;
    overflow: hidden;
  }

  .shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 2s infinite;
  }

  @keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
  }

  .glow-primary {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

.animate-pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Markdown Content Styles */
.markdown-content {
  color: #e5e7eb;
  line-height: 1.7;
}

.markdown-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.markdown-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.markdown-content h2::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 2px;
}

.markdown-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #f1f5f9;
}

.markdown-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: #d1d5db;
}

.markdown-content ul,
.markdown-content ol {
  margin-left: 1.75rem;
  margin-bottom: 1rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
  color: #d1d5db;
}

.markdown-content code {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  color: #93c5fd;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.markdown-content pre {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: #e5e7eb;
  border: none;
  font-size: 0.875rem;
  line-height: 1.6;
}

.markdown-content blockquote {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
  padding: 1rem 1.5rem;
  margin: 1.25rem 0;
  border-radius: 0 0.75rem 0.75rem 0;
  color: #cbd5e1;
  font-style: italic;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.markdown-content a {
  color: #60a5fa;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

.markdown-content a:hover {
  color: #93c5fd;
  border-bottom-color: #60a5fa;
}

.markdown-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #334155;
  padding: 0.875rem 1rem;
  text-align: left;
}

.markdown-content th {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  font-weight: 700;
  color: #ffffff;
  border-bottom: 2px solid #3b82f6;
}

.markdown-content tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.5);
}

.markdown-content tr:hover {
  background: rgba(59, 130, 246, 0.1);
}

.markdown-content hr {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  margin: 2rem 0;
}

.big-screen-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

.animate-shimmer {
  position: relative;
  overflow: hidden;
}

.animate-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

.data-flow-line {
  stroke-dasharray: 5 5;
  animation: data-flow 1s linear infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes data-flow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 20; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.25s ease-out;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

[data-theme="light"] .markdown-content {
  color: #374151;
}

[data-theme="light"] .markdown-content h1 {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .markdown-content h2 {
  color: #1e293b;
}

[data-theme="light"] .markdown-content h2::before {
  background: linear-gradient(180deg, #2563eb 0%, #7c3aed 100%);
}

[data-theme="light"] .markdown-content h3 {
  color: #374151;
}

[data-theme="light"] .markdown-content p,
[data-theme="light"] .markdown-content li {
  color: #4b5563;
}

[data-theme="light"] .markdown-content code {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .markdown-content pre {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .markdown-content pre code {
  color: #1e293b;
}

[data-theme="light"] .markdown-content blockquote {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
  color: #4b5563;
}

[data-theme="light"] .markdown-content a {
  color: #2563eb;
}

[data-theme="light"] .markdown-content a:hover {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

[data-theme="light"] .markdown-content th,
[data-theme="light"] .markdown-content td {
  border-color: #e2e8f0;
}

[data-theme="light"] .markdown-content th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #1e293b;
  border-bottom-color: #2563eb;
}

[data-theme="light"] .markdown-content tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.5);
}

[data-theme="light"] .markdown-content tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

[data-theme="light"] .markdown-content hr {
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
}
