# -*- coding: utf-8 -*-
import sys, io, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52\details")

CSS = """<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>__TITLE__ · 美加研究生项目查询库</title>
<style>
:root{--bg:#f6f7fb;--card:#fff;--ink:#1f2330;--muted:#6b7280;--line:#e5e7eb;--accent:#7c3aed;--accent2:#0ea5e9;--chip:#eef2ff;--ok:#10b981;--warn:#f59e0b;}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--ink);line-height:1.65}
.wrap{max-width:1080px;margin:0 auto;padding:24px}
.crumb{font-size:13px;color:var(--muted);margin-bottom:12px}
.crumb a{color:var(--accent);text-decoration:none}
h1{font-size:26px;margin:0 0 6px}
.sub{color:var(--muted);font-size:14px;margin-bottom:18px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}
.chip{background:var(--chip);color:var(--accent);padding:4px 12px;border-radius:999px;font-size:13px;font-weight:500}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px 20px}
.card h2{font-size:16px;margin:0 0 10px;color:var(--accent);border-left:3px solid var(--accent);padding-left:8px}
.kv{display:grid;grid-template-columns:110px 1fr;gap:6px 10px;font-size:14px}
.kv .k{color:var(--muted)}
ul{margin:6px 0;padding-left:20px}
.back{display:inline-block;margin-top:20px;padding:10px 18px;background:var(--accent);color:#fff;border-radius:8px;text-decoration:none;font-size:14px}
.note{background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:10px 14px;font-size:13px;color:#92400e;margin-top:16px}
@media(max-width:760px){.grid{grid-template-columns:1fr}}
</style>
</head>
<body><div class="wrap">
__BODY__
</div></body></html>"""

def page(crumb, title, h1, sub, chips, kvs, cards, note):
    chips_html = "".join('<span class="chip">%s</span>' % c for c in chips)
    kvs_html = "".join('<div class="kv"><span class="k">%s</span><span>%s</span></div>' % (k,v) for k,v in kvs)
    cards_html = ""
    for ct, cul in cards:
        lis = "".join("<li>%s</li>" % li for li in cul)
        cards_html += '<div class="card"><h2>%s</h2><ul>%s</ul></div>' % (ct, lis)
    body = '<div class="crumb">%s</div><h1>%s</h1><div class="sub">%s</div><div class="chips">%s</div><div class="grid">%s%s</div><div class="note">%s</div><a class="back" href="../index_main.html">返回项目库列表</a>' % (crumb, h1, sub, chips_html, kvs_html, cards_html, note)
    return CSS.replace("__TITLE__", title).replace("__BODY__", body)

# 1. up-dsai-mse
p1 = page(
    '<a href="../index_main.html">← 返回项目库</a> · 宾夕法尼亚大学 UPenn · 数据科学与人工智能工程硕士',
    "UPenn MSE in Data Science & AI",
    "MSE in Data Science & Artificial Intelligence（数据科学与人工智能工程硕士）",
    "宾夕法尼亚大学 UPenn · 数据科学与人工智能工程硕士",
    ["SEAS 工程学院", "CIS 系 / ESE 系", "STEM", "10 CU", "1.5–2 年（full-time）"],
    [("学位", "MSE（Master of Science in Engineering）"),
     ("学制", "10 course units；full-time 1.5–2 年，可走 thesis 或 practicum 应用方向"),
     ("所属", "SEAS · CIS 计算机与信息科学系 / ESE 电气与系统工程系"),
     ("STEM", "STEM-designated（SEAS 工程类）"),
     ("截止/语言/学费", "catalog 未公布，待补"),
     ("两个方向", "Data Science Track（数据管理与决策）或 Artificial Intelligence Track（智能系统）")],
    [("核心课程（4 CU）", [
        "线性代数/凸优化：CIS 5150 / MATH 5130 / MATH 5140 / ESE 6050 / STAT 5810 任选一",
        "统计：ESE 5420 Statistics for Data Science 或 STAT 5110/5120/5350/5420 任选一",
        "机器学习：CIS 5190 Applied ML 或 CIS 5200 ML 或 ESE 5460 Deep Learning",
        "算法：CIS 5030 Algorithms for Big Data 或 CIS 5020 或 CIS 6770",
    ]),
     ("DS 方向（6 CU）", [
        "CIS 5450 Big Data Analytics",
        "CIS 5500 Database and Information Systems 或 STAT 5710 Modern Data Mining",
        "4 CU 跨方向选修（ML/多模态 AI / 优化与控制 / 社会与网络科学 / AI for Discovery 等 bucket）",
     ]),
     ("AI 方向（6 CU）", [
        "CIS 5210 Artificial Intelligence",
        "CIS 5810 Computer Vision 或 CIS 5300 NLP 或 CIS 6800/6300 高级专题",
        "4 CU 选修（其中 2 CU 须来自 ML/多模态 AI bucket）",
     ]),
     ("应用中心", [
        "ASSET Center（可信 AI）",
        "Warren Center for Network and Data Science",
        "Price Lab for Digital Humanities（数字人文）",
        "Institute for Biomedical Informatics（生物医学信息）",
        "Penn Wharton Budget Model / Annenberg Center for Public Policy（公共政策）",
     ])],
    "本页字段以 UPenn 2026-27 Graduate Catalog 官方项目页为准；截止/语言/学费 catalog 未公布，待补。官网：https://catalog.upenn.edu/graduate/programs/data-science-artificial-intelligence-mse/ ；项目主页：https://dats.seas.upenn.edu/program/"
)
open("up-dsai-mse.html", "w", encoding="utf-8").write(p1)
print("OK up-dsai-mse.html")

