# -*- coding: utf-8 -*-
import io, sys, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

TPL = """<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>__TITLE__ | 北卡教堂山 | 美加硕博项目库</title><style>
:root{--bg:#f7f8fa;--card:#fff;--pri:#c8102e;--pri2:#a00d24;--line:#e5e7eb;--txt:#1f2937;--sub:#6b7280;--chip:#fef2f2;--link:#c8102e;}
*{box-sizing:border-box}body{margin:0;font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--txt);line-height:1.65}
.wrap{max-width:1080px;margin:0 auto;padding:24px}
.crumb{font-size:13px;color:var(--sub);margin-bottom:14px}
.crumb a{color:var(--link);text-decoration:none}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:22px 26px;margin-bottom:18px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
h1{font-size:26px;margin:0 0 6px;color:#111}h2{font-size:17px;margin:0 0 12px;color:var(--pri);border-left:4px solid var(--pri);padding-left:10px}
.meta{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0}
.chip{background:var(--chip);color:var(--pri2);padding:3px 10px;border-radius:999px;font-size:12.5px}
.kv{display:grid;grid-template-columns:110px 1fr;row-gap:8px;font-size:14px}
.kv dt{color:var(--sub)}.kv dd{margin:0}
ul{margin:6px 0;padding-left:20px}li{margin:3px 0}
.note{background:#fffbeb;border-left:4px solid #f59e0b;padding:10px 14px;border-radius:6px;font-size:13.5px;color:#92400e;margin-top:8px}
</style></head><body><div class="wrap">
<div class="crumb"><a href="../index_main.html">← 返回项目库</a> / 北卡教堂山 UNC-Chapel Hill / __TITLE__</div>
<div class="card">
<h1>__TITLE__</h1>
<div class="meta"><span class="chip">__DEG__</span><span class="chip">北卡教堂山 UNC-Chapel Hill</span><span class="chip">__DISC__</span>__STEM_CHIP__<span class="chip">__DEPT__</span></div>
<dl class="kv" style="margin-top:14px">
<dt>开设院系</dt><dd>__DEPT__</dd>
<dt>官网链接</dt><dd><a href="__URL__" target="_blank" rel="noopener">__URL__</a></dd>
<dt>截止日期</dt><dd>catalog 页未列具体轮次（待补）</dd>
<dt>语言要求</dt><dd>TOEFL iBT / IELTS Academic（最低分待补）</dd>
<dt>标化考试</dt><dd>catalog 页未列（待补）</dd>
<dt>学费</dt><dd>catalog 页未列打包学费（待补）</dd>
</dl>
</div>
<div class="card"><h2>核心课程 / 学位要求</h2><ul>__CORE__</ul></div>
<div class="card"><h2>方向选修 / 特色</h2><ul>__ELECT__</ul></div>
<div class="card"><h2>备注</h2><div class="note">__NOTE__</div></div>
</div></body></html>"""

def build(title, deg, disc, stem, dept, url, core, elect, note):
    stem_chip = '<span class="chip">STEM（OPT 36 个月）</span>' if stem else ''
    return TPL.replace("__TITLE__", title).replace("__DEG__", deg).replace("__DISC__", disc).replace("__STEM_CHIP__", stem_chip).replace("__DEPT__", dept).replace("__URL__", url).replace("__CORE__", core).replace("__ELECT__", elect).replace("__NOTE__", note)

pages = []

