# -*- 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=""":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}
.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}
.links a{display:inline-block;margin:4px 8px 4px 0;padding:8px 14px;background:var(--navy2);color:#fff;border-radius:8px;font-size:13px;text-decoration:none;font-weight:600}
.foot{max-width:900px;margin:0 auto 40px;padding:0 16px}
.yellow{background:#fff8e1;border-left:4px solid var(--gold);border-radius:8px;padding:12px 16px;font-size:12px;line-height:1.8}
.back{display:inline-block;margin-bottom:14px;color:var(--navy2);text-decoration:none;font-size:13px;font-weight:600}"""

RICE_LANG="TOEFL 90（iBT 最低）/ IELTS 7（最低）/ Duolingo 115（最低）；英语授课学位可豁免（EPMP 工程硕士通用口径）。"
RICE_BG="工程或相关学科学士背景；本科 GPA 3.0+；全部就读院校成绩单、3 封推荐信；GRE 代码 6609（Rice University）；holistic 评审。"
RICE_TUI="项目级学费费率/总额官网未在招生页单列，以 Rice Bursar 官方公布为准，留空不估算；merit 奖学金按项目口径自动评审。"

P=[
 dict(sc="cmu",det="details/cmu-c274a8e.html",title="计算生物学硕士",en="M.S. in Computational Biology (MSCB)",school="卡内基梅隆大学 · 计算生物学系（SCS）× 生物科学系（Mellon College of Science）联合",badge="跨学科职业型硕士",url="http://www.cmu.edu/bio/graduate/prospective_students/ms_comp_bio/",
  ddl="项目页未列具体申请截止日期；申请通过 School of Computer Science 申请门户提交，截止以门户当年公告为准，留空待补。",
  lang="Duolingo 115（Literacy 105 / Conversation 95 / Comprehension 115 / Production 90）；TOEFL 新版 Overall 4.5（R4.5 / L5.0 / S4.0 / W4.5；2026 前旧版 86 / R22 / L22 / S20 / W22）；IELTS 6.5（R6.5 / L6.5 / S6.0 / W6.0）；非母语者不豁免；美国/澳大利亚/加拿大（除魁北克）/爱尔兰/英国在读学位可接受 5 年内非正式过期成绩。",
  test="<b>GRE：accepted, optional</b>（愿意提交则纳入评审，不强制）。",
  bg="项目页未单列先修课程与材料清单；申请走 SCS 申请门户，具体材料以门户为准，留空待补。",
  mat="通过 SCS 申请门户提交；项目联系人 DJ Brasier & Dan DeBlasio（Assistant Directors）；申请问题 compbio-slate@andrew.cmu.edu / scs-grad-application@andrew.cmu.edu。",
  tui="项目级学费费率/总额本页未列示（页面链接至 Graduate program tuition & fees），留空待补，不估算。",
  cur=["<b>学位总要求</b>：四学期（4-semester）；课程结构含 Foundation Courses、Background Courses、Breadth & Depth Courses，跨生物学、计算机科学、统计与机器学习。",
       "<b>研究与研讨</b>：学生可参与深度研究项目与实习；必修 Graduate Research Seminar（Journal Club）与 Departmental Research Seminars；另设伦理、科研诚信与职业准备研讨。",
       "<b>方向</b>：生物信息学、个性化医疗、基因组学、神经科学、药物设计、环境健康等。"],
  extra="SCS 计算生物学系与 Mellon College of Science 生物科学系联合培养；小班 cohort、师生比低，个性化导师指导；毕业生可进入生物技术/制药/政府/学术界，或衔接顶尖 PhD 项目。",
  job="据 exit survey，校友中位起薪约 $100,000（毕业薪资分布，非最低门槛、非保证起薪）；雇主含 J. Craig Venter Institute、Thermo Fisher Scientific、Philips Research、Broad Institute of MIT and Harvard；部分毕业生赴顶尖高校继续 PhD。",
  city="美国 · 宾夕法尼亚州 匹兹堡 — 生物技术、制药与科研机构密集。",
  excl="M.S. in Automated Science (MSAS，共享部分师资与核心课但聚焦自动化实验设计与数据采集)；PhD；M.S. in Quantitative Biology and Bioinformatics；M.S. in Biotechnology and Pharmaceutical Engineering。"),
 dict(sc="rice",det="details/rice-computational-applied-mathematics-operations-research.html",title="计算与应用数学硕士",en="Master of Computational and Applied Mathematics (MCAAM)",school="莱斯大学 Rice University · George R. Brown 工程与计算学院 · CMOR 系",badge="非论文职业型硕士",url="https://ga.rice.edu/programs-study/departments-programs/engineering/computational-applied-mathematics-operations-research/",
  ddl="Fall 2027：Priority 2027-01-15 / Late 2027-02-28；无春季入学（EPMP 工程硕士截止表）。",
  lang=RICE_LANG,
  test="<b>GRE：optional</b>（Rice 2025 一般不要求 GRE；各项目可自选建议/强建议/要求，MCAAM 未明示强制，建议提交则纳入 holistic 评审；GRE 代码 6609）。",
  bg=RICE_BG,
  mat="在线申请；全部就读院校成绩单；3 封推荐信；GRE（可选，代码 6609）；TOEFL/IELTS/Duolingo（如适用）。",
  tui=RICE_TUI,
  cur=["<b>学位性质</b>：professional non-thesis 职业型硕士，面向工业界技术岗位；提供计算与应用数学工具，用于求解工程、科学与商业中的复杂问题。",
       "<b>课程</b>：具体学分总数与课程清单以 Rice General Announcements（GA）官方目录为准；系站项目页本轮 406 不可达，学分/课程细节待补。"],
  extra="隶属 Computational Applied Mathematics and Operations Research (CMOR) 系；跨工程、科学与商业应用。",
  job="面向工业界计算/应用数学技术岗位；项目页未披露具体雇主与薪资数字，不估算。",
  city="美国 · 得克萨斯州 休斯顿 — 能源、医疗、航天与科技创业活跃。",
  excl="研究型 MS（论文导向，PhD 衔接）；PhD；Rice 本科第五年贯通通道；在线/在职版本。"),
 dict(sc="rice",det="details/rice-computational-science-engineering.html",title="计算科学与工程硕士",en="Master of Computational Science and Engineering (MCSE)",school="莱斯大学 Rice University · 工程学院 · CMOR × Statistics 合办",badge="非论文跨学科硕士",url="https://ga.rice.edu/programs-study/departments-programs/engineering/computational-science-engineering",
  ddl="Fall 2027：Priority 2027-01-15 / Late 2027-02-28；无春季入学（EPMP 工程硕士截止表）。",
  lang=RICE_LANG,
  test="<b>GRE：optional，不要求</b>（项目页明示 MCSE 不要求 GRE，可选择提交，提交后纳入 holistic 评审）。",
  bg=RICE_BG,
  mat="在线申请；全部成绩单；3 封推荐信；GRE（可选）；TOEFL/IELTS/Duolingo（如适用）。",
  tui=RICE_TUI,
  cur=["<b>学位性质</b>：interdisciplinary non-thesis，由 CMOR 与 Statistics (STAT) 两系合办；核心课程来自计算与应用数学、统计、计算机科学，另修沟通、伦理与领导力。",
       "<b>Home 系选择</b>：申请时须二选一 CMOR 或 STAT 作为主修系/方向；录取进入对应 home 系，修读该系较多课程。",
       "<b>方向</b>：科学计算、高性能计算、数据分析、数据工程、数据科学、机器学习、科学数据分析与可视化。",
       "<b>课程/学分</b>：具体学分总数与课表以 GA 官方目录为准；项目页称内部审批完成后补充细节，待补。"],
  extra="面向计算科学与数据密集型应用；跨 CMOR/STAT/CS 三系选课；项目联系 mcse@rice.edu。",
  job="路径 Computational Scientist、Computational Engineer、Data Engineering、Data Analyst、高性能计算与科学数据可视化；项目页未披露具体薪资数字，不估算。",
  city="美国 · 得克萨斯州 休斯顿。",
  excl="研究型 MS（论文导向）；PhD；在线/在职版本。"),
 dict(sc="rice",det="details/rice-industrial-engineering.html",title="工业工程硕士",en="Master of Industrial Engineering (MIE)",school="莱斯大学 Rice University · George R. Brown 工程与计算学院 · CMOR 系监管",badge="非论文职业型硕士",url="https://ga.rice.edu/programs-study/departments-programs/engineering/industrial-engineering",
  ddl="Fall 2027：2027-02-01；无春季入学（EPMP 工程硕士截止表）。",
  lang=RICE_LANG,
  test="<b>GRE：optional</b>（Rice 2025 一般不要求 GRE；MIE 未明示强制；代码 6609）。",
  bg=RICE_BG,
  mat="在线申请；全部成绩单；3 封推荐信；GRE（可选，代码 6609）；TOEFL/IELTS/Duolingo（如适用）。",
  tui=RICE_TUI,
  cur=["<b>学位总要求</b>：31 学分 500 级及以上课程，含 1 学分最终项目（INDE 590 Capstone Experience）；non-thesis 职业型。",
       "<b>核心课</b>：INDE 501 Fundamentals of Industrial Engineering；INDE 503 Lean Six Sigma；INDE 545 Prescriptive Analytics；INDE 561 Supply Chain Management；INDE 571 Probability & Statistical Inference；INDE 572 Stochastic Processes and Simulation；INDE 577 Data Science and Machine Learning。",
       "<b>方向</b>：制造、服务、供应链管理、能源、交通、医疗等工业系统的分析与优化；数据驱动决策。"],
  extra="位于休斯顿——美国能源之都、全球最大医疗中心所在地、制造岗位数量领先；面向工业界、政府与非营利部门的复杂系统效率与安全优化。",
  job="路径工业工程/运筹分析、供应链与运营优化、医疗系统 OR、数据驱动决策；项目页未披露具体雇主与薪资数字，不估算。",
  city="美国 · 得克萨斯州 休斯顿。",
  excl="研究型 MS（论文导向）；PhD；在线/在职版本。"),
 dict(sc="rice",det="details/rice-mechanical-engineering.html",title="机械工程硕士",en="Master of Mechanical Engineering (MME)",school="莱斯大学 Rice University · George R. Brown 工程与计算学院 · 机械工程系",badge="非论文职业型硕士",url="https://ga.rice.edu/programs-study/departments-programs/engineering/mechanical-engineering",
  ddl="Fall 2027：2026-12-15 或 2027-01-15；Spring：2026-10-15（EPMP 工程硕士截止表）。",
  lang=RICE_LANG,
  test="<b>GRE：optional</b>（Rice 2025 一般不要求 GRE；MME 未明示强制；代码 6609）。",
  bg="工程学士背景；本科 GPA 3.0+；全部成绩单、3 封推荐信。",
  mat="在线申请；全部成绩单；3 封推荐信；GRE（可选，代码 6609）；TOEFL/IELTS/Duolingo（如适用）。",
  tui=RICE_TUI,
  cur=["<b>学位性质</b>：professional non-thesis 职业型硕士，面向有志于技术领域进阶与领导力发展的工程专业人士，也适合刚完成四年制工程学士的学生。",
       "<b>方向</b>：热（Thermal）、流体（Fluid）、力学（Mechanics）、生物医学（Biomedical）、设计（Design）、动力学与控制（Dynamics and Controls）、高性能计算（HPC）。",
       "<b>课程/学分</b>：具体学分总数与课表以 GA 官方目录为准；系站项目页本轮 406 不可达，学分细节待补。"],
  extra="隶属 Mechanical Engineering 系；工程各子领域理论与应用进阶训练。",
  job="面向机械工程各子领域工业岗位；项目页未披露具体雇主与薪资数字，不估算。",
  city="美国 · 得克萨斯州 休斯顿。",
  excl="研究型 MS（Mechanical Engineering MS，论文导向）；PhD；在线/在职版本。"),
]

def render(p):
    badge=f'<div class="badges"><span class="badge">{p["badge"]}</span></div>'
    rows_req=[("申请截止",p["ddl"]),("语言要求",p["lang"]),("标化要求",p["test"]),("学术背景",p["bg"]),("申请材料",p["mat"])]
    req_html="".join(f'<tr><td class="k">{k}</td><td class="v">{v}</td></tr>' for k,v in rows_req)
    cur_html="".join(f"<li>{c}</li>" for c in p["cur"])
    links=f'<div class="clinks"><a href="{p["url"]}" target="_blank">📘 项目官网 · 要求与课程 ↗</a></div>'
    html=f"""<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{p['title']} · {p['school'].split(' · ')[0]} · 项目详情 | 美加硕士项目查询系统</title>
<style>{CSS}</style></head>
<body>
<div class="hero">
  <h1>{p['title']}</h1>
  <div class="en">{p['en']}</div>
  <div class="school">{p['school']}</div>
  <div class="ranks"></div>
  {badge}
</div>
<div class="wrap">
  <a class="back" href="../index_main.html">← 返回项目库</a>
<div class="card"><h2>申请要求（2027 申请季 · 官网口径）</h2><table class="kv">{req_html}</table></div>
<div class="card"><h2>费用（学费 + 奖学金 · 官网口径）</h2><table class="kv"><tr><td class="k">学费与奖学金</td><td class="v">{p['tui']}</td></tr></table></div>
<div class="card"><h2>课程设置（官网口径）</h2><ul class="cl">{cur_html}</ul>{links}</div>
<div class="card"><h2>培养方案与项目要点（官网口径）</h2><div class="ptext" style="font-size:13px;line-height:1.9">{p['extra']}</div></div>
<div class="card"><h2>毕业走向 · 就业率 · 薪资（官网披露）</h2><table class="kv"><tr><td class="k">毕业走向（官网披露）</td><td class="v">{p['job']}</td></tr></table></div>
<div class="card"><h2>院校与城市速览（编辑整理，供沟通参考）</h2><table class="kv"><tr><td class="k">📍 城市</td><td class="v">{p['city']}</td></tr><tr><td class="k">💰 薪资口径</td><td class="v">上方就业/薪资为官网自愿调查或项目披露口径，录取分数与薪资均为分布参考、非最低门槛、非保证起薪；具体随方向与个人背景浮动。</td></tr></table><div class="note">ℹ️ 本卡为编辑整理内容，便于接待沟通；上方各卡为官网数据。</div></div>
<div class="card links"><h2>官方链接</h2><a href="{p['url']}" target="_blank">🔗 项目官方页面</a></div>
</div>
<div class="foot">
  <div class="yellow">📋 数据说明：本页内容摘自学校官网（抓取日期 2026-11-19，对应 2027 申请季）。官网未公布的字段整项不展示，不做估算填充；录取分数与薪资为分布参考，非最低门槛。排除口径：{p['excl']}。</div>
</div>
</body>
</html>"""
    open(p["det"],"w",encoding="utf-8").write(html)
    print("written",p["det"],len(html))

for p in P: render(p)
