# -*- 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 page(crumb, title, h1, sub, chips, kvs, cards, note):
    chip_html = "".join(f'<span class="chip">{c}</span>' for c in chips)
    kv_html = "".join(f'<div class="kv"><div class="k">{k}</div><div class="v">{v}</div></div>' for k, v in kvs)
    cards_html = "".join(f'<div class="card"><h3>{t}</h3><ul>{"".join("<li>"+li+"</li>" for li in lis)}</ul></div>' for t, lis in cards)
    return f"""<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8">
<title>{title}</title>
<link rel="stylesheet" href="../assets/det.css">
</head><body>
<nav class="crumb">{crumb}</nav>
<header class="hero"><h1>{h1}</h1><p class="sub">{sub}</p><div class="chips">{chip_html}</div></header>
<section class="kvwrap">{kv_html}</section>
<section class="cards">{cards_html}</section>
<footer class="note">{note}</footer>
</body></html>"""

# 1. MAPP — 覆盖 up-c4e6bf6.html
p1 = page(
    '<a href="../index_main.html">← 返回项目库</a> / 宾大 · SAS/LPS 应用积极心理学',
    "Applied Positive Psychology MAPP - UPenn",
    "应用积极心理学硕士",
    "Master of Applied Positive Psychology (MAPP)",
    ["宾大 UPenn", "SAS/LPS", "MAPP", "1年全日制", "非STEM"],
    [
        ("学位", "MAPP (Master of Applied Positive Psychology)"),
        ("所属学院", "School of Arts and Sciences · College of Liberal and Professional Studies (LPS)"),
        ("学制", "9 门课，1 年全日制（Fall / Spring / Summer 连续三学期）"),
        ("学习方式", "全日制在校"),
        ("STEM", "否（应用心理学/职业型硕士）"),
        ("官网", '<a href="https://catalog.upenn.edu/graduate/programs/applied-positive-psychology-mapp/" target="_blank">catalog.upenn.edu</a>'),
    ],
    [
        ("项目概览", [
            "全球首个应用积极心理学学位项目，由积极心理学创始人 Martin E.P. Seligman 及顶尖研究者与从业者授课。",
            "课程涵盖积极心理学的历史、理论、研究方法，及其在职业场景中的应用。",
            "暑期 Capstone 项目整合所学，应用于个人最关注的职业或研究领域。",
        ]),
        ("核心课程（Catalog）", [
            "MAPP 6000 The Foundation and Future of Positive Psychology",
            "MAPP 6010 Research Methods and Evaluation",
            "MAPP 6020 Foundations of Positive Interventions",
            "MAPP 6030 Perspectives on Well-Being",
            "MAPP 7080 Positive Psychology and Individuals",
            "MAPP 7100 Humanities and Human Flourishing",
            "MAPP 7120 The Psychology & Neuroscience of Character",
            "MAPP 7140 Applying Positive Interventions in Institutions",
            "MAPP 8000 Capstone",
        ]),
        ("毕业要求", [
            "完成 9 门课程（8 门核心 + 1 门 Capstone）",
            "1 年连续 Fall/Spring/Summer 学期全日制读完",
        ]),
    ],
    "信息来源：UPenn Catalog 2026-27 官方页面。截止/语言/GRE/学费在 catalog 项目页未公布，按口径留空待补。"
)
open("details/up-c4e6bf6.html","w",encoding="utf-8").write(p1)

