// MSW mock fixtures：模拟 parent-bff GraphQL + iam login 响应
// 依据：
// - ISSUE-010 iam GetChildrenByParent P0 阻塞 → 用 mock（student-001 + student-002）
// - 02-architecture-design.md §8 MSW 模拟未就绪上游
// - F9 GraphQL（所有查询走 GraphQL）
// - ISSUE-004 登录端点走 REST

import type {
  UserSession,
  ChildInfo,
  ChildSummary,
  GradeDataPoint,
  AttendanceRecord,
  HomeworkItem,
  WeaknessPoint,
  LearningTrend,
  NotificationItem,
  NotificationPreferences,
  LoginResponse,
  ExamListItem,
  ExamResult,
  ClassInfo,
  LearningPathNode,
  LeaveRequest,
  AcademicYear,
  ReportCard,
  ErrorBookStats,
  TopWrongQuestion,
  WeakKp,
  MasterySummary,
  DiagnosticReport,
  PracticeStats,
  PracticeSession,
  CoursePlan,
  CoursePlanDetail,
  LessonPlan,
  LessonPlanDetail,
  ElectiveSelection,
  ChildDetail,
  ExportResult,
  GrowthArchive,
} from "@/types";

// ===== 用户 =====
export const mockParent: UserSession = {
  id: "parent-001",
  email: "parent@example.com",
  name: "张父",
  roles: ["parent"],
  permissions: [
    "DASHBOARD_VIEW",
    "CHILD_GRADE_VIEW",
    "CHILD_ATTENDANCE_VIEW",
    "CHILD_HOMEWORK_VIEW",
    "CHILD_WEAKNESS_VIEW",
    "CHILD_TREND_VIEW",
    "CHILD_EXAM_VIEW",
    "CHILD_CLASS_VIEW",
    "CHILD_LEARNING_PATH_VIEW",
    "PROFILE_VIEW",
    "NOTIFICATION_VIEW",
    "NOTIFICATION_PREFERENCE_UPDATE",
  ],
  dataScope: "CHILDREN",
  schoolId: "school-001",
};

// ===== 子女列表（ISSUE-010：iam P0 阻塞，用 mock）=====
export const mockChildren: ChildInfo[] = [
  {
    id: "student-001",
    name: "张小明",
    grade: "grade.7",
    schoolName: "实验中学",
    classId: "class-7-1",
    className: "初一(1)班",
  },
  {
    id: "student-002",
    name: "张小红",
    grade: "grade.5",
    schoolName: "实验小学",
    classId: "class-5-2",
    className: "五年级(2)班",
  },
];

// ===== 成绩数据点 =====
export const mockGradeDataPoints: GradeDataPoint[] = [
  {
    examId: "exam-001",
    examName: "期中数学测验",
    examDate: "2026-03-15T09:00:00Z",
    subject: "数学",
    studentScore: 92,
    classAverage: 78,
    classMax: 100,
    classMin: 45,
    gradeLevel: "A",
  },
  {
    examId: "exam-002",
    examName: "期中语文测验",
    examDate: "2026-03-16T09:00:00Z",
    subject: "语文",
    studentScore: 85,
    classAverage: 75,
    classMax: 95,
    classMin: 52,
    gradeLevel: "B",
  },
  {
    examId: "exam-003",
    examName: "期中英语测验",
    examDate: "2026-03-17T09:00:00Z",
    subject: "英语",
    studentScore: 88,
    classAverage: 72,
    classMax: 98,
    classMin: 40,
    gradeLevel: "B",
  },
  {
    examId: "exam-004",
    examName: "月考物理",
    examDate: "2026-04-10T09:00:00Z",
    subject: "物理",
    studentScore: 95,
    classAverage: 80,
    classMax: 100,
    classMin: 50,
    gradeLevel: "A",
  },
];

// ===== 子女概览 =====
export const mockChildSummary: ChildSummary = {
  childId: "student-001",
  avgScore: 90,
  classRank: 5,
  classSize: 45,
  attendanceRate: 0.96,
  pendingHomeworkCount: 3,
  recentGradeTrend: "up",
  recentScores: mockGradeDataPoints,
  upcomingEvents: [
    {
      id: "event-001",
      type: "exam",
      title: "期末数学考试",
      dueDate: "2026-07-20T09:00:00Z",
    },
    {
      id: "event-002",
      type: "homework",
      title: "物理实验报告",
      dueDate: "2026-07-12T23:59:59Z",
    },
  ],
};

// ===== 考勤记录 =====
export const mockAttendance: AttendanceRecord[] = (() => {
  const records: AttendanceRecord[] = [];
  const baseDate = new Date("2026-06-01");
  for (let i = 0; i < 22; i++) {
    const d = new Date(baseDate);
    d.setDate(d.getDate() + i);
    // 周末跳过
    const day = d.getDay();
    if (day === 0 || day === 6) continue;
    let status: AttendanceRecord["status"] = "present";
    if (i === 5) status = "late";
    if (i === 12) status = "leave";
    records.push({
      id: `att-${i}`,
      date: d.toISOString().slice(0, 10),
      status,
    });
  }
  return records;
})();