# 2. up-mascs
p2 = page(
    '<a href="../index_main.html">← 返回项目库</a> · 宾夕法尼亚大学 UPenn · 计算机科学应用硕士（非 CS 背景）',
    "UPenn MAS-CS (MASCS)",
    "Master of Applied Science in Computer Science, MASCS（计算机科学应用硕士 · 非 CS 背景转 CS）",
    "宾夕法尼亚大学 UPenn · 计算机科学应用硕士（On-Campus 路径）",
    ["SEAS 工程学院", "CIS 系", "STEM", "10 CU", "2 年（full-time）", "非 CS 背景可申"],
    [("学位", "MAS-CS（Master of Applied Science in Computer Science，原 MCIT 升级版）"),
     ("学制", "10 course units；full-time 前两学期修完 6 门必修，第二年修 4 门选修"),
     ("所属", "SEAS · CIS 计算机与信息科学系"),
     ("STEM", "STEM-designated（SEAS 工程类）"),
     ("截止/语言/学费", "catalog 未公布，待补"),
     ("招生对象", "面向非计算机科学背景本科生，转专业入读；可续读 CIS/MSE 双学位（再加 6 门 CIS 课）")],
    [("6 门必修", [
        "CIT 5910 Introduction to Software Development（2 CU，Fall）",
        "CIT 5920 Mathematical Foundations of Computer Science（2 CU，Fall）",
        "CIT 5930 Introduction to Computer Systems（2 CU，Fall）",
        "CIT 5940 Data Structures and Software Design（Spring）",
        "CIT 5950 Computer Systems Programming（Spring）",
        "CIT 5960 Algorithms and Computation（Spring）",
    ]),
     ("4 门选修（至少 3 门 CIS）", [
        "推荐：CIS 5500 Database / CIS 5550 Internet and Web Systems / CIS 5730 Software Engineering / CIS 5570 Programming for the Web",
        "可选：CIS 5020 Analysis of Algorithms / CIS 5050 Software Systems / CIS 5190 Applied ML / CIS 5510 Computer and Network Security / CIS 5530 Networked Systems / CIS 5810 Computer Vision",
        "可选：CIS 5210 AI / CIS 5300 NLP / CIS 5450 Big Data / CIS 5690 GPU Computing for ML",
        "最多 1 门经批准的非 CIS 研究生课",
     ]),
     ("双学位路径", [
        "MAS-CS 在读生可申请续读 CIS/MSE（MSE in Computer & Information Science）",
        "需满足最低 GPA、至少一门 CIS 选修拿高分、完成大部分 MAS-CS 要求后申请",
        "双学位共 16 CU（MAS-CS 10 + CIS/MSE 再加 6）",
     ])],
    "本页字段以 UPenn 2026-27 Graduate Catalog 官方项目页为准；On-Campus 路径（另有 Online 版本按口径排除）。截止/语言/学费 catalog 未公布，待补。官网：https://catalog.upenn.edu/graduate/programs/computer-science-mascs/"
)
open("up-mascs.html", "w", encoding="utf-8").write(p2)
print("OK up-mascs.html")