# 2. Government Administration (FT) MPA — 覆盖 up-c250a59.html
p2 = page(
    '<a href="../index_main.html">← 返回项目库</a> / 宾大 · Fels 政府研究所',
    "Government Administration (FT) MPA - UPenn",
    "政府管理硕士（全日制）",
    "Master of Public Administration in Government Administration (Full-Time)",
    ["宾大 UPenn", "Fels Institute", "MPA", "全日制", "非STEM"],
    [
        ("学位", "MPA (Master of Public Administration, Government Administration, Full-Time)"),
        ("所属学院", "Fels Institute of Government · School of Arts and Sciences"),
        ("学制", "10 Course Units；全日制"),
        ("学习方式", "全日制在校（与 Executive MPA 在职版对应）"),
        ("STEM", "否（公共管理/政策职业型硕士）"),
        ("官网", '<a href="https://catalog.upenn.edu/graduate/programs/government-administration-mpaf/" target="_blank">catalog.upenn.edu</a>'),
    ],
    [
        ("项目概览", [
            "Fels 政府研究所全日制 MPA，培养公共部门、非营利组织与政策领域的管理者与分析者。",
            "提供多方向：Individualized / Political Advocacy / Domestic Policy / Non-Profit Management / International Affairs / Data Analytics 等。",
            "与 Executive MPA（在职高管版）同一学院，本项目为全日制应届/转型者设计。",
        ]),
        ("核心课程（Catalog）", [
            "GAFL 6110 Statistics for Public Policy",
            "GAFL 6210 Public Economics",
            "GAFL 6310 Policymaking Under Constraints",
            "GAFL 6400 Program Evaluation and Data Analysis",
            "GAFL 6520 Financial Management of Public and Nonprofit Organizations",
            "GAFL 5310 Data Science for Public Policy",
            "GAFL 7980 MPA Capstone I / GAFL 7990 MPA Capstone II",
            "GAFL 8990 Public Administration Internship",
        ]),
        ("毕业要求", [
            "完成 10 Course Units（含 Capstone 与实习）",
            "GPA 3.0 以上；C 以下课程不计学位",
        ]),
    ],
    "信息来源：UPenn Catalog 2026-27 官方页面。注意：同 slug 系列另有 Government Administration (Exec) 在职高管 MPA，按口径排除；本页为 Full-Time 全日制版。截止/语言/GRE/学费在 catalog 项目页未公布，按口径留空待补。"
)
open("details/up-c250a59.html","w",encoding="utf-8").write(p2)

# 3. International MPA (I-MPA) — 新建 up-impa.html
p3 = page(
    '<a href="../index_main.html">← 返回项目库</a> / 宾大 · SAS/LPS 国际公共管理',
    "International MPA (I-MPA) - UPenn",
    "国际公共管理硕士",
    "International Master of Public Administration (I-MPA)",
    ["宾大 UPenn", "SAS/LPS", "I-MPA", "1年全日制", "非STEM"],
    [
        ("学位", "I-MPA (International Master of Public Administration)"),
        ("所属学院", "School of Arts and Sciences · College of Liberal and Professional Studies (LPS)"),
        ("学制", "12 Course Units；1 年全日制 cohort"),
        ("学习方式", "全日制在校（case-based cohort 模式）"),
        ("STEM", "否（公共/国际事务职业型硕士）"),
        ("官网", '<a href="https://catalog.upenn.edu/graduate/programs/international-mpa/" target="_blank">catalog.upenn.edu</a>'),
    ],
    [
        ("项目概览", [
            "跨学科、多语言、多国师资的 1 年 cohort 项目，面向全球治理、公共部门与非营利领域的 problem-solving leaders。",
            "案例教学覆盖国际、国家与地方治理与领导力议题。",
            "通过 evening sessions 邀请美国政府、企业与非营利现任/前领导人讲座。",
        ]),
        ("核心课程（Catalog）", [
            "IMPA 6010 Critical Issues in Governance—Strategic Management",
            "IMPA 6030 Quantitative Reasoning for Real-Time Problem-Solving",
            "IMPA 6040 Collaboration Across Sectors: Boundary Spanning Leadership",
            "IMPA 6055 Economic Reasoning for Strategic Decision-Making",
            "IMPA 6060 Critical Issues in Global Leadership Ethics",
            "IMPA 6080 Global Leadership and Global Health in Developing Countries",
            "IMPA 6095 Global Problem-Solving and Program Evaluation—Elder Care in Asia",
            "IMPA 6100 Leadership Theory, Practice, and Biographical Analysis",
            "IMPA 6200 Global Leadership—Exploring Existential Threats to Human Well-Being",
        ]),
        ("毕业要求", [
            "完成 12 Course Units",
            "每学期与学术顾问及 I-MPA Faculty-Senior Staff Committee 开会（围绕 Capstone）",
        ]),
    ],
    "信息来源：UPenn Catalog 2026-27 官方页面。截止/语言/GRE/学费在 catalog 项目页未公布，按口径留空待补。"
)
open("details/up-impa.html","w",encoding="utf-8").write(p3)

