# -*- 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. BME MS
core1 = """<ul class="cl">
<li><b>学位结构</b>：Thesis / Non-Thesis 双选项；跨学院（BME 系）。</li>
<li><b>Non-Thesis Option（官网列出）</b>：<br>· Fundamental Courses（基础课）<br>· Focus Area（方向课）<br>· Approved Electives（批准选修）</li>
<li><b>Thesis Option（官网列出）</b>：<br>· Fundamental Courses（基础课）<br>· Approved Electives（批准选修）<br>· Thesis Hours（论文学时）</li>
</ul>"""
pages.append(("details/gatech-biomedical-engineering-ms.html",
  build("生物医学工程硕士（MS Biomedical Engineering）",
        "Master of Science in Biomedical Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 生物医学工程系（BME）",
        "Thesis/Non-Thesis 双选 · 基础课 + 方向 + 选修 · STEM",
        core1,
        "https://catalog.gatech.edu/programs/biomedical-engineering-ms/")))

# 2. Chemical Engineering MS
core2 = """<ul class="cl">
<li><b>学位结构</b>：31 学分；授课型硕士。</li>
<li><b>课程构成（官网列出）</b>：<br>· CHBE Elective（化工系选修）<br>· Other Electives（其他选修）</li>
</ul>"""
pages.append(("details/gatech-chemical-engineering-ms.html",
  build("化学工程硕士（MS Chemical Engineering）",
        "Master of Science in Chemical Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 化学与生物分子工程系（ChBE）",
        "31 学分 · 授课型 · CHBE 选修 + 其他选修 · STEM",
        core2,
        "https://catalog.gatech.edu/programs/chemical-engineering-ms/")))

# 3. Civil Engineering MS
core3 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；Thesis / Non-Thesis 双选项。</li>
<li><b>课程构成（官网列出）</b>：<br>· Area of Specialization（专业方向课）<br>· Approved Electives（批准选修）</li>
</ul>"""
pages.append(("details/gatech-civil-engineering-ms.html",
  build("土木工程硕士（MS Civil Engineering）",
        "Master of Science in Civil Engineering",
        "佐治亚理工学院 Georgia Institute of Technology · 土木与环境工程系（CEE）",
        "30 学分 · Thesis/Non-Thesis 双选 · 专业方向 + 选修 · STEM",
        core3,
        "https://catalog.gatech.edu/programs/civil-engineering-ms/")))

# 4. Mathematics MS
core4 = """<ul class="cl">
<li><b>学位结构</b>：30 学分；Analysis Concentration + Areas 跨领域；Non-Thesis / Thesis 双选项。</li>
<li><b>Analysis Concentration（官网列出）</b>：至少选 2 门分析方向课。</li>
<li><b>Areas（官网列出）</b>：从两个领域各至少选 1 门。</li>
<li><b>Non-Thesis Option</b>：MATH 6000 级或以上 + Free Electives。</li>
<li><b>Thesis Option</b>：MATH 6000 级 + Thesis + 额外 4000 级或以上课程。</li>
</ul>"""
pages.append(("details/gatech-mathematics-ms.html",
  build("数学硕士（MS Mathematics）",
        "Master of Science in Mathematics",
        "佐治亚理工学院 Georgia Institute of Technology · 数学学院",
        "30 学分 · Analysis Concentration + 跨领域 · Thesis/Non-Thesis 双选 · STEM",
        core4,
        "https://catalog.gatech.edu/programs/mathematics-ms/")))

# 5. Robotics MS
core5 = """<ul class="cl">
<li><b>学位结构</b>：36 学分；Thesis / Non-Thesis 双选项；跨学院机器人方向。</li>
<li><b>课程构成（官网列出）</b>：<br>· Foundation Courses（基础课）<br>· Robotics Elective Courses（机器人选修）<br>· Open Electives（开放选修）<br>· Robotics Internship（机器人实习）</li>
<li><b>Thesis Option</b>：额外 Thesis Hours（论文学时）。</li>
</ul>"""
pages.append(("details/gatech-robotics-ms.html",
  build("机器人学硕士（MS Robotics）",
        "Master of Science in Robotics",
        "佐治亚理工学院 Georgia Institute of Technology · 跨学院机器人方向",
        "36 学分 · Foundation + 机器人选修 + 实习 · Thesis/Non-Thesis 双选 · STEM",
        core5,
        "https://catalog.gatech.edu/programs/robotics-ms/")))

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