# -*- 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")

def build(title, school, deg, disc, stem, dur, core, elect, note, url, dept):
    stem_txt = "STEM（OPT 36 个月）" if stem else "非 STEM（OPT 12 个月）"
    chips = f'<span class="chip">{deg}</span><span class="chip">{school}</span><span class="chip">{disc}</span><span class="chip">{stem_txt}</span><span class="chip">{dur}</span>'
    core_html = "".join(f"<li>{c}</li>" for c in core)
    elect_html = "".join(f"<li>{e}</li>" for e in elect)
    return f"""<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>{title} | 美加硕博项目库</title><style>
:root{{--bg:#f7f8fa;--card:#fff;--pri:#c8102e;--pri2:#a00d24;--line:#e5e7eb;--txt:#1f2937;--sub:#6b7280;--chip:#fef2f2;--link:#c8102e;}}
*{{box-sizing:border-box}}body{{margin:0;font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--txt);line-height:1.65}}
.wrap{{max-width:1080px;margin:0 auto;padding:24px}}
.crumb{{font-size:13px;color:var(--sub);margin-bottom:14px}}
.crumb a{{color:var(--link);text-decoration:none}}
.card{{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:22px 26px;margin-bottom:18px;box-shadow:0 1px 2px rgba(0,0,0,.03)}}
h1{{font-size:26px;margin:0 0 6px;color:#111}}h2{{font-size:17px;margin:0 0 12px;color:var(--pri);border-left:4px solid var(--pri);padding-left:10px}}
.meta{{display:flex;flex-wrap:wrap;gap:8px;margin:10 0 0}}
.chip{{background:var(--chip);color:var(--pri2);padding:3px 10px;border-radius:999px;font-size:12.5px}}
.kv{{display:grid;grid-template-columns:110px 1fr;row-gap:8px;font-size:14px}}
.kv dt{{color:var(--sub)}}.kv dd{{margin:0}}
ul{{margin:6px 0;padding-left:20px}}li{{margin:3px 0}}
.note{{background:#fffbeb;border-left:4px solid #f59e0b;padding:10px 14px;border-radius:6px;font-size:13.5px;color:#92400e;margin-top:8px}}
</style></head><body><div class="wrap">
<div class="crumb"><a href="../index_main.html">← 返回项目库</a> / 佐治亚理工 Georgia Tech / {title}</div>
<div class="card">
<h1>{title}</h1>
<div class="meta">{chips}</div>
<dl class="kv" style="margin-top:14px">
<dt>开设院系</dt><dd>{dept}</dd>
<dt>官网链接</dt><dd><a href="{url}" target="_blank" rel="noopener">{url}</a></dd>
<dt>截止日期</dt><dd>catalog 页未列具体轮次（待补）</dd>
<dt>语言要求</dt><dd>TOEFL iBT / IELTS Academic（最低分待补）</dd>
<dt>标化考试</dt><dd>catalog 页未列（待补）</dd>
<dt>学费</dt><dd>catalog 页未列打包学费（待补）</dd>
</dl>
</div>
<div class="card"><h2>核心课程 / 学位要求</h2><ul>{core_html}</ul></div>
<div class="card"><h2>方向选修 / 特色</h2><ul>{elect_html}</ul></div>
<div class="card"><h2>备注</h2><div class="note">{note}</div></div>
</div></body></html>"""

pages = []

# 1. MID 工业设计硕士
pages.append(("details/gatech-mid.html", build(
    "工业设计硕士（Master of Industrial Design, MID）",
    "佐治亚理工 Georgia Tech", "MID", "art", 0,
    "学制约 90 学分；全日制；设计学院专业硕士",
    [
        "ID 6100 Introduction to Graduate Studies in Industrial Design（3cr）",
        "ID 6101 Human Centered Design（3cr）",
        "ID 6211 Graduate Studio One（4cr）",
        "ID 6216 Service Design, Brand and Value Creation（3cr）",
        "ID 6403 Intro to Thesis Studies（3cr）",
        "ID 6212 Grad Studio Two: Health and Wellness（学分待补）",
        "ID 6213 Grad Studio Two: Interactive Products（学分待补）",
        "ID 6106 3D Design Methods（学分待补）",
    ],
    [
        "College of Design 主办专业型工业设计硕士",
        "Studio 方向：健康与福祉 / 交互产品 / 服务设计 / 品牌价值",
        "含 Thesis Studies 研究阶段",
        "面向工业设计、用户体验设计、产品设计、服务设计岗位",
    ],
    "catalog 页未列截止/语言/GRE/学费，整项待补；MID 为设计学院专业型硕士，与已录 MS Architecture（研究型 Thesis）、MSUD（城市设计）为不同项目。",
    "https://catalog.gatech.edu/programs/masters-industrial-design/",
    "College of Design, Industrial Design")))

# 2. GMC 全球媒体与文化
pages.append(("details/gatech-gmc-ms.html", build(
    "全球媒体与文化硕士（MS Global Media and Cultures, GMC）",
    "佐治亚理工 Georgia Tech", "MS", "art", 0,
    "学制约 30 学分；全日制；LMC 系",
    [
        "GMC 6001 Introduction to Global Media and Cultures（3cr）",
        "GMC 8803 Media & Cultural Studies Foundations（3cr）",
        "GMC 6005 Professional Portfolio（3cr）",
    ],
    [
        "Liberal Arts / Literature, Media, and Communication 主办",
        "方向：全球媒体研究、文化研究、跨文化传播、专业作品集",
        "面向媒体、文化、传播、国际交流岗位",
    ],
    "catalog 页未列截止/语言/GRE/学费，整项待补；GMC 为 LMC 系人文艺术类硕士，与已录 Digital Media（LMC 数字媒体）为不同项目。",
    "https://catalog.gatech.edu/programs/global-media-cultures-ms/",
    "School of Literature, Media, and Communication")))

# 3. HTS 科技史与科技社会学
pages.append(("details/gatech-hts-ms.html", build(
    "科技史与科技社会学硕士（MS History and Sociology of Technology and Science, HTS）",
    "佐治亚理工 Georgia Tech", "MS", "soc", 0,
    "学制约 30 学分；全日制；含研究方法；HTS 系",
    [
        "HTS 6001 Proseminar in Social Theory（3cr）",
        "HTS 6003 Historical Methods（3cr）",
        "HTS 8803 Special Topics: Politics, Power, and Inequality（3cr）",
        "HTS 8803 Special Topics: Communicating Social and Historical Research（3cr）",
        "HTS 6125 Quantitative Methods in Social Research（学分待补）",
        "HTS 8803 Special Topics: Qualitative Methods in Social and Historical Research（学分待补）",
        "HTS 6002 Proseminar in the History of Technology（学分待补）",
        "HTS 6110 Gender, Science, and Technology（学分待补）",
    ],
    [
        "School of History and Sociology 主办",
        "方向：社会理论、历史方法、定量/定性社会研究、性别与科技、政治权力不平等",
        "研究型硕士，适合申请科技史/科学社会学博士或科技政策岗位",
    ],
    "catalog 页未列截止/语言/GRE/学费，整项待补；HTS 为研究型硕士，与已录 Public Policy（PUBP）、International Affairs（INTA）为不同项目。",
    "https://catalog.gatech.edu/programs/history-sociology-technology-science-ms/",
    "School of History and Sociology")))

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