// ===== 作业列表 =====
export const mockHomework: HomeworkItem[] = [
  {
    id: "hw-001",
    title: "数学第三章习题",
    subject: "数学",
    className: "初一(1)班",
    assignedDate: "2026-07-01T09:00:00Z",
    dueDate: "2026-07-10T23:59:59Z",
    status: "in_progress",
    maxScore: 100,
  },
  {
    id: "hw-002",
    title: "语文古诗文背诵",
    subject: "语文",
    className: "初一(1)班",
    assignedDate: "2026-06-28T09:00:00Z",
    dueDate: "2026-07-08T23:59:59Z",
    status: "submitted",
    maxScore: 50,
  },
  {
    id: "hw-003",
    title: "英语听力练习",
    subject: "英语",
    className: "初一(1)班",
    assignedDate: "2026-07-05T09:00:00Z",
    dueDate: "2026-07-12T23:59:59Z",
    status: "not_started",
    maxScore: 30,
  },
  {
    id: "hw-004",
    title: "物理实验报告",
    subject: "物理",
    className: "初一(1)班",
    assignedDate: "2026-06-20T09:00:00Z",
    dueDate: "2026-06-25T23:59:59Z",
    status: "graded",
    score: 28,
    maxScore: 30,
    feedback: "实验步骤完整，数据分析准确。",
  },
];

// ===== 学情薄弱点 =====
export const mockWeakness: WeaknessPoint[] = [
  {
    id: "wp-001",
    knowledgePoint: "一元二次方程",
    masteryLevel: 0.45,
    subject: "数学",
    recommendation: "建议复习配方法，完成针对性练习 20 道",
  },
  {
    id: "wp-002",
    knowledgePoint: "文言文虚词",
    masteryLevel: 0.6,
    subject: "语文",
    recommendation: "建议背诵常见虚词用法表",
  },
  {
    id: "wp-003",
    knowledgePoint: "现在完成时",
    masteryLevel: 0.72,
    subject: "英语",
  },
];

// ===== 学习趋势 =====
export const mockLearningTrend: LearningTrend = {
  childId: "student-001",
  period: "month",
  dataPoints: [
    { date: "2026-03", score: 82, subject: "数学" },
    { date: "2026-04", score: 88, subject: "数学" },
    { date: "2026-05", score: 92, subject: "数学" },
    { date: "2026-06", score: 90, subject: "数学" },
  ],
};

// ===== 考试列表 =====
export const mockExams: ExamListItem[] = [
  {
    id: "exam-001",
    name: "期中数学测验",
    subject: "数学",
    status: "graded",
    startsAt: "2026-03-15T09:00:00Z",
    expiresAt: "2026-03-15T11:00:00Z",
    durationSeconds: 7200,
    questionCount: 25,
    totalScore: 100,
    submittedAt: "2026-03-15T10:45:00Z",
  },
  {
    id: "exam-002",
    name: "期中语文测验",
    subject: "语文",
    status: "graded",
    startsAt: "2026-03-16T09:00:00Z",
    expiresAt: "2026-03-16T10:30:00Z",
    durationSeconds: 5400,
    questionCount: 20,
    totalScore: 100,
    submittedAt: "2026-03-16T10:20:00Z",
  },
  {
    id: "exam-003",
    name: "期末英语考试",
    subject: "英语",
    status: "in_progress",
    startsAt: "2026-07-13T09:00:00Z",
    expiresAt: "2026-07-13T11:00:00Z",
    durationSeconds: 7200,
    questionCount: 30,
    totalScore: 100,
  },
  {
    id: "exam-004",
    name: "月考物理",
    subject: "物理",
    status: "submitted",
    startsAt: "2026-07-10T09:00:00Z",
    expiresAt: "2026-07-10T10:30:00Z",
    durationSeconds: 5400,
    questionCount: 18,
    totalScore: 80,
    submittedAt: "2026-07-10T10:15:00Z",
  },
  {
    id: "exam-005",
    name: "期末化学考试",
    subject: "化学",
    status: "not_started",
    startsAt: "2026-07-20T14:00:00Z",
    expiresAt: "2026-07-20T15:30:00Z",
    durationSeconds: 5400,
    questionCount: 22,
    totalScore: 100,
  },
];