# 1. UNC MAC (Master of Accounting, On-Campus)
pages.append(("details/unc-mac.html", build(
    "会计硕士（Master of Accounting, On-Campus, STEM-designated）",
    "MAC", "biz", 1,
    "Kenan-Flagler Business School",
    "https://catalog.unc.edu/graduate/schools-departments/kenan-flagler-business-school/",
    "<li>Kenan-Flagler 商院 professional master，on-campus 在校版</li><li>STEM-designated（catalog 明示）</li><li>课程整合 accounting 与其他商业学科，强调会计概念在当前商业问题中的应用</li><li>Full-time 在校授课；Online MAC 为在线版，排除不录</li><li>申请联系：mac_info@unc.edu / (919) 962-3209</li>",
    "<li>会计与商业整合课程：financial accounting / managerial accounting / taxation / audit / accounting information systems 等核心</li><li>CPA 考试方向培养（美国注册会计师）</li><li>商业分析 / 数据分析选修（STEM-designated 方向）</li><li>MBA / Evening Executive MBA / Weekend Executive MBA / MBA@UNC Online 均排除（MBA 含双学位/在职/在线口径）</li><li>PhD in Business Administration 留批次5</li>",
    "catalog 页未列具体学分/课程列表/截止/语言/GRE/学费，整项待补；Online MAC 在线版排除；MBA 各方向（Full-Time / Evening / Weekend / Online）按排除口径不录；PhD 留批次5；STEM-designated 为 catalog 明示口径。"
)))

# 2. UNC MSM (Master of Science in Management)
pages.append(("details/unc-msm.html", build(
    "管理学理学硕士（Master of Science in Management, STEM-designated）",
    "MSM", "biz", 1,
    "Kenan-Flagler Business School",
    "https://catalog.unc.edu/graduate/schools-departments/kenan-flagler-business-school/",
    "<li>Kenan-Flagler 商院 professional master</li><li>STEM-designated（catalog 明示）</li><li>面向跨行业商业职业，提供 foundational and rigorous program of study in the field of business</li><li>培养 essential skills and knowledge necessary for successful business careers across multiple industries</li><li>cultivates principled, collaborative leaders（Kenan-Flagler 自1919年办学使命）</li>",
    "<li>商业基础核心：management / marketing / finance / accounting / strategy / organizational behavior</li><li>STEM 方向含定量分析 / 商业分析 / 数据分析模块</li><li>跨行业职业导向：consulting / tech / healthcare / finance / CPG 等</li><li>与 MBA 区分：MSM 面向早期职业（非 MBA 级别），MBA 排除不录</li><li>PhD in Business Administration 留批次5</li>",
    "catalog 页未列具体学分/课程列表/截止/语言/GRE/学费，整项待补；MBA 各方向（Full-Time / Evening / Weekend / Online）按排除口径不录；Online MAC 在线版排除；PhD 留批次5；STEM-designated 为 catalog 明示口径；MSM 为非 MBA 管理硕士，符合保留口径。"
)))

# 3. UNC MEITE (MA in Educational Innovation, Technology, and Entrepreneurship)
pages.append(("details/unc-meite.html", build(
    "教育创新、技术与创业文学硕士（MA in Educational Innovation, Technology, and Entrepreneurship）",
    "MA", "edu", 0,
    "School of Education",
    "https://catalog.unc.edu/graduate/schools-departments/education/",
    "<li>School of Education professional degree program</li><li>面向教育技术领域职业（public and private sectors）</li><li>36.0 credit hours 总学分</li><li>结构：core 12.0 hours + specialized track 12.0 hours + yearlong internship 6.0 hours + summer thesis project 6.0 hours</li><li>Full-time 或 part-time cohorts，August 与 January 两次入学</li>",
    "<li>四个 specialized tracks（catalog 页列 4 方向，具体 track 名称待补）</li><li>Yearlong internship experience（6 hours）：真实教育科技/创新组织实习</li><li>Summer thesis project（6 hours）：毕业项目</li><li>方向：learning design / educational data science / edtech entrepreneurship / innovation leadership</li><li>毕业生可推荐 NC professional licensure, Instructional Technology Specialist（教学技术专家执照）</li><li>与 M.Ed. for Experienced Teachers 区分：后者为 part-time field-based 在职教师项目，排除不录</li>",
    "catalog 页未列具体课程列表/截止/语言/GRE/学费，整项待补；M.Ed. for Experienced Teachers（ECIFS 在职教师 part-time）排除；M.S.A. Flex（school administration 在职 part-time）排除；MAT 师范 licensure 方向待终检定性；MEITE 为教育科技/创业 professional 硕士，非师范 licensure 项目，符合保留口径；STEM 状态 catalog 未明示，保守 stem:0。"
)))