# 3. up-scicomp-mse
p3 = page(
    '<a href="../index_main.html">← 返回项目库</a> · 宾夕法尼亚大学 UPenn · 科学计算工程硕士',
    "UPenn MSE in Scientific Computing",
    "MSE in Scientific Computing（科学计算工程硕士）",
    "宾夕法尼亚大学 UPenn · 科学计算工程硕士",
    ["SEAS 工程学院", "ENM / CIS / AMCS", "STEM", "10 CU", "2 年（full-time）"],
    [("学位", "MSE（Master of Science in Engineering）"),
     ("学制", "10 course units；含 thesis 或 independent study 选项"),
     ("所属", "SEAS · 工程与力学系 ENM / CIS 系 / 应用数学与计算科学 AMCS"),
     ("STEM", "STEM-designated（SEAS 工程类）"),
     ("截止/语言/学费", "catalog 未公布，待补"),
     ("招生背景", "欢迎物理/理论科学/工程/数学/CS 背景申请者，建议有编程经验")],
    [("核心（2 CU）", [
        "ENM 5020 Numerical Methods and Modeling",
        "CIS 5450 Big Data Analytics",
    ]),
     ("计算数学（1 CU，多选一）", [
        "AMCS 5141 Advanced Linear Algebra",
        "AMCS 5200 ODE / AMCS 5681 Mathematical Modeling in Physiology / AMCS 5840 Medical Imaging Math / AMCS 6025 Numerical Analysis I",
        "CIS 5150 Linear Algebra and Optimization / ENM 5220 Numerical Methods for PDEs / ESE 5300 Probability / MATH 6450 PDE / MATH 6490 Stochastic / STAT 5330/5440/5810",
     ]),
     ("机器学习（2 CU）", [
        "CIS 5190 Applied ML / CIS 5200 ML / CIS 5210 AI / CIS 5220 Deep Learning for Data Science",
        "CIS 5500 Database / CIS 6200 Advanced Topics in ML / CIS 6250 Theory of ML",
        "ENM 5310 Data-driven Modeling / ESE 5140 GNN / ESE 5380 ML for Time-Series / ESE 5420 Stats / ESE 5450 Data Mining / ESE 5460 Deep Learning / ESE 6450 Deep Generative / STAT 5710 Modern Data Mining",
     ]),
     ("自然科学应用（2 CU）", [
        "BE 5210 BCI / BE 5510 Biomicrofluidics / BE 5560 Molecular Diagnostics / BE 5810 MRI / BE 5830 Physics of Medical Imaging",
        "BIOL 5210 Molecular Biology / BIOL 5535 Computational Biology / BMIN 5210/5220 Health ML/NLP",
        "CBE 5170 Genome Engineering / CBE 5520 Protein Engineering / CBE 5540 Biotechnology",
        "CIS 5650 GPU Programming / CIS 5600 Interactive Graphics / ESE 5090 Quantum Circuits / ESE 5230 Quantum Engineering / ESE 6150 RoboRacer / MEAM 系列机器人/流体/材料 / MSE 材料 / PHYS 宇宙学/凝聚态",
        "或选 SCMP 9990 Master's Thesis（2 CU）",
     ]),
     ("方法与仿真（2 CU）", [
        "BE 5160 High-Performance Scientific Computing / BE 5300 Computational Neuroscience / BE 5590 Multiscale Modeling / BE 5370 Biomedical Image Analysis",
        "CBE 5250 Molecular Modeling / CBE 5440 Computational Science of Energy",
        "CIS 5350 Bioinformatics / CIS 5360 Computational Biology / CIS 5610 Advanced Graphics / CIS 5620 Computer Animation / CIS 5800 Machine Perception / CIS 5810 Computer Vision",
     ])],
    "本页字段以 UPenn 2026-27 Graduate Catalog 官方项目页为准；截止/语言/学费 catalog 未公布，待补。官网：https://catalog.upenn.edu/graduate/programs/scientific-computing-mse/ ；项目主页：https://pics.upenn.edu/masters-science-engineering-scientific-computing/"
)
open("up-scicomp-mse.html", "w", encoding="utf-8").write(p3)
print("OK up-scicomp-mse.html")