// ===== 考试结果（逐题回顾）=====
export const mockExamResult: ExamResult = {
  examId: "exam-001",
  examName: "期中数学测验",
  score: 78,
  maxScore: 100,
  grade: "B+",
  submittedAt: "2026-03-15T10:45:00Z",
  durationSeconds: 6300,
  questionResults: [
    {
      questionId: "q1",
      questionContent: "已知函数 f(x) = x² + 2x + 1，求 f(2) 的值。",
      questionType: "single-choice",
      studentAnswer: { type: "single-choice", optionId: "c" },
      correctAnswer: { type: "single-choice", optionId: "c" },
      isCorrect: true,
      isAnswered: true,
      explanation: "f(2) = 2² + 2×2 + 1 = 4 + 4 + 1 = 9",
      maxScore: 10,
      earnedScore: 10,
    },
    {
      questionId: "q2",
      questionContent: "下列哪些是质数？（多选）",
      questionType: "multiple-choice",
      studentAnswer: { type: "multiple-choice", optionIds: ["a", "c", "d"] },
      correctAnswer: { type: "multiple-choice", optionIds: ["a", "c"] },
      isCorrect: false,
      isAnswered: true,
      explanation:
        "9 = 3 × 3，不是质数。质数是只能被 1 和自身整除的大于 1 的自然数。",
      maxScore: 15,
      earnedScore: 8,
    },
    {
      questionId: "q3",
      questionContent: "sin(30°) = ______",
      questionType: "fill-blank",
      studentAnswer: { type: "fill-blank", values: ["0.5"] },
      correctAnswer: { type: "fill-blank", values: ["1/2"] },
      isCorrect: true,
      isAnswered: true,
      explanation: "sin(30°) = 1/2 = 0.5",
      maxScore: 10,
      earnedScore: 10,
    },
    {
      questionId: "q4",
      questionContent: "简述导数的定义。",
      questionType: "short-answer",
      studentAnswer: {
        type: "short-answer",
        text: "导数是函数在某点的瞬时变化率。",
      },
      correctAnswer: null,
      isCorrect: true,
      isAnswered: true,
      explanation:
        "导数是函数在某一点的瞬时变化率，即当自变量增量趋于零时函数增量与自变量增量之比的极限。",
      maxScore: 20,
      earnedScore: 18,
    },
    {
      questionId: "q5",
      questionContent: "论述微积分的基本思想及其在现代科学中的应用。",
      questionType: "essay",
      studentAnswer: null,
      correctAnswer: null,
      isCorrect: false,
      isAnswered: false,
      explanation:
        "本题未作答。微积分的基本思想包括极限、微分和积分，广泛应用于物理学、工程学、经济学等领域。",
      maxScore: 45,
      earnedScore: 0,
    },
  ],
};

// ===== 班级列表 =====
export const mockClasses: ClassInfo[] = [
  {
    id: "class-7-1",
    name: "初一(1)班",
    homeroomTeacher: "王老师",
    studentCount: 45,
    grade: "初一",
    year: 2026,
  },
  {
    id: "class-7-2",
    name: "初一(2)班",
    homeroomTeacher: "李老师",
    studentCount: 42,
    grade: "初一",
    year: 2026,
  },
];

// ===== 学习路径 =====
export const mockLearningPath: LearningPathNode[] = [
  {
    id: "kp-001",
    name: "一元一次方程",
    knowledgePointId: "kp-001",
    status: "completed",
    mastery: 0.92,
    dependencies: [],
    recommendedOrder: 1,
    recommendation: "已掌握，可进入下一知识点",
  },
  {
    id: "kp-002",
    name: "二元一次方程组",
    knowledgePointId: "kp-002",
    status: "completed",
    mastery: 0.85,
    dependencies: ["kp-001"],
    recommendedOrder: 2,
    recommendation: "已掌握，建议偶尔复习巩固",
  },
  {
    id: "kp-003",
    name: "一元二次方程",
    knowledgePointId: "kp-003",
    status: "in-progress",
    mastery: 0.55,
    dependencies: ["kp-001", "kp-002"],
    recommendedOrder: 3,
    recommendation: "建议练习配方法，完成针对性练习 20 道",
  },
  {
    id: "kp-004",
    name: "不等式与不等式组",
    knowledgePointId: "kp-004",
    status: "available",
    mastery: 0.2,
    dependencies: ["kp-003"],
    recommendedOrder: 4,
    recommendation: "建议先完成上一知识点",
  },
  {
    id: "kp-005",
    name: "函数与图像",
    knowledgePointId: "kp-005",
    status: "locked",
    mastery: 0,
    dependencies: ["kp-003", "kp-004"],
    recommendedOrder: 5,
  },
];

