@import "tailwindcss";

/* ========================================
   FF AI Workspace Design System - 飞书风格
   ======================================== */

@layer base {
  :root {
    /* 飞书主色调 */
    --lark-blue: #3370FF;
    --lark-blue-hover: #5087FF;
    --lark-blue-light: #EBF2FF;
    --lark-purple: #7C3AED;
    
    /* 中性色 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F7F8FA;
    --bg-tertiary: #EFF0F2;
    --border-color: #E3E5E8;
    --text-primary: #1F2329;
    --text-secondary: #646A73;
    --text-tertiary: #8F959E;
    
    /* 状态色 */
    --success: #00B42A;
    --warning: #FF7D00;
    --error: #F53F3F;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  }

  body {
    font-feature-settings: "rlig" 1, "calt" 1;
    background: var(--bg-secondary);
    color: var(--text-primary);
  }

  button, [role="button"] {
    cursor: pointer;
  }
}

/* ========================================
   自定义工具类
   ======================================== */

/* 飞书渐变背景 */
.bg-lark-gradient {
  background: linear-gradient(135deg, #3370FF 0%, #7C3AED 100%);
}

.bg-lark-blue {
  background: var(--lark-blue);
}

.bg-lark-light {
  background: var(--bg-secondary);
}

/* 玻璃态效果 */
.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);
}

/* ========================================
   动画
   ======================================== */

@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);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fadeIn 200ms ease-out;
}

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

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

.animate-slide-in-right {
  animation: slideInRight 300ms ease-out;
}

/* ========================================
   卡片样式
   ======================================== */

.card-modern {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-gradient {
  background: linear-gradient(135deg, #3370FF 0%, #7C3AED 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: white;
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* ========================================
   按钮样式
   ======================================== */

.btn-lark-primary {
  background: var(--lark-blue);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-lark-primary:hover {
  background: var(--lark-blue-hover);
}

.btn-lark-secondary {
  background: white;
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-lark-secondary:hover {
  border-color: var(--lark-blue);
  color: var(--lark-blue);
}

/* 兼容旧样式 */
.btn-modern {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 150ms ease;
}

.btn-gradient {
  background: linear-gradient(135deg, #3370FF 0%, #7C3AED 100%);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 150ms ease;
  border: none;
}

.btn-gradient:hover {
  opacity: 0.9;
}

/* ========================================
   输入框样式
   ======================================== */

.input-modern {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid rgb(229 231 235);
  border-radius: 0.5rem;
  transition: all 200ms ease;
}

.input-modern:focus {
  outline: none;
  border-color: rgb(59 130 246);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-modern:hover {
  border-color: rgb(209 213 219);
}

/* ========================================
   滚动条美化
   ======================================== */

.scrollbar-custom::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
  background: rgb(243 244 246);
  border-radius: 9999px;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
  background: rgb(209 213 219);
  border-radius: 9999px;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
  background: rgb(156 163 175);
}

.scrollbar-slim::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.scrollbar-slim::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-slim::-webkit-scrollbar-thumb {
  background: rgb(229 231 235);
  border-radius: 9999px;
}

.scrollbar-slim:hover::-webkit-scrollbar-thumb {
  background: rgb(203 213 225);
}

.scrollbar-slim::-webkit-scrollbar-thumb:hover {
  background: rgb(148 163 184);
}

/* ========================================
   页面布局
   ======================================== */

.page-container {
  min-height: 100vh;
  background: var(--bg-secondary);
}

.content-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .content-container {
    padding: 2rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .content-container {
    padding: 2rem 2rem;
  }
}

/* ========================================
   状态徽章
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-success {
  background: #E8FFEA;
  color: var(--success);
  border: 1px solid #9FE7A8;
}

.badge-warning {
  background: #FFF7E8;
  color: var(--warning);
  border: 1px solid #FFD6A5;
}

.badge-error {
  background: #FFECE8;
  color: var(--error);
  border: 1px solid #FFBB96;
}

.badge-info {
  background: var(--lark-blue-light);
  color: var(--lark-blue);
  border: 1px solid #A3C7FF;
}

.badge-inactive {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
}

/* ========================================
   表格样式
   ======================================== */

.table-modern {
  width: 100%;
  border-collapse: collapse;
}

.table-modern thead {
  background: rgb(249 250 251);
  border-bottom: 2px solid rgb(229 231 235);
}

.table-modern th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(55 65 81);
}

.table-modern td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: rgb(17 24 39);
  border-bottom: 1px solid rgb(243 244 246);
}

.table-modern tbody tr {
  transition: background-color 150ms ease;
}

.table-modern tbody tr:hover {
  background: rgb(249 250 251);
}

/* ========================================
   响应式优化
   ======================================== */

@media (max-width: 768px) {
  .card-modern,
  .card-gradient,
  .card-glass {
    padding: 1rem;
  }

  .content-container {
    padding: 1.5rem 0.75rem;
  }
}

/* ========================================
   打印样式
   ======================================== */

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }
}

