@import "tailwindcss";

/* ========================================
   FFOA Design System - 基于 FF 品牌风格
   ======================================== */

@layer base {
  :root {
    /* 主色调 - FF 科技蓝 */
    --primary-50: 239 246 255;
    --primary-100: 219 234 254;
    --primary-200: 191 219 254;
    --primary-300: 147 197 253;
    --primary-400: 96 165 250;
    --primary-500: 59 130 246;
    --primary-600: 37 99 235;
    --primary-700: 29 78 216;
    --primary-800: 30 64 175;
    --primary-900: 30 58 138;

    /* 背景色 */
    --background: 255 255 255;
    --foreground: 15 23 42;

    /* 卡片 */
    --card: 255 255 255;
    --card-foreground: 15 23 42;

    /* 边框 */
    --border: 229 231 235;
    --input: 229 231 235;

    /* 成功 */
    --success: 16 185 129;
    --success-light: 209 250 229;

    /* 警告 */
    --warning: 245 158 11;
    --warning-light: 254 243 199;

    /* 错误 */
    --destructive: 239 68 68;
    --destructive-light: 254 226 226;

    /* 圆角 */
    --radius: 0.5rem;
  }

  * {
    @apply border-gray-200;
  }

  body {
    @apply bg-gray-50 text-gray-900;
    font-feature-settings: "rlig" 1, "calt" 1;
  }
}

/* ========================================
   渐变背景
   ======================================== */
@layer utilities {
  .bg-gradient-primary {
    background: linear-gradient(135deg, rgb(102 126 234) 0%, rgb(118 75 162) 100%);
  }

  .bg-gradient-blue {
    background: linear-gradient(135deg, rgb(102 126 234) 0%, rgb(37 99 235) 100%);
  }

  .bg-gradient-purple {
    background: linear-gradient(135deg, rgb(118 75 162) 0%, rgb(240 147 251) 100%);
  }

  .bg-gradient-soft {
    background: linear-gradient(135deg, rgb(239 246 255) 0%, rgb(255 255 255) 100%);
  }

  /* 玻璃态效果 */
  .glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ========================================
   动画
   ======================================== */
@layer utilities {
  .animate-fade-in {
    animation: fadeIn 200ms ease-out;
  }

  .animate-slide-up {
    animation: slideUp 300ms ease-out;
  }

  .animate-scale-in {
    animation: scaleIn 200ms ease-out;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   卡片样式
   ======================================== */
@layer components {
  .card-modern {
    @apply bg-white rounded-xl p-6 shadow-lg hover:shadow-xl transition-all duration-300;
    @apply hover:-translate-y-1;
  }

  .card-gradient {
    @apply rounded-xl p-6 text-white shadow-lg;
    background: linear-gradient(135deg, rgb(102 126 234) 0%, rgb(118 75 162) 100%);
  }

  .card-glass {
    @apply glass rounded-xl p-6 shadow-lg;
  }
}

/* ========================================
   按钮样式
   ======================================== */
@layer components {
  .btn-modern {
    @apply px-6 py-3 rounded-lg font-semibold transition-all duration-200;
    @apply hover:shadow-lg hover:-translate-y-0.5;
  }

  .btn-gradient {
    @apply btn-modern text-white;
    background: linear-gradient(135deg, rgb(102 126 234) 0%, rgb(118 75 162) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  }

  .btn-gradient:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  }
}

/* ========================================
   滚动条美化
   ======================================== */
@layer utilities {
  .scrollbar-custom::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .scrollbar-custom::-webkit-scrollbar-track {
    @apply bg-gray-100 rounded-full;
  }

  .scrollbar-custom::-webkit-scrollbar-thumb {
    @apply bg-gray-300 rounded-full hover:bg-gray-400;
  }
}

/* ========================================
   输入框样式
   ======================================== */
@layer components {
  .input-modern {
    @apply w-full px-4 py-3 border-2 border-gray-200 rounded-lg;
    @apply focus:outline-none focus:border-blue-500 focus:ring-4 focus:ring-blue-50;
    @apply transition-all duration-200;
  }

  .input-modern:hover {
    @apply border-gray-300;
  }
}

/* ========================================
   页面布局
   ======================================== */
@layer utilities {
  .page-container {
    @apply min-h-screen bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50;
  }

  .content-container {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8;
  }
}

/* ========================================
   状态徽章
   ======================================== */
@layer components {
  .badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium;
  }

  .badge-success {
    @apply badge bg-green-100 text-green-800;
  }

  .badge-warning {
    @apply badge bg-yellow-100 text-yellow-800;
  }

  .badge-error {
    @apply badge bg-red-100 text-red-800;
  }

  .badge-info {
    @apply badge bg-blue-100 text-blue-800;
  }

  .badge-inactive {
    @apply badge bg-gray-100 text-gray-800;
  }
}

/* ========================================
   表格样式
   ======================================== */
@layer components {
  .table-modern {
    @apply w-full border-collapse;
  }

  .table-modern thead {
    @apply bg-gray-50 border-b-2 border-gray-200;
  }

  .table-modern th {
    @apply px-6 py-4 text-left text-sm font-semibold text-gray-700;
  }

  .table-modern td {
    @apply px-6 py-4 text-sm text-gray-900 border-b border-gray-100;
  }

  .table-modern tbody tr {
    @apply hover:bg-gray-50 transition-colors duration-150;
  }
}

/* ========================================
   响应式优化
   ======================================== */
@media (max-width: 768px) {
  .card-modern,
  .card-gradient,
  .card-glass {
    @apply p-4;
  }

  .content-container {
    @apply px-3 py-6;
  }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    @apply bg-white;
  }
}

/* ========================================
   无障碍优化
   ======================================== */
@layer utilities {
  .focus-visible-ring {
    @apply focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-blue-500 focus-visible:ring-opacity-50;
  }

  .sr-only-focusable:focus {
    @apply not-sr-only;
  }
}
