# -*- 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{--navy1:#0b2447;--navy2:#19376d;--navy3:#2b5ba8;--gold:#f0a500;--bg:#f5f7fa;--card:#fff;--line:#e3e8f0;--text:#1f2937;--muted:#6b7280;--green:#1e8449;--blue:#2563eb}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{color:var(--blue)}
.hero{background:linear-gradient(135deg,var(--navy1) 0%,var(--navy2) 55%,var(--navy3) 100%);color:#fff;padding:24px 30px 20px}
.hero h1{font-size:21px}
.hero .en{font-size:13px;opacity:.85;margin-top:4px}
.hero .school{margin-top:8px;font-size:14px;font-weight:600;color:#ffd77a}
.ranks{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.rank{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);border-radius:8px;padding:6px 14px;font-size:12px}
.rank b{color:#ffd77a;font-size:15px}
.badges{margin-top:12px;display:flex;gap:8px;flex-wrap:wrap}
.badge{font-size:12px;border-radius:5px;padding:3px 10px;font-weight:700;background:rgba(240,165,0,.25);color:#ffe1a1}
.wrap{max-width:900px;margin:20px auto 60px;padding:0 16px}
.card{background:var(--card);border-radius:12px;box-shadow:0 2px 10px rgba(15,35,80,.08);border:1px solid var(--line);padding:20px 24px;margin-bottom:16px}
.card h2{font-size:16px;color:var(--navy2);border-left:4px solid var(--gold);padding-left:10px;margin-bottom:14px}
table.kv{width:100%;border-collapse:collapse;font-size:13px}
table.kv td{border:1px solid var(--line);padding:10px 12px;vertical-align:top}
table.kv td.k{width:130px;background:#f0f4fa;color:var(--muted);font-weight:600;white-space:nowrap}
table.kv td.v{line-height:1.8}
ul.cl{padding-left:20px;line-height:1.95;font-size:13px}
ul.cl li{margin-bottom:9px}
ul.cl li b{color:var(--navy2)}
.note{font-size:12px;color:var(--muted);margin-top:10px;line-height:1.7}
.clinks{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line);display:flex;gap:8px;flex-wrap:wrap}
.clinks a{font-size:12px;padding:6px 12px;background:#eef3fb;color:var(--navy2);border:1px solid #cfdcef;border-radius:7px;text-decoration:none;font-weight:600}
.foot{max-width:900px;margin:0 auto 40px;padding:0 16px}
.back{display:inline-block;margin-bottom:14px;color:var(--navy2);text-decoration:none;font-size:13px;font-weight:600}</style>"""

def build(title, en, school, badge, core_html, catalog_url):
    return f"""<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{title} · 佐治亚理工学院 · 项目详情 | 美加硕士项目查询系统</title>
{CSS}
</head>
<body>
<div class="hero">
  <h1>{title}</h1>
  <div class="en">{en}</div>
  <div class="school">{school}</div>
  <div class="ranks"><div class="rank">Georgia Tech 2027 USNews<br><b>Top 30</b></div><div class="rank">STEM-designated<br><b>GaTech</b></div></div>
  <div class="badges"><span class='badge'>{badge}</span></div>
</div>
<div class="wrap">
  <a class="back" href="../index_main.html">← 返回项目库</a>

<div class="card"><h2>申请要求（2027 申请季 · 官网 catalog 口径）</h2><table class="kv">
<tr><td class="k">申请截止</td><td class="v">GaTech catalog 页未列具体申请轮次日期；以研究生院/系申请门户为准（待补）。</td></tr>
<tr><td class="k">语言要求</td><td class="v">母语非英语须提交 TOEFL iBT / IELTS Academic；catalog 页未列最低分（待补）。</td></tr>
<tr><td class="k">标化要求</td><td class="v">catalog 页未列 GRE 要求（待补；以系站为准）。</td></tr>
<tr><td class="k">学术背景</td><td class="v">本科相关工程/物理/化学/量化/社科背景；录取分布，非最低门槛。</td></tr>
</table></div>

<div class="card"><h2>费用（学费 · 2026-27 官网口径）</h2><table class="kv">
<tr><td class="k">学费</td><td class="v">catalog 页未列打包学费；按 GaTech 研究生学分制计费（待补）。</td></tr>
<tr><td class="k">奖学金</td><td class="v">研究生院/系级 RA/TA 随录取评审考虑；具体金额 catalog 页未列（待补）。</td></tr>
</table></div>

<div class="card"><h2>课程设置（官网 catalog 课程代码逐门列出）</h2>
{core_html}
<div class="note">注：以上课程结构与学分为 GaTech 2026-2027 catalog 官网列出；录取分布，非最低门槛。</div>
</div>

<div class="card"><h2>官网链接</h2>
<div class="clinks">
<a href="{catalog_url}" target="_blank">GaTech Catalog 官方项目页</a>
</div></div>
</div>
<div class="foot"><p style="font-size:12px;color:var(--muted)">数据来源：catalog.gatech.edu 2026-2027 Edition；截止/语言/GRE/学费未列字段以研究生院官网为准，本页不臆造。</p></div>
</body>
</html>"""

pages = []

# 1. Nuclear Engineering MS
core1 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；NRE 系（核与放射工程/医学物理）；Thesis / Non-Thesis 双选项。</li>
<li><b>Thesis Option（官网列出）</b>：<br>· NRE 7000 Master's Thesis（9 学分）<br>· 系内/跨院批准选修</li>
<li><b>Non-Thesis Option（官网列出）</b>：<br>· 授课型课程（核工程方向课 + 选修）</li>
<li><b>Nuclear Enterprise Management Option（官网列出）</b>：<br>· 另有 Non-thesis / Thesis 双选项的核企业管理方向，面向核工业界；本条目收录通用 NRE MS，方向 track 可在入学后选择。</li>
</ul>"""
pages.append(("details/gatech-nuclear-engineering-ms.html",
  build("核工程硕士（MS Nuclear Engineering）",
        "Master of Science in Nuclear Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 核与放射工程/医学物理系（NRE）",
        "30 学分 · Thesis/Non-Thesis 双选 · 含核企业管理方向 · STEM",
        core1,
        "https://catalog.gatech.edu/programs/nuclear-engineering-ms/")))

# 2. Environmental Engineering MS
core2 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；CEE 系；Thesis / Non-Thesis 双选项。</li>
<li><b>学分要求（官网列出）</b>：30 学分中至少 21 学分须为 6000-level 或以上研究生课程。</li>
<li><b>Thesis Option（官网列出）</b>：<br>· CEE 7000 Master's Thesis（6 学分）<br>· 环境工程方向课 + 批准选修</li>
<li><b>Non-Thesis Option（官网列出）</b>：<br>· 授课型课程（环境工程方向课 + 批准选修）</li>
</ul>"""
pages.append(("details/gatech-environmental-engineering-ms.html",
  build("环境工程硕士（MS Environmental Engineering）",
        "Master of Science in Environmental Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 土木与环境工程系（CEE）",
        "30 学分 · Thesis/Non-Thesis 双选 · 21/30cr 须 6000-level · STEM",
        core2,
        "https://catalog.gatech.edu/programs/environmental-engineering-ms/")))

# 3. Chemistry MS
core3 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；化学系；Thesis / Non-Thesis 双选项；多方向（核心+选修组合，由 Graduate Studies Director 批准）。</li>
<li><b>Thesis Option（官网列出）</b>：<br>· CHEM 7000 Master's Thesis（6 学分）<br>· 方向核心课 + 批准选修</li>
<li><b>Non-Thesis Option（官网列出）</b>：<br>· 授课型课程（方向核心课 + 批准选修）</li>
<li><b>方向（官网列出）</b>：核心与选修课按常见方向列示，替代课程组合可向 Graduate Studies Director 申请；同一 listing 中「or」表示二选一不可同时计入学分。</li>
</ul>"""
pages.append(("details/gatech-chemistry-ms.html",
  build("化学硕士（MS Chemistry）",
        "Master of Science in Chemistry",
        "佐治亚理工学院 Georgia Institute of Technology · 化学与生物化学系",
        "30 学分 · Thesis/Non-Thesis 双选 · 多方向（Graduate Director 批准）· STEM",
        core3,
        "https://catalog.gatech.edu/programs/chemistry-ms/")))

# 4. Management MS
core4 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；Scheller College of Business；Management Track / Research Track 双轨。</li>
<li><b>Management Track（官网列出）</b>：<br>· 授课型；MGT 选修（MGT 6010 等）<br>· 面向就业，导师批准选课时安排</li>
<li><b>Research Track（官网列出）</b>：<br>· Research Track Core（15 学分）<br>· 从 7 个管理学科方向中选一个，完成至少 15 学分该方向课程<br>· 15 选修可从 Research Track 选修列表或其他方向核心课中选择；其他选修需系主任批准</li>
<li><b>跨院选修（官网列出）</b>：ISYE 6663 非线性优化 / CS 7641 等跨院量化课程可选。</li>
<li><b>BSMS Option（官网列出）</b>：GaTech 本校本科生可跨工程/商/理/CS 学院 BS/MS 加速；本条目仅收录对外 MS 通道。</li>
<li><b>说明</b>：本项目为 Scheller 商学院 MS Management（研究型/授课型双轨），非 MBA；catalog 页未明示 STEM OPT Extension，按口径标 stem:0。</li>
</ul>"""
pages.append(("details/gatech-management-ms.html",
  build("管理学硕士（MS Management）",
        "Master of Science with a Major in Management",
        "佐治亚理工学院 Georgia Institute of Technology · Scheller 商学院",
        "30 学分 · Management/Research 双轨 · 非 MBA · 商科",
        core4,
        "https://catalog.gatech.edu/programs/management-ms/")))

# 5. Digital Media MS
core5 = """<ul class="cl">
<li><b>学位结构</b>：36 学分；LMC 文学媒体传播学院（跨学院）；项目制硕士。</li>
<li><b>课程要求（官网列出）</b>：<br>· 跨 LMC/CS/ID/心理学/音乐技术等院系课程<br>· 含 Vertically Integrated Projects（VIP）跨学科项目研究<br>· 毕业须完成 36 学分及项目要求</li>
<li><b>方向（官网列出）</b>：数字媒体/交互叙事/游戏研究/媒体理论/设计技术等；跨学院课程组合。</li>
<li><b>说明</b>：本项目为人文艺术/媒体方向硕士；catalog 页未明示 STEM OPT Extension，按口径标 stem:0。</li>
</ul>"""
pages.append(("details/gatech-digital-media-ms.html",
  build("数字媒体硕士（MS Digital Media）",
        "Master of Science in Digital Media",
        "佐治亚理工学院 Georgia Institute of Technology · 文学媒体传播学院（LMC）跨学院",
        "36 学分 · 项目制 · 跨 LMC/CS/ID/Psych/Music · 人文艺术",
        core5,
        "https://catalog.gatech.edu/programs/digital-media-ms/")))

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