// ===== 通知列表 =====
export const mockNotifications: NotificationItem[] = [
  {
    id: "notif-001",
    childId: "student-001",
    eventType: "grade_recorded",
    title: "grade_recorded.title",
    body: "grade_recorded.body",
    read: false,
    createdAt: new Date(Date.now() - 3600000).toISOString(),
    actionUrl: "/parent/grades?childId=student-001",
    pinned: true,
  },
  {
    id: "notif-002",
    childId: "student-001",
    eventType: "homework_assigned",
    title: "homework_assigned.title",
    body: "homework_assigned.body",
    read: false,
    createdAt: new Date(Date.now() - 7200000).toISOString(),
    actionUrl: "/parent/homework?childId=student-001",
  },
  {
    id: "notif-003",
    childId: null,
    eventType: "school_announcement",
    title: "school_announcement.title",
    body: "school_announcement.body",
    read: true,
    createdAt: new Date(Date.now() - 86400000).toISOString(),
  },
];

// ===== 通知偏好默认值（ISSUE-033：P4 localStorage 降级）=====
export const mockNotificationPreferences: NotificationPreferences = {
  parentId: "parent-001",
  preferences: {
    "student-001": {
      grade_recorded: { in_app: true, push: true },
      homework_graded: { in_app: true, push: true },
      homework_assigned: { in_app: true, push: true },
      exam_published: { in_app: true, push: true, sms: false },
      attendance_alert: { in_app: true, push: true, sms: true },
      school_announcement: { in_app: true },
      teacher_message: { in_app: true, push: true },
      fee_reminder: { in_app: true, push: true, sms: true },
      event_invitation: { in_app: true, push: true },
    },
    "student-002": {
      grade_recorded: { in_app: true, push: true },
      homework_graded: { in_app: true, push: true },
      homework_assigned: { in_app: true, push: true },
      exam_published: { in_app: true, push: true },
      attendance_alert: { in_app: true, push: true, sms: true },
      school_announcement: { in_app: true },
      teacher_message: { in_app: true, push: true },
      fee_reminder: { in_app: true, push: true, sms: true },
      event_invitation: { in_app: true, push: true },
    },
  },
  defaults: {
    grade_recorded: { in_app: true, push: true },
    homework_graded: { in_app: true, push: true },
    homework_assigned: { in_app: true, push: true },
    exam_published: { in_app: true, push: true },
    attendance_alert: { in_app: true, push: true, sms: true },
    school_announcement: { in_app: true },
    teacher_message: { in_app: true, push: true },
    fee_reminder: { in_app: true, push: true, sms: true },
    event_invitation: { in_app: true, push: true },
  },
  updatedAt: new Date().toISOString(),
};

// ===== 登录响应（ISSUE-004：REST 登录）=====
export const mockLoginResponse: LoginResponse = {
  user: mockParent,
  tokens: {
    accessToken: "mock-access-token-parent-001",
    refreshToken: "mock-refresh-token-parent-001",
    expiresIn: 3600,
  },
};

// ===== 请假记录（参考项目 /parent/leave）=====
export const mockLeaveRequests: LeaveRequest[] = [
  {
    id: "leave-001",
    childId: "student-001",
    childName: "张小明",
    className: "初一(1)班",
    type: "sick",
    startDate: "2026-05-10",
    endDate: "2026-05-11",
    reason: "感冒发烧，需在家休息观察",
    status: "approved",
    submittedAt: "2026-05-09T20:15:00Z",
    reviewedAt: "2026-05-10T08:30:00Z",
    reviewerName: "王老师",
    reviewComment: "已批准，注意休息，按时复课",
  },
  {
    id: "leave-002",
    childId: "student-001",
    childName: "张小明",
    className: "初一(1)班",
    type: "personal",
    startDate: "2026-06-15",
    endDate: "2026-06-15",
    reason: "家中临时事务，需陪同办理",
    status: "pending",
    submittedAt: "2026-06-13T21:00:00Z",
  },
  {
    id: "leave-003",
    childId: "student-002",
    childName: "张小红",
    className: "五年级(2)班",
    type: "family",
    startDate: "2026-04-20",
    endDate: "2026-04-22",
    reason: "回老家参加亲属婚礼",
    status: "approved",
    submittedAt: "2026-04-15T19:30:00Z",
    reviewedAt: "2026-04-16T09:00:00Z",
    reviewerName: "李老师",
    reviewComment: "已批准，请提前补做作业",
  },
];

// ===== 学年（参考项目 /parent/grades/report-card）=====
export const mockAcademicYears: AcademicYear[] = [
  {
    id: "ay-2025-2026",
    name: "2025-2026",
    startDate: "2025-09-01",
    endDate: "2026-07-15",
  },
  {
    id: "ay-2024-2025",
    name: "2024-2025",
    startDate: "2024-09-01",
    endDate: "2025-07-15",
  },
];

