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

TPL = """<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>__TITLE__ | 多伦多大学 | 美加硕博项目库</title><style>
:root{{--bg:#f7f8fa;--card:#fff;--pri:#003366;--pri2:#002244;--line:#e5e7eb;--txt:#1f2937;--sub:#6b7280;--chip:#eef3f8;--link:#003366;}}
*{{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:10px 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> / 多伦多大学 University of Toronto / __TITLE_SHORT__</div>
<div class="card">
<h1>__H1__</h1>
<div class="meta"><span class="chip">__DEG__</span><span class="chip">多伦多大学 UofT</span><span class="chip">__DISC__</span><span class="chip">__COLLEGE__</span></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>__DDL__</dd>
<dt>语言要求</dt><dd>__LANG__</dd>
<dt>标化考试</dt><dd>__TEST__</dd>
<dt>学费</dt><dd>__TUI__</dd>
</dl>
</div>
<div class="card"><h2>核心课程 / 学位要求</h2><ul>__CORE__</ul></div>
<div class="card"><h2>方向选修 / 特色</h2><ul>__ELECT__</ul></div>
<div class="card"><h2>备注</h2><div class="note">__NOTE__</div></div>
</div></body></html>"""

pages = []

def build(title, title_short, h1, deg, disc, college, dept, url, ddl, lang, test, tui, core, elect, note):
    return TPL.replace("__TITLE__", title).replace("__TITLE_SHORT__", title_short).replace("__H1__", h1).replace("__DEG__", deg).replace("__DISC__", disc).replace("__COLLEGE__", college).replace("__DEPT__", dept).replace("__URL__", url).replace("__DDL__", ddl).replace("__LANG__", lang).replace("__TEST__", test).replace("__TUI__", tui).replace("__CORE__", core).replace("__ELECT__", elect).replace("__NOTE__", note)

# 1. UT LLM
pages.append(("details/ut-c9f57d5.html", build(
    "法学硕士（LLM）", "法学硕士（LLM）",
    "法学硕士（Master of Laws, LLM）",
    "LLM", "soc", "法学院（Faculty of Law）",
    "Faculty of Law, Graduate Studies",
    "https://www.sgs.utoronto.ca/programs/law/",
    "SGS 页未列具体轮次（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "SGS 页未列（N/A，不要求 LSAT/标化）",
    "SGS 页未列打包学费（待补）",
    "<li>学位授予：LLM（一年制研究型硕士）</li><li>最低录取：B+（final year bachelor / law degree）</li><li>两条方向：thesis stream 与 coursework-only stream</li><li>导师在录取过程中由研究生单位指定</li><li>注意：LLM 为研究生研究型项目，不满足 NCA（National Committee on Accreditation）认证要求</li>",
    "<li>研究方向：宪法、国际法、商法、刑法、法理学等（具体方向待系站确认）</li><li>thesis stream 含论文写作；coursework-only stream 纯授课</li><li>SJD（Scientiae Juridicae Doctor）为 PhD 级，另设</li>",
    "SGS 页 200 可达（443KB），Quick Facts 表提取；LLM 为研究型法学硕士，非执业类 JD，保留；法学类保守 stem:0；截止/语言最低分/打包学费 SGS 页未列，留待补。"
)))

# 2. UT MSW
pages.append(("details/ut-c839284.html", build(
    "社会工作硕士（MSW）", "社会工作硕士（MSW）",
    "社会工作硕士（Master of Social Work, MSW）",
    "MSW", "soc", "Factor-Inwentash 社会工作学院",
    "Factor-Inwentash Faculty of Social Work",
    "https://www.sgs.utoronto.ca/programs/social-work/",
    "SGS 页未列具体轮次（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "SGS 页未列（N/A，不要求 GRE）",
    "SGS 页未列打包学费（待补）",
    "<li>学位授予：MSW（professional 硕士）</li><li>最低录取：mid-B（final year full-time study）</li><li>另设 MSW (ITR) — International 方向，面向国际学生</li><li>PhD 方向：B+，导师入学后由学生自行联系（first year 后 typically by June 1）</li>",
    "<li>加拿大最古老的社会工作学院（百年历史）</li><li>研究方向：社会政策、儿童与家庭、心理健康、社区发展、全球社工等</li><li>PhD 为研究型博士，另设</li>",
    "SGS 页 200 可达（447KB），Quick Facts 表提取；MSW 为专业型社工硕士，保留类公共政策/社会服务；社工类保守 stem:0；截止/语言最低分/打包学费 SGS 页未列，留待补。"
)))