# 4. up-mbds
p4 = page(
    '<a href="../index_main.html">← 返回项目库</a> · 宾夕法尼亚大学 UPenn · 行为与决策科学硕士',
    "UPenn MBDS",
    "Master of Behavioral and Decision Sciences, MBDS（行为与决策科学硕士）",
    "宾夕法尼亚大学 UPenn · 行为与决策科学硕士",
    ["SAS 文理学院 LPS", "9 CU", "1 年（full-time）", "跨学科"],
    [("学位", "MBDS（Master of Behavioral and Decision Sciences）"),
     ("学制", "9 course units；full-time 1 个学年完成，或 part-time 灵活节奏"),
     ("所属", "Penn SAS · College of Liberal and Professional Studies (LPS)"),
     ("STEM", "非 STEM（行为经济/决策科学/公共政策跨学科）"),
     ("截止/语言/学费", "catalog 未公布，待补"),
     ("方向", "行为经济学 / 决策科学 / 网络分析 / 公共政策；应用于社会政策、法律、教育、商业、医疗")],
    [("6 门必修", [
        "BDS 5010 Behavioral Science: Theory and Application of Experimental Methods",
        "BDS 5030 Behavioral Interventions for Policy and Organizations",
        "BDS 5210 Judgments & Decisions",
        "BDS 5996A Capstone Project: Applied Behavioral Science（0.5 CU，Fall）",
        "BDS 5996B Capstone Project（0.5 CU，Spring，行业合作 Design Challenge）",
    ]),
     ("应用单元（1 CU，三选一）", [
        "BDS 5020 Norms and Nudges（规范与助推）",
        "BDS 5250 Organizational Behavior（组织行为）",
        "BDS 5410 AI and Human Behavior（AI 与人类行为）",
     ]),
     ("量化单元（1 CU，按入学评测分班）", [
        "BDS 5220 Statistical Reasoning for Behavioral Science（中级，Fall）",
        "BDS 5160 Data Science and Quantitative Modeling（高级，Spring）",
     ]),
     ("3 门选修", [
        "可跨 SAS / Social Policy & Practice / Wharton / Penn Law / GSE / Annenberg / Nursing / Perelman 选课",
        "最多 1 门可在 SAS 外修读；项目 advisor 一对一指导选课",
     ]),
     ("预备课", [
        "入学前夏季可选：introductory statistics（统计学入门）",
        "microeconomics/game theory（微观经济学/博弈论）",
     ])],
    "本页字段以 UPenn 2026-27 Graduate Catalog 官方项目页为准；full-time 1 学年路径。截止/语言/学费 catalog 未公布，待补。官网：https://catalog.upenn.edu/graduate/programs/behavioral-decision-sciences-mbds/ ；项目主页：https://www.sas.upenn.edu/lps/graduate/mbds"
)
open("up-mbds.html", "w", encoding="utf-8").write(p4)
print("OK up-mbds.html")

# 5. up-biostat-ms
p5 = page(
    '<a href="../index_main.html">← 返回项目库</a> · 宾夕法尼亚大学 UPenn · 生物统计硕士',
    "UPenn MS in Biostatistics",
    "MS in Biostatistics（生物统计硕士）",
    "宾夕法尼亚大学 UPenn · 生物统计硕士",
    ["Perelman 医学院", "GGEB 研究生组", "STEM", "12 CU", "2 年（full-time）", "含论文"],
    [("学位", "MS（Master of Science in Biostatistics）"),
     ("学制", "12 course units；2 年全日制，含 Master's thesis"),
     ("所属", "Perelman School of Medicine · Graduate Group in Epidemiology and Biostatistics (GGEB)"),
     ("STEM", "STEM-designated（生物统计/统计类）"),
     ("截止/语言/学费", "catalog 未公布，待补"),
     ("培养目标", "训练生物医学问题中的统计方法基础理论与应用；含概率、数理统计、线性模型、纵向数据、生存分析、统计计算")],
    [("理论课（2 CU）", [
        "BSTA 6200 Probability I（Fall）",
        "BSTA 6210 Statistical Inference I（Spring）",
    ]),
     ("方法课（5 CU）", [
        "BSTA 5110 Biostatistics in Practice（Fall）",
        "BSTA 6320 Statistical Methods for Categorical and Survival Data（Spring）",
        "BSTA 6510 Linear Models（Fall）",
        "BSTA 6560 Longitudinal Data Analysis（Fall）",
        "BSTA 6700 Statistical Computing（Spring）",
    ]),
     ("高级选修（4 CU）", [
        "Attribute MPEB（跨研究生组高级选修课，4 CU）",
    ]),
     ("研究（1 CU）", [
        "BSTA 9900 Guided Thesis Research（Master's Thesis，Spring 第二年）",
    ]),
     ("典型两年计划", [
        "Year1 Fall：BSTA 5110 + 6200 + 6510",
        "Year1 Spring：BSTA 6210 + 6320 + 高级选修",
        "Year2 Fall：BSTA 6560 + 高级选修 + BSTA 9900 Thesis",
        "Year2 Spring：BSTA 6700 + 高级选修 + 论文答辩",
     ])],
    "本页字段以 UPenn 2026-27 Graduate Catalog 官方项目页为准；研究型 MS 含 thesis，按 University's Academic Rules for Research Master's Programs 执行。截止/语言/学费 catalog 未公布，待补。官网：https://catalog.upenn.edu/graduate/programs/epidemiology-biostatistics-biostatistics-ms/ ；项目主页：https://www.med.upenn.edu/ggeb/bio-academics.html"
)
open("up-biostat-ms.html", "w", encoding="utf-8").write(p5)
print("OK up-biostat-ms.html")
print("ALL DONE")
