*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: var(--font-family);
            background: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 50%, #0d0d2b 100%);
            color: #e0e0e0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* ── Header ── */
        .header {
            text-align: center;
            padding: 60px 20px 30px;
        }
        .header h1 {
            font-size: 2.4rem;
            font-weight: 700;
            background: linear-gradient(135deg, #74b9ff, #a29bfe);
            -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 12px;
        }
        .header p {
            color: #a0a0c0;
            font-size: 1.05rem;
            max-width: 500px;
            margin: 0 auto;
        }

        /* ── Device Banner ── */
        .device-banner {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 14px 24px;
            margin: 10px 20px 30px;
            display: flex; align-items: center; gap: 12px;
            font-size: 0.9rem;
            backdrop-filter: blur(10px);
        }
        .device-banner .icon { font-size: 1.4rem; }
        .device-banner .mid {
            font-family: 'Courier New', monospace;
            color: #74b9ff; font-size: 0.82rem;
            letter-spacing: 0.5px;
        }

        .license-policy-notice {
            width: min(816px, calc(100% - 40px));
            margin: 24px 20px 8px;
            padding: 16px 20px;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            color: #b8b8d0;
            font-size: 0.9rem;
            line-height: 1.7;
            overflow-wrap: anywhere;
        }
        .license-policy-notice summary { color: #d8d8f0; cursor: pointer; }
        .license-policy-notice p { margin-top: 12px; }

        /* ── Plan Cards ── */
        .plans {
            display: flex; gap: 28px; padding: 0 20px;
            max-width: 900px; flex-wrap: wrap; justify-content: center;
        }
        .plan-card {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 20px;
            padding: 36px 32px;
            width: min(380px, calc(100vw - 40px));
            position: relative;
            transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
            backdrop-filter: blur(12px);
        }
        .plan-card:hover {
            transform: translateY(-6px);
            border-color: rgba(116, 185, 255, 0.4);
            box-shadow: 0 20px 60px rgba(116, 185, 255, 0.08);
        }
        .plan-card.selected {
            border-color: #74b9ff;
            box-shadow: 0 0 0 2px rgba(116,185,255,0.3), 0 20px 60px rgba(116,185,255,0.12);
        }
        .plan-card .badge {
            position: absolute; top: -12px; right: 24px;
            background: linear-gradient(135deg, #0984e3, #6c5ce7);
            color: white; font-size: 0.72rem; font-weight: 600;
            padding: 4px 14px; border-radius: 20px; letter-spacing: 0.5px;
        }
        .plan-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
        .plan-card .price {
            font-size: 2.2rem; font-weight: 700;
            color: #74b9ff; margin: 16px 0;
        }
        .plan-card .price span { font-size: 0.9rem; color: #888; font-weight: 400; }
        .period-options {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            margin: 18px 0 20px;
        }
        .period-option {
            appearance: none;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.04);
            color: #d8d8f0;
            border-radius: 8px;
            min-height: 68px;
            padding: 10px 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s, transform 0.2s;
            font: inherit;
            text-align: center;
        }
        .period-option:hover {
            border-color: rgba(255,255,255,0.18);
            background: rgba(255,255,255,0.06);
            transform: translateY(-1px);
        }
        .plan-card.selected .period-option:hover {
            border-color: rgba(116, 185, 255, 0.45);
            background: rgba(255,255,255,0.07);
        }
        .plan-card.selected .period-option.selected {
            border-color: #74b9ff;
            background: rgba(116,185,255,0.12);
        }
        .plan-card:not(.selected) .period-option.selected {
            border-color: rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.04);
        }
        .period-option span {
            font-size: 0.76rem;
            color: #a8a8c8;
            line-height: 1.2;
        }
        .period-option strong {
            color: #ffffff;
            font-size: 0.94rem;
            line-height: 1.1;
            white-space: nowrap;
        }
        .plan-card .features { list-style: none; margin-top: 18px; }
        .plan-card .features li { padding: 6px 0; font-size: 0.92rem; color: #c0c0e0; }
        .plan-card .features li::before { content: "✓ "; color: #00b894; font-weight: 700; }
        .inline-payment-slot {
            margin-top: 18px;
        }
        .inline-payment-slot:empty {
            display: none;
        }

        /* ── Payment Method ── */
        .payment-section {
            display: none;
            margin: 18px 0 0;
            max-width: none;
            width: 100%;
            padding-top: 18px;
            border-top: 1px solid rgba(255,255,255,0.1);
            animation: fadeIn 0.3s ease;
            cursor: default;
        }
        .payment-section.show { display: block; }
        .checkout-required-notice {
            display: none;
            margin-bottom: 14px;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid rgba(253, 203, 110, 0.35);
            background: rgba(253, 203, 110, 0.1);
            color: #fde68a;
            font-size: 0.86rem;
            line-height: 1.55;
        }
        .checkout-required-notice.show { display: block; }
        .payment-message {
            margin-top: 12px;
            padding: 11px 13px;
            border-radius: 9px;
            font-size: 0.86rem;
            line-height: 1.5;
            text-align: left;
        }
        .payment-message[hidden] { display: none; }
        .payment-message.error {
            border: 1px solid rgba(225, 112, 85, 0.35);
            background: rgba(225, 112, 85, 0.1);
            color: #ffb4a2;
        }
        .payment-message.info {
            border: 1px solid rgba(116, 185, 255, 0.3);
            background: rgba(116, 185, 255, 0.08);
            color: #bfdbfe;
        }
        .selection-summary {
            display: grid;
            gap: 4px;
            margin-bottom: 14px;
            text-align: left;
        }
        .selection-summary span {
            color: #8f93bd;
            font-size: 0.72rem;
            font-weight: 600;
        }
        .selection-summary strong {
            color: #ffffff;
            font-size: 0.96rem;
            line-height: 1.35;
        }
        .payment-section h3 {
            text-align: left;
            font-size: 0.95rem;
            margin-bottom: 12px;
            color: #c0c0e0;
        }
        .payment-methods {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 14px;
        }
        .pm-btn {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            min-height: 56px;
            padding: 12px 10px;
            border-radius: 12px;
            border: 2px solid rgba(255,255,255,0.1);
            background: rgba(255,255,255,0.04);
            color: #e0e0e0;
            font-size: 0.9rem; font-weight: 600;
            cursor: pointer;
            transition: all 0.25s;
        }
        .pm-btn:hover {
            border-color: rgba(116, 185, 255, 0.4);
            background: rgba(255,255,255,0.07);
        }
        .pm-btn.selected {
            border-color: #00b894;
            background: rgba(0, 184, 148, 0.08);
        }
        .pm-btn:disabled {
            cursor: not-allowed;
            opacity: 0.45;
            border-color: rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.03);
        }
        .pm-btn:disabled:hover {
            transform: none;
            border-color: rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.03);
        }
        .pm-btn .pm-icon { font-size: 1.35rem; }
        .pm-wechat .pm-icon { color: #07c160; }
        .pm-alipay .pm-icon { color: #1677ff; }

        /* ── QR Code Area ── */
        .qr-section {
            display: none;
            text-align: center;
            animation: fadeIn 0.4s ease;
        }
        .qr-section.show { display: block; }
        .qr-container {
            background: white;
            border-radius: 16px;
            padding: 24px;
            display: inline-block;
            margin: 16px 0;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .qr-container.redirect {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.08);
        }
        .qr-code-target {
            width: 240px;
            min-height: 240px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .qr-code-target canvas,
        .qr-code-target img {
            display: block;
            width: 240px;
            height: 240px;
        }
        .qr-code-target .qr-render-error {
            color: #111827;
            font-size: 0.9rem;
            line-height: 1.5;
            text-align: center;
            max-width: 220px;
        }
        .payment-message:focus-visible,
        .qr-status:focus-visible,
        .qr-render-error:focus-visible,
        .result-panel:focus-visible {
            outline: 3px solid rgba(116, 185, 255, 0.8);
            outline-offset: 3px;
        }
        .qr-help {
            color: #a0a0c0;
            font-size: 0.85rem;
            margin: 8px 0;
        }
        .qr-amount {
            font-size: 1.8rem; font-weight: 700;
            color: #74b9ff; margin: 12px 0 4px;
        }
        .qr-plan-name {
            color: #a0a0c0; font-size: 0.9rem; margin-bottom: 16px;
        }
        .qr-status {
            font-size: 0.9rem;
            padding: 10px 20px;
            border-radius: 8px;
            margin-top: 16px;
        }
        .qr-status.waiting {
            background: rgba(253, 203, 110, 0.1);
            border: 1px solid rgba(253, 203, 110, 0.2);
            color: #fdcb6e;
        }
        .qr-status.success {
            background: rgba(0, 184, 148, 0.1);
            border: 1px solid rgba(0, 184, 148, 0.3);
            color: #00b894;
        }
        .qr-status.error {
            background: rgba(225, 112, 85, 0.1);
            border: 1px solid rgba(225, 112, 85, 0.2);
            color: #e17055;
        }

        /* ── Pay Button ── */
        .pay-btn-wrap {
            text-align: center;
            margin: 14px 0 0;
        }
        #btn-pay {
            background: linear-gradient(135deg, #0984e3, #6c5ce7);
            color: white; font-size: 0.98rem; font-weight: 600;
            border: none; border-radius: 14px;
            width: 100%;
            min-height: 52px;
            padding: 14px 18px; cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            letter-spacing: 0.3px;
        }
        #btn-pay:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 40px rgba(9,132,227,0.35);
        }
        #btn-pay:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

        /* ── Result Panel ── */
        .result-panel {
            display: none;
            background: rgba(39, 174, 96, 0.08);
            border: 1px solid rgba(39, 174, 96, 0.3);
            border-radius: 16px;
            padding: 32px; margin: 20px;
            max-width: 600px; text-align: center;
            animation: fadeIn 0.5s ease;
        }
        .result-panel.show { display: block; }
        .result-panel h3 { color: #27ae60; font-size: 1.5rem; margin-bottom: 12px; }
        .result-panel .key-display {
            background: rgba(0,0,0,0.4);
            border-radius: 10px; padding: 16px; margin: 16px 0;
            font-family: 'Courier New', monospace;
            font-size: 0.85rem; color: #74b9ff;
            word-break: break-all; letter-spacing: 0.5px;
            cursor: pointer; transition: background 0.2s;
        }
        .result-panel .key-display:hover { background: rgba(0,0,0,0.6); }
        .result-panel .hint { font-size: 0.88rem; color: #a0a0c0; margin-top: 12px; }
        .copied-toast {
            display: none;
            background: #27ae60; color: white;
            padding: 8px 20px; border-radius: 8px;
            font-size: 0.85rem; font-weight: 600;
            margin-top: 12px;
            animation: fadeIn 0.3s ease;
        }
        .copied-toast.show { display: inline-block; }

        /* ── Desktop Reminder ── */
        .desktop-reminder {
            display: none;
            background: rgba(9, 132, 227, 0.08);
            border: 1px solid rgba(9, 132, 227, 0.2);
            border-radius: 12px;
            padding: 20px 28px;
            margin: 16px 20px;
            max-width: 600px;
            text-align: center;
            animation: fadeIn 0.5s ease;
        }
        .desktop-reminder.show { display: block; }
        .desktop-reminder p { color: #74b9ff; font-size: 0.92rem; line-height: 1.6; }
        .desktop-reminder .big-icon { font-size: 2rem; margin-bottom: 8px; }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ── Footer ── */
        .footer {
            margin-top: auto; padding: 30px;
            text-align: center; color: #555; font-size: 0.82rem;
        }

        /* ── QR Countdown Timer ── */
        .qr-countdown {
            font-size: 1rem;
            font-weight: 600;
            color: #a0a0c0;
            margin: 8px 0;
            padding: 6px 16px;
            border-radius: 6px;
            background: rgba(255,255,255,0.04);
            display: inline-block;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.5px;
            transition: color 0.3s, background 0.3s;
        }
        .qr-countdown.urgent {
            color: #fdcb6e;
            background: rgba(253, 203, 110, 0.1);
            animation: pulse 1.5s ease-in-out infinite;
        }
        .qr-countdown.expired {
            color: #e17055;
            background: rgba(225, 112, 85, 0.1);
            border: 1px solid rgba(225, 112, 85, 0.3);
            animation: none;
        }
        @media (max-width: 420px) {
            .plan-card {
                padding: 30px 22px;
            }
            .payment-methods {
                grid-template-columns: 1fr;
            }
            .qr-container {
                padding: 16px;
            }
            .qr-code-target {
                width: 220px;
                min-height: 220px;
            }
            .qr-code-target canvas,
            .qr-code-target img {
                width: 220px;
                height: 220px;
            }
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
