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

CSS = """<style>
:root{--bg:#f7f8fa;--card:#fff;--line:#e5e7eb;--ink:#1f2329;--mut:#6b7280;--pri:#1d4ed8;--tag:#eef2ff;}
*{box-sizing:border-box}body{margin:0;font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--ink);line-height:1.6}
.wrap{max-width:980px;margin:0 auto;padding:24px}
.crumb{font-size:13px;color:var(--mut);margin-bottom:12px}
.crumb a{color:var(--pri);text-decoration:none}
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:20px 24px;margin-bottom:16px}
h1{font-size:22px;margin:0 0 6px}
h2{font-size:15px;margin:0 0 10px;color:var(--pri)}
.chips{margin:8px 0 0}
.chip{display:inline-block;background:var(--tag);color:var(--pri);border-radius:999px;padding:2px 10px;font-size:12px;margin-right:6px}
.kv{display:grid;grid-template-columns:110px 1fr;row-gap:6px;font-size:14px}
.kv .k{color:var(--mut)}
ul{margin:6px 0 0;padding-left:20px}
.note{background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:10px 14px;font-size:13px;color:#92400e}
.back{display:inline-block;margin-top:8px;color:var(--pri);text-decoration:none;font-size:14px}
</style>"""

def build(school_cn, school_en, crumb, title, h1, deg_chip, disc_chip, college_chip, dept, url, ddl, lang, test, tui, core_items, elect_items, note):
    parts = []
    parts.append('<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>'+title+'</title>')
    parts.append(CSS)
    parts.append('</head><body><div class="wrap">')
    parts.append('<div class="crumb">'+crumb+'</div>')
    parts.append('<div class="card"><h1>'+h1+'</h1><div class="chips"><span class="chip">'+deg_chip+'</span><span class="chip">'+disc_chip+'</span><span class="chip">'+college_chip+'</span></div></div>')
    parts.append('<div class="card"><h2>学位与院系</h2><div class="kv">')
    parts.append('<div class="k">学校</div><div>'+school_cn+'（'+school_en+'）</div>')
    parts.append('<div class="k">院系</div><div>'+dept+'</div>')
    parts.append('<div class="k">学位</div><div>'+deg_chip+'</div>')
    parts.append('<div class="k">官网</div><div><a href="'+url+'" target="_blank">'+url+'</a></div>')
    parts.append('</div></div>')
    parts.append('<div class="card"><h2>申请截止 / 语言 / 标化 / 学费</h2><div class="kv">')
    parts.append('<div class="k">截止</div><div>'+ddl+'</div>')
    parts.append('<div class="k">语言</div><div>'+lang+'</div>')
    parts.append('<div class="k">标化</div><div>'+test+'</div>')
    parts.append('<div class="k">学费</div><div>'+tui+'</div>')
    parts.append('</div></div>')
    parts.append('<div class="card"><h2>核心要求</h2><ul>')
    for it in core_items:
        parts.append('<li>'+it+'</li>')
    parts.append('</ul></div>')
    parts.append('<div class="card"><h2>选修 / 方向</h2><ul>')
    for it in elect_items:
        parts.append('<li>'+it+'</li>')
    parts.append('</ul></div>')
    parts.append('<div class="card"><h2>说明</h2><div class="note">'+note+'</div></div>')
    parts.append('<a class="back" href="../index_main.html">← 返回项目库</a>')
    parts.append('</div></body></html>')
    return "".join(parts)

pages = []

