    /* ===== Hero ===== */
    .page-hero {
      background: var(--bg-light, #f5f5f5);
      padding: 72px 16px 40px;
      text-align: center;
      color: var(--text-dark, #1a1a1a);
      position: relative;
      overflow: hidden;
      border-bottom: 1px solid var(--border, #e5e7eb);
    }
    .page-hero::before {
      content: '';
      position: absolute; inset: 0;
      background:
        radial-gradient(circle at 85% 15%, rgba(79, 70, 229, 0.1) 0%, transparent 45%);
    }
    .page-hero h1 { font-size: clamp(1.8rem,3.5vw,2.8rem); font-weight:900; margin-bottom:12px; letter-spacing:-0.5px; position:relative; }
    .page-hero p { font-size:1rem; color:var(--text-light, #757575); max-width:620px; margin:0 auto 20px; position:relative; }
    .page-hero .hero-stats {
      display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
      position: relative;
    }
    .page-hero .hero-stat {
      display: flex; flex-direction: column; align-items: center;
    }
    .page-hero .hero-stat-num { font-size: 1.9rem; font-weight: 900; color: var(--accent, #4caf50); line-height: 1; }
    .page-hero .hero-stat-lbl { font-size: 0.75rem; color: var(--text-light, #757575); font-weight: 600; margin-top: 4px; }

    .programs-section {
      background: var(--bg-light, #f5f5f5);
    }

    /* ===== Sticky Toolbar（搜尋 + 篩選 chips 一併吸頂）===== */
    .prog-search-bar {
      padding: 0;
    }

    .prog-toolbar {
      background: transparent;
      border-bottom: none;
      padding: 8px 16px 8px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: none;
      transition:
        top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        backdrop-filter 0.28s ease;
    }
    .prog-toolbar.is-stuck {
      background: rgba(255, 255, 255, 0.88);
      -webkit-backdrop-filter: blur(12px) saturate(1.15);
      backdrop-filter: blur(12px) saturate(1.15);
      border-bottom: 1px solid rgba(226, 232, 240, 0.75);
      box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    }
    .prog-toolbar-inner {
      max-width: 100%;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }
    .tb-chips-stack {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
      /* 横滑 chip 行突破 toolbar 左右 padding，避免首尾标签被边距裁切 */
      margin: 0 -16px;
    }
    .tb-chip-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      width: 100%;
    }
    .tb-chip-row-label {
      flex-shrink: 0;
      width: 2.25em;
      font-size: 0.72rem;
      font-weight: 800;
      color: var(--text-mid, #334155);
      letter-spacing: 0.02em;
      line-height: 1.2;
    }
    .tb-chip-row .tb-chips {
      flex: 1;
      min-width: 0;
    }
    .tb-search {
      width: 100%;
      flex: none;
    }
    .tb-search-box {
      display: flex;
      align-items: center;
      width: 100%;
      height: 40px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      background: #fff;
      transition: border-color 0.2s ease;
    }
    .tb-search-box:hover,
    .tb-search-box:focus-within {
      border-color: var(--primary);
    }
    .tb-search-icon {
      flex-shrink: 0;
      width: 40px;
      text-align: center;
      color: var(--text-light);
      font-size: 0.82rem;
      line-height: 1;
      pointer-events: none;
      transition: color 0.2s ease;
    }
    .tb-search-box:hover .tb-search-icon,
    .tb-search-box:focus-within .tb-search-icon {
      color: var(--primary);
    }
    .tb-search-box input {
      flex: 1;
      min-width: 0;
      padding: 0 12px 0 0;
      margin: 0;
      border: none;
      outline: none;
      font-size: 0.875rem;
      font-family: inherit;
      background: transparent;
    }
    .tb-chips {
      display: flex;
      align-items: center;
      gap: 5px;
      flex: 1;
      min-width: 0;
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 2px 16px;
      scroll-padding-inline: 16px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .tb-chips::-webkit-scrollbar {
      display: none;
    }
    .tb-chip {
      padding: 5px 11px;
      border-radius: 100px;
      border: 1px solid var(--border);
      background: var(--bg-card, #fff);
      box-shadow: none;
      font-size: 0.74rem; font-weight: 700;
      line-height: 1.2;
      min-height: 28px;
      color: var(--text-dark, #0f172a);
      cursor: pointer;
      transition: var(--transition);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .tb-chip.active {
      background: var(--primary, #4f46e5);
      border-color: var(--primary, #4f46e5);
      color: #fff;
    }
  /* 第一行學校：選中統一主色（不用各校色） */
    .tb-chip-row--uni .tb-chip.active {
      background: var(--primary, #4f46e5);
      border-color: var(--primary, #4f46e5);
      color: #fff;
    }
    .tb-chip-row--uni .tb-chip.active .uni-logo-img {
      background: #fff;
      border-radius: 4px;
      padding: 1px;
      box-sizing: border-box;
    }
    /* ===== Layout ===== */
    .prog-layout {
      max-width: 100%;
      margin: 0 auto;
      padding: 12px 16px 32px;
      display: flex;
      gap: 28px;
      align-items: flex-start;
    }

    /* ===== Sidebar（移動端隱藏）===== */
    .prog-sidebar {
      display: none;
    }
    .sidebar-section { margin-bottom: 22px; }
    .sidebar-title {
      font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
      letter-spacing: 0.6px; color: var(--text-light);
      margin-bottom: 8px; padding: 0 4px;
    }
    .sidebar-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 12px;
      border-radius: var(--radius-sm);
      font-size: 0.82rem; font-weight: 600; color: var(--text-mid);
      cursor: pointer;
      transition: var(--transition);
      border: none; background: none; width: 100%; text-align: left;
    }
    .sidebar-item:hover { background: var(--bg-light); color: var(--primary); }
    .sidebar-item.active { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); font-weight: 800; }
    .sidebar-badge {
      font-size: 0.68rem; font-weight: 700;
      background: var(--bg-light);
      color: var(--text-light);
      padding: 2px 7px; border-radius: 100px;
    }
    .sidebar-item.active .sidebar-badge { background: var(--primary); color: white; }

    /* ===== Main Content ===== */
    .prog-main { flex: 1; min-width: 0; }

    /* 院校分區 */
    .uni-section { margin-bottom: 22px; }
    .uni-section-header {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      margin-bottom: 8px;
      padding: 0;
    }
    .uni-logo-badge {
      width: 48px; height: 48px;
      border-radius: 12px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      background: #fff;
      border: 1px solid var(--border);
      padding: 5px;
      box-shadow: var(--shadow-sm);
    }
    .uni-logo-img {
      display: block;
      object-fit: contain;
      flex-shrink: 0;
    }
    .uni-logo-img.uni-logo-lg { width: 100%; height: 100%; }
    .uni-logo-img.uni-logo-sm { width: 18px; height: 18px; }
    .uni-logo-img.uni-logo-md { width: 22px; height: 22px; }
    .uni-logo-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .uni-logo-label > span { min-width: 0; }
    .tb-chip .uni-logo-img.uni-logo-sm { width: 16px; height: 16px; }
    .tb-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .sidebar-item > span:first-child,
    .sidebar-item .uni-logo-label {
      flex: 1;
      text-align: left;
    }
    .uni-section-name {
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--text-dark);
      letter-spacing: 0.02em;
    }
    .uni-prog-count {
      font-size: 0.72rem; font-weight: 600;
      color: var(--text-light);
      flex-shrink: 0;
    }

    .faculty-group { margin-bottom: 16px; }

    /* 學院 Info Day & 彈性收生 */
    .faculty-info-panel {
      margin-bottom: 10px;
      padding: 8px 12px;
      background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      transition: padding 0.2s ease;
    }
    .faculty-info-panel.is-expanded {
      padding: 12px 14px;
      margin-bottom: 14px;
    }
    .faculty-info-panel.hku  { border-left: 3px solid var(--hku); }
    .faculty-info-panel.ust  { border-left: 3px solid var(--ust); }
    .faculty-info-panel.cuhk { border-left: 3px solid var(--cuhk); }
    .faculty-info-panel.cityu { border-left: 3px solid var(--cityu); }
    .faculty-info-panel.polyu { border-left: 3px solid var(--polyu); }
    .faculty-info-panel.hkbu { border-left: 3px solid var(--hkbu); }
    .faculty-info-panel.lingu { border-left: 3px solid var(--lingu); }
    .faculty-info-panel.eduhk { border-left: 3px solid var(--eduhk); }
    .faculty-info-panel--modal {
      margin-bottom: 0;
      background: var(--bg-light);
    }
    .faculty-info-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 0;
      flex-wrap: wrap;
    }
    .faculty-info-panel.is-expanded .faculty-info-head {
      margin-bottom: 12px;
    }
    .faculty-info-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex: 1;
      min-width: 0;
      padding: 4px 2px;
      margin: 0;
      border: none;
      background: transparent;
      cursor: pointer;
      text-align: left;
      border-radius: 6px;
      transition: background 0.15s ease;
    }
    .faculty-info-toggle:hover {
      background: rgba(255, 255, 255, 0.65);
    }
    .faculty-info-toggle:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }
    .faculty-info-chevron {
      font-size: 0.7rem;
      color: var(--text-light);
      flex-shrink: 0;
      transition: transform 0.22s ease;
    }
    .faculty-info-panel.is-expanded .faculty-info-chevron {
      transform: rotate(180deg);
    }
    .faculty-info-title {
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--text-dark);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .faculty-info-title i { color: var(--primary); font-size: 0.85rem; }
    .faculty-info-link {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--primary);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .faculty-info-link:hover { text-decoration: underline; }
    .faculty-info-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }
    .faculty-info-card {
      background: white;
      border-radius: 8px;
      padding: 12px 14px;
      border: 1px solid rgba(0,0,0,0.06);
    }
    .faculty-info-card h5 {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-light);
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.35px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .faculty-info-card h5 i { color: var(--primary); }
    .faculty-info-card p {
      font-size: 0.8rem;
      color: var(--text-mid);
      line-height: 1.65;
      margin: 0;
    }
    .faculty-info-card .fi-hl {
      color: var(--primary);
      font-weight: 700;
    }
    .fi-details {
      margin-top: 10px;
      border-top: 1px dashed rgba(148, 163, 184, 0.55);
      padding-top: 8px;
    }
    .fi-details-summary {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      list-style: none;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--primary);
      user-select: none;
    }
    .fi-details-summary::-webkit-details-marker {
      display: none;
    }
    .fi-details-summary::before {
      content: '\f054';
      font-family: 'Font Awesome 6 Free';
      font-weight: 900;
      font-size: 0.62rem;
      transition: transform 0.2s ease;
    }
    .fi-details[open] .fi-details-summary::before {
      transform: rotate(90deg);
    }
    .fi-details-body {
      margin-top: 8px;
      font-size: 0.8rem;
      color: var(--text-mid);
      line-height: 1.65;
    }
    .pd-faculty-info-grid .req-val .fi-details-body {
      font-size: inherit;
      font-weight: 500;
    }
    .pd-section--faculty-info {
      padding-top: 0;
    }
    .pd-section--faculty-info .faculty-info-panel {
      margin-bottom: 0;
    }
    .pd-section-title--row {
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }
    .pd-section-title--row .faculty-info-link {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--primary);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      text-transform: none;
      letter-spacing: 0;
    }
    .pd-section-title--row .faculty-info-link:hover {
      text-decoration: underline;
    }
    .pd-faculty-info-grid .req-label i {
      margin-right: 4px;
      color: var(--primary);
    }
    .pd-faculty-info-grid .req-val {
      font-weight: 600;
      line-height: 1.65;
    }
    .pd-faculty-info-grid .req-val .fi-hl {
      color: var(--primary);
      font-weight: 700;
    }
    .faculty-info-grid { grid-template-columns: 1fr; }
    .pd-faculty-info-grid { grid-template-columns: 1fr; }

    /* ===== Program Card =====
       資訊層級（自上而下）：
       L1 課程名稱：中文（粗）+ 英文（淡）；院校 logo 在卡片右上角
       L2 個人洞察：加權分（主）+ 錄取概率（副）
       L3 標籤行：JUPAS 代碼 + 年制 + 分類標籤
       L4 參考數據：歷年 LQ / 中位数 / UQ（弱化）
    */
    .prog-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .prog-card {
      background: white;
      border: none;
      border-radius: var(--radius-md, 12px);
      padding: 12px 14px;
      transition: var(--transition);
      cursor: pointer;
      text-decoration: none;
      display: block;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-card);
    }
    .prog-card:hover {
      border-color: var(--primary);
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }

    .prog-card-uni-logo {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      flex-shrink: 0;
      pointer-events: none;
    }
    .prog-card-uni-logo .uni-logo-img.uni-logo-sm {
      width: 100%;
      height: 100%;
    }
    .prog-fact {
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--text-light);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }
    .prog-fact i {
      font-size: 0.7rem;
      opacity: 0.7;
    }

    /* L2：課程名稱 */
    .prog-card-title {
      margin-bottom: 8px;
      padding-right: 26px;
    }
    .prog-name {
      font-size: 0.88rem; font-weight: 800;
      color: var(--text-dark); line-height: 1.35;
    }
    .prog-name-en {
      font-size: 0.66rem; color: var(--text-light);
      font-weight: 500; margin-top: 2px;
      line-height: 1.25;
    }
    .prog-code-tag,
    .prog-tag {
      font-size: 0.68rem;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 100px;
      white-space: nowrap;
      background: var(--bg-light);
      color: var(--text-light);
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .prog-code-tag {
      font-size: 0.65rem;
      font-family: 'Space Mono', monospace;
      letter-spacing: 0.02em;
    }
    .prog-tag i,
    .prog-code-tag i {
      font-size: 0.62rem;
      opacity: 0.85;
    }

    /* L2：個人洞察 — 加權分與錄取概率各半 */
    .prog-corner {
      padding: 8px 4px 10px;
      border-radius: 8px;
      margin-top: 0;
      margin-bottom: 0;
      min-height: 64px;
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--border, #e5e7eb);
    }
    .prog-corner[data-level="mid"],
    .prog-corner[data-level="low"] {
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--border, #e5e7eb);
    }
    .prog-corner--empty,
    .prog-corner--placeholder {
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--border, #e5e7eb);
      min-height: auto;
    }
    .prog-corner-head {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 0.58rem;
      font-weight: 800;
      color: var(--text-light);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .prog-corner-head i {
      font-size: 0.6rem;
      opacity: 0.75;
    }
    .prog-corner-placeholder-text {
      margin: 0;
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--text-light);
      line-height: 1.4;
    }
    .prog-corner-metrics {
      display: flex;
      align-items: flex-start;
      gap: 0;
      padding-top: 4px;
    }
    .prog-corner-divider {
      width: 1px;
      align-self: stretch;
      min-height: 40px;
      margin: 3px 12px 0;
      background: rgba(15, 23, 42, 0.1);
      flex-shrink: 0;
    }
    .prog-corner-metric {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }
    .prog-corner-metric--hero {
      flex: 1;
      align-items: center;
      text-align: center;
    }
    .prog-corner-metric--side {
      flex: 1;
      align-items: center;
      text-align: center;
      padding: 2px 0;
      gap: 0;
    }
    .prog-corner-metric--side .prog-corner-lbl {
      margin-bottom: 4px;
    }
    .prog-corner-metric--side .prog-corner-val-slot {
      min-height: 1.15rem;
    }
    .prog-corner-val-slot {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 1.35rem;
      width: 100%;
    }
    .prog-corner-lbl {
      font-size: 0.66rem;
      font-weight: 800;
      color: var(--text-light);
      white-space: nowrap;
      letter-spacing: 0.04em;
    }
    .prog-corner-val {
      font-weight: 900;
      line-height: 1;
      color: var(--text-dark);
    }
    .prog-corner-metric--hero .prog-corner-val-slot {
      min-height: 1.55rem;
    }
    .prog-corner-val--prob {
      font-size: 1.45rem;
    }
    .prog-corner-val--score {
      font-size: 1.08rem;
      color: var(--text-dark);
      letter-spacing: -0.02em;
    }
    .prog-corner-val--high { color: var(--primary-light, #6366f1); }
    .prog-corner-val--green-zone { color: #00b86a; }
    .prog-corner-val--mid { color: var(--accent-warm); }
    .prog-corner-val--low { color: #e03555; }
    .prog-corner-val--warn {
      font-size: 0.95rem;
      color: #e03555;
    }
    .prog-corner--empty .prog-corner-val--prob,
    .prog-corner--empty .prog-corner-val--score {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--text-light);
    }
    .prog-corner-delta {
      display: inline-flex;
      align-items: baseline;
      justify-content: center;
      gap: 3px;
      margin-top: 2px;
      width: 100%;
      white-space: nowrap;
      line-height: 1.25;
      text-align: center;
    }
    .prog-corner-delta-lbl {
      font-size: 0.62rem;
      font-weight: 700;
      color: var(--text-light);
      opacity: 0.55;
      letter-spacing: 0.02em;
    }
    .prog-corner-delta-val {
      font-size: 0.8rem;
      font-weight: 900;
      letter-spacing: -0.01em;
    }
    .prog-corner-delta-val--high { color: var(--primary-light, #6366f1); }
    .prog-corner-delta-val--green-zone { color: #00b86a; }
    .prog-corner-delta-val--mid { color: var(--accent-warm); }
    .prog-corner-delta-val--low { color: #e03555; }

    /* L3：JUPAS 編號 + 年制 + 分類標籤 */
    .prog-tag-row {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .prog-tag-row-end {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
    }
    /* L4：歷年收生參考 — 弱化，不與個人估算搶眼 */
    .prog-scores-wrap {
      padding-top: 7px;
      border-top: none;
    }
    .prog-scores-lbl {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 0.56rem;
      font-weight: 800;
      color: var(--text-light);
      letter-spacing: 0.05em;
      text-transform: uppercase;
      margin-bottom: 5px;
      opacity: 0.85;
    }
    .prog-scores-lbl i {
      font-size: 0.58rem;
    }
    .score-est-badge {
      display: inline-flex;
      align-items: center;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 0.55rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: none;
      color: #94a3b8;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
      line-height: 1.3;
      vertical-align: middle;
    }
    .prog-scores {
      display: flex;
      align-items: stretch;
      background: #f8fafc;
      border-radius: 8px;
      overflow: hidden;
    }
    .prog-score-item {
      flex: 1;
      text-align: center;
      padding: 4px 5px;
    }
    .prog-score-item + .prog-score-item {
      border-left: 1px solid var(--border, #e5e7eb);
    }
    .prog-score-item .sc-val {
      display: block;
      font-size: 0.76rem;
      font-weight: 800;
      color: var(--text-mid, #64748b);
      line-height: 1.1;
      margin-bottom: 2px;
    }
    .prog-score-item .sc-label {
      font-size: 0.58rem;
      font-weight: 700;
      color: var(--text-light);
      display: block;
      letter-spacing: 0.02em;
    }
    .prog-score-item.median .sc-val {
      color: var(--text-mid, #64748b);
    }
    .prog-score-item .sc-val.na {
      color: var(--border);
      font-size: 0.7rem;
    }

    /* No results */
    .no-results {
      text-align: center; padding: 80px 20px;
      color: var(--text-light);
      display: none;
    }
    .no-results i { font-size: 3rem; margin-bottom: 16px; display: block; opacity: 0.3; }
    .no-results p { font-size: 1rem; font-weight: 700; }
    .no-results small { font-size: 0.85rem; }

    /* Uni anchor sections */
    .uni-anchor { scroll-margin-top: 140px; }
    .prog-card {
      scroll-margin-top: 140px;
      content-visibility: auto;
      contain-intrinsic-size: auto 132px;
    }

    /* ===== Prog Card as button ===== */
    .prog-card {
      cursor: pointer;
      transition: transform 0.18s, box-shadow 0.18s;
    }
    .prog-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 8px 28px rgba(0,0,0,0.13);
    }
    .prog-card { position: relative; }

    /* ===== Program Detail Modal ===== */
    .pd-overlay {
      position: fixed; inset: 0;
      background: rgba(10,20,50,0.55);
      backdrop-filter: blur(4px);
      z-index: 9000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s;
    }
    .pd-overlay.open {
      opacity: 1;
      pointer-events: all;
    }
    .pd-modal {
      background: white;
      border-radius: 20px;
      width: 100%;
      max-width: min(720px, var(--app-max-width, 600px));
      --pd-modal-height: min(92dvh, 92vh, calc(100dvh - 40px), calc(100vh - 40px));
      height: var(--pd-modal-height);
      min-height: var(--pd-modal-height);
      max-height: var(--pd-modal-height);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      box-shadow: 0 24px 80px rgba(0,0,0,0.25);
      transform: translateY(20px) scale(0.97);
      transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    }
    .pd-overlay.open .pd-modal {
      transform: translateY(0) scale(1);
    }
    /* Modal header */
    .pd-header {
      padding: 20px 24px 14px 24px;
      border-bottom: none;
      position: relative;
      flex-shrink: 0;
      background: var(--bg-light, #f8fafc);
      border-top-left-radius: inherit;
      border-top-right-radius: inherit;
    }
    .pd-header.hku  { border-top: 4px solid var(--hku); }
    .pd-header.ust  { border-top: 4px solid var(--ust); }
    .pd-header.cuhk { border-top: 4px solid var(--cuhk); }
    .pd-header.cityu { border-top: 4px solid var(--cityu); }
    .pd-header.polyu { border-top: 4px solid var(--polyu); }
    .pd-header.hkbu { border-top: 4px solid var(--hkbu); }
    .pd-header.lingu { border-top: 4px solid var(--lingu); }
    .pd-header.eduhk { border-top: 4px solid var(--eduhk); }
    .pd-close {
      position: absolute; top: 14px; right: 16px;
      width: 32px; height: 32px;
      border-radius: 50%;
      border: none;
      background: rgba(0,0,0,0.05);
      color: var(--text-dark);
      font-size: 1.1rem;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.15s;
    }
    .pd-close:hover { background: rgba(0,0,0,0.1); }
    .pd-uni-badge {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 0.72rem; font-weight: 800;
      padding: 4px 12px 4px 6px;
      border-radius: 100px;
      margin-bottom: 8px;
      background: white;
      box-shadow: var(--shadow-sm);
      max-width: calc(100% - 72px);
      flex-wrap: wrap;
    }
    .pd-uni-badge .uni-logo-img.uni-logo-sm { width: 20px; height: 20px; }
    .pd-uni-badge.hku  { background: rgba(30,58,138,0.12); color: var(--hku); }
    .pd-uni-badge.ust  { background: rgba(0,63,122,0.12);  color: var(--ust); }
    .pd-uni-badge.cuhk { background: rgba(107,13,13,0.12); color: var(--cuhk); }
    .pd-uni-badge.cityu { background: rgba(200,16,46,0.12); color: var(--cityu); }
    .pd-uni-badge.polyu { background: rgba(160,35,55,0.12); color: var(--polyu); }
    .pd-uni-badge.hkbu { background: rgba(0,60,113,0.12); color: var(--hkbu); }
    .pd-uni-badge.lingu { background: rgba(183,129,5,0.14); color: var(--lingu); }
    .pd-uni-badge.eduhk { background: rgba(122,31,122,0.12); color: var(--eduhk); }
    .pd-title {
      font-size: 1.15rem; font-weight: 900;
      color: var(--text-dark);
      margin-bottom: 2px;
      line-height: 1.3;
      max-width: none;
    }
    .pd-title-en {
      font-size: 0.78rem; color: var(--text-light);
      margin-bottom: 10px;
      max-width: none;
    }
    .pd-meta-row {
      display: flex; gap: 10px; flex-wrap: wrap;
      align-items: center;
    }
    .pd-code {
      font-size: 0.68rem; font-weight: 800;
      padding: 2px 8px;
      border-radius: 100px;
      letter-spacing: 0.5px;
    }
    .pd-code.hku  { background: rgba(30,58,138,0.1);  color: var(--hku); }
    .pd-code.ust  { background: rgba(0,63,122,0.1);   color: var(--ust); }
    .pd-code.cuhk { background: rgba(107,13,13,0.1);  color: var(--cuhk); }
    .pd-code.cityu { background: rgba(200,16,46,0.1); color: var(--cityu); }
    .pd-code.polyu { background: rgba(160,35,55,0.1); color: var(--polyu); }
    .pd-code.hkbu { background: rgba(0,60,113,0.1); color: var(--hkbu); }
    .pd-code.lingu { background: rgba(183,129,5,0.12); color: var(--lingu); }
    .pd-code.eduhk { background: rgba(122,31,122,0.1); color: var(--eduhk); }
    .pd-modal .prog-tag,
    .pd-modal .prog-code-tag {
      font-size: 0.65rem;
      padding: 2px 7px;
      background: #fff;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }
    .pd-modal .prog-tag i,
    .pd-modal .prog-code-tag i {
      font-size: 0.58rem;
    }
    .pd-pill {
      font-size: 0.68rem; font-weight: 700;
      padding: 2px 8px;
      border-radius: 100px;
      background: var(--bg-light);
      color: var(--text-light);
      display: inline-flex; align-items: center; gap: 4px;
    }
    .pd-pill.detail {
      background: linear-gradient(135deg, #fef3c7, #fde68a);
      color: #78350f;
      font-weight: 800;
    }
    .pd-pill.years {
      background: #fff;
      color: var(--text-mid, #64748b);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }
    .prog-tag.years {
      background: #eef1f8;
      color: var(--text-mid, #64748b);
    }
    .pd-prediction-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 10px;
      margin-bottom: 2px;
      border: 1px solid #e0e7ff;
      background: #f5f8ff;
    }
    .pd-prediction-banner--mid {
      border-color: #fef3c7;
      background: #fffdf7;
    }
    .pd-prediction-banner--low {
      border-color: #fee2e2;
      background: #fffafa;
    }
    .pd-prediction-banner--rich {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }
    .pd-prediction-metrics {
      display: flex;
      justify-content: space-around;
      gap: 10px;
      text-align: center;
    }
    .pd-prediction-metric {
      flex: 1;
      min-width: 0;
    }
    .pd-prediction-metric-lbl {
      display: block;
      font-size: 0.65rem;
      font-weight: 800;
      color: var(--text-light);
      margin-bottom: 4px;
      letter-spacing: 0.04em;
    }
    .pd-prediction-metric-val {
      font-size: 1.4rem;
      font-weight: 900;
      line-height: 1;
    }
    .pd-prediction-metric-val--score { color: var(--text-dark); }
    .pd-prediction-metric-val--high { color: var(--primary-light, #6366f1); }
    .pd-prediction-metric-val--green-zone { color: #00b86a; }
    .pd-prediction-metric-val--mid { color: #b45309; }
    .pd-prediction-metric-val--low { color: #e03555; }
    .pd-prediction-banner--green-zone {
      border-color: #d1e7d7;
      background: #f2faf4;
    }
    .pd-prediction-banner--green-zone .pd-prediction-delta {
      color: #15803d;
      background: #d1fae5;
    }
    .pd-prediction-banner-tail {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      padding-top: 2px;
      border-top: 1px solid rgba(15, 23, 42, 0.08);
    }
    .pd-prediction-main--note {
      flex: 1;
      min-width: 140px;
    }
    .pd-prediction-main--note i {
      font-size: 0.85rem;
      margin-top: 1px;
    }
    .pd-prediction-main--note > span {
      font-size: 0.68rem;
      color: var(--text-mid);
      line-height: 1.45;
    }
    .pd-prediction-main {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      font-size: 0.78rem;
      color: var(--text-mid);
      line-height: 1.45;
    }
    .pd-prediction-main i {
      font-size: 1.1rem;
      color: var(--primary);
      margin-top: 2px;
    }
    .pd-prediction-main strong {
      display: block;
      font-size: 0.9rem;
      color: var(--text-dark);
      margin-bottom: 2px;
    }
    .pd-prediction-delta {
      font-size: 0.82rem;
      font-weight: 800;
      white-space: nowrap;
      color: var(--primary);
    }

    /* 分數條 + 正文共用捲動區（頂部標題固定） */
    .pd-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }
    .pd-scores-strip {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }
    .pd-score-cell {
      text-align: center;
      padding: 10px 6px;
      border-right: 1px solid var(--border);
    }
    .pd-score-cell:last-child { border-right: none; }
    .pd-score-cell .sc-lbl {
      font-size: 0.65rem; font-weight: 700; color: var(--text-light);
      display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
    }
    .pd-score-cell .sc-num {
      font-size: 1.25rem; font-weight: 900;
    }
    .pd-score-cell.median .sc-num { color: var(--text-dark); }
    .pd-score-cell.low-cell .sc-num { color: #dc2626; }
    .pd-score-cell.high-cell .sc-num { color: var(--primary, #4f46e5); }
    /* Modal body */
    .pd-body {
      padding: 16px 20px 20px;
      background: white;
    }
    /* 課程詳情分頁：整體在 pd-scroll 內捲動，Tab 列 sticky 吸頂 */
    .pd-detail-tabs {
      display: block;
    }
    .pd-tablist {
      display: flex;
      flex-shrink: 0;
      gap: 0;
      margin: 0 0 14px;
      padding: 0 0 2px;
      background: white;
      border: none;
      border-bottom: 1px solid var(--border);
      border-radius: 0;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      justify-content: flex-start;
    }
    .pd-tablist.pd-tablist--sticky {
      position: sticky;
      top: 0;
      z-index: 3;
    }
    .pd-tablist::-webkit-scrollbar {
      display: none;
    }
    .pd-tab {
      flex: 0 0 auto;
      min-width: 5.25rem;
      margin: 0;
      border: none;
      border-bottom: 3px solid transparent;
      margin-bottom: -1px;
      border-radius: 0;
      background: transparent;
      color: var(--text-mid, #64748b);
      font-size: 0.8rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      padding: 9px 14px 11px;
      cursor: pointer;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
      white-space: nowrap;
      text-align: left;
    }
    .pd-tab:hover {
      color: var(--text-dark);
      background: rgba(0, 0, 0, 0.03);
    }
    .pd-tab[aria-selected="true"] {
      color: var(--primary);
      font-weight: 800;
      border-bottom-color: var(--primary);
      background: transparent;
      box-shadow: none;
    }
    .pd-tab:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: -2px;
      border-radius: 6px 6px 0 0;
    }
    .pd-tabpanels {
      display: block;
    }
    .pd-section {
      margin-bottom: 16px;
    }
    .pd-section:last-child { margin-bottom: 0; }
    .pd-section-title {
      font-size: 0.75rem; font-weight: 800;
      text-transform: uppercase; letter-spacing: 0.8px;
      color: var(--text-light);
      margin-bottom: 7px;
      display: flex; align-items: center; gap: 6px;
    }
    .pd-section-title i { color: var(--primary); }
    .pd-intro {
      font-size: 0.85rem; color: var(--text-dark);
      line-height: 1.6;
    }
    .pd-intro-careers {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border);
    }
    .pd-intro-careers .pd-section-title {
      margin-bottom: 8px;
    }

    /* ----- 課程簡介 / Info Day 分頁字級層級 -----
       L1 分區標題 · L2 正文 · L3 子標/欄位名 · L4 標籤/強調 · L5 分組提示 */
    .pd-tabpanel--course .pd-section-title,
    .pd-tabpanel--info .pd-section-title--row > span:first-child {
      font-size: 0.8125rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      text-transform: none;
      color: var(--text-dark);
      margin-bottom: 10px;
    }
    .pd-tabpanel--course .pd-section-title i,
    .pd-tabpanel--info .pd-section-title--row > span:first-child i {
      color: var(--primary);
    }
    .pd-tabpanel--course .pd-intro {
      font-size: 0.9375rem;
      font-weight: 500;
      color: var(--text-dark);
      line-height: 1.65;
    }
    .pd-tabpanel--course .pd-intro-careers {
      margin-top: 14px;
      padding-top: 12px;
    }
    .pd-tabpanel--course .pd-intro-careers .pd-section-title {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-light);
      margin-bottom: 8px;
    }
    .pd-tabpanel--course .pd-career-tag {
      font-size: 0.8125rem;
      font-weight: 600;
    }
    .pd-tabpanel--course .pd-req-item .req-label {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      margin-bottom: 5px;
    }
    .pd-tabpanel--course .pd-req-item .req-val {
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1.55;
    }
    .pd-tabpanel--course .pd-subj-group-label {
      font-size: 0.6875rem;
      font-weight: 800;
      color: var(--text-light);
      align-self: center;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .pd-tabpanel--course .pd-subj-group {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      align-items: center;
    }
    .pd-tabpanel--course .pd-subj-group--bonus {
      flex-basis: 100%;
    }
    .pd-tabpanel--course .pd-subj-pill {
      font-size: 0.8125rem;
    }
    .pd-tabpanel--info .pd-section-title--row {
      margin-bottom: 12px;
    }
    .pd-tabpanel--info .pd-section-title--row .faculty-info-link {
      font-size: 0.75rem;
      font-weight: 700;
    }
    .pd-tabpanel--info .pd-faculty-info-grid {
      gap: 10px;
    }
    .pd-tabpanel--info .pd-faculty-info-grid .pd-req-item {
      padding: 12px 14px;
    }
    .pd-tabpanel--info .pd-faculty-info-grid .req-label {
      font-size: 0.8125rem;
      font-weight: 800;
      color: var(--text-dark);
      text-transform: none;
      letter-spacing: 0.02em;
      margin-bottom: 6px;
      line-height: 1.35;
    }
    .pd-tabpanel--info .pd-faculty-info-grid .req-label i {
      font-size: 0.8rem;
    }
    .pd-tabpanel--info .pd-faculty-info-grid .req-val {
      font-size: 0.875rem;
      font-weight: 500;
      line-height: 1.65;
      color: var(--text-mid);
    }
    .pd-tabpanel--info .pd-faculty-info-grid .req-val .fi-hl {
      font-size: inherit;
      font-weight: 700;
      color: var(--primary);
    }

    /* Requirement rows */
    .pd-req-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .pd-req-item {
      background: var(--bg-light);
      border-radius: 10px;
      padding: 10px 12px;
    }
    .pd-req-item .req-label {
      font-size: 0.67rem; font-weight: 700; color: var(--text-light);
      margin-bottom: 4px; display: block;
      text-transform: uppercase; letter-spacing: 0.5px;
    }
    .pd-req-item .req-val {
      font-size: 0.85rem; font-weight: 700; color: var(--text-dark);
      line-height: 1.45;
    }
    /* Subject pills */
    .pd-subj-list {
      display: flex; flex-wrap: wrap; gap: 7px;
    }
    .pd-subj-group {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      align-items: center;
    }
    .pd-subj-group--bonus {
      flex-basis: 100%;
    }
    .pd-subj-pill {
      font-size: 0.7rem; font-weight: 700;
      padding: 4px 10px;
      border-radius: 8px;
      background: var(--bg-light);
      color: var(--text-dark);
      border: 1.5px solid var(--border);
    }
    .pd-subj-pill.must {
      background: var(--bg-tint);
      border-color: var(--border-mint);
      color: var(--primary);
    }
    .pd-subj-pill.rec {
      background: #eef2ff;
      border-color: #c7d2fe;
      color: var(--primary-dark, #3730a3);
    }
    .pd-subj-pill.adv {
      background: #fefce8;
      border-color: #fde68a;
      color: #92400e;
    }
    /* Career tags */
    .pd-career-list {
      display: flex; flex-wrap: wrap; gap: 8px;
    }
    .pd-career-tag {
      font-size: 0.72rem; font-weight: 700;
      padding: 4px 10px;
      border-radius: 100px;
      background: var(--bg-tint);
      border: 1.5px solid var(--border-mint);
      color: var(--primary);
    }
    /* My score indicator inside modal */
    .pd-myscore-bar {
      background: var(--bg-tint);
      border: 1.5px solid var(--border-mint);
      border-radius: 12px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .pd-myscore-num {
      font-size: 1.35rem;
      font-weight: 900;
      line-height: 1;
    }
    .pd-myscore-num.safe   { color: var(--primary, #4f46e5); }
    .pd-myscore-num.border { color: #d97706; }
    .pd-myscore-num.low    { color: #dc2626; }
    .pd-myscore-info { flex: 1; }
    .pd-myscore-label {
      font-size: 0.72rem; font-weight: 700; color: var(--text-light);
      margin-bottom: 3px;
    }
    .pd-myscore-verdict {
      font-size: 0.78rem; font-weight: 800;
      padding: 2px 10px;
      border-radius: 100px;
      display: inline-block;
    }
    .pd-myscore-verdict.safe   { background: #eef2ff; color: var(--primary-dark, #3730a3); }
    .pd-myscore-verdict.border { background: #fef3c7; color: #92400e; }
    .pd-myscore-verdict.low    { background: #fee2e2; color: #991b1b; }
    .pd-myscore-verdict.none   { background: var(--bg-light); color: var(--text-light); }
    /* Progress bar in modal */
    .pd-prog-bar-wrap {
      flex: 1;
    }
    .pd-prog-bar-track {
      height: 8px;
      background: #e2e8f0;
      border-radius: 4px;
      position: relative;
      overflow: visible;
      margin-top: 6px;
    }
    .pd-prog-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
    }
    .pd-prog-bar-fill.safe   { background: linear-gradient(90deg, #4ade80, #22c55e); }
    .pd-prog-bar-fill.border { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
    .pd-prog-bar-fill.low    { background: linear-gradient(90deg, #f87171, #ef4444); }
    .pd-prog-bar-fill.none   { background: #cbd5e1; }
    .pd-prog-median-mark {
      position: absolute;
      top: -4px;
      width: 3px;
      height: 16px;
      background: var(--primary);
      border-radius: 2px;
      transform: translateX(-50%);
    }

    /* ===== DSE 計分公式版塊 ===== */
    .pd-formula-wrap {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }
    .pd-formula-str {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--electric-blue);
      margin-bottom: 10px;
      padding: 8px 12px;
      background: var(--bg-light);
      border-radius: var(--radius-sm);
      border: none;
      font-family: 'Courier New', monospace;
      letter-spacing: 0.2px;
      word-break: break-all;
      line-height: 1.6;
    }
    .pd-formula-rows {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }
    .pd-formula-row {
      display: grid;
      grid-template-columns: 120px 1fr 40px;
      align-items: center;
      gap: 10px;
    }
    .pd-formula-subj {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-dark);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .pd-formula-bar-track {
      height: 8px;
      background: #e2e8f0;
      border-radius: 4px;
      overflow: hidden;
    }
    .pd-formula-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
    }
    .pd-formula-bar-fill.core   { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); }
    .pd-formula-bar-fill.elec   { background: linear-gradient(90deg, var(--accent-lime), var(--primary-light)); }
    .pd-formula-bar-fill.bonus  { background: linear-gradient(90deg, var(--primary-light), var(--accent-lime)); }
    .pd-formula-wt {
      font-size: 0.72rem;
      font-weight: 900;
      color: var(--text-light);
      text-align: right;
    }
    .pd-formula-legend {
      display: flex;
      gap: 14px;
      margin-top: 12px;
      flex-wrap: wrap;
    }
    .pd-formula-legend-item {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 0.68rem;
      font-weight: 700;
      color: var(--text-light);
    }
    .pd-formula-legend-dot {
      width: 10px; height: 10px;
      border-radius: 3px;
    }
    .pd-formula-legend-dot.core  { background: var(--primary); }
    .pd-formula-legend-dot.elec  { background: #10b981; }
    .pd-formula-legend-dot.bonus { background: #f59e0b; }
    .pd-formula-notes,
    .pd-formula-weights,
    .pd-formula-missing {
      font-size: 0.75rem;
      color: var(--text-light);
      margin-top: 10px;
      line-height: 1.5;
    }
    .pd-formula-notes i,
    .pd-formula-weights i { margin-right: 4px; color: var(--primary); }

    /* ===== 計分方式：公式卡 + 明細表 ===== */
    .pd-scoring-stack {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .pd-score-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      box-shadow: var(--shadow-sm);
    }
    .pd-score-card__head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      font-size: 0.8rem;
      font-weight: 800;
      color: var(--text-dark);
    }
    .pd-score-card__head > i {
      color: var(--primary);
      font-size: 0.85rem;
      width: 1.1rem;
      text-align: center;
    }
    .pd-score-card__info {
      margin-left: auto;
      border: none;
      background: transparent;
      color: var(--text-light);
      padding: 2px 6px;
      cursor: help;
      font-size: 0.9rem;
      line-height: 1;
    }
    .pd-score-card__info:hover { color: var(--primary); }
    .pd-score-formula-text {
      margin: 0;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--electric-blue, #4f46e5);
      line-height: 1.55;
      word-break: break-word;
    }
    .pd-score-card--formula .pd-score-formula-text {
      padding: 10px 12px;
      background: var(--bg-light);
      border-radius: var(--radius-sm);
      font-family: 'Courier New', ui-monospace, monospace;
      letter-spacing: 0.15px;
    }
    .pd-formula-collapsible {
      position: relative;
      display: flex;
      flex-direction: column;
    }
    .pd-formula-collapsible.is-collapsed::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 48px;
      background: linear-gradient(to bottom, transparent, var(--bg-light));
      pointer-events: none;
      border-bottom-left-radius: var(--radius-sm);
      border-bottom-right-radius: var(--radius-sm);
    }
    .pd-formula-collapsible.is-collapsed .pd-score-formula-text {
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .pd-formula-collapsible.can-collapse .pd-score-formula-text {
      cursor: pointer;
      padding-bottom: 28px;
    }
    .pd-formula-collapsible__toggle {
      position: absolute;
      right: 8px;
      bottom: 8px;
      z-index: 10;
      background: rgba(255, 255, 255, 0.75);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border: 1px solid var(--border, #e5e7eb);
      color: var(--text-mid, #4b5563);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
      padding: 0;
      transition: all 0.2s ease;
    }
    .pd-formula-collapsible__toggle[hidden] {
      display: none !important;
    }
    .pd-formula-collapsible__toggle:hover {
      background-color: var(--primary, #4f46e5);
      color: #ffffff;
      border-color: var(--primary, #4f46e5);
      transform: scale(1.1);
    }
    .pd-formula-collapsible__toggle-icon {
      font-size: 0.75rem;
      transition: transform 0.2s;
    }
    .pd-score-formula-note {
      margin: 10px 0 0;
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--text-light);
      line-height: 1.45;
    }
    .pd-score-card__hint {
      margin: 12px 0 0;
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-light);
      line-height: 1.45;
    }
    .pd-score-card__hint i { margin-right: 5px; color: var(--primary); }
    .pd-score-table-notice {
      margin: 0 0 8px;
      padding: 8px 10px;
      font-size: 0.72rem;
      font-weight: 600;
      line-height: 1.45;
      color: #92400e;
      background: #fffbeb;
      border: 1px solid #fde68a;
      border-radius: var(--radius-sm);
    }
    .pd-score-table-notice i {
      margin-right: 6px;
      color: #d97706;
    }
    .pd-score-footer--pending {
      background: linear-gradient(90deg, #f8fafc, #f1f5f9);
    }
    .pd-score-footer__val--na {
      font-size: 1.1rem;
      font-weight: 800;
      color: #94a3b8;
    }
    .pd-formula-legend-item--max {
      margin-left: auto;
      font-size: 0.68rem;
      color: var(--text-light);
    }
    .pd-formula-legend-item--max strong {
      color: var(--electric-blue, #4f46e5);
    }
    .pd-score-table-hint {
      margin: -4px 0 8px;
      font-size: 0.65rem;
      font-weight: 600;
      color: var(--text-light);
      line-height: 1.4;
    }
    .pd-score-table-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 0 -4px;
      padding: 0 4px;
    }
    .pd-score-table {
      width: 100%;
      min-width: 300px;
      border-collapse: collapse;
      font-size: 0.74rem;
    }
    .pd-score-table thead th {
      padding: 6px 4px;
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--text-light);
      text-align: left;
      border-bottom: 1px solid #e2e8f0;
      white-space: nowrap;
    }
    .pd-score-table thead th:nth-child(n+2) { text-align: center; }
    .pd-score-table tbody td {
      padding: 9px 4px;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: middle;
    }
    .pd-score-table tbody tr:last-child td { border-bottom: none; }
    .pd-score-tbl__subj {
      font-weight: 700;
      color: var(--text-dark);
      max-width: 110px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .pd-score-tbl__grade,
    .pd-score-tbl__conv,
    .pd-score-tbl__mult,
    .pd-score-tbl__total {
      text-align: center;
      font-weight: 700;
      color: var(--text-dark);
    }
    .pd-score-tbl__total { color: var(--text-dark); }
    .pd-score-mult {
      display: inline-block;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 0.68rem;
      font-weight: 800;
      color: var(--primary-dark, #1e40af);
      background: #dbeafe;
    }
    .pd-score-mult--none {
      background: transparent;
      color: #cbd5e1;
      font-weight: 600;
    }
    .pd-score-dropped {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px dashed #e2e8f0;
      font-size: 0.68rem;
      line-height: 1.45;
    }
    .pd-score-dropped__label {
      font-weight: 800;
      color: var(--text-light);
      margin-right: 6px;
    }
    .pd-score-dropped__list { color: var(--text-light); font-weight: 600; }
    .pd-score-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: 12px -14px -12px;
      padding: 11px 14px;
      background: linear-gradient(90deg, #eff6ff, #f8fafc);
      border-top: 1px solid #e2e8f0;
      border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    .pd-score-footer__lbl {
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--text-dark);
    }
    .pd-score-footer__val {
      font-size: 1.15rem;
      font-weight: 900;
      color: var(--electric-blue, #4f46e5);
      letter-spacing: -0.02em;
    }

    /* ===== 歷年收生數據版塊 ===== */
    .pd-history-wrap {
      display: grid;
      grid-template-columns: 1fr;
      gap: 16px;
      align-items: stretch;
      width: 100%;
    }
    .pd-history-wrap > div {
      width: 100%;
      min-width: 0;
    }
    .pd-history-table {
      width: 100%;
      table-layout: fixed;
      border-collapse: collapse;
      font-size: 0.78rem;
    }
    .pd-history-table th {
      font-size: 0.65rem;
      font-weight: 800;
      color: var(--text-light);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 8px 8px;
      background: var(--bg-light);
      border-radius: 0;
      text-align: center;
      border-bottom: 1px solid var(--border);
    }
    .pd-history-table th:first-child,
    .pd-history-table td:first-child {
      width: 36%;
      min-width: 100px;
    }
    .pd-history-table th:first-child { text-align: left; border-radius: 8px 0 0 0; }
    .pd-history-table th:last-child  { border-radius: 0 8px 0 0; }
    .pd-history-table td {
      padding: 10px 8px;
      text-align: center;
      border-bottom: 1px solid var(--border);
      color: var(--text-dark);
      font-weight: 600;
    }
    .pd-history-table td:first-child {
      text-align: left;
      font-weight: 800;
      color: var(--text-light);
      white-space: nowrap;
    }
    .pd-history-table tr:last-child td {
      border-bottom: none;
    }
    .pd-history-table tr.current-year td {
      background: var(--bg-tint);
      font-weight: 800;
    }
    .pd-history-table tr.current-year td:first-child {
      color: var(--primary);
    }
    .pd-history-table .med-val {
      color: var(--primary);
      font-weight: 900;
    }
    .pd-history-chart {
      width: 100%;
      min-width: 0;
    }
    .pd-history-note {
      margin: 12px 0 0;
      padding: 10px 12px;
      font-size: 0.72rem;
      line-height: 1.55;
      color: #92400e;
      background: #fffbeb;
      border: 1px solid #fde68a;
      border-radius: 8px;
    }
    .pd-history-chart svg {
      width: 100%;
      height: auto;
      max-height: 120px;
      display: block;
    }
    .pd-chart-label {
      font-size: 0.62rem;
      font-weight: 700;
      color: var(--text-light);
      text-align: center;
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .pd-trend-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.7rem;
      font-weight: 800;
      padding: 3px 10px;
      border-radius: 100px;
      margin-top: 8px;
    }
    .pd-trend-badge.up   { background: #eef2ff; color: var(--primary-dark, #3730a3); }
    .pd-trend-badge.down { background: #fee2e2; color: #991b1b; }
    .pd-trend-badge.flat { background: #f1f5f9; color: #64748b; }

    /* ===== Disclaimer Banner ===== */
    .disclaimer-banner {
      background: #fffbeb;
      border-top: none;
      border-bottom: none;
      padding: 14px 24px;
      box-shadow: none;
      border: 1px solid #fde68a;
      border-radius: var(--radius-md, 12px);
      margin: 0 16px 16px;
    }
    .disclaimer-banner-inner {
      max-width: 100%;
      margin: 0 auto;
      display: flex;
      align-items: flex-start;
      gap: 14px;
    }
    .disclaimer-icon {
      font-size: 1.25rem;
      flex-shrink: 0;
      margin-top: 1px;
    }
    .disclaimer-text {
      font-size: 0.875rem;
      color: var(--text-mid, #1a1a2e);
      line-height: 1.6;
    }
    .disclaimer-text strong {
      font-weight: 700;
      color: var(--accent, #4caf50);
      display: block;
      margin-bottom: 2px;
    }
    .disclaimer-text a {
      color: var(--accent, #4caf50);
      text-decoration: underline;
      font-weight: 700;
    }
    .disclaimer-text a:hover { color: var(--primary-dark, #1b5e20); }

    .prog-toolbar-inner { gap: 6px; }
    .tb-chip-row-label { font-size: 0.68rem; width: 2em; }
    .tb-chips-stack { gap: 5px; }
    .tb-search-box { height: 38px; }
    .tb-search-box input { font-size: 0.8125rem; }
    .tb-chip { padding: 4px 9px; font-size: 0.7rem; }
    .page-hero .hero-stats { gap: 20px; }
    .disclaimer-banner { padding: 12px 16px; }
    .disclaimer-text { font-size: 0.82rem; }
    .pd-modal {
      border-radius: 16px 16px 0 0;
      --pd-modal-height: min(92dvh, 92vh);
      height: var(--pd-modal-height);
      min-height: var(--pd-modal-height);
      max-height: var(--pd-modal-height);
    }
    .pd-overlay { align-items: flex-end; padding: 0; }
    .pd-header { padding: 18px 16px 12px 16px; }
    .pd-body { padding: 14px 16px 16px; }
    .pd-tab {
      font-size: 0.7rem;
      padding: 8px 5px 10px;
      min-width: 4.25rem;
    }
    .pd-req-grid { grid-template-columns: 1fr; }
    .pd-title { font-size: 1.1rem; }
    .pd-formula-row { grid-template-columns: 100px 1fr 36px; }
    .pd-history-wrap { grid-template-columns: 1fr; }
    .pd-history-chart { width: 100%; }