// ===== 报告卡（含 4 个学科）=====
export const mockReportCard: ReportCard = {
  childId: "student-001",
  childName: "张小明",
  className: "初一(1)班",
  academicYearId: "ay-2025-2026",
  academicYearName: "2025-2026",
  semester: 2,
  subjects: [
    {
      subject: "语文",
      score: 85,
      maxScore: 100,
      gradeLevel: "B",
      classAverage: 75,
      rank: 8,
      classSize: 45,
      teacherComment: "阅读理解能力较强，作文需加强立意深度",
    },
    {
      subject: "数学",
      score: 92,
      maxScore: 100,
      gradeLevel: "A",
      classAverage: 78,
      rank: 3,
      classSize: 45,
      teacherComment: "逻辑思维清晰，解题规范，继续保持",
    },
    {
      subject: "英语",
      score: 88,
      maxScore: 100,
      gradeLevel: "B",
      classAverage: 72,
      rank: 5,
      classSize: 45,
      teacherComment: "听力有进步，建议加强口语练习",
    },
    {
      subject: "物理",
      score: 95,
      maxScore: 100,
      gradeLevel: "A",
      classAverage: 80,
      rank: 2,
      classSize: 45,
      teacherComment: "实验探究能力突出，分析问题思路严谨",
    },
  ],
  overallScore: 90,
  classRank: 5,
  classSize: 45,
  teacherComment:
    "本学期学习态度认真，成绩稳中有进，望继续保持，加强薄弱环节",
  headTeacherComment:
    "该生品学兼优，关心集体，乐于助人，下学期可担任班干部锻炼能力",
  issuedAt: "2026-07-05T10:00:00Z",
};

// ===== 错题本统计 =====
export const mockErrorBookStats: ErrorBookStats = {
  childId: "student-001",
  totalCount: 128,
  newCount: 23,
  learningCount: 45,
  masteredCount: 60,
  dueReviewCount: 18,
  masteredRate: 0.469,
};

// ===== 高频错题（4 条）=====
export const mockTopWrongQuestions: TopWrongQuestion[] = [
  {
    id: "wq-001",
    questionContent:
      "已知一元二次方程 x² - 5x + 6 = 0，求方程的解。",
    subject: "数学",
    knowledgePoint: "一元二次方程",
    errorCount: 5,
    lastErrorAt: "2026-07-08T15:20:00Z",
    masteryRate: 0.4,
  },
  {
    id: "wq-002",
    questionContent: "下列句子中，加点词语使用正确的一项是（ ）",
    subject: "语文",
    knowledgePoint: "词语辨析",
    errorCount: 4,
    lastErrorAt: "2026-07-06T16:10:00Z",
    masteryRate: 0.55,
  },
  {
    id: "wq-003",
    questionContent:
      "Choose the correct word to fill in the blank: He ___ to school every day.",
    subject: "英语",
    knowledgePoint: "一般现在时",
    errorCount: 3,
    lastErrorAt: "2026-07-05T14:30:00Z",
    masteryRate: 0.7,
  },
  {
    id: "wq-004",
    questionContent: "物体在水平面上做匀速直线运动，所受合力为（ ）",
    subject: "物理",
    knowledgePoint: "力的合成与平衡",
    errorCount: 3,
    lastErrorAt: "2026-07-03T11:00:00Z",
    masteryRate: 0.65,
  },
];

// ===== 薄弱知识点（4 条）=====
export const mockWeakKps: WeakKp[] = [
  {
    knowledgePointName: "一元二次方程",
    subject: "数学",
    errorCount: 5,
    masteryRate: 0.4,
  },
  {
    knowledgePointName: "文言文虚词",
    subject: "语文",
    errorCount: 4,
    masteryRate: 0.55,
  },
  {
    knowledgePointName: "现在完成时",
    subject: "英语",
    errorCount: 4,
    masteryRate: 0.6,
  },
  {
    knowledgePointName: "浮力与阿基米德原理",
    subject: "物理",
    errorCount: 3,
    masteryRate: 0.5,
  },
];

// ===== 掌握度总览（含 4 个学科）=====
export const mockMasterySummary: MasterySummary = {
  childId: "student-001",
  overallMastery: 0.78,
  subjectMastery: [
    { subject: "语文", mastery: 0.82 },
    { subject: "数学", mastery: 0.75 },
    { subject: "英语", mastery: 0.8 },
    { subject: "物理", mastery: 0.85 },
  ],
  totalKps: 86,
  masteredKps: 67,
};