# 1. UNC Public Policy MPP（新建）
pages.append(("details/unc-mpp.html", build(
    "北卡教堂山","UNC Chapel Hill",
    '<a href="../index_main.html">项目库</a> / 北卡教堂山 / 公共政策系 / 公共政策硕士 MPP',
    "UNC Public Policy MPP",
    "公共政策硕士（MPP）",
    "MPP","社科/公共政策","文理学院",
    "Department of Public Policy, College of Arts and Sciences",
    "https://catalog.unc.edu/graduate/schools-departments/public-policy/",
    "Graduate School 统一截止，catalog 页未列具体轮次（待补）",
    "Graduate School 统一 TOEFL/IELTS 要求，catalog 页未列最低分（待补）",
    "Graduate School 统一要求，catalog 页未列（待补）",
    "Graduate School 统一学费，catalog 页未列打包学费（待补）",
    ["48 学分：8 门核心 MPP 课程（26 学分）+ 选修/领域课（18 学分）+ 管理/领导力课（3 学分）+ 方法/统计课（3 学分）+ 专业发展/实习研讨（1 学分）",
     "核心课：PLCY 800 Mathematical Preparation for Public Policy and Economics / 801 Design of Policy-Oriented Research / 810 Public Policy Seminar / 816 Politics and Public Policy Theory / 817 Institutional Analysis / 880 Normative Dimensions of Policy Analysis",
     "加速双本科-硕士项目：senior spring 修研究生课，再一年完成 MPP",
     "含实习（夏季或秋季/春季）与 Maymester 研讨",
     "先修课：ECON 101 / PLCY 210 / PLCY 460 / PLCY 581"],
    ["社会政策与不平等（教育/劳动/税收/职业许可）",
     "环境与人类福利",
     "数据驱动环境政策",
     "Carolina Population Center / Data-Driven EnviroLab 等研究中心"],
    "UNC catalog 系页列 MPP 为加速双学位路径；具体截止/语言最低分/GRE/学费未在本页单列，待补。PhD 通道附带 MA（30学分，前两年核心+选修）留批次5。录取分布非最低门槛。")))

# 2. NYU French Studies MA
pages.append(("details/nyu-c289be9.html", build(
    "纽约大学","NYU New York University",
    '<a href="../index_main.html">项目库</a> / 纽约大学 / 法国研究所 / 法国研究 MA',
    "NYU French Studies MA",
    "法国研究文学硕士（MA）",
    "MA","人文","文理学院 GSAS",
    "Institute of French Studies, Graduate School of Arts and Science",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/french-studies-ma/",
    "GSAS 统一申请轮次，bulletin 页未列具体截止（待补）",
    "GSAS 统一 TOEFL/IELTS 要求；系内要求法语能力，bulletin 页未列具体语种分数（待补）",
    "GSAS 统一要求，bulletin 页未列（待补）",
    "GSAS 统一学费，bulletin 页未列打包学费（待补）",
    ["32 学分（8 门课）+ 综合考试",
     "核心课：IFST-GA 1610 19th Century France（4 学分）+ 28 学分 IFS 选修",
     "综合考试：5 小时英语笔试，覆盖 19 世纪法国史 / 20 世纪法国史 / 法国社会 / 法国政治经济或法国文化",
     "课程以法语和英语授课，多学科视角：历史/社会学/政治学/人类学/文化分析",
     "在巴黎提供两门暑期研究生课（6 月初至中旬）"],
    ["帝国民族与后殖民状况",
     "福利与歧视",
     "记忆与遗忘",
     "性别与种族",
     "宗教与世俗主义"],
    "NYU GSAS bulletin 仅列学位要求；具体截止/语言最低分/GRE/学费未在本页公布，待补。毕业生去向含 Foreign Service / 新闻 / 人道援助 / 移民法 / 教育 / 翻译 / 国际商务。录取分布非最低门槛。")))

# 3. NYU Italian Studies MA
pages.append(("details/nyu-cb13119.html", build(
    "纽约大学","NYU New York University",
    '<a href="../index_main.html">项目库</a> / 纽约大学 / 意大利研究系 / 意大利研究 MA',
    "NYU Italian Studies MA",
    "意大利研究文学硕士（MA）",
    "MA","人文","文理学院 GSAS",
    "Department of Italian Studies, Graduate School of Arts and Science",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/italian-studies-ma/",
    "GSAS 统一申请轮次，bulletin 页未列具体截止（待补）",
    "GSAS 统一 TOEFL/IELTS 要求；系内要求意大利语能力，bulletin 页未列具体语种分数（待补）",
    "GSAS 统一要求，bulletin 页未列（待补）",
    "GSAS 统一学费，bulletin 页未列打包学费（待补）",
    ["32 学分（至少 24 学分在校 NYU）+ 硕士论文",
     "32 学分全选修（与学术导师协商选课）",
     "硕士论文：导师指导 + 研究生主任批准",
     "方向：medieval and Renaissance studies / 20th-century literature, film, culture / postmodern Italy"],
    ["中世纪与文艺复兴研究",
     "20 世纪文学、电影与文化",
     "后现代意大利",
     "跨学科：历史/电影/比较文学/哲学"],
    "NYU GSAS bulletin 仅列学位要求；具体截止/语言最低分/GRE/学费未在本页公布，待补。兼读制学生可申请硕士。录取分布非最低门槛。")))

