# -*- coding: utf-8 -*-
"""Build 5 detail pages for round 173."""
import os

os.chdir(os.path.dirname(os.path.abspath(__file__)))

DETAILS = [
    {
        "file": "details/notre-msba.html",
        "title": "Notre Dame MSBA (South Bend)",
        "school_zh": "圣母大学",
        "prog_zh": "商业分析理学硕士（South Bend 在校 · STEM · 1 年）",
        "en": "Master of Science in Business Analytics (MSBA, Residential)",
        "sub": "Mendoza College of Business · IT, Analytics and Operations Department · On-campus South Bend",
        "color": "#0C2340",
        "cards": [
            ("学位", "MS（商业分析理学硕士）"),
            ("学制", "1 年（3 semesters / 12 months，pre-professional）"),
            ("STEM", "是（STEM-designated）"),
            ("申请截止", "Early Action Sep 10 / R1 Oct 20 / R2 Jan 7 / R3 Mar 17, 2027"),
            ("语言要求", "TOEFL / PTE / IELTS Academic（国际生，要求待补）"),
            ("标化", "GMAT/GRE 可免（GPA 3.5+ 或 Notre 本科豁免；录取分布，非最低门槛）"),
            ("先修课程", "1 门 Statistics + 2 门 Business（Accounting/Finance/Management/Marketing 任选）"),
            ("最低 GPA", "3.0/4.0（B average）"),
            ("工作经验", "不要求（面向 recent grads 与 ≤2 年经验）"),
        ],
        "overview": "Notre Dame Mendoza 商学院 MSBA 是 1 年 STEM-designated 在校硕士，面向 pre-professional 学生（recent graduates 与 ≤2 年工作经验），与 Chicago MSBA（alternating weekend 在职）不同。课程覆盖统计、编程、机器学习、商业沟通与 capstone 项目，培养数据驱动决策的商业分析人才。",
        "tags": ["on-campus", "STEM", "pre-professional", "capstone", "1-year"],
        "curriculum": [
            "1 年 3 semesters 紧凑课程",
            "核心：统计、Python/R、SQL、机器学习、预测分析、数据可视化",
            "商业核心：会计、金融、营销、战略基础",
            "Capstone 项目：企业实战数据分析项目",
            "可选 Sports Analytics Concentration（体育分析方向）",
            "无工作经验硬性要求，但有 quantitative 背景优先",
        ],
        "admissions": [
            "本科：任意专业学士学位（business 本科除 BA 专业外欢迎申请；science/econ/engineering 背景优先）",
            "先修：1 门 statistics + 2 门 business courses（Accounting/Finance/Management/Marketing）",
            "GPA：本科 major 至少 B average（3.0）",
            "GMAT/GRE：GPA 3.5+ 或 Notre 本科可免；其他申请者建议提交",
            "推荐信：2 封（含至少 1 封学术推荐）",
            "材料：Transcripts / 2 推荐信 / Resume / SOP / 4-slide presentation / Essay / Video assessment",
            "语言：TOEFL / PTE / IELTS Academic（国际生；本科全英文授课可豁免）",
            "截止：EA Sep 10 / R1 Oct 20 / R2 Jan 7（国际生建议 R2 前）/ R3 Mar 17",
        ],
        "links": [
            ("项目官网", "https://mendoza.nd.edu/graduate-programs/business-analytics-msba/"),
            ("申请要求", "https://mendoza.nd.edu/graduate-programs/business-analytics-msba/msba-application-requirements/"),
            ("Bulletin", "https://registrar.nd.edu/assets/629076/2025_2026_mendoza_graduate_business_bulletin.pdf"),
        ],
        "note": "半核验页说明：学位、学制、STEM、4 轮申请截止、先修课程、GMAT/GRE 豁免政策已从 Mendoza 官网核实；具体课程清单、精确学费、语言最低分待系站目录恢复后补全。<br><b>对比排除：</b>Notre Dame MSBA Chicago 是 alternating weekend（Fri-Sat）面向 working professionals，不提供 F-1/J-1 签证 sponsor → 排除，本库仅收录 South Bend 在校 MSBA。",
    },
    {
        "file": "details/notre-msf.html",
        "title": "Notre Dame MSF (Residential)",
        "school_zh": "圣母大学",
        "prog_zh": "金融理学硕士（Residential · STEM · 量化金融）",
        "en": "Master of Science in Finance (MSF, Residential)",
        "sub": "Mendoza College of Business · STEM-designated · On-campus South Bend",
        "color": "#0C2340",
        "cards": [
            ("学位", "MS（金融理学硕士）"),
            ("学制", "~1 年（accelerated 在校项目，具体待补）"),
            ("STEM", "是（STEM-designated）"),
            ("申请截止", "Early Action Sep 10 / R1 Oct 20 / R2 Jan 7 / R3 Mar 17, 2027"),
            ("语言要求", "TOEFL / PTE / IELTS Academic（国际生，要求待补）"),
            ("标化", "GMAT/GRE 可免（GPA 3.5+ 或 Notre 本科豁免；录取分布，非最低门槛）"),
            ("方向", "Corporate Finance / Investments / Finance"),
            ("最低 GPA", "3.0/4.0（B average）"),
            ("工作经验", "不要求（面向 quantitative 本科背景转金融）"),
        ],
        "overview": "Notre Dame Mendoza MSF (Residential) 是 STEM-designated 量化金融硕士，面向 science/engineering 量化背景本科生转金融。课程聚焦量化分析、投资策略、Python for Finance、估值与金融建模。无工作经验硬性要求，可作为本科直申的金融硕士选项。",
        "tags": ["on-campus", "STEM", "quantitative finance", "no work exp required", "1-year"],
        "curriculum": [
            "核心：quantitative analysis、investments、Python for Finance、valuation、financial modeling",
            "方向：Corporate Finance / Investments / Finance（bulletin 列出）",
            "Interterm 短期课程 + Wall Street 高管实战项目",
            "Accelerated 课程节奏（具体学期待补）",
            "Experiential learning：企业项目与行业高管网络",
        ],
        "admissions": [
            "本科：任意专业学士学位（science/engineering/quantitative 背景优先）",
            "GPA：本科 major 至少 B average（3.0）",
            "GMAT/GRE：GPA 3.5+ 或 Notre 本科可免；其他申请者建议提交",
            "推荐信：2 封（至少 1 封学术推荐）",
            "材料：Transcripts / 2 推荐信 / Resume / SOP（100 words）/ 4-slide presentation / Essay / Video assessment",
            "语言：TOEFL / PTE / IELTS Academic（国际生；本科全英文授课可豁免）",
            "申请费：$50",
            "截止：EA Sep 10 / R1 Oct 20 / R2 Jan 7 / R3 Mar 17",
        ],
        "links": [
            ("项目官网", "https://mendoza.nd.edu/graduate-programs/finance-msf/"),
            ("申请要求", "https://mendoza.nd.edu/graduate-programs/finance-msf/msf-application-requirements/"),
            ("Bulletin", "https://registrar.nd.edu/assets/629076/2025_2026_mendoza_graduate_business_bulletin.pdf"),
        ],
        "note": "半核验页说明：学位、STEM、3 个 concentration、4 轮申请截止、GMAT/GRE 豁免政策已从 Mendoza 官网与 2025-2026 Bulletin 核实；具体学分数、精确学费、语言最低分待系站目录恢复后补全。",
    },
    {
        "file": "details/ucsd-cse-ms.html",
        "title": "UCSD CSE MS",
        "school_zh": "加州大学圣地亚哥分校",
        "prog_zh": "计算机科学与工程理学硕士（Thesis / Comprehensive 三种 Plan）",
        "en": "Master of Science in Computer Science and Engineering (CSE MS)",
        "sub": "Department of Computer Science and Engineering · Jacobs School of Engineering · Fall admission",
        "color": "#182B49",
        "cards": [
            ("学位", "MS（Computer Science / Computer Engineering 两方向）"),
            ("学制", "2 年 full-time（thesis plan）/ 1.5-2 年（comprehensive plan）"),
            ("STEM", "是（CSE）"),
            ("申请截止", "12 月（Fall 2027 入学，具体日期待补）"),
            ("语言要求", "TOEFL iBT / IELTS（UCSD Graduate Division standard，待补）"),
            ("标化", "GRE not required for Fall 2027（录取分布，非最低门槛）"),
            ("最低 GPA", "3.0/4.0（B average）"),
            ("推荐信", "3 封"),
            ("Thesis", "Thesis Plan / Comprehensive Standard / Comprehensive Interdisciplinary 三选一"),
        ],
        "overview": "UCSD CSE 系提供 MS in Computer Science 与 MS in Computer Engineering 两个方向，每个方向有 Thesis Plan、Comprehensive Standard Plan、Comprehensive Interdisciplinary Plan 三种学习路径。课程强调 fundamental concepts、breadth（跨领域）与 depth（专业方向），可 full-time 或 part-time。",
        "tags": ["on-campus", "STEM", "thesis option", "comprehensive option", "Fall only"],
        "curriculum": [
            "两种 major：Computer Science / Computer Engineering",
            "三种 Plan：Thesis Plan（capstone thesis + 3 人委员会）/ Comprehensive Standard / Comprehensive Interdisciplinary",
            "课程要求：Fundamental concepts + Breadth requirement + Depth requirement",
            "Interdisciplinary Option：跨系选修 additional coursework",
            "Thesis Plan：12 units CSE 298 研究学分，导师指导完成 thesis",
            "Admission 每年 Fall 入学，不接受 Spring",
        ],
        "admissions": [
            "本科：BS/BA in CS/CE/EE/Math 优先；其他专业需补完 CSE 先修课",
            "GPA：至少 B average（3.0）",
            "GRE：Fall 2027 不要求，可自愿提交",
            "推荐信：3 封（学术/研究/业界均可）",
            "材料：Transcripts / 3 推荐信 / SOP / Resume / 语言成绩",
            "语言：TOEFL iBT / IELTS（UCSD Graduate Division 标准）",
            "截止：12 月（Fall 入学）",
            "备注：MS 与 PhD 录取独立；MS 在读想转 PhD 需重新提交 petition + 新 SOP + 3 新推荐信",
        ],
        "links": [
            ("项目官网", "https://cse.ucsd.edu/graduate/degree-programs/ms-program"),
            ("招生要求", "https://cse.ucsd.edu/graduate/admissions"),
            ("Checklist", "https://cse.ucsd.edu/graduate/cse-graduate-application-checklist"),
            ("Catalog", "https://catalog.ucsd.edu/curric/CSE-gr.html"),
        ],
        "note": "半核验页说明：学位、两种 major、三种 Plan、Fall-only 入学、GRE not required for Fall 2027、GPA 3.0、3 推荐信已从 UCSD CSE 官网与 Catalog 核实；具体 49 units 课程清单、精确学费、语言最低分待系站目录恢复后补全。<br><b>对比排除：</b>UCSD 已落的 ucsd-cse-am 是 CSE 系下 Advanced Manufacturing 方向 specialization，本条目是 CSE 主 MS（CS/CE 两方向），不重复。",
    },
    {
        "file": "details/uva-me-bme.html",
        "title": "UVA M.E. in Biomedical Engineering",
        "school_zh": "弗吉尼亚大学",
        "prog_zh": "生物工程工程硕士（M.E. · 32 credits · 课程型）",
        "en": "Master of Engineering in Biomedical Engineering (M.E. BME)",
        "sub": "Department of Biomedical Engineering · School of Engineering and Applied Science · On-Grounds",
        "color": "#E03C1B",
        "cards": [
            ("学位", "M.E.（Master of Engineering，professional 课程型）"),
            ("学制", "~1-1.5 年（32 credits coursework + design）"),
            ("STEM", "是（BME）"),
            ("申请截止", "Fall M.E. Jul 31, 2026（MS/PhD Dec 15）"),
            ("语言要求", "TOEFL iBT 90-100 recommended / IELTS 7.0+"),
            ("标化", "GRE 2026 申请已 waive（录取分布，非最低门槛）"),
            ("先修课程", "intro chemistry + biology + physics（2 semesters calc-based）+ math through differential equations + programming"),
            ("最低 GPA", "B average（典型录取 GPA >3.5）"),
            ("设计项目", "32 credits 含 design work（无 thesis）"),
        ],
        "overview": "UVA BME 系提供 M.E. in Biomedical Engineering（professional coursework 学位），区别于研究型 M.S.。课程型 M.E. 共 32 credits 课程 + design work，无 thesis，适合直接就业的本科毕业生。UVA 同时提供 UVAccelerate 本硕连读项目（UVA 本科三年级申请）。",
        "tags": ["on-campus", "STEM", "professional coursework", "no thesis", "design project"],
        "curriculum": [
            "32 credits 课程 + design work",
            "核心：biomedical engineering fundamentals、biomaterials、biomechanics、medical imaging",
            "Design project 代替 thesis",
            "UVAccelerate：UVA 本科/Sweet Briar 工程科学本科三年级可申请，提前修研究生课",
            "Fall 入学为主（M.E. 截止 7 月 31 日，晚于 MS/PhD 12 月 15 日）",
        ],
        "admissions": [
            "本科：BS/BA in engineering/applied science 优先；其他专业可补先修课",
            "先修：intro chemistry + biology + physics（2 semesters calc-based）+ math through differential equations + programming（Matlab/C++/Java）",
            "GPA：B average（典型录取 GPA >3.5）",
            "GRE：2026 申请已 waive（不强制；国际生建议提交）",
            "材料：Transcripts / 推荐信 / SOP / Resume / 语言成绩",
            "语言：TOEFL iBT 90-100 recommended / IELTS 7.0+",
            "截止：M.E. Fall Jul 31 / M.S. & PhD Fall Dec 15",
            "申请费：2026 申请已自动 waive",
        ],
        "links": [
            ("项目官网", "https://engineering.virginia.edu/department/biomedical-engineering/academics/graduate-programs/me-biomedical-engineering"),
            ("招生要求", "https://engineering.virginia.edu/department/biomedical-engineering/apply/apply-bme"),
            ("Grad Admission", "https://engineering.virginia.edu/graduate-study/future-grad-students/graduate-admission"),
        ],
        "note": "半核验页说明：学位、32 credits、M.E. vs M.S. 区别、Fall 截止、GRE waive、语言推荐分数已从 UVA Engineering 官网核实；具体课程清单、精确学费、奖学金细节待系站目录恢复后补全。",
    },
    {
        "file": "details/uchicago-msca.html",
        "title": "UChicago MScA (Professional)",
        "school_zh": "芝加哥大学",
        "prog_zh": "分析理学硕士（MScA · 12 门课 + capstone · NBC Tower 在校）",
        "en": "Master of Science in Analytics (MScA)",
        "sub": "Data Science Institute / Graham School · NBC Tower downtown Chicago · Full-time in-person",
        "color": "#800000",
        "cards": [
            ("学位", "MS in Analytics（Professional 应用分析学位）"),
            ("学制", "12-15 个月（full-time 3 courses/quarter）/ part-time evening/Sat"),
            ("STEM", "是（Analytics / Data Science）"),
            ("申请截止", "Autumn 入学 rolling（最终截止 Jun 23，满员即关）"),
            ("语言要求", "TOEFL iBT 102 minimum / IELTS 7.0（no sub-score requirement）"),
            ("标化", "GRE/GMAT not required（录取分布，非最低门槛）"),
            ("学分", "12 courses = 7 core + 3 elective + 2 capstone quarters"),
            ("Capstone", "2-quarter 企业实战项目（团队 4 人）"),
            ("入学", "Autumn only（full-time in-person 唯一签证 eligible 选项）"),
        ],
        "overview": "UChicago MScA 是 Data Science Institute 与 Graham School 合办的应用分析硕士，12 courses + 2-quarter capstone，在 downtown Chicago NBC Tower 授课。Full-time in-person 是唯一签证 eligible 选项；part-time evening/Sat 与 online 项目不提供 F-1/J-1 sponsor。区别于 DSI 的 MS in Applied Data Science（9 courses + practicum）。",
        "tags": ["on-campus", "STEM", "applied", "capstone", "Autumn only", "visa-eligible full-time"],
        "curriculum": [
            "12 courses = 7 core + 3 elective + 2 capstone quarters",
            "核心：Data Mining Principles / Machine Learning & Predictive Analytics / Big Data Platforms / 统计分析 / Python for Analytics / Leadership or Data Science for Consulting",
            "选修：Advanced ML & AI、行业应用（finance/healthcare/marketing）",
            "Capstone：2-quarter 企业实战项目（团队 4 人，与企业合作方共同完成）",
            "Full-time：3 courses/quarter，白天授课；part-time：2 courses/quarter，evening/Sat",
            "Autumn 入学（无 Spring/Summer 入学）",
        ],
        "admissions": [
            "本科：任意专业（STEM/econ/quantitative 背景优先；recent grads 与转行者均欢迎）",
            "平均工作经验：6 months - 4 years（full-time 学生群体）",
            "GRE/GMAT：not required，可自愿提交",
            "材料：Transcripts / 推荐信 / SOP / Resume / 语言成绩",
            "语言：TOEFL iBT 102 minimum（no sub-score）/ IELTS 7.0（no sub-score）",
            "申请费：待补",
            "截止：Autumn rolling（最终 Jun 23；满员即关）",
            "Visa：仅 full-time in-person 提供 F-1/J-1 sponsor；part-time/online 不提供",
        ],
        "links": [
            ("项目官网", "https://professional.uchicago.edu/find-your-fit/masters/master-science-analytics/"),
            ("Curriculum", "https://professional.uchicago.edu/find-your-fit/masters/master-science-analytics/curriculum"),
            ("Capstone", "https://professional.uchicago.edu/find-your-fit/masters/master-science-analytics/capstone-projects"),
            ("FAQ", "https://professional.uchicago.edu/find-your-fit/masters/master-science-analytics/frequently-asked-questions"),
        ],
        "note": "半核验页说明：学位、12 courses 结构、7 core + 3 elective + 2 capstone、TOEFL 102 / IELTS 7.0、Autumn only、Visa-eligible full-time 已从 UChicago Professional 官网核实；具体学费、奖学金、精确推荐信数量待系站目录恢复后补全。<br><b>对比排除：</b>MScA Part-time（evening/Sat）与 Online 项目不提供 F-1/J-1 sponsor → 排除，本库仅收录 full-time in-person。<br><b>与已落 uchicago-ads 区别：</b>MSADS（9 courses + practicum，DSI）vs MScA（12 courses + 2-quarter capstone，Graham School，NBC Tower），是两个不同项目。",
    },
]