// ===== 诊断报告（1 published + 1 draft）=====
export const mockDiagnosticReports: DiagnosticReport[] = [
  {
    id: "diag-001",
    childId: "student-001",
    title: "2026 春季学期学情诊断报告",
    summary:
      "该生本学期整体学习情况良好，数学和物理掌握较好，语文作文和英语口语为薄弱环节，建议针对性强化。",
    status: "published",
    createdAt: "2026-06-20T09:00:00Z",
    publishedAt: "2026-06-25T10:00:00Z",
    masteryScore: 78,
    subjects: [
      {
        subject: "语文",
        masteryLevel: 0.82,
        strengths: ["阅读理解", "古诗文默写"],
        weaknesses: ["作文立意", "现代文词语辨析"],
        recommendation: "每周练习 1 篇议论文，积累优秀范文素材",
      },
      {
        subject: "数学",
        masteryLevel: 0.75,
        strengths: ["几何证明", "函数基础"],
        weaknesses: ["一元二次方程应用题"],
        recommendation: "完成配方法专项练习 20 道，错题及时整理",
      },
      {
        subject: "英语",
        masteryLevel: 0.8,
        strengths: ["词汇量", "语法基础"],
        weaknesses: ["口语表达", "听力长对话"],
        recommendation: "每天 15 分钟英语听力，每周一次口语对话练习",
      },
      {
        subject: "物理",
        masteryLevel: 0.85,
        strengths: ["力学概念", "实验设计"],
        weaknesses: ["浮力综合题"],
        recommendation: "针对性练习阿基米德原理综合题 10 道",
      },
    ],
  },
  {
    id: "diag-002",
    childId: "student-001",
    title: "2026 暑期学情预诊断报告（草稿）",
    summary: "基于暑期前练习数据生成的预诊断，待教研组审核发布。",
    status: "draft",
    createdAt: "2026-07-10T14:00:00Z",
    masteryScore: 72,
    subjects: [
      {
        subject: "数学",
        masteryLevel: 0.7,
        strengths: ["代数基础"],
        weaknesses: ["不等式组", "应用题建模"],
        recommendation: "暑期完成不等式专项练习册",
      },
      {
        subject: "英语",
        masteryLevel: 0.74,
        strengths: ["阅读"],
        weaknesses: ["完形填空"],
        recommendation: "每天 1 篇完形填空专项训练",
      },
    ],
  },
];

// ===== 练习统计 =====
export const mockPracticeStats: PracticeStats = {
  childId: "student-001",
  totalSessions: 48,
  completedSessions: 42,
  totalQuestionsAnswered: 560,
  overallAccuracy: 0.83,
};

// ===== 练习会话（4 条）=====
export const mockPracticeSessions: PracticeSession[] = [
  {
    id: "ps-001",
    childId: "student-001",
    subject: "数学",
    startedAt: "2026-07-10T19:00:00Z",
    completedAt: "2026-07-10T19:35:00Z",
    questionCount: 20,
    correctCount: 17,
    accuracy: 0.85,
    durationSeconds: 2100,
    knowledgePoints: ["一元二次方程", "配方法"],
  },
  {
    id: "ps-002",
    childId: "student-001",
    subject: "英语",
    startedAt: "2026-07-09T20:10:00Z",
    completedAt: "2026-07-09T20:40:00Z",
    questionCount: 15,
    correctCount: 12,
    accuracy: 0.8,
    durationSeconds: 1800,
    knowledgePoints: ["现在完成时", "过去进行时"],
  },
  {
    id: "ps-003",
    childId: "student-001",
    subject: "语文",
    startedAt: "2026-07-08T18:30:00Z",
    completedAt: "2026-07-08T19:05:00Z",
    questionCount: 18,
    correctCount: 15,
    accuracy: 0.833,
    durationSeconds: 2100,
    knowledgePoints: ["文言文虚词", "古诗文默写"],
  },
  {
    id: "ps-004",
    childId: "student-001",
    subject: "物理",
    startedAt: "2026-07-07T19:20:00Z",
    completedAt: "2026-07-07T19:50:00Z",
    questionCount: 12,
    correctCount: 11,
    accuracy: 0.917,
    durationSeconds: 1800,
    knowledgePoints: ["浮力", "阿基米德原理"],
  },
  {
    id: "ps-005",
    childId: "student-001",
    subject: "数学",
    startedAt: "2026-07-06T20:00:00Z",
    completedAt: "2026-07-06T20:25:00Z",
    questionCount: 10,
    correctCount: 9,
    accuracy: 0.9,
    durationSeconds: 1500,
    knowledgePoints: ["不等式组"],
  },
];

// ===== 课程计划（3 条）=====
export const mockCoursePlans: CoursePlan[] = [
  {
    id: "cp-001",
    title: "初一数学下学期课程计划",
    description: "涵盖一元二次方程、不等式组、函数与图像等核心章节",
    subject: "数学",
    className: "初一(1)班",
    teacherName: "王老师",
    startDate: "2026-02-15",
    endDate: "2026-07-10",
    status: "active",
    chapterCount: 8,
  },
  {
    id: "cp-002",
    title: "初一语文下学期课程计划",
    description: "包含古诗文鉴赏、现代文阅读、议论文写作三大模块",
    subject: "语文",
    className: "初一(1)班",
    teacherName: "李老师",
    startDate: "2026-02-15",
    endDate: "2026-07-10",
    status: "active",
    chapterCount: 6,
  },
  {
    id: "cp-003",
    title: "初一英语上学期课程计划",
    description: "上学期英语语法与词汇基础课程",
    subject: "英语",
    className: "初一(1)班",
    teacherName: "张老师",
    startDate: "2025-09-01",
    endDate: "2026-01-15",
    status: "completed",
    chapterCount: 10,
  },
];

