# -*- 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. CSE MS
core1 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；Core 12cr（5 门选 4）+ Specialization Minor 12cr（含至少 6cr non-CS/CSE）+ Course/Thesis Option 6cr。</li>
<li><b>Core 5 选 4（官网列出）</b>：<br>· CSE/MATH 6643 数值线性代数<br>· CSE 6140 计算科学与工程算法<br>· CSE 6730 建模仿真：基础与实现<br>· CSE/ISYE 6740 计算数据分析：学习、挖掘与计算<br>· CSE 6220 高性能计算</li>
<li><b>Thesis Option</b>：6cr MS Thesis，须在导师委员会答辩；入学第一学期须获 home unit coordinator 与 CSE program director 批准学习计划。</li>
</ul>"""
pages.append(("details/gatech-computational-science-engineering-ms.html",
  build("计算科学与工程硕士（MS Computational Science and Engineering）",
        "Master of Science in Computational Science and Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 计算学院 / 跨学院",
        "30 学分 · Core 5 选 4 · Course/Thesis 双选 · STEM",
        core1,
        "https://catalog.gatech.edu/programs/computational-science-engineering-ms/")))

# 2. Economics MS
core2 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；授课型硕士。</li>
<li><b>课程构成（官网列出）</b>：<br>· Economics electives（经济选修）<br>· Advisor approved electives（导师批准选修）</li>
<li><b>方向</b>：经济学硕士，非 PhD 预备；catalog 页未细分 track。</li>
</ul>"""
pages.append(("details/gatech-economics-ms.html",
  build("经济学硕士（MS Economics）",
        "Master of Science in Economics",
        "佐治亚理工学院 Georgia Institute of Technology · 经济学院（Ivan Allen College）",
        "30 学分 · 授课型 · STEM-designated Economics",
        core2,
        "https://catalog.gatech.edu/programs/economics-ms/")))

# 3. Urban Analytics MS
core3 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；跨学院（城市规划 / 计算 / 统计）。</li>
<li><b>课程构成（官网列出）</b>：<br>· Urban Systems Core Courses（城市系统核心）<br>· Capstone and application of urban analytics in practice（实践 Capstone）<br>· Courses in spatial analysis（空间分析）<br>· Courses in computational statistics（计算统计）<br>· Courses in modeling and visualization（建模与可视化）</li>
</ul>"""
pages.append(("details/gatech-urban-analytics-ms.html",
  build("城市分析硕士（MS Urban Analytics）",
        "Master of Science in Urban Analytics",
        "佐治亚理工学院 Georgia Institute of Technology · 城市区域规划学院 / 跨学院",
        "30 学分 · 空间分析 + 计算统计 + Capstone · STEM",
        core3,
        "https://catalog.gatech.edu/programs/urban-analytics-ms/")))

# 4. ME MS
core4 = """<ul class="cl">
<li><b>学位结构</b>：30 学分最低；Non-Thesis / Thesis 双选项；仅 6cr 可 4000 级，其余须 6000 级以上；累计 GPA 须 ≥ 3.0。</li>
<li><b>Non-Thesis Option（官网列出）</b>：<br>· Major Area 21cr（机械工程连贯方向）<br>· Minor Area 6cr（与 Major 不同领域）<br>· Math Area 3cr（数学系课程）</li>
<li><b>Thesis Option（官网列出）</b>：<br>· Major Area 12cr 课程 + 9cr MS Thesis<br>· Minor Area 6cr<br>· Math Area 3cr</li>
<li><b>授课地点</b>：Atlanta 校园；可选 Georgia Tech-Lorraine、Stuttgart 联合项目、video course 远程修课。</li>
</ul>"""
pages.append(("details/gatech-mechanical-engineering-ms.html",
  build("机械工程硕士（MS Mechanical Engineering）",
        "Master of Science in Mechanical Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · Woodruff 机械工程学院",
        "30 学分 · Non-Thesis/Thesis 双选 · GPA≥3.0 · STEM",
        core4,
        "https://catalog.gatech.edu/programs/mechanical-engineering-ms/")))

# 5. Bioinformatics MS
core5 = """<ul class="cl">
<li><b>学位结构</b>：36 学分；授课型硕士。</li>
<li><b>课程构成（官网列出）</b>：<br>· Core Courses（核心）<br>· Statistics Requirement（统计要求）<br>· Capstone（实践 Capstone）<br>· Bioinformatics Electives（生信选修）</li>
</ul>"""
pages.append(("details/gatech-bioinformatics-ms.html",
  build("生物信息学硕士（MS Bioinformatics）",
        "Master of Science in Bioinformatics",
        "佐治亚理工学院 Georgia Institute of Technology · 生物科学学院 / 跨学院",
        "36 学分 · Core + 统计 + Capstone · STEM",
        core5,
        "https://catalog.gatech.edu/programs/bioinformatics-ms/")))

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