# -*- 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")

CSS = """
:root{--bg:#f7f8fa;--card:#fff;--pri:#003366;--pri2:#002244;--line:#e5e7eb;--txt:#1f2937;--sub:#6b7280;--chip:#eef3f8;--link:#003366;}
*{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}
"""

def build(crumb, title, h1, deg_chip, disc_chip, college_chip, dept, url, ddl, lang, test, tui, core_items, elect_items, note):
    return f"""<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>{title} | 美加硕博项目库</title><style>{CSS}</style></head><body><div class="wrap">
<div class="crumb"><a href="../index_main.html">← 返回项目库</a> / 纽约大学 / {title}</div>
<div class="card">
<h1>{h1}</h1>
<div class="meta"><span class="chip">{deg_chip}</span><span class="chip">纽约大学 New York University</span><span class="chip">{disc_chip}</span><span class="chip">{college_chip}</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>{ddl}</dd>
<dt>语言要求</dt><dd>{lang}</dd>
<dt>标化考试</dt><dd>{test}</dd>
<dt>学费</dt><dd>{tui}</dd>
</dl>
</div>
<div class="card"><h2>核心课程 / 学位要求</h2><ul>{core_items}</ul></div>
<div class="card"><h2>方向选修 / 特色</h2><ul>{elect_items}</ul></div>
<div class="card"><h2>备注</h2><div class="note">{note}</div></div>
</div></body></html>"""

pages = []

# 1. NYU Data Science MS
pages.append(("details/nyu-c3472a1.html", build(
    "数据科学硕士", "数据科学硕士", "数据科学硕士（MS in Data Science）",
    "MS", "cs", "文理学院 GSAS",
    "Center for Data Science",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/data-science-ms/",
    "GSAS bulletin 页未列具体截止日期（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "GSAS bulletin 页未列标化要求（待补）",
    "GSAS bulletin 页未列打包学费（待补）",
    "<li>学位授予：MS（数据科学硕士）</li><li>入学要求：需具备扎实的数学基础（典型背景为数学/统计/工程/物理/理论经济/CS专业）</li><li>要求具备编程训练和计算机基础知识</li><li>课程涵盖统计、机器学习、大数据系统、算法等</li>",
    "<li>方向：机器学习、数据挖掘、统计建模、大数据系统、可视化</li><li>由 NYU Center for Data Science 开设</li><li>面向数据科学行业与 PhD 衔接</li><li>CIP 待补，HEGIS 待补</li>",
    "bulletins.nyu.edu 200 可达（48KB）；数据科学/CS 类标 stem:1；具体学分/截止/语言最低分/标化/学费 GSAS 页未列，留待补。"
)))

# 2. NYU Chemistry MS
pages.append(("details/nyu-c239b95.html", build(
    "化学硕士", "化学硕士", "化学硕士（MS in Chemistry）",
    "MS", "sci", "文理学院 GSAS",
    "Department of Chemistry",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/chemistry-ms/",
    "GSAS bulletin 页未列具体截止日期（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "GSAS bulletin 页未列标化要求（待补）",
    "GSAS bulletin 页未列打包学费（待补）",
    "<li>学位授予：MS（化学硕士）</li><li>共 32 学分（至少 24 学分须在 NYU 校内完成）</li><li>GPA 须达 3.0 以上，单课成绩不低于 B-</li><li>必修：CHEM-GA 2673 Professional Development（0学分，第一学期修读）</li><li>另有 CHEM-GA 3010 Graduate Research 等研究要求</li>",
    "<li>方向：有机化学、无机化学、物理化学、分析化学、生物化学</li><li>学生可参与系里研究组工作</li><li>面向继续攻读 PhD 或化工/医药行业就业</li><li>CIP 待补，HEGIS 待补</li>",
    "bulletins.nyu.edu 200 可达（33KB）；化学/理科类标 stem:1；具体截止/语言最低分/标化/学费 GSAS 页未列，留待补。"
)))