// ===== 课程计划详情（含 4 章节）=====
export const mockCoursePlanDetail: CoursePlanDetail = {
  id: "cp-001",
  title: "初一数学下学期课程计划",
  description: "涵盖一元二次方程、不等式组、函数与图像等核心章节",
  subject: "数学",
  className: "初一(1)班",
  teacherName: "王老师",
  startDate: "2026-02-15",
  endDate: "2026-07-10",
  status: "active",
  chapterCount: 8,
  chapters: [
    {
      id: "cp-001-ch-01",
      title: "第一章 一元二次方程",
      description: "学习一元二次方程的概念、解法及其应用",
      sortOrder: 1,
      lessonCount: 8,
      estimatedHours: 6,
    },
    {
      id: "cp-001-ch-02",
      title: "第二章 不等式与不等式组",
      description: "掌握一元一次不等式及不等式组的解法",
      sortOrder: 2,
      lessonCount: 6,
      estimatedHours: 4.5,
    },
    {
      id: "cp-001-ch-03",
      title: "第三章 函数与图像",
      description: "理解函数概念，掌握一次函数与反比例函数",
      sortOrder: 3,
      lessonCount: 10,
      estimatedHours: 8,
    },
    {
      id: "cp-001-ch-04",
      title: "第四章 数据的收集与整理",
      description: "学习统计基础，掌握数据图表绘制",
      sortOrder: 4,
      lessonCount: 5,
      estimatedHours: 3.5,
    },
  ],
};

// ===== 备课计划（4 条，全 published）=====
export const mockLessonPlans: LessonPlan[] = [
  {
    id: "lp-001",
    title: "一元二次方程的概念",
    subject: "数学",
    className: "初一(1)班",
    teacherName: "王老师",
    textbookTitle: "人教版七年级数学下册",
    chapterTitle: "第一章 一元二次方程",
    status: "published",
    publishedAt: "2026-02-18T10:00:00Z",
    estimatedMinutes: 45,
  },
  {
    id: "lp-002",
    title: "配方法解一元二次方程",
    subject: "数学",
    className: "初一(1)班",
    teacherName: "王老师",
    textbookTitle: "人教版七年级数学下册",
    chapterTitle: "第一章 一元二次方程",
    status: "published",
    publishedAt: "2026-02-22T10:00:00Z",
    estimatedMinutes: 45,
  },
  {
    id: "lp-003",
    title: "文言文虚词专题（一）",
    subject: "语文",
    className: "初一(1)班",
    teacherName: "李老师",
    textbookTitle: "人教版七年级语文下册",
    chapterTitle: "第二单元 文言文阅读",
    status: "published",
    publishedAt: "2026-03-05T10:00:00Z",
    estimatedMinutes: 45,
  },
  {
    id: "lp-004",
    title: "现在完成时专项练习",
    subject: "英语",
    className: "初一(1)班",
    teacherName: "张老师",
    textbookTitle: "人教版七年级英语下册",
    chapterTitle: "Unit 6 Tenses",
    status: "published",
    publishedAt: "2026-03-12T10:00:00Z",
    estimatedMinutes: 40,
  },
];

// ===== 备课计划详情 =====
export const mockLessonPlanDetail: LessonPlanDetail = {
  id: "lp-002",
  title: "配方法解一元二次方程",
  subject: "数学",
  className: "初一(1)班",
  teacherName: "王老师",
  textbookTitle: "人教版七年级数学下册",
  chapterTitle: "第一章 一元二次方程",
  status: "published",
  publishedAt: "2026-02-22T10:00:00Z",
  estimatedMinutes: 45,
  objectives: [
    "理解配方法的几何意义",
    "掌握用配方法解一元二次方程的步骤",
    "能够将一般一元二次方程化为 (x+a)²=b 的形式",
  ],
  keyPoints: [
    "配方法的核心步骤：移项 → 二次项系数化为 1 → 配方 → 开方",
    "完全平方式 a²±2ab+b²=(a±b)² 的应用",
  ],
  difficultPoints: [
    "配方时如何确定两边同时加上的常数项",
    "当二次项系数不为 1 时的处理方法",
  ],
  content:
    "本节课主要讲解配方法解一元二次方程。首先复习完全平方式的概念，通过几何图形直观展示配方的过程。然后通过例题演示配方法的标准步骤：(1) 将方程化为一般形式；(2) 二次项系数化为 1；(3) 移常数项到右边；(4) 左右两边同时加上一次项系数一半的平方；(5) 左边写成完全平方形式；(6) 开平方求解。最后通过练习题巩固，重点关注学生易错点。",
  homeworkDescription:
    "课本第 25 页练习 1-4 题，配套练习册第 15 页配方法专项 8 题，要求写出完整解题过程。",
};