# 3. UT Music MA
pages.append(("details/ut-cfce3b0.html", build(
    "音乐文学硕士（MA）", "音乐文学硕士（MA）",
    "音乐文学硕士（Master of Arts in Music, MA）",
    "MA", "art", "文理学院 · 音乐学院（Faculty of Music）",
    "Faculty of Music, Graduate Studies",
    "https://www.sgs.utoronto.ca/programs/music/",
    "SGS 页未列具体轮次（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "SGS 页未列（N/A，不要求 GRE）",
    "SGS 页未列打包学费（待补）",
    "<li>学位授予：MA（研究型硕士）</li><li>最低录取：mid-B or better（final two years）</li><li>导师入学后由学生自行联系（after admission）</li><li>PhD 方向：B+，本科可直申 PhD（direct entry）</li>",
    "<li>五个研究方向：Ethnomusicology（民族音乐学）、Music and Health Sciences（音乐与健康科学）、Music Education（音乐教育）、Musicology（音乐学）、Music Theory（音乐理论）</li><li>另设 MMus（音乐表演硕士），为另一项目</li>",
    "SGS 页 200 可达（444KB），Quick Facts 表提取；MA 为研究型音乐硕士，保留；人文艺术类保守 stem:0；音乐表演 MMus 另录（details/ut-cb5b3c3.html）；截止/语言最低分/打包学费 SGS 页未列，留待补。"
)))

# 4. UT MScF Forestry
pages.append(("details/ut-cc2276a.html", build(
    "林业科学硕士（MScF）", "林业科学硕士（MScF）",
    "林业科学硕士（Master of Science in Forestry, MScF）",
    "MScF", "sci", "建筑、景观与设计学院（Daniels）",
    "John H. Daniels Faculty of Architecture, Landscape, and Design, Graduate School",
    "https://www.sgs.utoronto.ca/programs/forestry/",
    "SGS 页未列具体轮次（待补）",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "SGS 页未列（N/A，不要求 GRE）",
    "SGS 页未列打包学费（待补）",
    "<li>学位授予：MScF（研究/thesis-based 硕士）</li><li>最低录取：mid-B；collaborative specialization 方向需 B+</li><li>导师：学生先自行联系，研究生单位在发 offer 前确认分配</li><li>PhD 方向：A-，本科可直申 PhD</li>",
    "<li>研究方向：森林保护生物学与野生生态、森林生物圈科学、城市林业、生态系统管理、气候变化与林业等</li><li>thesis-based，须完成毕业论文</li><li>跨学科 collaborative specialization 可选</li>",
    "SGS 页 200 可达（441KB），Quick Facts 表提取；MScF 为研究型林业/生态硕士，按 STEM 口径标 stem:1；自然科学类；截止/语言最低分/打包学费 SGS 页未列，留待补。"
)))

# 5. UT Dentistry MSc (Dental Biomedical Sciences)
pages.append(("details/ut-cdentmsc.html", build(
    "牙科生物医学科学硕士（MSc）", "牙科生物医学科学硕士（MSc）",
    "牙科生物医学科学硕士（Master of Science in Dental Biomedical Sciences, MSc）",
    "MSc", "med", "牙医学院（Faculty of Dentistry）",
    "Faculty of Dentistry, Graduate Studies",
    "https://www.sgs.utoronto.ca/programs/dentistry/",
    "Fall 2026 entry：2026-03-01；Winter 2027 entry：2026-08-01",
    "TOEFL iBT / IELTS Academic（最低分待补）",
    "SGS 页未列（N/A，不要求 GRE）",
    "SGS 页未列打包学费（待补）",
    "<li>学位授予：MSc（研究型硕士，6 sessions）</li><li>最低录取：B+（final year of bachelor 或 DDS）</li><li>导师：入学前由学生自行联系（before admission）</li><li>PhD 方向：A-（Master's degree），本科可直申 PhD（A-）</li><li>面向牙医与非牙医申请者，研究生研究训练</li>",
    "<li>研究方向：牙科生物医学科学（Dental Biomedical Sciences），含口腔生物学、牙科材料、口腔公共卫生、疼痛科学等</li><li>MSc 与 PhD 共用课程体系，研究型路径</li><li>非临床执业类（DDS 为博士临床，另设）</li>",
    "SGS 页 200 可达（440KB），Quick Facts 表提取；MSc 为研究型牙科生物医学硕士，非临床执业 DDS，保留类生物医学研究；按 STEM 口径标 stem:1；语言最低分/打包学费 SGS 页未列，留待补。"
)))

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