import typography from '@tailwindcss/typography'
import plugin from 'tailwindcss/plugin'

/** @type {import('tailwindcss').Config} */
export default {
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {
      colors: {
        // 品牌色 — 暖红橙，可信温暖
        brand: {
          50: '#FBF0EE',
          100: '#F5D9D4',
          200: '#EBB3A9',
          300: '#E08D7E',
          400: '#D66853',
          500: '#C7442E',
          600: '#C7442E',
          700: '#A93625',
          800: '#8B2B1E',
          900: '#6D2118',
        },
        // 兼容旧 primary 引用，指向 brand-600
        primary: {
          DEFAULT: '#C7442E',
          light: '#D66853',
          dark: '#A93625',
        },
        // 文字色
        ink: {
          900: '#202622',
          700: '#3A4239',
          600: '#59615C',
          500: '#7A8278',
          400: '#9CA39B',
        },
        // 表面色
        surface: {
          page: '#F7F8F6',
          card: '#FFFFFF',
          muted: '#F0F2EF',
        },
        // 状态色
        success: {
          DEFAULT: '#237A57',
          light: '#3A9B72',
          bg: '#E6F4ED',
        },
        warning: {
          DEFAULT: '#A76113',
          light: '#C98A30',
          bg: '#FBF0E0',
        },
        danger: {
          DEFAULT: '#B83232',
          light: '#D94848',
          bg: '#FCEAEA',
        },
        info: {
          DEFAULT: '#356A8A',
          light: '#4F8AAB',
          bg: '#E8F0F5',
        },
        // 边框
        border: {
          DEFAULT: '#DDE1DD',
          strong: '#C4C9C4',
          subtle: '#ECEEEC',
        },
      },
      fontFamily: {
        sans: ['Inter', '"Noto Sans SC"', '"PingFang SC"', '"Microsoft YaHei"', 'sans-serif'],
      },
      fontSize: {
        // 使用 tabular-nums 对齐数字
        'kpi': ['28px', { lineHeight: '36px', fontWeight: '600' }],
      },
      maxWidth: {
        content: '1440px',
      },
      borderRadius: {
        card: '8px',
      },
      spacing: {
        '18': '72px',
      },
    },
  },
  plugins: [
    typography,
    plugin(({ addUtilities }) => {
      addUtilities({
        '.scrollbar-hide': {
          'scrollbar-width': 'none',
          '-ms-overflow-style': 'none',
          '&::-webkit-scrollbar': { display: 'none' },
        },
      })
    }),
  ],
}