// ===== 选修课（3 条）=====
export const mockElectiveSelections: ElectiveSelection[] = [
  {
    id: "ele-001",
    childId: "student-001",
    courseName: "创意写作",
    courseCode: "ELECTIVE-A001",
    teacherName: "陈老师",
    category: "language",
    credits: 2,
    schedule: "周三 15:00-16:30",
    status: "enrolled",
    enrolledAt: "2026-02-25T09:00:00Z",
  },
  {
    id: "ele-002",
    childId: "student-001",
    courseName: "趣味物理实验",
    courseCode: "ELECTIVE-S012",
    teacherName: "周老师",
    category: "science",
    credits: 2,
    schedule: "周五 15:00-16:30",
    status: "enrolled",
    enrolledAt: "2026-02-25T09:00:00Z",
  },
  {
    id: "ele-003",
    childId: "student-001",
    courseName: "篮球基础",
    courseCode: "ELECTIVE-P005",
    teacherName: "孙老师",
    category: "sports",
    credits: 1,
    schedule: "周一 16:30-18:00",
    status: "completed",
    enrolledAt: "2025-09-05T09:00:00Z",
    score: 88,
  },
];

// ===== 子女详情聚合 =====
export const mockChildDetail: ChildDetail = {
  childId: "student-001",
  basicInfo: {
    name: "张小明",
    avatar: "https://example.com/avatar/student-001.png",
    grade: "grade.7",
    className: "初一(1)班",
    schoolName: "实验中学",
    relation: "父亲",
  },
  todaySchedule: [
    {
      id: "sch-today-1",
      dayOfWeek: 1,
      period: 1,
      subject: "数学",
      teacherName: "王老师",
      classroom: "初一(1)班教室",
      startTime: "08:00",
      endTime: "08:45",
    },
    {
      id: "sch-today-2",
      dayOfWeek: 1,
      period: 2,
      subject: "语文",
      teacherName: "李老师",
      classroom: "初一(1)班教室",
      startTime: "08:55",
      endTime: "09:40",
    },
    {
      id: "sch-today-3",
      dayOfWeek: 1,
      period: 3,
      subject: "英语",
      teacherName: "张老师",
      classroom: "初一(1)班教室",
      startTime: "10:00",
      endTime: "10:45",
    },
  ],
  weeklySchedule: [
    {
      id: "sch-w-1",
      dayOfWeek: 1,
      period: 1,
      subject: "数学",
      teacherName: "王老师",
      classroom: "初一(1)班教室",
      startTime: "08:00",
      endTime: "08:45",
    },
    {
      id: "sch-w-2",
      dayOfWeek: 1,
      period: 2,
      subject: "语文",
      teacherName: "李老师",
      classroom: "初一(1)班教室",
      startTime: "08:55",
      endTime: "09:40",
    },
    {
      id: "sch-w-3",
      dayOfWeek: 2,
      period: 1,
      subject: "英语",
      teacherName: "张老师",
      classroom: "初一(1)班教室",
      startTime: "08:00",
      endTime: "08:45",
    },
    {
      id: "sch-w-4",
      dayOfWeek: 2,
      period: 2,
      subject: "物理",
      teacherName: "周老师",
      classroom: "物理实验室",
      startTime: "08:55",
      endTime: "09:40",
    },
    {
      id: "sch-w-5",
      dayOfWeek: 3,
      period: 1,
      subject: "数学",
      teacherName: "王老师",
      classroom: "初一(1)班教室",
      startTime: "08:00",
      endTime: "08:45",
    },
  ],
  homeworkSummary: {
    pendingCount: 3,
    overdueCount: 0,
    submittedCount: 5,
    gradedCount: 8,
  },
  gradeSummary: {
    avgScore: 90,
    classRank: 5,
    classSize: 45,
    trend: "up",
  },
  examResults: {
    upcoming: 2,
    completed: 4,
    avgScore: 88,
  },
};

// ===== 成长档案（班级均对比线）=====
export const mockGrowthArchive: GrowthArchive = {
  childId: "student-001",
  subject: "数学",
  dataPoints: [
    { date: "2026-03", studentScore: 82, classAverage: 76 },
    { date: "2026-04", studentScore: 88, classAverage: 78 },
    { date: "2026-05", studentScore: 92, classAverage: 79 },
    { date: "2026-06", studentScore: 90, classAverage: 80 },
  ],
};

// ===== 成绩导出结果 =====
export const mockExportResult: ExportResult = {
  downloadUrl:
    "https://example.com/exports/grades-student-001-2026-07-13.xlsx",
  expiresAt: "2026-07-13T23:59:59Z",
};
