-- 金刚区功能表
CREATE TABLE IF NOT EXISTS `home_function_grid` (
  `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` VARCHAR(50) NOT NULL COMMENT '功能名称',
  `icon` VARCHAR(20) NOT NULL COMMENT '图标（emoji）',
  `path` VARCHAR(255) NOT NULL COMMENT '跳转路径',
  `bg_color` VARCHAR(50) NULL COMMENT '背景颜色',
  `icon_color` VARCHAR(50) NULL COMMENT '图标颜色',
  `gradient` VARCHAR(255) NULL COMMENT '渐变背景',
  `need_login` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否需要登录：0-不需要 1-需要',
  `type` VARCHAR(20) NOT NULL DEFAULT 'user' COMMENT '功能类型：user-用户端 matchmaker-红娘端',
  `sort` INT NOT NULL DEFAULT 0 COMMENT '排序',
  `status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '状态：0-禁用 1-启用',
  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_status_sort_type` (`status`, `sort`, `type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='首页金刚区功能表';

-- 插入初始数据
INSERT INTO `home_function_grid` (`name`, `icon`, `path`, `bg_color`, `icon_color`, `gradient`, `need_login`, `type`, `sort`, `status`) VALUES
-- 用户端金刚区功能
('星命测算', '💖', '/pages/astrology/index', '#FF6B9D', '#FFFFFF', 'linear-gradient(135deg, #FF6B9D 0%, #FF8EAB 100%)', 0, 'user', 1, 1),
('红娘列表', '👤', '/pages/matchmakers/list', '#6BC5F8', '#FFFFFF', 'linear-gradient(135deg, #6BC5F8 0%, #87CEEB 100%)', 0, 'user', 2, 1),
('精品课程', '📚', '/pages/courses/list', '#FF8C42', '#FFFFFF', 'linear-gradient(135deg, #FF8C42 0%, #FFA366 100%)', 0, 'user', 3, 1),
('今日缘分', '💝', '/pages/recommend/index', '#FF69B4', '#FFFFFF', 'linear-gradient(135deg, #FF69B4 0%, #FF8CC8 100%)', 1, 'user', 4, 1),
-- 红娘端金刚区功能
('我的资源', '📋', '/pages/matchmaker-workbench/my-resources', '#4CAF50', '#FFFFFF', 'linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%)', 1, 'matchmaker', 1, 1),
('优质资源', '🌟', '/pages/matchmaker-workbench/quality-resources', '#2196F3', '#FFFFFF', 'linear-gradient(135deg, #2196F3 0%, #42A5F5 100%)', 1, 'matchmaker', 2, 1),
('课程培训', '🎓', '/pages/courses/list', '#FF9800', '#FFFFFF', 'linear-gradient(135deg, #FF9800 0%, #FFB74D 100%)', 0, 'matchmaker', 3, 1),
('积分商城', '🎁', '/pages/matchmaker-workbench/points-mall', '#9C27B0', '#FFFFFF', 'linear-gradient(135deg, #9C27B0 0%, #AB47BC 100%)', 1, 'matchmaker', 4, 1),
('活动中心', '🎉', '/pages/matchmaker-workbench/activities', '#F44336', '#FFFFFF', 'linear-gradient(135deg, #F44336 0%, #EF5350 100%)', 0, 'matchmaker', 5, 1);