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

HEAD = """<!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: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> / 莱斯 Rice University / __CRUMB__</div>
<div class="card">
<h1>__H1__</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>__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>
"""

def build(title, crumb, h1, chips, dept, url, ddl, lang, test, tui, core, elect, note):
    s = HEAD
    for k,v in [("__TITLE__",title),("__CRUMB__",crumb),("__H1__",h1),("__CHIPS__",chips),
                ("__DEPT__",dept),("__URL__",url),("__DDL__",ddl),("__LANG__",lang),
                ("__TEST__",test),("__TUI__",tui),("__CORE__",core),("__ELECT__",elect),("__NOTE__",note)]:
        s = s.replace(k,v)
    return s

pages = []

# 1. Mechanical Engineering MME
pages.append(("details/rice-mme.html", build(
    title="机械工程硕士（Master of Mechanical Engineering, MME）",
    crumb="机械工程硕士（Master of Mechanical Engineering, MME）",
    h1="机械工程硕士（Master of Mechanical Engineering, MME）",
    chips='<span class="chip">MME</span><span class="chip">莱斯 Rice University</span><span class="chip">eng</span><span class="chip">STEM（OPT 36 个月）</span><span class="chip">非 Thesis；面向工业界；Department of Mechanical Engineering</span>',
    dept="Department of Mechanical Engineering, George R. Brown School of Engineering",
    url="https://mech.rice.edu/academics/graduate-programs/masters-mechanical-engineering",
    ddl="官网页未列具体轮次（待补）",
    lang="TOEFL iBT / IELTS Academic（最低分待补）",
    test="官网页未列（待补）",
    tui="官网页未列打包学费（待补）",
    core="<li>非 Thesis 专业型硕士，面向工业界而非研究</li><li>两个学期应用实践：团队项目（MECH 601 + 602）或与 faculty 的独立项目（MECH 621 + 622）</li><li>五个方向任选其一，每方向 3 门课形成深度</li>",
    elect="<li>Aerospace Engineering 航空航天</li><li>Biomedical Engineering 生物医学</li><li>Energy 能源</li><li>Robotics 机器人</li><li>Mechanical Engineering 机械工程通用</li><li>面向 aerospace / energy / health / robotics 行业职业</li>",
    note="Rice 机械工程在校专业硕士；官网页未列截止/语言/GRE/学费，整项待补；与 MS (thesis) 研究型硕士区分，本页录 professional MME。"
)))

# 2. Materials Science and NanoEngineering MMSNE
pages.append(("details/rice-mmsne.html", build(
    title="材料科学与纳米工程硕士（Master of Materials Science and NanoEngineering, MMSNE）",
    crumb="材料科学与纳米工程硕士（MMSNE）",
    h1="材料科学与纳米工程硕士（Master of Materials Science and NanoEngineering, MMSNE）",
    chips='<span class="chip">MMSNE</span><span class="chip">莱斯 Rice University</span><span class="chip">eng</span><span class="chip">STEM（OPT 36 个月）</span><span class="chip">非 Thesis；career-focused；Department of Materials Science and NanoEngineering</span>',
    dept="Department of Materials Science and NanoEngineering, George R. Brown School of Engineering",
    url="https://msne.rice.edu/academics/graduate-programs/mmsne-program",
    ddl="官网页未列具体轮次（待补）",
    lang="TOEFL iBT / IELTS Academic（最低分待补）",
    test="官网页未列（待补）",
    tui="官网页未列打包学费（待补）",
    core="<li>非 Thesis 专业型硕士，面向学术优秀学生及希望深化工程专业知识的在职工程师</li><li>除工程能力训练外，辅以 entrepreneurship / project management / networking / leadership 培训</li><li>面向 industry advancement 与 technical skills 提升</li>",
    elect="<li>Carbon, Nanostructured & Low-Dimensional Materials：碳纳米管、石墨烯、低维系统，驱动能源/电子/环境技术突破</li><li>Biomaterials & Materials for Human Health：伤口愈合、再生医学、药物递送、诊断材料</li><li>纳米技术在能源、电子、环境、医疗领域的应用</li>",
    note="Rice 材料纳米工程在校专业硕士；官网页未列截止/语言/GRE/学费，整项待补；与 MS (thesis) 研究型硕士区分，本页录 professional MMSNE。"
)))

