:root {
      --navy: #0A1A33;
      --navy-mid: #12284B;
      --navy-soft: #EBF1F8;
      --gold: #D99B00;
      --gold-bright: #FFC52F;
      --gold-soft: #FFF7DF;
      --bg: #F4F6FA;
      --card: #FFFFFF;
      --text: #1A2433;
      --muted: #526277;
      --border: #D9E2EC;
      --green: #0F7B4D;
      --green-bg: #E7F6EE;
      --amber: #B25E09;
      --amber-bg: #FEF3E2;
      --red: #B42318;
      --red-bg: #FEECEB;
      --blue: #1D4E89;
      --blue-bg: #EBF3FA;
      --shadow: 0 4px 18px rgba(10, 26, 51, 0.06);
      --radius: 14px;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

    body {
      margin: 0;
      font-family: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.72;
      font-size: 16px;
    }

    .num, td, th { font-variant-numeric: tabular-nums; }

    /* Hero Header */
    .hero {
      position: relative;
      overflow: hidden;
      background: linear-gradient(135deg, #061020 0%, var(--navy) 48%, var(--navy-mid) 78%, #1D3E6E 100%);
      color: #FFFFFF;
      padding: 42px 20px 36px;
      border-bottom: 4px solid var(--gold-bright);
    }

    .hero::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image: repeating-linear-gradient(
        90deg,
        rgba(255, 197, 47, 0.035) 0 1px,
        transparent 1px 34px
      );
      pointer-events: none;
    }

    .hero-bg-svg {
      position: absolute;
      right: -30px;
      top: -24px;
      width: 340px;
      height: 340px;
      opacity: 0.12;
      pointer-events: none;
    }

    .container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
    .hero .container { position: relative; z-index: 1; }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(255, 197, 47, 0.16);
      border: 1px solid rgba(255, 197, 47, 0.45);
      color: #FFE493;
      font-size: 13px;
      font-weight: 700;
      padding: 5px 13px;
      border-radius: 999px;
      letter-spacing: 0.02em;
      margin-bottom: 14px;
    }

    .hero h1 {
      margin: 0 0 12px;
      font-size: clamp(23px, 3.8vw, 35px);
      line-height: 1.28;
      font-weight: 800;
      letter-spacing: -0.01em;
    }

    .hero-subtitle {
      margin: 0 0 26px;
      font-size: clamp(14.5px, 2.2vw, 17px);
      color: rgba(255, 255, 255, 0.9);
      max-width: 900px;
    }

    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }

    .kpi-card {
      background: rgba(255, 255, 255, 0.09);
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-top: 3px solid var(--gold-bright);
      border-radius: 12px;
      padding: 14px 16px;
      backdrop-filter: blur(6px);
    }

    .kpi-card.kpi-green { border-top-color: #34D399; }
    .kpi-card.kpi-blue { border-top-color: #60A5FA; }

    .kpi-label { font-size: 12px; color: rgba(255, 255, 255, 0.82); margin-bottom: 4px; font-weight: 600; }
    .kpi-val { font-size: clamp(18px, 2.4vw, 23px); font-weight: 800; color: #FFFFFF; line-height: 1.25; margin-bottom: 4px; }
    .kpi-sub { font-size: 12px; color: #DCE7F5; line-height: 1.45; }

    /* Sticky Pill Nav */
    .sticky-nav {
      position: sticky;
      top: 0;
      z-index: 50;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border);
    }

    .nav-inner {
      max-width: 1120px;
      margin: 0 auto;
      padding: 10px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      padding-bottom: 2px;
    }

    .nav-links::-webkit-scrollbar { display: none; }

    .nav-pill {
      flex: 0 0 auto;
      text-decoration: none;
      color: var(--navy);
      background: var(--navy-soft);
      font-size: 13px;
      font-weight: 700;
      padding: 6px 13px;
      border-radius: 999px;
      transition: background 0.18s, color 0.18s;
      white-space: nowrap;
    }

    .nav-pill:hover, .nav-pill:focus-visible { background: var(--navy); color: var(--gold-bright); }

    .btn-print {
      flex: 0 0 auto;
      border: 1px solid var(--navy);
      background: var(--navy);
      color: #FFFFFF;
      font-size: 13px;
      font-weight: 700;
      padding: 6px 14px;
      border-radius: 999px;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.18s;
    }

    .btn-print:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }

    /* Main Content */
    main { padding: 28px 0 56px; }
    section { margin-bottom: 36px; scroll-margin-top: 66px; }

    .section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

    .section-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--navy);
      color: var(--gold-bright);
      font-size: 15px;
      font-weight: 800;
      flex-shrink: 0;
    }

    .section-title {
      margin: 0;
      font-size: clamp(20px, 3vw, 24px);
      font-weight: 800;
      color: var(--navy);
      line-height: 1.3;
    }

    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 22px;
      box-shadow: var(--shadow);
      margin-bottom: 18px;
    }

    .card h3 {
      margin: 0 0 12px;
      font-size: 18px;
      font-weight: 800;
      color: var(--navy);
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .card h4 { margin: 16px 0 8px; font-size: 15.5px; font-weight: 800; color: var(--navy-mid); }
    p { margin: 0 0 12px; }
    p:last-child { margin-bottom: 0; }
    ul, ol { margin: 8px 0 12px; padding-left: 22px; }
    li { margin-bottom: 8px; }

    /* Summary Grid */
    .summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }

    .summary-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-top: 4px solid var(--navy);
      border-radius: var(--radius);
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .summary-card:nth-child(2) { border-top-color: var(--gold); }
    .summary-card:nth-child(3) { border-top-color: var(--green); }
    .summary-tag { font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.03em; }
    .summary-card:nth-child(2) .summary-tag { color: var(--amber); }
    .summary-card:nth-child(3) .summary-tag { color: var(--green); }
    .summary-card p { font-size: 14.5px; color: var(--text); }

    /* Badges & Pills */
    .badge {
      display: inline-block;
      font-size: 11.5px;
      font-weight: 700;
      padding: 2px 9px;
      border-radius: 999px;
      line-height: 1.45;
      white-space: nowrap;
      vertical-align: middle;
    }

    .badge-mlb { background: #E2E8F0; color: #334155; }
    .badge-mil { background: var(--navy); color: var(--gold-bright); }
    .badge-gold { background: var(--gold-soft); color: #8A5A00; border: 1px solid #F3D37A; }
    .badge-good { background: var(--green-bg); color: var(--green); }
    .badge-warn { background: var(--amber-bg); color: var(--amber); }
    .badge-bad { background: var(--red-bg); color: var(--red); }
    .badge-blue { background: var(--blue-bg); color: var(--blue); }

    /* Callouts */
    .callout {
      border-left: 4px solid var(--navy);
      background: var(--navy-soft);
      padding: 14px 16px;
      border-radius: 0 10px 10px 0;
      margin: 14px 0;
      font-size: 14.5px;
    }

    .callout-gold { border-left-color: var(--gold); background: var(--gold-soft); }
    .callout-green { border-left-color: var(--green); background: var(--green-bg); }
    .callout-warn { border-left-color: var(--amber); background: var(--amber-bg); }
    .callout-red { border-left-color: var(--red); background: var(--red-bg); }

    /* Grids & Charts */
    .chart-grid-2, .two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 14px 0; }
    .three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0; }

    .chart-box {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
      background: #FAFCFF;
    }

    .chart-title {
      font-size: 14px;
      font-weight: 800;
      color: var(--navy);
      margin-bottom: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }

    .chart-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 8px;
    }

    .legend-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
    .legend-swatch { width: 14px; height: 3.5px; border-radius: 2px; display: inline-block; }
    .legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
    svg.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

    /* Decomp Bars */
    .decomp-row { margin-bottom: 14px; }
    .decomp-row:last-child { margin-bottom: 0; }
    .decomp-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; color: var(--navy); flex-wrap: wrap; gap: 6px; }
    .decomp-track { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: #E2E8F0; }
    .decomp-loc { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
    .decomp-mech { background: linear-gradient(90deg, var(--navy), #28528C); }
    .decomp-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; gap: 6px; }

    /* Spotlight Cards */
    .spot-card {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
      background: #FAFCFF;
      border-top: 4px solid var(--navy);
    }

    .spot-card.gold { border-top-color: var(--gold); }
    .spot-card.good { border-top-color: var(--green); }
    .spot-card.warn { border-top-color: var(--amber); }

    .spot-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      flex-wrap: wrap;
    }

    .spot-name { font-size: 15.5px; font-weight: 800; color: var(--navy); }

    .spot-metrics {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      margin: 10px 0;
      padding: 8px;
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 8px;
      text-align: center;
    }

    .spot-m-lbl { font-size: 11px; color: var(--muted); font-weight: 600; display: block; }
    .spot-m-val { font-size: 13px; font-weight: 800; color: var(--navy); }
    .spot-card p { font-size: 13.5px; color: var(--text); }

    /* Tables */
    .table-hint { display: none; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

    .table-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #FFFFFF;
      margin: 10px 0;
    }

    table { width: 100%; border-collapse: collapse; font-size: 13.2px; text-align: left; }

    thead th {
      background: #F1F5F9;
      color: var(--navy);
      font-weight: 700;
      padding: 9px 9px;
      border-bottom: 2px solid var(--border);
      white-space: nowrap;
    }

    tbody td { padding: 8px 9px; border-bottom: 1px solid #E8EEF5; vertical-align: middle; }
    tbody tr:last-child td { border-bottom: none; }
    tbody tr:hover { background: #F8FBFF; }
    tr.row-hl { background: #FFFBEB !important; font-weight: 600; }
    tr.row-navy { background: #EBF1F8 !important; font-weight: 600; }
    tr.row-good { background: #ECFDF5 !important; }
    tr.row-warn { background: #FEF3E2 !important; }
    tr.row-bad { background: #FEECEB !important; }

    .text-right { text-align: right; }
    .text-center { text-align: center; }
    .table-note { font-size: 12.8px; color: var(--muted); margin-top: 8px; }

    /* Strike-Zone 9-Grid + 4-Border Heatmap */
    .sz-block {
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      background: #FAFCFF;
      margin: 14px 0;
    }

    .sz-block-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
    }

    .sz-block-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--navy);
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .sz-kpi-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-bottom: 14px;
    }

    .sz-kpi-pill {
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 5px 10px;
      font-size: 12.5px;
      color: var(--text);
      line-height: 1.35;
    }

    .sz-kpi-pill strong { color: var(--navy); }

    .sz-pair {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }

    .sz-card {
      background: #FFFFFF;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 14px;
    }

    .sz-card-title {
      font-size: 13.5px;
      font-weight: 800;
      color: var(--navy);
      text-align: center;
      margin-bottom: 4px;
    }

    .sz-axis-hint {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      margin-bottom: 6px;
      padding: 0 4px;
    }

    .sz-frame {
      display: grid;
      grid-template-columns: 58px 1fr 58px;
      grid-template-rows: auto auto auto;
      gap: 5px;
      align-items: stretch;
    }

    .sz-ball-top { grid-column: 2; grid-row: 1; }
    .sz-ball-left { grid-column: 1; grid-row: 2; }
    .sz-zone-wrap {
      grid-column: 2;
      grid-row: 2;
      border: 2.5px solid var(--navy);
      border-radius: 6px;
      overflow: hidden;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: repeat(3, 1fr);
      gap: 1px;
      background: #CBD5E1;
    }
    .sz-ball-right { grid-column: 3; grid-row: 2; }
    .sz-ball-bottom { grid-column: 2; grid-row: 3; }

    .sz-cell {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 8px 4px;
      text-align: center;
      background: #F8FAFC;
      min-height: 54px;
    }

    .sz-ball {
      border: 1.5px dashed #CBD5E1;
      border-radius: 8px;
      padding: 6px 4px;
      min-height: 44px;
    }

    .sz-lbl { font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.2; margin-bottom: 2px; }
    .sz-val { font-size: 14px; font-weight: 800; color: var(--navy); line-height: 1.2; }
    .sz-diff { font-size: 11px; font-weight: 700; margin-top: 2px; line-height: 1.2; }

    .diff-pos { color: #B45309; }
    .diff-neg { color: #1D4ED8; }
    .diff-good-neg { color: #0F7B4D; }
    .diff-neu { color: var(--muted); }

    .heat-hot { background: #FEE2B3; }
    .heat-warm { background: #FFF4D6; }
    .heat-mid { background: #F8FAFC; }
    .heat-cool { background: #EBF4FF; }
    .heat-cold { background: #DBEAFE; }
    .heat-freeze { background: #BFDBFE; }
    .heat-red { background: #FEE2E2; }

    .sz-legend {
      font-size: 11.5px;
      color: var(--muted);
      text-align: center;
      margin-top: 8px;
    }

    .footer {
      text-align: center;
      font-size: 13px;
      color: var(--muted);
      padding: 22px 16px 38px;
      border-top: 1px solid var(--border);
      background: #FFFFFF;
    }

    @media (max-width: 860px) {
      .kpi-grid { grid-template-columns: repeat(2, 1fr); }
      .summary-grid, .chart-grid-2, .two-col, .three-col, .sz-pair { grid-template-columns: 1fr; }
      .table-hint { display: block; }
    }

    @media (max-width: 520px) {
      .hero { padding: 28px 14px 24px; }
      .card { padding: 16px; }
      .spot-metrics { grid-template-columns: repeat(2, 1fr); }
      .sz-frame { grid-template-columns: 48px 1fr 48px; }
      .sz-val { font-size: 12.5px; }
    }

    @media print {
      @page { size: A4; margin: 13mm 11mm; }
      body { background: #FFFFFF; font-size: 10pt; line-height: 1.5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
      .sticky-nav, .btn-print, .table-hint { display: none !important; }
      .hero { padding: 16px 18px; border-radius: 10px; margin-bottom: 12px; }
      .container { max-width: 100%; padding: 0; }
      main { padding: 8px 0 20px; }
      .card, .summary-card, .chart-box, .callout, .spot-card, .sz-block { box-shadow: none !important; break-inside: avoid; }
      .sz-pair { grid-template-columns: repeat(2, 1fr); }
      .table-wrap { overflow: visible !important; }
      table { font-size: 8.5pt; }
      thead th, tbody td { padding: 5px 6px; }
      tr { break-inside: avoid; }
      .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    }
