# -*- 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 = """<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):
    core = "".join(f"<li>{x}</li>" for x in core_items)
    elec = "".join(f"<li>{x}</li>" for x in elect_items) if elect_items else "<li>待补</li>"
    return f"""<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>{title}</title>{CSS}</head><body><div class="wrap">
<div class="crumb"><a href="../index_main.html">项目库</a> / {crumb}</div>
<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>
<div class="card"><h2>学位与院系</h2><div class="kv">
<div class="k">学校</div><div>{school_cn}（{school_en}）</div>
<div class="k">院系</div><div>{dept}</div>
<div class="k">学位</div><div>{deg_chip}</div>
<div class="k">官网</div><div><a href="{url}" target="_blank">{url}</a></div>
</div></div>
<div class="card"><h2>申请截止 / 语言 / 标化 / 学费</h2><div class="kv">
<div class="k">截止</div><div>{ddl}</div>
<div class="k">语言</div><div>{lang}</div>
<div class="k">标化</div><div>{test}</div>
<div class="k">学费</div><div>{tui}</div>
</div></div>
<div class="card"><h2>核心要求</h2><ul>{core}</ul></div>
<div class="card"><h2>选修 / 方向</h2><ul>{elec}</ul></div>
<div class="card"><h2>说明</h2><div class="note">{note}</div></div>
<a class="back" href="../index_main.html">← 返回项目库</a>
</div></body></html>"""

pages = []

# 1 Cybersecurity MS
pages.append(("details/nyu-c687b24.html", build(
    "纽约大学", "NYU", "纽约大学 / Tandon 工程学院 / 网络安全",
    "NYU Cybersecurity MS", "网络安全硕士（MS）",
    "MS", "CS 计算机", "Tandon 工程学院",
    "Computer Science and Engineering 系",
    "https://bulletins.nyu.edu/graduate/engineering/programs/cybersecurity-ms/",
    "GSAS/Tandon 招生页未列具体截止日期，待补",
    "招生页未列最低分，待补",
    "招生页未列，待补",
    "招生页未列，待补",
    ["CIP 11.1003（Cyber Security）",
     "NSA 指定的网络安全学术卓越中心（CAE-Cyber Operations / CAE-Research / CAE-Cyber Defense）",
     "NYU Center for Cybersecurity 与 OSIRIS 实验室教学",
     "课程兼顾理论与实战，面向网络攻防与事件响应"],
    ["Offensive Security", "Incident Response", "Internet Security", "Network Security"],
    "Tandon bulletin 仅列项目描述与培养方向，具体学分数/截止/语言/GRE/学费未在本页公布，待补。录取分布非最低门槛。")))

# 2 Industrial Engineering MS
pages.append(("details/nyu-c46580c.html", build(
    "纽约大学", "NYU", "纽约大学 / Tandon 工程学院 / 工业工程",
    "NYU Industrial Engineering MS", "工业工程硕士（MS）",
    "MS", "工程", "Tandon 工程学院",
    "Technology Management and Innovation 系",
    "https://bulletins.nyu.edu/graduate/engineering/programs/industrial-engineering-ms/",
    "Tandon 招生页未列具体截止，待补",
    "招生页未列最低分，待补",
    "招生页未列，待补",
    "招生页未列，待补",
    ["CIP 14.3501（Industrial Engineering）",
     "USNews 排名工业工程项目，项目制学习",
     "必修 Capstone：企业赞助项目实战",
     "与 INFORMS / IISE 专业协会关联，IE 校友顾问委员会支持"],
    ["Operations Research", "Data Analytics", "Supply Chain", "Human Factors", "Service Operations"],
    "Tandon bulletin 仅列项目描述与培养方向，具体学分数/截止/语言/GRE/学费未在本页公布，待补。录取分布非最低门槛。")))

# 3 Biotechnology MS
pages.append(("details/nyu-c93eac8.html", build(
    "纽约大学", "NYU", "纽约大学 / Tandon 工程学院 / 生物技术",
    "NYU Biotechnology MS", "生物技术硕士（MS）",
    "MS", "工程", "Tandon 工程学院",
    "Chemical and Biomolecular Engineering 系",
    "https://bulletins.nyu.edu/graduate/engineering/programs/biotechnology-ms/",
    "Tandon 招生页未列具体截止，待补",
    "招生页未列最低分，待补",
    "招生页未列，待补",
    "招生页未列，待补",
    ["CIP 26.1201（Biotechnology）",
     "必修 Advanced Cell and Molecular Biology（含实验）",
     "必修 Genetic Engineering（含实验）",
     "可修两门 Project Course 完成等同硕士论文的研究工作（论文可选）",
     "可跨选 Biotechnology and Entrepreneurship MS 商业/管理课"],
    ["Industrial Enzymes", "Bio-polymer Synthesis", "Drug Design", "Biotechnology in Healthcare", "Environmental Biotech"],
    "Tandon bulletin 仅列项目描述与课程方向，具体学分数/截止/语言/GRE/学费未在本页公布，待补。录取分布非最低门槛。")))

# 4 Construction Management MS
pages.append(("details/nyu-c5315aa.html", build(
    "纽约大学", "NYU", "纽约大学 / Tandon 工程学院 / 施工管理",
    "NYU Construction Management MS", "施工管理硕士（MS）",
    "MS", "工程", "Tandon 工程学院",
    "Civil, Urban, and Environmental Engineering 系",
    "https://bulletins.nyu.edu/graduate/engineering/programs/construction-management-ms/",
    "Tandon 招生页未列具体截止，待补",
    "招生页未列最低分，待补",
    "招生页未列，待补",
    "招生页未列，待补",
    ["CIP 14.3301（Construction Management）",
     "Major Requirements：至少 18 学分（6 门课）",
     "核心课含 Planning, Construction, and Management of Sustainable Energy",
     "培养管理/技术/财务/商业法律综合能力，面向建筑业管理岗"],
    ["Construction Planning", "Project Management", "Construction Finance", "Legal Aspects", "Sustainable Construction"],
    "Tandon bulletin 列至少 18 学分主修要求，具体总学分数/截止/语言/GRE/学费未在本页公布，待补。录取分布非最低门槛。")))

# 5 Integrated Design and Media MS
pages.append(("details/nyu-c414a40.html", build(
    "纽约大学", "NYU", "纽约大学 / Tandon 工程学院 / 整合设计与媒体",
    "NYU Integrated Design and Media MS", "整合设计与媒体硕士（MS）",
    "MS", "人文艺术", "Tandon 工程学院",
    "Technology, Culture and Society 系",
    "https://bulletins.nyu.edu/graduate/engineering/programs/integrated-design-media-ms/",
    "Tandon 招生页未列具体截止，待补",
    "招生页未列最低分，待补",
    "招生页未列，待补",
    "招生页未列，待补",
    ["CIP 11.0103（Computer Graphics / Media）",
     "项目制学习：艺术探索 + 技术实践结合",
     "课程含设计的历史/文化/社会/哲学维度",
     "毕业作品（Final Project）融合理论与实践，展示创意与技术能力"],
    ["Interactive Media", "Physical Computing", "Narrative Design", "Emerging Tech", "Critical Design"],
    "Tandon bulletin 仅列项目描述与培养方向，具体学分数/截止/语言/GRE/学费未在本页公布，待补。STEM 口径 CIP 11.0103 偏媒体设计，保守标 stem:0。")))

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