# 4. MPH — 新建 up-mph.html
p4 = page(
    '<a href="../index_main.html">← 返回项目库</a> / 宾大 · 跨学院公共卫生',
    "Public Health MPH - UPenn",
    "公共卫生硕士",
    "Master of Public Health (MPH)",
    ["宾大 UPenn", "Perelman 医学院", "MPH", "2年全日制", "非STEM"],
    [
        ("学位", "MPH (Master of Public Health)"),
        ("所属学院", "University-wide interdisciplinary program，核心单位为 Perelman School of Medicine 与 DBEI 系"),
        ("学制", "14 Credit Units + 125 小时 APE；2 年全日制（或 3 年兼读）"),
        ("学习方式", "全日制为主（Epidemiology track 仅限全日制）；兼读可选"),
        ("STEM", "否（公共卫生职业型硕士；Epi track 偏研究但 MPH 整体职业导向）"),
        ("官网", '<a href="https://catalog.upenn.edu/graduate/programs/public-health-mph/" target="_blank">catalog.upenn.edu</a>'),
    ],
    [
        ("项目概览", [
            "宾大跨学院 MPH，提供 Generalist / Global Health / One Health / Epidemiology 等方向。",
            "One Health track 与宾大兽医学院紧密合作；Epidemiology track 与 Graduate Group of Epidemiology and Biostatistics 合办，名额有限、竞争激烈。",
            "全日制学生通常 2 年完成；GPA 需保持 3.0 以上，每课需 B- 以上方可计入学位。",
        ]),
        ("核心课程（Catalog）", [
            "PUBH 5010 Introduction to Biostatistics",
            "PUBH 5020 Introduction to the Principles and Methods of Epidemiology",
            "PUBH 5040 Public Health Theories & Frameworks",
            "PUBH 5050 Public Health Policy",
            "另含 6 门选修课 + APE（Applied Practice Experience）+ Capstone Project",
        ]),
        ("毕业要求", [
            "完成 14 Credit Units",
            "完成至少 125 小时 community-based public health work（APE）",
            "完成 Capstone Project",
            "GPA 3.0 以上，每课 B- 以上",
        ]),
    ],
    "信息来源：UPenn Catalog 2026-27 官方页面。截止/语言/GRE/学费在 catalog 项目页未公布，按口径留空待补。"
)
open("details/up-mph.html","w",encoding="utf-8").write(p4)

# 5. SMART M.S.Ed. — 新建 up-smart.html
p5 = page(
    '<a href="../index_main.html">← 返回项目库</a> / 宾大 · GSE 教育统计与测量',
    "Statistics, Measurement, Assessment, and Research Technology (SMART) M.S.Ed. - UPenn",
    "统计、测量、评估与研究技术硕士",
    "M.S.Ed. in Statistics, Measurement, Assessment, and Research Technology (SMART)",
    ["宾大 UPenn", "GSE", "SMART M.S.Ed.", "全日制/兼读", "STEM"],
    [
        ("学位", "M.S.Ed. in Statistics, Measurement, Assessment, and Research Technology (SMART)"),
        ("所属学院", "Graduate School of Education (GSE)"),
        ("学制", "10 Course Units；全日制或兼读"),
        ("学习方式", "在校（full-time 每学期 ≥3 CUs；part-time 1–2 CUs/学期）"),
        ("STEM", "是（统计/测量/数据方法/实验设计）"),
        ("官网", '<a href="https://catalog.upenn.edu/graduate/programs/statistics-measurement-assessment-research-technology-msed/" target="_blank">catalog.upenn.edu</a>'),
    ],
    [
        ("项目概览", [
            "SMART 培养研究与评估组织、公共机构、政府部门（教育/心理/相关人类服务领域）所需的统计与测量专业人才。",
            "课程覆盖数据分析、测量理论与测验构建、问卷设计、随机对照试验与准实验设计、评估策略、统计分析与报告。",
            "毕业生去向：学区、政府机构、研究中心、教育测评公司、教育研究机构的研究员与统计分析师。",
        ]),
        ("核心课程（Catalog）", [
            "EDUC 6625 Data Processing and Analysis",
            "EDUC 6680 Evaluation of Policies, Programs and Projects",
            "EDUC 6683 Survey Design",
            "另含测量理论、统计方法、实验设计等选修与 Comprehensive Examination",
        ]),
        ("毕业要求", [
            "完成 10 Course Units",
            "修读课程结束时参加 Comprehensive Examination",
            "（入学前未修 EDUC 6667 或同等课程者需补修，part-time 与 full-time 同等要求）",
        ]),
    ],
    "信息来源：UPenn Catalog 2026-27 官方页面。截止/语言/GRE/学费在 catalog 项目页未公布，按口径留空待补。"
)
open("details/up-smart.html","w",encoding="utf-8").write(p5)

print("5 pages written")
for f in ["details/up-c4e6bf6.html","details/up-c250a59.html","details/up-impa.html","details/up-mph.html","details/up-smart.html"]:
    print(f, os.path.getsize(f))
