#!/usr/bin/env python3
"""Build 5 detail pages for round 176: UChicago Harris MSDAP / UChicago Harris MSCEP / Emory Goizueta MSBA / Vanderbilt MSBT / Vanderbilt MAcc."""
import os

OUT = r"D:\work buddy\2026-11-05-14-15-52"

HTML_TMPL = """<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>{school} | {program_cn}</title>
<style>
body{{font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;max-width:960px;margin:0 auto;padding:24px;color:#222;line-height:1.65;background:#fafafa}}
h1{{font-size:22px;border-bottom:3px solid #1a3a6c;padding-bottom:10px}}
h2{{font-size:16px;color:#1a3a6c;margin-top:28px;background:#eef2f8;padding:8px 12px;border-left:4px solid #1a3a6c}}
ul{{margin:8px 0;padding-left:22px}}
li{{margin:4px 0}}
.meta{{background:#fff;border:1px solid #dde;border-radius:6px;padding:12px 16px;margin:14px 0}}
.meta b{{color:#1a3a6c}}
a{{color:#1a6fc4}}
.badge{{display:inline-block;background:#1a3a6c;color:#fff;padding:2px 8px;border-radius:10px;font-size:12px;margin-left:8px}}
.warn{{background:#fff8e1;border-left:4px solid #f0a020;padding:8px 12px;margin:12px 0}}
</style>
</head>
<body>
<h1>{school} · {program_cn} <span class="badge">{degree}</span></h1>
<div class="meta">
<b>英文名：</b>{program_en}<br>
<b>学制：</b>{duration}<br>
<b>STEM：</b>{stem_label}<br>
<b>申请截止：</b>{ddl}<br>
<b>语言要求：</b>{lang}<br>
<b>标化：</b>{test}<br>
<b>学费：</b>{tuition}<br>
<b>官网：</b><a href="{url_official}" target="_blank">{url_official}</a>
</div>
{cards_html}
<div class="warn">说明：本页为半核验页，学位/学制/截止/语言方向/先修已从学校官网核实；具体课程清单、精确学费、奖学金细节等待系站恢复后补全。录取分布，非最低门槛。</div>
</body>
</html>
"""

CARD_TMPL = "<h2>{title}</h2><ul>{items}</ul>"