# 4. UNC MSW (2-Year Residential)
pages.append(("details/unc-ssw-msw.html", build(
    "社会工作硕士（Master of Social Work, 2-Year Residential）",
    "MSW", "soc", 0,
    "School of Social Work",
    "https://catalog.unc.edu/graduate/schools-departments/social-work/",
    "<li>School of Social Work professional master，2-Year 在校 full-time 版</li><li>Minimum 62 credit hours</li><li>Generalist curriculum：29 credit hours（human behavior and the social environment / institutionalized discrimination / social work practice / social policy / research）</li><li>Specialization curriculum：evidence-informed practice 方向（Direct Practice 或 Community, Management and Policy Practice）</li><li>Practicum：每学期 250+ government/nonprofit/human services agencies 现场实习</li><li>Typical time to completion：4 semesters full-time</li><li>SOWO 810 Evaluation of Social Work Interventions（3 hours）+ Master's Oral Exam</li>",
    "<li>两大 specialization：Direct Practice（个人/家庭/群体高级社工实践）/ Community, Management and Policy Practice（社区/管理/政策）</li><li>3-Year 版本：part-time，每周 16 hours practicum，适合在职转行者，留后续补录</li><li>12-Month Advanced Standing：面向本科社工（CSWE 认证）毕业生，40 credits，5 月入学，留后续补录</li><li>Online MSW：在线版，排除不录</li><li>PhD in Social Work 留批次5</li>",
    "catalog 页未列具体截止/语言/GRE/学费，整项待补；Online MSW 在线版排除；3-Year part-time 与 12-Month Advanced Standing 为同校不同通道，留后续补录；MPH-MSW 双学位按排除口径不录；PhD 留批次5；MSW 为社会工作专业型硕士，非临床执业医师类，符合保留口径。"
)))

# 5. UNC Nutrition NFSH (on-campus)
pages.append(("details/unc-nutrition-nfsh.html", build(
    "营养学公共卫生硕士-食物系统与健康方向（MPH in Nutrition, Food Systems and Health, On-Campus）",
    "MPH", "med", 0,
    "Department of Nutrition, Gillings School of Global Public Health",
    "https://catalog.unc.edu/graduate/schools-departments/nutrition/",
    "<li>Gillings 公卫学院 professional master，Food Systems and Health (NFSH) 方向，on-campus 在校版</li><li>Minimum 42 hours；SPHG Integrated Core（711/712/721/722）</li><li>Practicum：SPHG 703/707</li><li>Concentration 核心：NUTR 711 Nutrition Across the Lifecycle（3h）、NUTR 713 Nutrition Communication, Culture and Equity（3h）、NUTR 723 Community Nutrition（3h）、NUTR 765 Foundations in Nutrition Epidemiology（3h）</li><li>Advanced：NUTR 805 Nutrition Policy（3h）</li><li>Culminating：NUTR 992 Master's Non-Thesis（3h）</li><li>Electives：≥9 hours graduate-level</li>",
    "<li>NFSH 方向：研究 food systems / food policy / nutrition equity / community nutrition / global health</li><li>与 Nutrition & Dietetics 方向区分：Dietetics 方向含临床实习 + RDN 注册路径（已录 unc-nutrition-mph）；NFSH 方向偏政策/系统/传播，无临床实习</li><li>NFSH 同时提供 on-campus 与 online 两种形式：on-campus 在校版录，online 版排除</li><li>已录 unc-nutrition-ms（研究型 MS）与 unc-nutrition-mph（Dietetics 方向），本条为 NFSH 方向在校版，独立项目不重复</li><li>B.S.PH.+M.S. 本硕连读排除；PhD in Nutrition 留批次5</li>",
    "catalog 页未列具体截止/语言/GRE/学费，整项待补；NFSH online 版排除；B.S.PH.+M.S. 本硕连读排除；PhD 留批次5；与已录 unc-nutrition-ms / unc-nutrition-mph 为不同方向/不同类型（研究型 vs 专业型 Dietetics vs 专业型 NFSH），不重复。"
)))

for path, html in pages:
    with open(path, "w", encoding="utf-8") as f:
        f.write(html)
    print("WROTE", path, len(html))
