/* --- Vercel/Stripe Tech Dark Design System --- */
/* Google Fonts: 使用 font-display: swap 避免 FOIT；通过本地 dns-prefetch + preconnect 加速 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --primary: #ff5c00;
    --primary-hover: #e05200;
    --bg-page: #08090d;
    --bg-card: #0e121b;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: #ff5c00;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #4b5563;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --radius: 12px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(255, 92, 0, 0.07) 0%, transparent 60%),
        linear-gradient(rgba(255,255,255,0.003) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.003) 1px, transparent 1px);
    background-size: auto, 40px 40px, 40px 40px;
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

/* Page Wrapper */
.checkout-wrapper {
    display: flex;
    width: 100%;
    max-width: 1040px;
    gap: 60px;
    align-items: center;
}

/* Left Side - Brand Display */
.brand-column {
    flex: 1;
    max-width: 480px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 92, 0, 0.1);
    border: 1px solid rgba(255, 92, 0, 0.2);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.brand-column h1 {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #ffffff;
    margin-bottom: 20px;
}

.brand-column p.subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Features list */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feature-item .f-icon {
    font-size: 20px;
    color: var(--primary);
    line-height: 1;
    margin-top: 2px;
}

.feature-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.feature-item p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Right Side - Card Container */
.checkout-card {
    flex: 0 0 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.checkout-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 92, 0, 0.5), transparent);
}

/* Product header */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.product-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.product-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.product-header .price-display {
    text-align: right;
}

.product-header .price-val {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    display: block;
}

.product-header .price-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    background: #06080c;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    color: #ffffff;
    font-family: var(--font-mono);
    line-height: 1.5;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.15);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* IP Chip Container */
.ip-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border);
    border-radius: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.ip-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
}

.ip-tag.valid {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.ip-tag.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.ip-tag.invalid {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Discount Rules */
.discount-rules-panel {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.discount-rules-panel .panel-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.rule-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 8px 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.rule-card .qty {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.rule-card .discount {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.rule-card.highlight {
    border-color: rgba(255, 92, 0, 0.3);
    background: rgba(255, 92, 0, 0.05);
}

.rule-card.highlight .discount {
    color: var(--primary);
}

/* Billing details */
.billing-details {
    background: rgba(255, 92, 0, 0.02);
    border: 1px solid rgba(255, 92, 0, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row.total-row {
    border-top: 1px solid rgba(255, 92, 0, 0.2);
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 700;
    color: #ffffff;
}

.detail-row.total-row #bulkTotal {
    color: var(--primary);
}

/* Submit section */
.submit-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.total-pay-box .label {
    font-size: 13px;
    color: var(--text-muted);
}

.total-pay-box .pay-amount {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
}

.submit-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 92, 0, 0.3);
    text-decoration: none;
}

.submit-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Trust seals */
.trust-guarantees {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.trust-guarantees .g-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Query Link */
.query-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
}

.query-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.query-links a:hover {
    color: #ffffff;
}

.query-links .dot {
    color: var(--text-light);
    margin: 0 8px;
}

/* Alerts */
.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.01);
}

.modal-title {
    font-weight: 700;
    color: #ffffff;
    font-size: 14px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    height: 650px;
    position: relative;
    background: #06080c;
}

.modal-loading {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255,255,255,0.05);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Auxiliary pages layout */
.centered-layout {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: var(--bg-page);
    width: 100%;
}

.centered-layout .action-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.centered-layout .card-header {
    text-align: center;
    margin-bottom: 24px;
}

.centered-layout .card-header .brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    display: inline-block;
}

.centered-layout h1 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.centered-layout p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.qr-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    display: inline-block;
}

.status-section {
    text-align: center;
    margin-bottom: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge.processing {
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.info-list {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 13px;
}

.info-row .label {
    color: var(--text-muted);
}

.info-row .value {
    color: #ffffff;
    font-weight: 600;
    font-family: var(--font-mono);
    text-align: right;
}

.btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.card-footer {
    margin-top: 20px;
    text-align: center;
}

.card-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.card-footer a:hover {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 900px) {
    .checkout-wrapper {
        flex-direction: column;
        gap: 40px;
        padding: 20px 0;
    }
    
    .brand-column {
        max-width: 100%;
        text-align: center;
    }
    
    .brand-column h1 {
        font-size: 32px;
    }
    
    .feature-list {
        align-items: center;
    }
    
    .feature-item {
        max-width: 400px;
    }
    
    .checkout-card {
        flex: 1;
        width: 100%;
    }
}

/* License Type Selection Cards */
.license-type-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    user-select: none;
}

.license-type-card:hover {
    border-color: rgba(255, 92, 0, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.license-type-card.active {
    border-color: var(--primary);
    background: rgba(255, 92, 0, 0.04);
    box-shadow: 0 0 0 1px var(--primary);
}

.license-type-card .card-icon {
    font-size: 16px;
    color: var(--text-muted);
}

.license-type-card.active .card-icon {
    color: var(--primary);
}

.license-type-card .card-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.license-type-card .card-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
}

.license-type-card .card-desc.desc-highlight-red {
    font-size: 11px;
    font-weight: 700;
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.15);
    border: 1px solid rgba(255, 77, 79, 0.25);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin: 4px 0;
    line-height: 1.2;
}

.license-type-card .card-desc.desc-highlight-green {
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin: 4px 0;
    line-height: 1.2;
}

.limit-badge {
    color: #ff5c00;
    font-size: 12px;
    font-weight: 900;
    background: rgba(255, 92, 0, 0.2);
    border: 1px solid rgba(255, 92, 0, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
    margin: 0 2px;
    display: inline-block;
    box-shadow: 0 0 6px rgba(255, 92, 0, 0.15);
}

.license-type-card .card-price {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 4px;
}

.license-type-card.active .card-price {
    color: var(--primary);
}