# -*- 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 = """*{box-sizing:border-box;margin:0;padding:0}body{font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:#f5f7fa;color:#222;line-height:1.6;padding:24px}.wrap{max-width:1080px;margin:0 auto}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.back{color:#1a5fb4;text-decoration:none;font-size:14px}.school-tag{background:#e8f0fe;color:#1a5fb4;padding:4px 12px;border-radius:12px;font-size:13px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.card{background:#fff;border-radius:10px;padding:18px 20px;box-shadow:0 1px 3px rgba(0,0,0,.06)}.card.full{grid-column:1/-1}h1{font-size:22px;margin-bottom:6px;color:#1a2a4a}h2{font-size:15px;color:#1a5fb4;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid #eef1f5}.kv{display:flex;justify-content:space-between;padding:5px 0;font-size:14px}.kv .k{color:#666}.kv .v{font-weight:500;text-align:right;max-width:62%}.stem{display:inline-block;background:#e6f4ea;color:#1e7e34;padding:2px 8px;border-radius:4px;font-size:12px;margin-left:6px}.stem0{background:#fdecea;color:#c0392b}.note{background:#fff8e1;border-left:3px solid #f0a020;padding:10px 14px;border-radius:4px;font-size:13px;margin-top:8px}.url{word-break:break-all}.tag{display:inline-block;background:#eef1f5;color:#444;padding:2px 8px;border-radius:4px;font-size:12px;margin:2px 4px 2px 0}ul{padding-left:20px;font-size:14px}li{margin-bottom:4px}"""

def build(title, school, deg, disc, stem, dur, core, elect, note, url, dept):
    stem_cls = "stem" if stem else "stem stem0"
    stem_txt = "STEM-designated" if stem else "非 STEM OPT"
    core_html = "".join(f"<li>{c}</li>" for c in core)
    elect_html = "".join(f'<span class="tag">{e}</span>' for e in elect)
    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="top"><a class="back" href="../index_main.html">← 返回项目库</a><span class="school-tag">{school}</span></div>