# 4. NYU Latin American and Caribbean Studies MA
pages.append(("details/nyu-c79eabf.html", build(
    "纽约大学","NYU New York University",
    '<a href="../index_main.html">项目库</a> / 纽约大学 / 拉美加勒比研究中心 / 拉美加勒比研究 MA',
    "NYU Latin American and Caribbean Studies MA",
    "拉美与加勒比研究文学硕士（MA）",
    "MA","社科/跨学科","文理学院 GSAS",
    "Center for Latin American and Caribbean Studies (CLACS), Graduate School of Arts and Science",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/latin-american-caribbean-studies-ma/",
    "GSAS 统一申请轮次，bulletin 页未列具体截止（待补）",
    "GSAS 统一 TOEFL/IELTS 要求；系内要求西班牙语/葡萄牙语或原住民语言能力，bulletin 页未列具体语种分数（待补）",
    "GSAS 统一要求，bulletin 页未列（待补）",
    "GSAS 统一学费，bulletin 页未列打包学费（待补）",
    ["32 学分",
     "核心课：LATC-GA 1001 Intro Lat Am & Carib I: Iberian-Atlantic & Colonial / 2001 Intro Lat Am & Carib II: Hemispheric & Postcolonial",
     "12 学分 CLACS 选修（至少 3 门 12 学分通过 CLACS 提供）+ 12 学分其他选修",
     "Special Project/Thesis（跨学科田野研究 + 期末硕士项目）",
     "语言能力要求：克丘亚语 / 海地克里奥尔语 / 米斯特克语 / 纳瓦特尔语等"],
    ["发展研究",
     "社会运动与民主转型",
     "美洲关系与冲突解决",
     "性别与性 / 移民 / 族裔研究",
     "艺术、博物馆、媒体、文化产业与文化政策",
     "可选 Museum Studies 方向",
     "可选 Global Public Health 方向"],
    "NYU GSAS bulletin 仅列学位要求；具体截止/语言最低分/GRE/学费未在本页公布，待补。资助含 McCracken Fellowship / FLAS / GSAS Tuition Incentive。录取分布非最低门槛。")))

# 5. NYU Near Eastern Studies MA
pages.append(("details/nyu-c130659.html", build(
    "纽约大学","NYU New York University",
    '<a href="../index_main.html">项目库</a> / 纽约大学 / 近东研究 Kevorkian 中心 / 近东研究 MA',
    "NYU Near Eastern Studies MA",
    "近东研究文学硕士（MA）",
    "MA","人文","文理学院 GSAS",
    "Kevorkian Center for Near Eastern Studies, Graduate School of Arts and Science",
    "https://bulletins.nyu.edu/graduate/arts-science/programs/near-eastern-studies-ma/",
    "GSAS 统一申请轮次，bulletin 页未列具体截止（待补）",
    "GSAS 统一 TOEFL/IELTS 要求；系内要求中东语言能力（阿拉伯语/波斯语/土耳其语/希伯来语等），bulletin 页未列具体语种分数（待补）",
    "GSAS 统一要求，bulletin 页未列（待补）",
    "GSAS 统一学费，bulletin 页未列打包学费（待补）",
    ["标准 32 学分；三个 concentration 路径为 40 学分",
     "核心课：MEIS-GA 1687 Prob & Methods in Middle East Studies / 1642 History of the Middle East: 1750-Present",
     "Distribution Requirement 8 学分（至少 2 门历史以外学科，如人类学/比较文学/政治学/经济学）",
     "16 学分其他选修",
     "硕士论文或报告 + 语言要求 + 实习"],
    ["Advanced Language Proficiency（8 额外研究生语言学分，中东语言高级文学能力）",
     "Museum Studies",
     "International Relations",
     "历史/政治/经济/宗教/文化研究",
     "跨北非至中亚区域研究"],
    "NYU GSAS bulletin 仅列学位要求；具体截止/语言最低分/GRE/学费未在本页公布，待补。与新闻学院联合 MA 项目另录。录取分布非最低门槛。")))

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