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

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: oklch(0.145 0 0);
  --card: #ffffff;
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: #030213;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.95 0.0058 264.53);
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: #030213;
  --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);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 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.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --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(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/**
 * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
 */
@layer base {
  :where(:not(:has([class*=' text-']), :not(:has([class^='text-'])))) {
    h1 {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h2 {
      font-size: var(--text-xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h3 {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h4 {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    p {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }

    label {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    button {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    input {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }
  }
}

html {
  font-size: var(--font-size);
}

@keyframes gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 表格操作列按钮统一样式 - 参考 Ant Design 表格效果 */
/* 使用最高优先级选择器确保样式生效，覆盖所有可能的样式 */

/* 基础样式：所有表格单元格中的按钮都应该有指针样式 */
table td button,
table td [data-slot="button"],
table td a[role="button"],
td[data-slot="table-cell"] button,
td[data-slot="table-cell"] [data-slot="button"],
td[data-slot="table-cell"] a[role="button"],
tbody td button,
tbody td [data-slot="button"],
table tbody td button,
table tbody td [data-slot="button"] {
  cursor: pointer !important;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}

/* 表格操作列按钮 hover 效果 - 蓝色文字和下划线（无背景色） */
/* 使用最高优先级覆盖按钮组件的默认 hover 样式，包括 Tailwind 的 hover 类 */
/* 直接覆盖所有可能的 hover 类，使用更简单的选择器 */
table td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
td[data-slot="table-cell"] button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
td[data-slot="table-cell"] [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) {
  color: #1677ff !important;
  text-decoration: underline !important;
}

/* 额外规则：确保覆盖所有包含 hover 类的按钮 */
table td button:hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]),
td[data-slot="table-cell"] button:hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]),
tbody td button:hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]) {
  color: #1677ff !important;
  text-decoration: underline !important;
}

/* 针对普通 button 标签 */
table td button:not([data-slot]):hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]),
td[data-slot="table-cell"] button:not([data-slot]):hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]),
tbody td button:not([data-slot]):hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]),
table tbody td button:not([data-slot]):hover:not(:disabled):not([class*="text-red"]):not([class*="ant-btn-primary"]):not([class*="ant-btn-danger"]) {
  color: #1677ff !important;
  text-decoration: underline !important;
}

/* 针对 Ant Design Button 组件 */
table td .ant-btn:not(.ant-btn-primary):not(.ant-btn-danger):hover:not(:disabled),
table td .ant-btn-link:hover:not(:disabled),
td[data-slot="table-cell"] .ant-btn:not(.ant-btn-primary):not(.ant-btn-danger):hover:not(:disabled),
td[data-slot="table-cell"] .ant-btn-link:hover:not(:disabled),
tbody td .ant-btn:not(.ant-btn-primary):not(.ant-btn-danger):hover:not(:disabled),
tbody td .ant-btn-link:hover:not(:disabled) {
  color: #1890ff !important;
  border-color: #1890ff !important;
}

/* 表格操作列按钮 hover 效果 - 蓝色文字和下划线（无背景色） */
table td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
td[data-slot="table-cell"] button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
td[data-slot="table-cell"] [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]),
table tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) {
  color: #1677ff !important;
  text-decoration: underline !important;
}

/* 表格操作列按钮内的 SVG 图标 hover 效果 */
table td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
table td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
td[data-slot="table-cell"] button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
td[data-slot="table-cell"] [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
table tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg,
table tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) svg {
  color: #1677ff !important;
}

/* 表格操作列按钮内的文字 span hover 效果 */
table td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
table td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
td[data-slot="table-cell"] button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
td[data-slot="table-cell"] [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
table tbody td button[data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span,
table tbody td [data-slot="button"]:hover:not(:disabled):not([class*="text-red"]) span {
  color: #1677ff !important;
}

/* 针对删除按钮 - 保持红色，但添加背景色 */
/* 使用最高优先级覆盖 hover:text-red-700 等 Tailwind 类 */
table td button[class*="text-red"]:hover:not(:disabled),
table td button.text-red-600:hover:not(:disabled),
table td button.text-red-700:hover:not(:disabled),
table td [data-slot="button"][class*="text-red"]:hover:not(:disabled),
table td button[data-slot="button"][class*="text-red"]:hover:not(:disabled),
table td button[data-slot="button"][class*="hover:text-red"]:hover:not(:disabled),
td[data-slot="table-cell"] button[class*="text-red"]:hover:not(:disabled),
td[data-slot="table-cell"] button.text-red-600:hover:not(:disabled),
td[data-slot="table-cell"] button.text-red-700:hover:not(:disabled),
td[data-slot="table-cell"] [data-slot="button"][class*="text-red"]:hover:not(:disabled),
td[data-slot="table-cell"] button[data-slot="button"][class*="text-red"]:hover:not(:disabled),
tbody td button[class*="text-red"]:hover:not(:disabled),
tbody td button.text-red-600:hover:not(:disabled),
tbody td button.text-red-700:hover:not(:disabled),
tbody td [data-slot="button"][class*="text-red"]:hover:not(:disabled),
tbody td button[data-slot="button"][class*="text-red"]:hover:not(:disabled),
table tbody td button[class*="text-red"]:hover:not(:disabled),
table tbody td button.text-red-600:hover:not(:disabled),
table tbody td button.text-red-700:hover:not(:disabled),
table tbody td [data-slot="button"][class*="text-red"]:hover:not(:disabled),
table tbody td button[data-slot="button"][class*="text-red"]:hover:not(:disabled) {
  color: #ff4d4f !important; /* Ant Design 危险色，保持红色 - 覆盖 hover:text-red-700 */
  background-color: rgba(255, 77, 79, 0.06) !important;
}

/* 针对 Ant Design 危险按钮 */
table td .ant-btn-danger:hover:not(:disabled),
td[data-slot="table-cell"] .ant-btn-danger:hover:not(:disabled),
tbody td .ant-btn-danger:hover:not(:disabled) {
  color: #ff4d4f !important;
  border-color: #ff4d4f !important;
}