<h1>{title} <span class="{stem_cls}">{stem_txt}</span></h1>
<div class="grid">
<div class="card"><h2>学位与学制</h2>
<div class="kv"><span class="k">学位</span><span class="v">{deg}</span></div>
<div class="kv"><span class="k">院系</span><span class="v">{dept}</span></div>
<div class="kv"><span class="k">学制</span><span class="v">{dur}</span></div>
<div class="kv"><span class="k">学科大类</span><span class="v">{disc}</span></div>
</div>
<div class="card"><h2>录取与标化</h2>
<div class="kv"><span class="k">截止日期</span><span class="v">catalog 页未列具体轮次（待补）</span></div>
<div class="kv"><span class="k">语言要求</span><span class="v">TOEFL iBT / IELTS Academic（最低分待补）</span></div>
<div class="kv"><span class="k">GRE</span><span class="v">catalog 页未列（待补）</span></div>
<div class="kv"><span class="k">学费</span><span class="v">catalog 页未列打包学费（待补）</span></div>
</div>
<div class="card full"><h2>核心课程 / 培养要求</h2><ul>{core_html}</ul></div>
<div class="card full"><h2>选修方向</h2><div>{elect_html}</div></div>
<div class="card full"><h2>说明</h2><div class="note">{note}</div></div>
<div class="card full"><h2>官方来源</h2><div class="kv url"><span class="k">官网项目页</span><span class="v">{url}</span></div></div>
</div></div></body></html>"""

pages = []

# 1. International Affairs MS（覆盖占位）
pages.append(("details/gatech-international-affairs-ms.html", build(
    "佐治亚理工学院 国际事务硕士（MS International Affairs, INTA）",
    "佐治亚理工 Georgia Tech", "MS", "社科/国际事务", 0,
    "42 学分；2 年；核心理论 + 战略分析；需外语 2 年大学水平 + 经济学素养（微/宏观）；BS/MS 本校加速通道",
    ["国际关系理论 International Relations Theory",
     "比较政治 Comparative Politics",
     "国际政治经济 International Political Economy",
     "国际安全 International Security",
     "实证研究方法 Empirical Research Methods"],
    ["国际技术与转让 INTA 6011", "国际政治经济 INTA 6302", "全球化 INTA 6306", "ICT 与全球发展 INTA/CS 6745", "科技政策比较 INTA 6753", "区域研究（中国/拉美/后苏联/全球南方）", "能源环境政策", "性别与全球发展", "冲突与安全"],
    "Sam Nunn 国际事务学院；面向直接就业或继续 PhD 深造。外语要求可在校内修读或通过现代语言学院考试证明；经济学素养可通过本科或在校修课满足。提供 BS/MS 五年本硕连读（本科 INTA 学生 GPA 3.5+）。",
    "https://catalog.gatech.edu/programs/international-affairs-ms/",
    "Sam Nunn School of International Affairs（Ivan Allen 学院）")))

# 2. Global Development MS（覆盖占位）
pages.append(("details/gatech-global-development-ms.html", build(
    "佐治亚理工学院 全球发展硕士（MS Global Development）",
    "佐治亚理工 Georgia Tech", "MS", "社科/发展研究", 0,
    "36 学分；12 个月；跨 CRP/Econ/INTA；核心课 + 方向选修 + 顶点项目/Studio；面向政府/私人发展公司/NGO",
    ["INTA/ECON 6704 Introduction to Global Development 全球发展导论 3cr",
     "INTA 6003 Empirical Research Methods 实证研究方法 3cr",
     "CP 6514 Introduction to Geographic Information Systems GIS 导论 3cr",
     "方向三选一：INTA 8803 发展政治经济 / ECON 6360 发展经济学 / INTA 6202 比较政治 / CP 6233 可持续城市发展 3cr",
     "顶点三选一：CP 6052 Applied Planning Studio / CP 6053 Applied Planning Studio (Urban Design) / INTA 8803 Graduate Capstone / ECON 8803 3cr",
     "选修 15cr"],
    ["国际贸易与技术转让", "国际政治经济", "全球化", "ICT 与全球发展", "科技政策比较", "城市与区域发展理论", "土地利用规划", "气候变化规划", "交通规划", "地方经济发展", "水资源规划", "公平社会正义", "环境分析 GIS", "社会经济 GIS", "城市增长与基础设施", "房地产金融与发展", "社区发展", "民主与全球南方", "中国政治经济", "能源环境与政策"],
    "12 个月紧凑项目，跨城市规划学院/经济学院/Sam Nunn 国际事务学院；应对快速城市化、气候变化、城市不平等挑战，覆盖基础设施提供到减贫。",
    "https://catalog.gatech.edu/programs/global-development-ms/",
    "Sam Nunn School of International Affairs / CRP / Economics 跨学院")))

# 3. MCRP（新建）
pages.append(("details/gatech-mcrp.html", build(
    "佐治亚理工学院 城市与区域规划硕士（Master of City and Regional Planning, MCRP）",
    "佐治亚理工 Georgia Tech", "MCRP", "社科/城市规划", 0,
    "55 学分；2 年；7 门核心课 + 专业方向 + 实习 + Thesis/Applied Research Paper；只招秋季；1/15 奖助截止 / 2/15 最终截止；核心课须 C 以上",
    ["规划理论 Planning Theory",
     "规划方法 Planning Methods",
     "规划法 Planning Law",
     "经济分析 Economic Analysis",
     "规划实践 Planning Practice",
     "应用 Studio 真实城市项目（亚特兰大本地/全国/国际）",
     "实习 Internship"],
    ["经济发展 Economic Development", "环境与健康规划 Environment & Health Planning", "全球发展 Global Development", "住房与社区发展 Housing & Community Development", "土地利用规划 Land Use Planning", "交通规划 Transportation Planning", "城市设计 Urban Design"],
    "NAAB 同等专业规划学位；提供与建筑/土木/法律/公共政策双学位通道；跨学院可选建筑/CEE/PUBP/IS/EAS 或 Emory/Georgia State 课程。",
    "https://catalog.gatech.edu/programs/mcrp/",
    "School of City and Regional Planning（College of Design）")))

# 4. MArch（新建）
pages.append(("details/gatech-march.html", build(
    "佐治亚理工学院 建筑学硕士（Master of Architecture, M.Arch.）",
    "佐治亚理工 Georgia Tech", "M.Arch.", "建筑/设计", 1,
    "60-102 学分（视前置建筑背景）；NAAB 认证职业学位；1/3 截止；需 portfolio；无前置建筑背景 3.5 年，有建筑本科 2 年；所有课须 C 以上，高级学分仅 A/B 可转",
    ["ARCH 6010 Media + Modeling 媒体与建模 3cr",
     "ARCH 6028 Core 1 Studio 核心设计 Studio 1 5cr",
     "ARCH 6105 Architectural History I 建筑史 I 3cr",
     "ARCH 6229 Construction Technology and Design Integration I 建造技术 I 3cr",
     "ARCH 6531 Environmental Systems I 环境系统 I 3cr",
     "ARCH 6015 Structures 1 结构 1 3cr",
     "ARCH 6029 Core 2 Studio 核心设计 Studio 2 5cr",
     "ARCH 6106 Architectural History II 建筑史 II 3cr"],
    ["城市与区域规划双学位", "公共政策跨选", "历史/哲学", "房地产开发", "工程跨选", "Studio Art", "Emory/Georgia State 跨选"],
    "STEM-designated 职业实践学位，通向建筑执业执照；国际生 TOEFL iBT 100+ / IELTS 7.5（catalog 页原文写 TOEFL 5+ 疑为笔误，以系站招生页为准待补）；鼓励多学科学习。",
    "https://catalog.gatech.edu/programs/march/",
    "School of Architecture（College of Design）")))

# 5. Biology MS（新建）
pages.append(("details/gatech-biology-ms.html", build(
    "佐治亚理工学院 生物学硕士（MS Biology）",
    "佐治亚理工 Georgia Tech", "MS", "理科/生命科学", 1,
    "36 学分；Thesis/Non-Thesis 双选；默认录取 Non-thesis，Thesis 需 Graduate Committee petition + 导师支持；核心生物研究生课 6000-9000-level",
    ["BIOL 6000-9000-level 生物研究生课 15cr（Non-thesis）/ 12cr（Thesis）",
     "其他研究生课 9cr（Non-thesis，可在 BIOL 外）",
     "BIOL 4000-level 及以上生物课 6cr",
     "BIOL 8901 Special Problems 4cr（Non-thesis）/ 7cr（Thesis）",
     "BIOL 8002 & BIOL 8003 Seminar 2cr",
     "Thesis：BIOL 7000 Master's Thesis 9cr"],
    ["细胞生物学", "分子生物学", "生态学", "进化生物学", "遗传学", "微生物学", "生理学", "生物信息学跨选"],
    "School of Biological Sciences；Thesis 通道面向 PhD 深造准备；提供 BS/MS 本硕连读（Biology / Bioinformatics 两个方向）。",
    "https://catalog.gatech.edu/programs/biology-ms/",
    "School of Biological Sciences（生物科学学院）")))

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