    :root {
      --ap-red: #DF1B27;
      --ap-red-dark: #99131B;
      --ap-bg: #f3f4f6;
      --ap-text: #0f172a;
      --ap-muted: #64748b;
      --ap-border: #e2e8f0;
      --ap-radius: 14px;
      --ap-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
      --ap-ease: cubic-bezier(.22, .61, .36, 1);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 24px 12px;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: radial-gradient(circle at top left, #fee2e2, #fef2f2, #f3f4f6);
      color: var(--ap-text);
    }

    .AP_page {
      max-width: 960px;
      margin: 0 auto;
    }

    .AP_card {
      background: #ffffff;
      border-radius: var(--ap-radius);
      box-shadow: var(--ap-shadow);
      padding: 24px 20px 26px;
      border: 1px solid rgba(148, 163, 184, 0.25);
    }

    @media (min-width: 768px) {
      body {
        padding: 40px 16px;
      }

      .AP_card {
        padding: 32px 28px 30px;
      }
    }

    /* ========= 新增：信头 Header ========= */
    .AP_letterhead {
      margin-bottom: 18px;
      border-bottom: 1px solid #d1d5db;
      padding-bottom: 6px;
    }

    .AP_letterhead-table {
      width: 100%;
      border-collapse: collapse;
    }

    .AP_letterhead-logo {
      width: 40%;
      vertical-align: top;
    }

    .AP_letterhead-logo img {
      height: 45px;
      display: block;
    }

    .AP_letterhead-address {
      width: 60%;
      vertical-align: top;
      text-align: right;
      font-size: 11px;
      line-height: 1.4;
      color: #111827;
    }

    .AP_letterhead-address strong {
      font-size: 12px;
    }

    .AP_letterhead-address a {
      color: #1d4ed8;
      text-decoration: none;
    }

    .AP_letterhead-address a:hover {
      text-decoration: underline;
    }

    /* ========= 旧 header 区（标题用） ========= */

    .AP_header {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 20px;
    }

    .AP_header-title {
      margin-top: 4px;
    }

    .AP_title {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: 0.02em;
      color: var(--ap-text);
    }

    .AP_subtitle {
      margin-top: 4px;
      font-size: 13px;
      color: var(--ap-muted);
    }

    .AP_subtitle span {
      color: var(--ap-red-dark);
      font-weight: 600;
    }

    /* Alerts */
    .AP_alert {
      border-radius: 12px;
      padding: 10px 12px;
      font-size: 13px;
      margin-bottom: 14px;
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    .AP_alert-error {
      background: #fef2f2;
      border: 1px solid #fecaca;
      color: #991b1b;
    }

    .AP_alert-success {
      background: #ecfdf3;
      border: 1px solid #bbf7d0;
      color: #166534;
    }

    .AP_alert-icon {
      font-size: 16px;
      line-height: 1;
      margin-top: 2px;
    }

    .AP_alert ul {
      margin: 0 0 0 18px;
      padding: 0;
    }

    .AP_alert p {
      margin: 0;
    }

    /* Form layout */
    form.AP_form {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .AP_section {
      border-radius: 12px;
      border: 1px solid var(--ap-border);
      padding: 14px 14px 16px;
      background: #f9fafb;
    }

    .AP_section-header {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-bottom: 8px;
      gap: 8px;
    }

    .AP_section-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--ap-red-dark);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .AP_section-title::before {
      content: "";
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: var(--ap-red);
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
    }

    .AP_section-note {
      font-size: 11px;
      color: var(--ap-muted);
    }

    .AP_grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px 16px;
    }

    @media (min-width: 720px) {
      .AP_grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    .AP_field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .AP_field-full {
      grid-column: 1 / -1;
    }

    .AP_programme-grid {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px 16px;
    }

    .AP_label {
      font-size: 12px;
      font-weight: 500;
      color: #0f172a;
      display: flex;
      justify-content: space-between;
      gap: 6px;
    }

    .AP_label-multi {
      align-items: flex-start;
    }

    .AP_label-main {
      line-height: 1.35;
    }

    .AP_label span.AP_required {
      color: #dc2626;
      font-weight: 600;
    }

    .AP_hint {
      font-size: 11px;
      color: var(--ap-muted);
    }

    .AP_field-half-on-desktop .AP_select {
      max-width: 100%;
    }

    @media (min-width: 720px) {
      .AP_programme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .AP_field-half-on-desktop .AP_select {
        max-width: calc(50% - 8px);
      }
    }

    .AP_input,
    .AP_select {
      width: 100%;
      border-radius: 10px;
      border: 1px solid var(--ap-border);
      padding: 8px 10px;
      font-size: 13px;
      transition: border-color 0.15s var(--ap-ease), box-shadow 0.15s var(--ap-ease), background-color 0.15s var(--ap-ease);
      background: #ffffff;
    }

    .AP_input:focus-visible,
    .AP_select:focus-visible {
      outline: none;
      border-color: var(--ap-red);
      box-shadow: 0 0 0 1px var(--ap-red);
    }

    .AP_input::placeholder {
      color: #cbd5f5;
    }

    .AP_radio-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 13px;
    }

    .AP_radio-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid var(--ap-border);
      background: #ffffff;
      cursor: pointer;
      font-size: 13px;
      transition: background-color 0.15s var(--ap-ease), border-color 0.15s var(--ap-ease), box-shadow 0.15s var(--ap-ease), transform 0.1s var(--ap-ease);
    }

    .AP_radio-pill input {
      accent-color: var(--ap-red);
    }

    .AP_radio-pill:hover {
      border-color: rgba(148, 163, 184, 0.8);
      background: #f9fafb;
    }

    .AP_radio-pill input:checked+span {
      color: var(--ap-red-dark);
      font-weight: 600;
    }

    .AP_file-input {
      font-size: 12px;
    }

    .AP_policy-image {
      margin-top: 8px;
      border-radius: 10px;
      border: 1px dashed var(--ap-border);
      padding: 8px;
      background: #fef2f2;
      font-size: 11px;
      color: var(--ap-red-dark);
      text-align: center;
    }

    .AP_policy-image img {
      max-width: 100%;
      display: block;
      margin: 0 auto 4px;
    }

    .AP_policy-doc {
      margin-top: 8px;
      border-radius: 10px;
      border: 1px solid #9ca3af;
      padding: 14px 12px 10px;
      background: #fef2f2;
      color: #1f2937;
    }

    .AP_policy-doc-title {
      margin: 0 0 14px;
      text-align: center;
      font-size: 18px;
      line-height: 1.2;
      font-weight: 700;
      color: #1f2937;
    }

    .AP_policy-list {
      margin: 0;
      padding-left: 24px;
      font-size: 13px;
      line-height: 1.45;
      color: #374151;
    }

    .AP_policy-list li {
      margin-bottom: 10px;
    }

    .AP_policy-list li:last-child {
      margin-bottom: 8px;
    }

    .AP_policy-table-wrap {
      margin-top: 8px;
      overflow-x: auto;
      background: #ffffff;
      border: 1.5px solid #374151;
    }

    .AP_policy-table {
      width: 100%;
      border-collapse: collapse !important;
      min-width: 760px;
      table-layout: fixed;
      font-size: 12px;
      color: #111827;
      background: #ffffff;
      border: 1.5px solid #374151;
    }

    .AP_policy-table th,
    .AP_policy-table td {
      border: 1px solid #374151 !important;
      padding: 7px 6px;
      text-align: center;
      vertical-align: middle;
      line-height: 1.2;
    }

    .AP_policy-table thead tr:first-child th {
      background: #4b5563;
      color: #f9fafb;
      font-weight: 700;
    }

    .AP_policy-table thead tr:nth-child(2) th,
    .AP_policy-table thead tr:nth-child(3) th {
      background: #d1d5db;
      color: #111827;
      font-weight: 600;
    }

    .AP_policy-table tbody th {
      background: #4b5563;
      color: #f9fafb;
      font-weight: 700;
      white-space: nowrap;
    }

    .AP_policy-table tbody td {
      background: #e5e7eb;
    }

    .AP_policy-mobile-cards {
      display: none;
      margin-top: 10px;
      gap: 8px;
    }

    .AP_policy-mobile-card {
      border: 1px solid #374151;
      border-radius: 8px;
      background: #ffffff;
      padding: 9px 10px;
    }

    .AP_policy-mobile-card h4 {
      margin: 0 0 6px;
      font-size: 14px;
      color: #111827;
    }

    .AP_policy-mobile-card dl {
      margin: 0;
    }

    .AP_policy-mobile-card dl div {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 5px 0;
      border-top: 1px solid #d1d5db;
    }

    .AP_policy-mobile-card dl div:first-child {
      border-top: 0;
      padding-top: 2px;
    }

    .AP_policy-mobile-card dt {
      margin: 0;
      font-size: 11px;
      color: #4b5563;
      font-weight: 600;
    }

    .AP_policy-mobile-card dd {
      margin: 0;
      text-align: right;
      font-size: 12px;
      color: #111827;
      font-weight: 600;
      white-space: nowrap;
    }

    .AP_policy-clause {
      margin-top: 10px;
      border: 1px solid #9ca3af;
      border-radius: 8px;
      background: #fff7ed;
      padding: 9px 10px;
    }

    .AP_policy-clause h4 {
      margin: 0 0 6px;
      font-size: 14px;
      color: #111827;
    }

    .AP_policy-sublist {
      margin: 0;
      padding-left: 18px;
      font-size: 12px;
      line-height: 1.45;
      color: #1f2937;
    }

    .AP_policy-sublist li {
      margin-bottom: 6px;
    }

    .AP_policy-clause-note {
      margin: 3px 0 0;
      font-size: 11px;
      color: #4b5563;
    }

    .AP_transfer-doc {
      margin-top: 10px;
      border-radius: 10px;
      border: 1px solid #9ca3af;
      padding: 14px 12px 10px;
      background: #fef2f2;
      color: #1f2937;
    }

    .AP_transfer-doc-title {
      margin: 0 0 14px;
      text-align: center;
      font-size: 22px;
      line-height: 1.2;
      font-weight: 700;
      color: #1f2937;
    }

    .AP_transfer-list {
      margin: 0;
      padding-left: 24px;
      font-size: 13px;
      line-height: 1.5;
      color: #374151;
    }

    .AP_transfer-list li {
      margin-bottom: 8px;
    }

    .AP_transfer-list li:last-child {
      margin-bottom: 10px;
    }

    .AP_transfer-table-wrap {
      margin-top: 8px;
      overflow-x: auto;
      background: #ffffff;
      border: 1.5px solid #1f2937;
    }

    .AP_transfer-table {
      width: 100%;
      border-collapse: collapse !important;
      min-width: 760px;
      table-layout: fixed;
      font-size: 12px;
      color: #111827;
      background: #ffffff;
      border: 1.5px solid #1f2937;
    }

    .AP_transfer-table th,
    .AP_transfer-table td {
      border: 1px solid #1f2937 !important;
      padding: 8px 7px;
      text-align: center;
      vertical-align: middle;
      line-height: 1.2;
    }

    .AP_transfer-table thead tr th {
      background: #0b72b9;
      color: #ffffff;
      font-weight: 700;
    }

    .AP_transfer-table tbody th {
      background: #e5e7eb;
      color: #111827;
      font-weight: 700;
      width: 18%;
    }

    .AP_transfer-table tbody td {
      background: #f8fafc;
    }

    .AP_transfer-mobile-cards {
      display: none;
      margin-top: 10px;
    }

    .AP_transfer-mobile-card {
      border: 1px solid #1f2937;
      border-radius: 8px;
      background: #ffffff;
      padding: 9px 10px;
    }

    .AP_transfer-mobile-card h4 {
      margin: 0 0 6px;
      font-size: 14px;
      color: #111827;
    }

    .AP_transfer-mobile-card dl {
      margin: 0;
    }

    .AP_transfer-mobile-card dl div {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 0;
      border-top: 1px solid #d1d5db;
    }

    .AP_transfer-mobile-card dl div:first-child {
      border-top: 0;
      padding-top: 2px;
    }

    .AP_transfer-mobile-card dt {
      margin: 0;
      font-size: 11px;
      color: #4b5563;
      font-weight: 600;
    }

    .AP_transfer-mobile-card dd {
      margin: 0;
      text-align: right;
      font-size: 12px;
      color: #111827;
      font-weight: 600;
      max-width: 58%;
    }

    @media (max-width: 767px) {
      .AP_policy-table {
        min-width: 680px;
      }

      .AP_policy-table tbody th {
        position: sticky;
        left: 0;
        z-index: 1;
      }

      .AP_transfer-table {
        min-width: 700px;
      }

      .AP_transfer-table tbody th,
      .AP_transfer-table thead tr th:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
      }
    }

    @media (max-width: 479px) {
      .AP_policy-table-wrap {
        display: none;
      }

      .AP_policy-mobile-cards {
        display: grid;
      }

      .AP_transfer-table-wrap {
        display: none;
      }

      .AP_transfer-mobile-cards {
        display: grid;
      }
    }

    @media (max-width: 640px) {
      .AP_policy-doc {
        padding: 12px 10px 8px;
      }

      .AP_policy-doc-title {
        font-size: 16px;
      }

      .AP_transfer-doc {
        padding: 12px 10px 8px;
      }

      .AP_transfer-doc-title {
        font-size: 19px;
      }
    }

    .AP_checkbox-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 12px;
      margin-top: 10px;
    }

    .AP_checkbox-row input {
      margin-top: 2px;
      accent-color: var(--ap-red);
    }

    /* Signature pad */
    .AP_signature-wrapper {
      margin-top: 10px;
      border-radius: 12px;
      border: 1px dashed var(--ap-border);
      background: #ffffff;
      padding: 10px;
    }

    .AP_signature-label {
      font-size: 12px;
      margin-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .AP_signature-label small {
      color: var(--ap-muted);
      font-size: 11px;
    }

    .AP_signature-canvas-wrap {
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
    }

    #signature-pad {
      width: 100%;
      height: 160px;
      display: block;
      touch-action: none;
    }

    .AP_signature-actions {
      margin-top: 6px;
      display: flex;
      justify-content: flex-end;
    }

    .AP_btn-ghost {
      border-radius: 999px;
      border: 1px solid var(--ap-border);
      background: #ffffff;
      font-size: 12px;
      padding: 4px 10px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--ap-muted);
      transition: background-color 0.15s var(--ap-ease), border-color 0.15s var(--ap-ease), transform 0.08s var(--ap-ease);
    }

    .AP_btn-ghost:hover {
      background: #f9fafb;
      border-color: #cbd5e1;
    }

    .AP_btn-ghost:active {
      transform: translateY(1px);
    }

    /* Submit row */
    .AP_actions {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 4px;
    }

    @media (min-width: 640px) {
      .AP_actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
      }
    }

    .AP_btn-primary {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 9px 18px;
      border-radius: 999px;
      border: none;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      background: linear-gradient(135deg, var(--ap-red), var(--ap-red-dark));
      color: #ffffff;
      box-shadow: 0 10px 24px rgba(220, 38, 38, 0.35);
      transition: transform 0.1s var(--ap-ease), box-shadow 0.1s var(--ap-ease), opacity 0.1s var(--ap-ease);
      white-space: nowrap;
    }

    .AP_btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 32px rgba(220, 38, 38, 0.45);
    }

    .AP_btn-primary:active {
      transform: translateY(1px);
      box-shadow: 0 8px 18px rgba(220, 38, 38, 0.3);
    }

    .AP_btn-primary:disabled {
      opacity: 0.7;
      cursor: not-allowed;
      box-shadow: 0 6px 14px rgba(148, 163, 184, 0.4);
    }

    .AP_btn-primary .btn-spinner {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-top-color: #ffffff;
      animation: ap_spin 0.7s linear infinite;
    }

    .AP_btn-primary.is-loading {
      opacity: 0.85;
      cursor: wait;
    }

    @keyframes ap_spin {
      to {
        transform: rotate(360deg);
      }
    }

    .AP_actions-note {
      font-size: 11px;
      color: var(--ap-muted);
    }

    .AP_small-disclaimer {
      margin-top: 8px;
      font-size: 11px;
      color: var(--ap-muted);
      line-height: 1.4;
    }

    /* mobile optimizations */
    @media (max-width: 480px) {
      .AP_title {
        font-size: 19px;
      }

      .AP_subtitle {
        font-size: 12px;
      }

      .AP_card {
        padding-inline: 16px;
      }
    }

    .AP_photo-preview {
      margin-top: 6px;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      max-width: 260px;
    }

    .AP_photo-preview img {
      display: block;
      width: 100%;
      height: auto;
    }


    #programmeExtrasWrap .AP_field {
      min-width: 0;
    }