# 3. NYU Human Skeletal Biology MS
pages.append(("details/nyu-ce522c3.html", build(
    "人体骨骼生物学硕士", "人体骨骼生物学硕士", "人体骨骼生物学硕士（MS in Human Skeletal Biology）",
    "MS", "sci", "文理学院 GSAS · 人类学系",
    "Department of Anthropology",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/human-skeletal-biology-ms/",
    "GSAS bulletin 页未列具体截止日期（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "GSAS bulletin 页未列标化要求（待补）",
    "GSAS bulletin 页未列打包学费（待补）",
    "<li>学位授予：MS（人体骨骼生物学硕士）</li><li>共 36 学分</li><li>核心课：ANTH-GA 1516 Human Osteology and Odontology（4学分）/ ANTH-GA 1520 Interpreting the Human Skeleton（4学分）/ ANTH-GA 1505 History and Philosophy of Biological Anthropology（4学分）</li><li>选修 24 学分</li><li>必修：Master's thesis</li>",
    "<li>方向：骨骼鉴定、古人类学到、法医人类学、生物考古</li><li>课程结合人类学与生物学方法</li><li>面向法医/考古/博物馆/生物人类学 PhD 衔接</li><li>CIP 待补，HEGIS 待补</li>",
    "bulletins.nyu.edu 200 可达（34KB）；生物/人类学类标 stem:1；具体截止/语言最低分/标化/学费 GSAS 页未列，留待补。"
)))

# 4. NYU International Relations MA
pages.append(("details/nyu-cbbe78d.html", build(
    "国际关系硕士", "国际关系硕士", "国际关系硕士（MA in International Relations）",
    "MA", "soc", "文理学院 GSAS",
    "Department of Politics – International Relations",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/international-relations-ma/",
    "GSAS bulletin 页未列具体截止日期（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "GSAS bulletin 页未列标化要求（待补）",
    "GSAS bulletin 页未列打包学费（待补）",
    "<li>学位授予：MA（国际关系硕士）</li><li>核心课：INTRL-GA 1700 International Relations（4学分）/ INTRL-GA 1600 Global & International History（4学分）</li><li>方法课二选一：INTRL-GA 1120 Quantitative Analysis I 或 INTRL-GA 1220 Qualitative Analysis I</li><li>区域研究选修：INTRL-GA 1450 等</li><li>要求完成一门外语要求</li>",
    "<li>方向：国际安全、国际政治经济、比较政治、区域研究（欧亚/东亚/拉美/非洲/中东）</li><li>面向外交/国际组织/跨国企业/NGO/PhD 衔接</li><li>CIP 待补，HEGIS 待补</li>",
    "bulletins.nyu.edu 200 可达（89KB）；国际关系/社科类保守 stem:0；具体学分总数/截止/语言最低分/标化/学费 GSAS 页未列，留待补。"
)))

# 5. NYU Politics MA
pages.append(("details/nyu-c8cf4c5.html", build(
    "政治学硕士", "政治学硕士", "政治学硕士（MA in Politics）",
    "MA", "soc", "文理学院 GSAS",
    "Department of Politics",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/politics-ma/",
    "GSAS bulletin 页未列具体截止日期（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "GSAS bulletin 页未列标化要求（待补）",
    "GSAS bulletin 页未列打包学费（待补）",
    "<li>学位授予：MA（政治学硕士）</li><li>共 36 学分</li><li>必修：POL-GA 3995 Internship Seminar（2学分）/ POL-GA 4000 Master's Thesis Seminar（2学分）</li><li>Field Courses 16 学分（政治学核心领域）</li><li>选修 8 学分 + 其他选修 8 学分</li><li>必修：Master's thesis</li>",
    "<li>方向：政治理论、比较政治、美国政治、国际关系、政治方法论</li><li>含实习研讨环节，强调实践与学术结合</li><li>面向公共部门/智库/法学院/PhD 衔接</li><li>CIP 待补，HEGIS 待补</li>",
    "bulletins.nyu.edu 200 可达（35KB）；政治学/社科类保守 stem:0；具体截止/语言最低分/标化/学费 GSAS 页未列，留待补。"
)))

for path, html in pages:
    open(path, "w", encoding="utf-8").write(html)
    print(f"WRITTEN {path} {len(html)}")