TEMPLATE = """<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>{title} - 项目库</title>
<style>
body{{font-family:-apple-system,"Segoe UI",sans-serif;max-width:1080px;margin:0 auto;padding:24px;background:#f5f6f8;color:#222;line-height:1.6}}
h1{{font-size:22px;border-bottom:3px solid {color};padding-bottom:10px}}
h2{{font-size:17px;color:{color};margin-top:28px;border-left:4px solid {color};padding-left:10px}}
.grid{{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}}
.card{{background:#fff;border-radius:10px;padding:16px;box-shadow:0 1px 4px rgba(0,0,0,.06)}}
.card h3{{margin:0 0 8px;font-size:14px;color:#555;font-weight:600}}
.card .v{{font-size:15px;font-weight:600}}
.tag{{display:inline-block;background:#f0e6e6;color:{color};padding:2px 8px;border-radius:4px;font-size:12px;margin-right:4px}}
a{{color:{color};word-break:break-all}}
ul{{margin:6px 0;padding-left:20px}}
li{{margin:3px 0;font-size:14px}}
.note{{background:#fffbe6;border-left:4px solid #faad14;padding:10px 14px;border-radius:4px;font-size:13px;margin-top:10px}}
</style>
</head>
<body>
<h1>{school_zh} · {prog_zh}</h1>
<p style="color:#666">{sub}</p>

<div class="grid">
{cards_html}
</div>

<h2>项目概述</h2>
<div class="card">
<p>{overview}</p>
<p>{tags_html}</p>
</div>

<h2>课程结构</h2>
<div class="card">
<ul>
{curriculum_html}
</ul>
</div>

<h2>申请要求</h2>
<div class="card">
<ul>
{admissions_html}
</ul>
</div>

<h2>关键链接</h2>
<div class="card">
<ul>
{links_html}
</ul>
</div>

<div class="note">
{note}
</div>
</body>
</html>
"""

for d in DETAILS:
    cards_html = "\n".join(
        f'<div class="card"><h3>{k}</h3><div class="v">{v}</div></div>' for k, v in d["cards"]
    )
    tags_html = "".join(f'<span class="tag">{t}</span>' for t in d["tags"])
    curriculum_html = "\n".join(f"<li>{c}</li>" for c in d["curriculum"])
    admissions_html = "\n".join(f"<li>{a}</li>" for a in d["admissions"])
    links_html = "\n".join(
        f'<li>{name}：<a href="{url}">{url}</a></li>' for name, url in d["links"]
    )
    html = TEMPLATE.format(
        title=d["title"],
        color=d["color"],
        school_zh=d["school_zh"],
        prog_zh=d["prog_zh"],
        sub=d["sub"],
        cards_html=cards_html,
        tags_html=tags_html,
        overview=d["overview"],
        curriculum_html=curriculum_html,
        admissions_html=admissions_html,
        links_html=links_html,
        note=d["note"],
    )
    with open(d["file"], "w", encoding="utf-8") as f:
        f.write(html)
    print(f"[OK] wrote {d['file']}")