DETAILS = [
    {
        "file": "details/uchicago-harris-msdap.html",
        "school": "芝加哥大学",
        "school_code": "uchicago",
        "program_cn": "数据 analytics 与政策理学硕士（MSDAP · 11 个月 · 夏季入学）",
        "program_en": "Master of Science in Data Analytics and Policy (MSDAP, Harris School of Public Policy)",
        "degree": "MS",
        "duration": "11 months, summer start (June matriculation)",
        "stem": True,
        "ddl": "Summer 入学；申请轮次见 Harris Admissions（精确日期待补）",
        "lang": "TOEFL iBT / IELTS Academic（具体分数要求待 Harris 系站确认）",
        "test": "GRE required 或满足 waiver 条件",
        "tuition": "Harris MSDAP 学费约 USD 75,000+/11-month（精确数字待 Harris 系站确认）",
        "url_official": "https://harris.uchicago.edu/academics/degrees/ms-data-analytics-policy",
        "cards": [
            ("学位与学制", [
                "MS in Data Analytics and Policy 是 Harris 提供的 11-month accelerated full-time 项目",
                "Summer start（6 月入学），次年 5 月毕业",
                "面向希望在短时间内获得 quantitative data analytics / machine learning / program evaluation 系统训练的学生",
                "Harris 官方定位：accelerated, quantitative training in data analytics, machine learning, and program evaluation for evidence-based policy work",
                "适合已有强定量背景、希望直接就业于 policy / data analytics 岗位的学生"
            ]),
            ("核心课程与学分", [
                "Intensive preparation in programming and statistics（夏季 boot camp）",
                "Machine learning for public policy",
                "AI for public policy",
                "Advanced program evaluation",
                "具体课程清单与学分：Harris 系站待补",
                "GPA 要求：core courses C- 及以上"
            ]),
            ("申请要求", [
                "在线 Graduate Application",
                "Resume",
                "Motivation Statement（Why Harris? Why policy? 300 词）",
                "可选 Short Essay（二选一）",
                "本科成绩单",
                "3 封推荐信（其中至少 1 封学术推荐，直申本科者）",
                "GRE required 或满足 waiver 条件",
                "TOEFL/IELTS（国际生）"
            ]),
            ("先修与背景", [
                "官方明确：strong quantitative background required",
                "建议本科背景：economics / statistics / applied math / CS / data science 或其他 quantitative social science",
                "无硬性先修课程清单，但隐含需要 calculus / statistics / programming 基础",
                "夏季入学前会有 intensive programming boot camp"
            ]),
            ("费用与资助", [
                "Harris MSDAP 学费约 USD 75,000+/11-month（精确数字待 Harris 系站确认）",
                "Merit-based scholarship 自动考虑",
                "11-month 项目无 summer internship（夏季即入学）"
            ]),
            ("录取提示", [
                "Harris 项目家族：MPP 2-year flagship / MA 1-year accelerated / MSCAPP 2-year / MSDAP 11-month summer / MSCEP 11-month climate/energy / MACRM 2-year PhD-bound / EMP evening part-time（已排除）",
                "MSDAP 与 MSCAPP 区别：MSCAPP 是 2-year 与 CS 系合办，侧重 computational；MSDAP 是 11-month accelerated，侧重 policy analytics 直接就业",
                "录取分布，非最低门槛——官方不公布 GPA/GRE 中位数",
                "排除项：Harris Evening Master's Program (EMP) 是 part-time evening，mid-career → 排除"
            ])
        ]
    },
    {
        "file": "details/uchicago-harris-mscep.html",
        "school": "芝加哥大学",
        "school_code": "uchicago",
        "program_cn": "气候与能源政策理学硕士（MSCEP · 11 个月 · STEM · 2026 首届）",
        "program_en": "Master of Science in Climate and Energy Policy (MSCEP, Harris School of Public Policy & Institute for Climate and Sustainable Growth)",
        "degree": "MS",
        "duration": "11 months, summer start (July matriculation)",
        "stem": True,
        "ddl": "4 轮申请：EA 2026/10/8 / R1 2026/12/3 / R2 2027/1/21 / R3 2027/6/17；国际生建议 R2 前",
        "lang": "TOEFL iBT / IELTS Academic（具体分数要求待 Harris 系站确认）",
        "test": "GRE required 或满足 waiver 条件",
        "tuition": "Harris MSCEP 学费约 USD 75,000+/11-month（精确数字待 Harris 系站确认）",
        "url_official": "https://harris.uchicago.edu/academics/degrees/ms-climate-energy-policy-mscep",
        "cards": [
            ("学位与学制", [
                "MS in Climate and Energy Policy 是 Harris 与 Institute for Climate and Sustainable Growth 合办的 11-month full-time 项目",
                "2026 年 7 月首届招生（first cohort in Summer 2026）",
                "Summer start（7 月入学），含 September experiential learning module（西德州/纽约实地考察）",
                "学位要求：12 graduate-level courses (1200 units)，9 门 core required",
                "GPA ≥ 2.7 at graduation；最多 1 门 Pass/Fail；core courses 必须 letter grade",
                "STEM-designated（DHS STEM list），F-1 学生可申请 24-month OPT extension（共 36 个月 OPT）"
            ]),
            ("核心课程与学分", [
                "4 core domains:",
                "Data & Analytical Tools: Statistics, programming, data visualization, ML, program evaluation",
                "Economics & Policy Analysis: Climate economics, energy markets, regulatory policy, cost-benefit analysis",
                "Climate Science & Systems: Earth systems science, climate modeling, carbon cycle dynamics, climate attribution",
                "Energy Technology & Innovation: Grid decarbonization, electrification, carbon capture/storage, renewable integration, geoengineering, nuclear, emerging technologies",
                "9 门 core required（具体课程编号：Harris 系站待补）",
                "Experiential learning requirement（September module）"
            ]),
            ("申请要求", [
                "在线 Graduate Application",
                "Resume",
                "4 段短文书（每段最多 250 词）：①最近关注的气候/能源政策动态；②职业目标；③quantitative 技能如何助力；④教育/职业背景证明 ready for rigorous quantitative program",
                "本科成绩单",
                "3 封推荐信",
                "GRE required 或 waiver",
                "TOEFL/IELTS（国际生）"
            ]),
            ("先修与背景", [
                "官方定位：analytically minded professionals with backgrounds in economics, engineering, statistics, or the natural sciences",
                "建议本科背景：economics / engineering / statistics / natural sciences / public policy",
                "无硬性先修课程清单，但隐含需要 strong quantitative preparation"
            ]),
            ("费用与资助", [
                "Harris MSCEP 学费约 USD 75,000+/11-month（精确数字待 Harris 系站确认）",
                "Merit-based scholarship 自动考虑",
                "$2000 deposit 占位（offer acceptance deadline 4/15/2027）"
            ]),
            ("录取提示", [
                "MSCEP 是 2026 年新项目，无校友 track record",
                "国际生建议 R2（1/21/2027）前提交，以便签证时间",
                "录取分布，非最低门槛——官方不公布 GPA/GRE 中位数",
                "与 MSDAP 区别：MSCEP 聚焦 climate/energy 垂直领域，MSDAP 是通用 policy analytics"
            ])
        ]
    },
    {
        "file": "details/emory-msba.html",
        "school": "埃默里大学",
        "school_code": "emory",
        "program_cn": "商业分析理学硕士（MSBA · 10 个月 · STEM · Goizueta 商学院）",
        "program_en": "Master of Science in Business Analytics (MSBA, Goizueta Business School)",
        "degree": "MSBA",
        "duration": "10 months (July start, graduate May) 或 16 months (含 summer internship + 9 additional credits)",
        "stem": True,
        "ddl": "Summer（7 月）入学；具体轮次见 Goizueta Admissions（精确日期待补）",
        "lang": "TOEFL iBT / IELTS Academic（具体分数要求待 Goizueta 系站确认）",
        "test": "GRE/GMAT 政策待 Goizueta 系站确认",
        "tuition": "Goizueta MSBA 学费约 USD 70,000+/10-month（精确数字待 Goizueta 系站确认）",
        "url_official": "https://business.emory.edu/msba",
        "cards": [
            ("学位与学制", [
                "MS in Business Analytics 是 Goizueta 商学院的 STEM-designated full-time on-campus 项目",
                "10-month option：7 月入学，次年 5 月毕业",
                "16-month option：延长至次年 12 月毕业，含 summer internship + 9 additional elective credits",
                "面向 early-career professionals / recent graduates，无需工作经验",
                "4 个 track：AI in Business / Business Analytics / Marketing Analytics / Supply Chain Analytics（秋季选 track）",
                "F-1 学生 STEM-designated 可享 36 个月 OPT"
            ]),
            ("核心课程与学分", [
                "Pre-fall boot camp（Math Bootcamp: calculus review, probability, random variables, Bayesian, matrices, logarithms）",
                "核心：Business Statistics, Business Analytics, Social Network Analytics, Machine Learning, Data Visualization, Designs Analytics & Optimization",
                "高阶：Machine Learning & AI at Scale, Deep Learning and Neural Networks, Reinforcement Learning for Business Decisions",
                "Cloud Computing: AWS SQL & NoSQL, Hadoop, Pig, Spark",
                "Analytics Practicum (ISOM 689)：与 industry partners 真实项目（如 Delta / Airbnb / Starbucks / JD.com），交付 code + dashboards + executive presentation",
                "Track 课程（具体清单：Goizueta 系站待补）"
            ]),
            ("申请要求", [
                "在线 Application",
                "Resume",
                "Essays",
                "本科成绩单",
                "推荐信（具体封数待 Goizueta 系站确认）",
                "GRE/GMAT（政策待 Goizueta 系站确认）",
                "TOEFL/IELTS（国际生）",
                "无需工作经验，可从本科直申"
            ]),
            ("先修与背景", [
                "官方明确：no professional experience required",
                "建议本科背景：quantitative / business / CS / statistics / economics",
                "Pre-fall boot camp 帮助 refresh math 基础",
                "Emory BBA 学生可申请 joint BBA/MSBA（4.5 年完成双学位）"
            ]),
            ("费用与资助", [
                "Goizueta MSBA 学费约 USD 70,000+/10-month（精确数字待 Goizueta 系站确认）",
                "Scholarship 自动考虑",
                "100% 学生配对 personal career coach"
            ]),
            ("录取提示", [
                "QS 2026 美国 MSBA 项目 Value for Money 排名前列",
                "Capstone 合作企业：The Home Depot, Delta Airlines, Airbnb, Starbucks, JD.com",
                "录取分布，非最低门槛——官方不公布 GPA/GRE 中位数",
                "排除项：Emory Goizueta MBA 是 MBA，不在本库范围"
            ])
        ]
    },
    {
        "file": "details/vandy-msbt.html",
        "school": "范德堡大学",
        "school_code": "vanderbilt",
        "program_cn": "商业与技术理学硕士（MSBT · 1 年 · STEM · NYC 校区 · 2027 首届）",
        "program_en": "Master of Science in Business and Technology (MSBT, Owen Graduate School of Management & School of Engineering, NYC Campus)",
        "degree": "MS",
        "duration": "1 year (30 credit hours = 24 core + 6 capstone)",
        "stem": True,
        "ddl": "2026/8/1 开放；Priority 2026/11/19；Final 2027/7/1；2027/8/23 开学",
        "lang": "TOEFL iBT / IELTS Academic（具体分数要求待 Vanderbilt 系站确认）",
        "test": "GRE/GMAT not required（官方明确：No GRE/GMAT or application fee）",
        "tuition": "Vanderbilt MSBT 学费约 USD 70,000+/年（精确数字待 Vanderbilt 系站确认）",
        "url_official": "https://www.vanderbilt.edu/nyc/academics-experiential-learning/ms-business-and-tech/",
        "cards": [
            ("学位与学制", [
                "MS in Business and Technology 是 Vanderbilt Owen 商学院 + School of Engineering + College of Connected Computing 合办的 1-year full-time residential 项目",
                "2027 Fall 首届招生（inaugural cohort）",
                "NYC Campus（Chelsea, 440 W. 21st St., Manhattan）",
                "30 credit hours = 24 core graduate-level courses + 6 credit hours immersive capstone",
                "Fall 开学，Summer capstone 结束",
                "STEM-designated",
                "Full-time residential，无 part-time/online option（官方明确）"
            ]),
            ("核心课程与学分", [
                "Core Business (12 credit hours):",
                "The Language of Business: Accounting and Finance",
                "Strategic Management of Technology Corporations and AI Integration",
                "Organizational Effectiveness: Leadership, Teamwork, & Negotiations",
                "Product Management: Operations and Marketing",
                "Applied STEM：AI, data analytics, emerging technologies",
                "Immersive NYC capstone（6 credit hours）：与 NYC 科技/商业生态合作"
            ]),
            ("申请要求", [
                "在线 Application",
                "Bachelor's Degree（任何专业）",
                "Transcripts",
                "Video Essay",
                "2 封推荐信",
                "Statement of Purpose",
                "No GRE/GMAT required",
                "No application fee",
                "TOEFL/IELTS（国际生）"
            ]),
            ("先修与背景", [
                "面向已有技术背景、希望补充 business/leadership 技能的学生",
                "官方定位：translators between technical execution and high-level business goals",
                "建议本科背景：engineering / CS / technical / quantitative",
                "Career outcomes: Product Management, Technology Consulting, Business Strategy, Innovation Leadership"
            ]),
            ("费用与资助", [
                "Vanderbilt MSBT 学费约 USD 70,000+/年（精确数字待 Vanderbilt 系站确认）",
                "Vanderbilt 不提供 dedicated housing，学生自行在 Chelsea / West Village / Flatiron / Hell's Kitchen / Murray Hill 租房",
                "NYC 生活成本显著高于 Nashville"
            ]),
            ("录取提示", [
                "2027 Fall 首届，无校友 track record",
                "Priority Deadline 11/19/2026 保证 12/1/2026 前出结果",
                "录取分布，非最低门槛——官方不公布 GPA/GRE 中位数",
                "与 Vanderbilt Nashville 校区 MSF/MSM/MM 区别：MSBT 在 NYC 校区，跨 Owen + Engineering 合办，侧重 tech + business"
            ])
        ]
    },
    {
        "file": "details/vandy-macc.html",
        "school": "范德堡大学",
        "school_code": "vanderbilt",
        "program_cn": "会计硕士（MAcc · 12 个月 · 两个方向：Assurance / Valuation）",
        "program_en": "Master of Accountancy (MAcc, Owen Graduate School of Management) - Assurance & Valuation tracks",
        "degree": "MAcc",
        "duration": "12 months (mod system, 2 mods per semester)",
        "stem": False,
        "ddl": "Fall 入学（8 月初开学）；具体轮次见 Owen Admissions（精确日期待补）",
        "lang": "TOEFL iBT / IELTS Academic（具体分数要求待 Owen 系站确认）",
        "test": "GRE/GMAT 政策待 Owen 系站确认",
        "tuition": "Vanderbilt MAcc 学费约 USD 70,000+/12-month（精确数字待 Owen 系站确认）",
        "url_official": "https://business.vanderbilt.edu/masters-in-accounting/",
        "cards": [
            ("学位与学制", [
                "Master of Accountancy 是 Owen 商学院的 12-month accelerated full-time 项目",
                "两个 distinct track：MAcc Assurance（审计/鉴证方向）和 MAcc Valuation（估值/财务方向）",
                "Mod system：每学期 2 个 mod，每个 mod 7 周",
                "Fall 入学（8 月初），次年 5 月毕业",
                "面向任何本科专业的 recent graduates 或有 1-3 年工作经验者",
                "10-week paid internship at Big 4（实习平均薪资 $11,000）"
            ]),
            ("核心课程与学分", [
                "Mod 0 Summer: Leadership Communications in Accountancy (MGT 6315, 1 credit), Business Ethics in Accounting (MGT 6317, 1 credit), Financial Economics I (MGT 6401, 2 credit — 仅 Valuation)",
                "Core: Audit, financial reporting, accounting analytics",
                "MAcc Assurance：CPA exam prep（Becker Review）",
                "MAcc Valuation：CPA + CFA Level 1 双备考（Schweser CFA + Becker CPA）",
                "Valuation track 需完成 37 credit hours coursework",
                "具体课程清单：Owen 系站待补"
            ]),
            ("申请要求", [
                "在线 Application",
                "Bachelor's Degree（任何专业）",
                "Transcripts",
                "Essays",
                "推荐信（具体封数待 Owen 系站确认）",
                "GRE/GMAT（政策待 Owen 系站确认）",
                "TOEFL/IELTS（国际生）",
                "Valuation track 先修：Financial and Managerial Accounting, Economics, Finance（B 或以上；录取后可补）"
            ]),
            ("先修与背景", [
                "Assurance track：不限本科专业，任何专业可申请",
                "Valuation track：需 strong quantitative experience and aptitude",
                "Valuation 先修：Financial and Managerial Accounting, Economics, Finance（B 或以上）",
                "多数学生本科直申，也接受 1-3 年工作经验者"
            ]),
            ("费用与资助", [
                "Vanderbilt MAcc 学费约 USD 70,000+/12-month（精确数字待 Owen 系站确认）",
                "Application fee $100",
                "Scholarship 自动考虑",
                "10-week paid internship at Big 4 平均 $11,000"
            ]),
            ("录取提示", [
                "100% MAcc 学生毕业 90 天内接受 offer（year after year）",
                "CPA 首次通过率在 top MAcc 项目中位居前列",
                "毕业生 5 年内多数达到六位数薪资",
                "主要雇主：Big 4（Deloitte, EY, KPMG, PwC）",
                "录取分布，非最低门槛——官方不公布 GPA/GRE 中位数"
            ])
        ]
    }
]


def build():
    for d in DETAILS:
        stem_label = "Yes (DHS STEM-designated)" if d["stem"] else "No"
        cards_html = "\n".join(
            CARD_TMPL.format(title=title, items="".join(f"<li>{item}</li>" for item in items))
            for title, items in d["cards"]
        )
        html = HTML_TMPL.format(
            school=d["school"],
            program_cn=d["program_cn"],
            degree=d["degree"],
            program_en=d["program_en"],
            duration=d["duration"],
            stem_label=stem_label,
            ddl=d["ddl"],
            lang=d["lang"],
            test=d["test"],
            tuition=d["tuition"],
            url_official=d["url_official"],
            cards_html=cards_html,
        )
        path = os.path.join(OUT, d["file"])
        os.makedirs(os.path.dirname(path), exist_ok=True)
        with open(path, "w", encoding="utf-8") as f:
            f.write(html)
        print("WROTE", path, len(html))


if __name__ == "__main__":
    build()