# 3. Chemical Engineering MChE
pages.append(("details/rice-mche.html", build(
    title="化学工程硕士（Master of Chemical Engineering, MChE）",
    crumb="化学工程硕士（MChE）",
    h1="化学工程硕士（Master of Chemical Engineering, MChE）",
    chips='<span class="chip">MChE</span><span class="chip">莱斯 Rice University</span><span class="chip">eng</span><span class="chip">STEM（OPT 36 个月）</span><span class="chip">非 Thesis；Department of Chemical and Biomolecular Engineering</span>',
    dept="Department of Chemical and Biomolecular Engineering, George R. Brown School of Engineering",
    url="https://chbe.rice.edu/academics/graduate-programs/mche-program",
    ddl="官网页未列具体轮次（待补）",
    lang="TOEFL iBT / IELTS Academic（最低分待补）",
    test="官网页未列（待补）",
    tui="官网页未列打包学费（待补）",
    core="<li>非 Thesis 专业型硕士</li><li>核心技术能力训练 + business / management / communication / leadership 选修</li><li>面向工业界化学工程师职业发展</li>",
    elect="<li>研究方向：Materials & Nanotechnology / Energy & Sustainability / Biomolecular Engineering</li><li>选修商科、管理、沟通、领导力课程，补足工程技术之外的职业能力</li>",
    note="Rice 化工在校专业硕士；官网页未列截止/语言/GRE/学费，整项待补；与 PhD 研究型项目区分，本页录 professional MChE。"
)))

# 4. Statistics MStat
pages.append(("details/rice-mstat.html", build(
    title="统计硕士（Master of Statistics, MStat）",
    crumb="统计硕士（MStat）",
    h1="统计硕士（Master of Statistics, MStat）",
    chips='<span class="chip">MStat</span><span class="chip">莱斯 Rice University</span><span class="chip">cs</span><span class="chip">STEM（OPT 36 个月）</span><span class="chip">Professional master；Department of Statistics</span>',
    dept="Department of Statistics, George R. Brown School of Engineering",
    url="https://statistics.rice.edu/master-statistics",
    ddl="官网页未列具体轮次（待补）；Qualified applicants 提供奖学金",
    lang="TOEFL iBT / IELTS Academic（最低分待补）",
    test="官网页未列（待补）",
    tui="官网页未列打包学费（待补）",
    core="<li>Professional master's，面向 mathematical / physical / engineering sciences 学位学生</li><li>提供 advanced learning and training，准备工业界 statistician 职业</li><li>训练 applied aspects of statistics theory, methodology and techniques，超出本科水平</li>",
    elect="<li>就业方向：business / industry / non-profit / government statistical work 及其他 quantitative 领域</li><li>Bridge to industry，强调统计理论与方法的应用</li><li>Rice 本科 Fifth Year 通道（本硕连读，排除口径）</li>",
    note="Rice 统计在校专业硕士；官网页未列截止/语言/GRE/学费，整项待补；与 PhD 项目区分，本页录 professional MStat。"
)))

# 5. Bioengineering MBE
pages.append(("details/rice-mbe.html", build(
    title="生物工程硕士（Master of Bioengineering, MBE）",
    crumb="生物工程硕士（MBE）",
    h1="生物工程硕士（Master of Bioengineering, MBE）",
    chips='<span class="chip">MBE</span><span class="chip">莱斯 Rice University</span><span class="chip">eng</span><span class="chip">STEM（OPT 36 个月）</span><span class="chip">非 Thesis；两个方向；Department of Bioengineering</span>',
    dept="Department of Bioengineering, George R. Brown School of Engineering",
    url="https://bioengineering.rice.edu/academics/masters-programs",
    ddl="官网页未列具体轮次（待补）",
    lang="TOEFL iBT / IELTS Academic（最低分待补）",
    test="官网页未列（待补）",
    tui="官网页未列打包学费（待补）",
    core="<li>Professional non-thesis 学位，广受认可</li><li>两个方向：Applied Bioengineering 应用生物工程 / Global Medical Innovation 全球医疗创新</li><li>Practical experience：real world problems + business training + hands-on experience</li>",
    elect="<li>Applied Bioengineering：生物医学工程应用方向</li><li>Global Medical Innovation：全球医疗创新方向，跨学科</li><li>Industry Mentorship Program 行业导师计划</li><li>Rice 本科 5th Year 通道（本硕连读，排除口径）</li>",
    note="Rice 生物工程在校专业硕士；官网页未列截止/语言/GRE/学费，整项待补；与 PhD 项目区分，本页录 professional MBE。"
)))

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