/**
 * PSS License Server - Frontend Styles
 * 设计风格参考 OneNav 主题
 */

:root {
    /* 主色调 - OneNav 主题色 */
    --pss-primary: #f1404b;
    --pss-primary-rgb: 241, 64, 75;
    --pss-primary-hover: #d12768;
    --pss-primary-light: rgba(var(--pss-primary-rgb), 0.1);
    --pss-focus-shadow: rgba(220, 65, 75, 0.6);
    
    /* 状态色 */
    --pss-success: #10b981;
    --pss-success-light: #d1fae5;
    --pss-warning: #f59e0b;
    --pss-warning-light: #fef3c7;
    --pss-danger: #ef4444;
    --pss-danger-light: #fee2e2;
    
    /* 文字色 - OneNav 风格 */
    --pss-text: #484b4f;
    --pss-text-secondary: #66686b;
    --pss-text-muted: #93959a;
    
    /* 背景色 - OneNav 风格 */
    --pss-border: #e6e8ea;
    --pss-bg: #f2f4f7;
    --pss-bg-card: #ffffff;
    --pss-bg-muted: #f1f2f4;
    --pss-input-bg: var(--pss-bg);
    
    /* 阴影 - OneNav 风格 */
    --pss-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --pss-shadow-md: 0 5px 20px rgba(0, 0, 0, 0.1);
    --pss-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    /* 圆角 - OneNav 风格 */
    --pss-radius: 12px;
    --pss-radius-lg: 16px;
    --pss-radius-md: 8px;
    --pss-radius-sm: 6px;
    
    /* 过渡 */
    --pss-transition: all 0.3s ease;
}

/* 深色模式支持 - 继承 OneNav 的 io-black-mode */
.io-black-mode {
    --pss-text: #b4b8bf;
    --pss-text-secondary: #a6a8ab;
    --pss-text-muted: #73757a;
    --pss-bg: #1b1d1f;
    --pss-bg-card: #2D2E2F;
    --pss-bg-muted: #24262a;
    --pss-border: #3a3d41;
    --pss-input-bg: #24262a;
}

/* 容器 */
.pss-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--pss-text);
    line-height: 1.6;
}

/* 页面标题 */
.pss-page-header {
    text-align: center;
    margin-bottom: 32px;
}

.pss-page-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--pss-text);
    margin: 0 0 8px 0;
}

.pss-page-subtitle {
    font-size: 15px;
    color: var(--pss-text-secondary);
    margin: 0;
}

/* 卡片 - OneNav 风格 */
.pss-card {
    position: relative;
    background: var(--pss-bg-card);
    border: none;
    border-radius: var(--pss-radius);
    box-shadow: var(--pss-shadow);
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    transition: background-color 0.3s;
}

.pss-card-header {
    position: relative;
    padding: 16px 20px;
}

.pss-card-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    height: 1px;
    left: 20px;
    right: 20px;
    background: rgba(116, 116, 116, 0.1);
}

.pss-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    height: 1px;
    left: 20px;
    width: 0;
    background: var(--pss-primary);
    box-shadow: 0 0 5px var(--pss-focus-shadow);
    transition: 0.3s ease-out;
}

.pss-card:hover .pss-card-header::after {
    width: calc(100% - 40px);
}

.pss-card-body {
    padding: 20px;
}

/* 兼容旧版卡片内边距 */
.pss-card > *:not(.pss-card-header):not(.pss-card-body) {
    padding: 0 20px;
}

.pss-card > *:first-child:not(.pss-card-header) {
    padding-top: 20px;
}

.pss-card > *:last-child:not(.pss-card-body) {
    padding-bottom: 20px;
}

.pss-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--pss-text);
}

/* 套餐网格 */
.pss-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* 套餐卡片 */
.pss-plan-card {
    position: relative;
    background: var(--pss-bg-card);
    border: 2px solid var(--pss-border);
    border-radius: var(--pss-radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--pss-transition);
}

.pss-plan-card:hover {
    border-color: var(--pss-primary);
    box-shadow: var(--pss-shadow-md);
    transform: translateY(-2px);
}

.pss-plan-card.active {
    border-color: var(--pss-primary);
    background: var(--pss-primary-light);
}

.pss-plan-card.featured {
    border-color: var(--pss-primary);
}

.pss-plan-card.featured::before {
    content: attr(data-badge);
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pss-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.pss-plan-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--pss-text);
    margin: 0 0 8px 0;
}

.pss-plan-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--pss-primary);
    margin: 16px 0;
}

.pss-plan-price .currency {
    font-size: 18px;
    font-weight: 500;
}

.pss-plan-duration {
    font-size: 14px;
    color: var(--pss-text-secondary);
    margin-bottom: 16px;
}

.pss-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    text-align: left;
}

.pss-plan-features li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--pss-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pss-plan-features li::before {
    content: "✓";
    color: var(--pss-success);
    font-weight: 600;
}

/* 表单 - OneNav 风格 */
.pss-form-group {
    margin-bottom: 20px;
}

.pss-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--pss-text);
    margin-bottom: 8px;
}

.pss-form-label .required {
    color: var(--pss-primary);
}

.pss-form-input,
.pss-form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: var(--pss-radius-sm);
    background: var(--pss-input-bg);
    color: var(--pss-text);
    box-shadow: 0 0 0 .625rem transparent;
    transition: background-color 0.2s, border-color 0.3s, box-shadow 0.25s;
    box-sizing: border-box;
}

.pss-form-input:focus,
.pss-form-select:focus {
    outline: none;
    background: var(--pss-input-bg);
    border-color: var(--pss-border);
    box-shadow: 0 0 0 3px var(--pss-focus-shadow);
}

.pss-form-input::placeholder {
    color: var(--pss-text-muted);
    opacity: 1;
}

.pss-form-hint {
    font-size: 13px;
    color: var(--pss-text-muted);
    margin-top: 6px;
}

.pss-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* 支付方式选择 */
.pss-pay-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.pss-pay-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid var(--pss-border);
    border-radius: var(--pss-radius);
    cursor: pointer;
    transition: var(--pss-transition);
    background: var(--pss-bg-card);
}

.pss-pay-method:hover {
    border-color: var(--pss-primary);
}

.pss-pay-method.active {
    border-color: var(--pss-primary);
    background: var(--pss-primary-light);
}

.pss-pay-method input {
    display: none;
}

.pss-pay-method-icon {
    width: 28px;
    height: 28px;
}

.pss-pay-method-icon.wechat {
    background: #07c160;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.pss-pay-method-icon.alipay {
    background: #1677ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.pss-pay-method-icon.paypal {
    background: #003087;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.pss-pay-method-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--pss-text);
}

/* 按钮 - OneNav 风格 */
.pss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--pss-radius-sm);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    vertical-align: middle;
    background: var(--pss-bg-muted);
    color: var(--pss-text);
}

.pss-btn:hover {
    background: var(--pss-border);
    color: var(--pss-text);
}

.pss-btn-primary {
    background: var(--pss-primary);
    border-color: var(--pss-primary);
    color: white;
}

.pss-btn-primary:hover {
    background: var(--pss-primary-hover);
    border-color: var(--pss-primary-hover);
    color: white;
}

.pss-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pss-btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--pss-radius-md);
}

.pss-btn-block {
    width: 100%;
}

.pss-btn-outline {
    background: transparent;
    border: 2px solid var(--pss-border);
    color: var(--pss-text);
}

.pss-btn-outline:hover {
    border-color: var(--pss-primary);
    color: var(--pss-primary);
}

/* 订单摘要 */
.pss-order-summary {
    background: var(--pss-bg);
    border-radius: var(--pss-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.pss-order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--pss-text-secondary);
}

.pss-order-summary-row.total {
    border-top: 1px solid var(--pss-border);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--pss-text);
}

.pss-order-summary-row.total .price {
    color: var(--pss-danger);
}

/* 支付弹窗 */
.pss-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: var(--pss-transition);
}

.pss-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pss-modal {
    background: var(--pss-bg-card);
    border-radius: var(--pss-radius-lg);
    box-shadow: var(--pss-shadow-lg);
    width: 90%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
    transform: scale(0.9);
    transition: var(--pss-transition);
}

.pss-modal-overlay.active .pss-modal {
    transform: scale(1);
}

.pss-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: var(--pss-text);
}

.pss-qrcode-wrap {
    display: inline-block;
    padding: 16px;
    background: white;
    border: 1px solid var(--pss-border);
    border-radius: var(--pss-radius);
    margin-bottom: 16px;
}

.pss-qrcode-wrap img {
    display: block;
    width: 200px;
    height: 200px;
}

.pss-modal-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--pss-danger);
    margin-bottom: 16px;
}

.pss-modal-timer {
    font-size: 14px;
    color: var(--pss-text-secondary);
    margin-bottom: 16px;
}

.pss-modal-timer .time {
    font-weight: 600;
    color: var(--pss-warning);
}

.pss-modal-order-no {
    font-size: 13px;
    color: var(--pss-text-muted);
    margin-bottom: 20px;
}

.pss-modal-close {
    background: none;
    border: none;
    color: var(--pss-text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
}

.pss-modal-close:hover {
    color: var(--pss-text);
}

/* 状态徽章 */
.pss-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    background: var(--pss-bg);
    color: var(--pss-text-secondary);
}

.pss-badge-success {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-badge-warning {
    background: var(--pss-warning-light);
    color: var(--pss-warning);
}

.pss-badge-danger {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

.pss-badge-primary {
    background: var(--pss-primary-light);
    color: var(--pss-primary);
}

/* 成功页面 */
.pss-success-icon {
    width: 80px;
    height: 80px;
    background: var(--pss-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: var(--pss-success);
}

.pss-license-display {
    background: var(--pss-bg);
    border: 1px solid var(--pss-border);
    border-radius: var(--pss-radius);
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pss-license-display code {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    color: var(--pss-text);
    word-break: break-all;
}

.pss-license-display .copy-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--pss-primary);
    color: white;
    border: none;
    border-radius: var(--pss-radius-sm);
    cursor: pointer;
    transition: var(--pss-transition);
    white-space: nowrap;
}

.pss-license-display .copy-btn:hover {
    background: var(--pss-primary-hover);
}

/* 订单信息列表 */
.pss-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pss-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--pss-border);
    font-size: 14px;
}

.pss-info-list li:last-child {
    border-bottom: none;
}

.pss-info-list li .label {
    color: var(--pss-text-secondary);
}

.pss-info-list li .value {
    color: var(--pss-text);
    font-weight: 500;
}

/* 查询页面 */
.pss-query-result {
    margin-top: 24px;
}

.pss-query-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pss-query-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pss-query-status-icon.valid {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-query-status-icon.expired {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

.pss-query-status-icon.inactive {
    background: var(--pss-warning-light);
    color: var(--pss-warning);
}

/* 进度条 */
.pss-progress {
    height: 8px;
    background: var(--pss-border);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.pss-progress-bar {
    height: 100%;
    background: var(--pss-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 提示信息 */
.pss-alert {
    padding: 16px 20px;
    border-radius: var(--pss-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pss-alert-icon {
    flex-shrink: 0;
    font-size: 20px;
}

.pss-alert-content {
    flex: 1;
}

.pss-alert-warning {
    background: var(--pss-warning-light);
    color: #92400e;
}

.pss-alert-info {
    background: var(--pss-primary-light);
    color: #1e40af;
}

.pss-alert-success {
    background: var(--pss-success-light);
    color: #065f46;
}

.pss-alert-danger {
    background: var(--pss-danger-light);
    color: #991b1b;
}

/* 加载状态 */
.pss-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.pss-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--pss-border);
    border-top-color: var(--pss-primary);
    border-radius: 50%;
    animation: pss-spin 0.8s linear infinite;
}

@keyframes pss-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 640px) {
    .pss-container {
        padding: 16px 12px;
    }
    
    .pss-page-title {
        font-size: 22px;
    }
    
    .pss-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .pss-form-row {
        grid-template-columns: 1fr;
    }
    
    .pss-pay-methods {
        flex-direction: column;
    }
    
    .pss-modal {
        padding: 24px 16px;
    }
    
    .pss-btn-lg {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* ============================
   支付弹窗样式
   ============================ */

/* 弹窗容器 */
#pss-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000; /* 必须高于全屏购买页面 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 遮罩层 */
.pss-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* 弹窗内容 */
#pss-payment-modal .pss-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    animation: pss-modal-in 0.3s ease;
}

@keyframes pss-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 弹窗头部 */
.pss-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pss-border);
    font-size: 18px;
    font-weight: 600;
    color: var(--pss-text);
}

.pss-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--pss-background);
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    color: var(--pss-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pss-modal-close:hover {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

/* 弹窗主体 */
.pss-modal-body {
    padding: 24px;
    text-align: center;
}

/* 支付信息 */
.pss-payment-info {
    margin-bottom: 24px;
}

.pss-payment-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--pss-primary);
    margin-bottom: 8px;
}

.pss-payment-amount::before {
    content: '¥';
    font-size: 20px;
    margin-right: 4px;
}

.pss-payment-order {
    font-size: 13px;
    color: var(--pss-text-light);
}

/* 二维码区域 */
.pss-qrcode-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    background: var(--pss-background);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pss-qrcode-wrap img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
}

/* 二维码加载状态 */
.pss-qrcode-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pss-background);
    gap: 12px;
}

.pss-qrcode-loading .pss-spinner {
    width: 40px;
    height: 40px;
}

/* 支付提示 */
.pss-payment-tip {
    font-size: 14px;
    color: var(--pss-text-secondary);
    margin-bottom: 16px;
}

#pss-pay-method-name {
    color: var(--pss-primary);
    font-weight: 500;
}

/* 支付状态 */
.pss-payment-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--pss-primary-light);
    border-radius: 8px;
    color: var(--pss-primary);
    font-size: 14px;
}

/* 内联加载动画 */
.pss-spinner-inline {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pss-spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* 表单消息 */
.pss-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pss-form-message--error {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

.pss-form-message--success {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-form-message--error::before {
    content: '✕';
    font-weight: bold;
}

.pss-form-message--success::before {
    content: '✓';
    font-weight: bold;
}

/* 支付成功状态 */
.pss-payment-status.pss-status-success {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-payment-status.pss-status-success::before {
    content: '✓';
    font-weight: bold;
}

/* 移动端适配 */
@media (max-width: 480px) {
    #pss-payment-modal {
        padding: 16px;
    }
    
    #pss-payment-modal .pss-modal-content {
        max-width: 100%;
    }
    
    .pss-modal-header {
        padding: 16px 20px;
    }
    
    .pss-modal-body {
        padding: 20px;
    }
    
    .pss-payment-amount {
        font-size: 32px;
    }
    
    .pss-qrcode-wrap {
        width: 200px;
        height: 200px;
    }
    
    .pss-qrcode-wrap img {
        max-width: 180px;
        max-height: 180px;
    }
}

/* ============================
   全屏购买页面模式 (Redesigned)
   ============================ */

/* 处理 WP Admin Bar 给 html 加的 margin-top（登录状态下） */
html.pss-fullscreen-active {
    margin-top: 0 !important;
}

/* 全屏模式下禁止页面底层滚动 */
body.pss-buy-active {
    overflow: hidden !important;
}

/* 强制全屏覆盖 */
.pss-fullscreen-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 2vh 20px !important;
    background: #f0f2f5 !important;
    z-index: 2147483647 !important; /* 最大整数值 */
    overflow-y: hidden; 
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    transform: none !important; /* 防止父级 transform 干扰 */
}

/* 如果屏幕实在太小，仍然允许滚动 */
@media (max-height: 800px) {
    .pss-fullscreen-wrapper {
        overflow-y: auto !important;
    }
}

/* 隐藏 WordPress Admin Bar */
html.pss-fullscreen-active body.admin-bar .pss-fullscreen-wrapper {
    top: 0 !important; /* 强制覆盖 Admin Bar */
}

/* 隐藏页面滚动条 */
html.pss-fullscreen-active,
html.pss-fullscreen-active body {
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
}

/* 购买卡片容器 - 紧凑版 */
.pss-buy-card {
    width: 100%;
    max-width: 1100px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: auto;
    height: auto;
    margin: auto 0; /* 垂直居中 */
    position: relative;
    z-index: 1;
}

/* 左侧栏 - 美化版 */
.pss-buy-sidebar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important; /* 强制深色渐变背景 */
    padding: 32px;
    color: #e2e8f0; /* 浅灰白色文字 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

/* 装饰性背景光点 */
.pss-buy-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.pss-brand-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.pss-brand-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 24px;
}

.pss-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.pss-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pss-feature-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.pss-feature-text p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

.pss-sidebar-footer {
    font-size: 12px;
    color: #64748b;
    margin-top: auto;
    padding-top: 20px;
}

/* 右侧购买表单区域 - 紧凑版 */
.pss-buy-main {
    padding: 24px 32px; /* 32px 40px -> 24px 32px */
    justify-content: center; /* 内容垂直居中 */
}

/* 套餐选择器 - 紧凑版 */
.pss-plan-selector-title {
    margin-bottom: 10px; /* 16px -> 10px */
    font-size: 12px;
}

.pss-plans-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 130px -> 120px，更容易单行排布 */
    gap: 10px;
    margin-bottom: 16px; /* 24px -> 16px */
}

.pss-plan-option {
    min-height: 100px; /* 120px -> 100px */
    padding: 12px 8px;
}

.pss-plan-option-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.pss-plan-option-price {
    font-size: 18px;
}

/* 选中套餐详情 - 紧凑版 */
.pss-selected-plan-details {
    padding: 12px 16px; /* 20px -> 12px 16px */
    margin-bottom: 16px; /* 24px -> 16px */
    background: #f8fafc;
}

.pss-detail-row {
    margin-bottom: 8px; /* 12px -> 8px */
    font-size: 13px;
}

.pss-detail-row.total {
    margin-top: 10px;
    padding-top: 10px;
}

.pss-total-price {
    font-size: 20px; /* 24px -> 20px */
}

/* 表单输入 - 紧凑版 */
.pss-form-section {
    margin-bottom: 16px; /* 32px -> 16px */
}

.pss-input-group {
    margin-bottom: 12px; /* 20px -> 12px */
}

.pss-input-label {
    font-size: 13px;
    margin-bottom: 4px;
}

.pss-input-field {
    padding: 8px 12px 8px 36px; /* 高度减小 */
    font-size: 13px;
}

/* 支付方式 - 紧凑版 */
.pss-payment-methods {
    gap: 10px;
}

.pss-pay-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 80px;
}

.pss-pay-method-icon {
    width: 20px;
    height: 20px;
    font-size: 12px; /* 图标文字缩小 */
}

/* 提交按钮 - 紧凑版 */
.pss-submit-btn {
    padding: 12px; /* 16px -> 12px */
    font-size: 15px;
    margin-top: 8px;
}

.pss-sidebar-content {
    position: relative;
    z-index: 1;
}



/* 右侧购买表单区域 */
.pss-buy-main {
    padding: 40px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0; /* 防止 grid 子项溢出 */
}

/* 套餐选择器 */
.pss-plan-selector-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.pss-plans-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
    overflow: visible;
    padding: 4px 2px 10px;
    flex-shrink: 0;
}

.pss-plans-row::-webkit-scrollbar {
    display: none;
}

.pss-plan-option {
    width: auto;
    min-height: 100px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
}

.pss-plan-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.pss-plan-option.active {
    border-color: var(--pss-primary);
    background: rgba(var(--pss-primary-rgb), 0.04);
}

.pss-plan-option.active::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--pss-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.pss-plan-option-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(var(--pss-primary-rgb), 0.12);
    color: var(--pss-primary);
}

.pss-plan-option-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.pss-plan-option-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    min-height: 0;
}

.pss-plan-option-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--pss-primary);
    letter-spacing: -0.2px;
}

.pss-plan-option-old {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.pss-plan-option-old del {
    text-decoration: line-through;
}

.pss-plan-option-duration {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

/* 当前选中套餐详情 */
.pss-selected-plan-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.pss-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(var(--pss-primary-rgb), 0.10);
    color: var(--pss-primary);
}

.pss-detail-old-price {
    font-size: 12px;
    color: #94a3b8;
}

.pss-detail-old-price del {
    text-decoration: line-through;
}

.pss-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #475569;
}

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

.pss-detail-row.total {
    border-top: 1px dashed #e2e8f0;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.pss-total-price {
    font-size: 20px;
    color: var(--pss-primary);
    font-weight: 700;
}

/* 表单输入 */
.pss-form-section {
    margin-bottom: 16px;
}

.pss-input-group {
    margin-bottom: 12px;
}

.pss-input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.pss-input-wrapper {
    position: relative;
}

.pss-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.pss-input-field {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #1e293b;
}

.pss-input-field:focus {
    outline: none;
    border-color: var(--pss-primary);
    box-shadow: 0 0 0 3px rgba(var(--pss-primary-rgb), 0.1);
}

/* 支付方式 */
.pss-payment-methods {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
}

.pss-pay-btn {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.pss-pay-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.pss-pay-btn.active {
    border-color: var(--pss-primary);
    background: rgba(var(--pss-primary-rgb), 0.04);
    color: var(--pss-primary);
    font-weight: 500;
}

.pss-pay-btn input {
    display: none;
}

/* 提交按钮 */
.pss-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--pss-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.pss-submit-btn:hover {
    background: var(--pss-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--pss-primary-rgb), 0.3);
}

/* 移动端适配 */
@media (max-width: 900px) {
    .pss-fullscreen-wrapper {
        display: block; /* 移动端改回 block，防止 flex 居中问题 */
        padding: 20px 16px;
    }

    .pss-buy-card {
        grid-template-columns: 1fr;
        margin: 0; /* 移除居中 margin */
        display: flex;
        flex-direction: column;
    }

    .pss-buy-sidebar {
        border-radius: 12px 12px 0 0;
        min-height: auto;
    }
    
    .pss-buy-main {
        border-radius: 0 0 12px 12px;
    }
}

/* ============================
   新版支付弹窗样式
   ============================ */

.pss-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important; /* 必须比 .pss-fullscreen-wrapper 高 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pss-payment-modal .pss-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.pss-payment-modal .pss-modal-dialog {
    position: relative;
    background: var(--pss-bg-card);
    border-radius: var(--pss-radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: pss-modal-in 0.3s ease;
}

.pss-payment-modal .pss-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pss-border);
}

.pss-payment-modal .pss-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--pss-text);
}

.pss-payment-modal .pss-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--pss-bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    color: var(--pss-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pss-payment-modal .pss-modal-close:hover {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

.pss-payment-modal .pss-modal-body {
    padding: 24px;
}

/* 支付内容 */
.pss-pay-content {
    text-align: center;
}

.pss-pay-state {
    animation: pss-fade-in 0.3s ease;
}

@keyframes pss-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 支付方式切换标签 */
.pss-pay-method-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pss-pay-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--pss-border);
    border-radius: var(--pss-radius);
    background: var(--pss-bg-card);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--pss-text-secondary);
    transition: all 0.2s ease;
}

.pss-pay-tab:hover {
    border-color: var(--pss-primary);
    color: var(--pss-primary);
}

.pss-pay-tab.active {
    border-color: var(--pss-primary);
    background: rgba(var(--pss-primary-rgb), 0.05);
    color: var(--pss-primary);
}

/* 二维码显示 */
.pss-qrcode-display {
    width: 220px;
    height: 220px;
    margin: 0 auto 24px;
    background: white;
    border: 1px solid var(--pss-border);
    border-radius: var(--pss-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pss-qr-img {
    max-width: 200px;
    max-height: 200px;
    display: none;
}

.pss-qr-img.active {
    display: block;
}

.pss-online-qrcode {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pss-online-qrcode img {
    max-width: 200px;
    max-height: 200px;
}

.pss-online-qrcode .pss-qrcode-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    gap: 12px;
    font-size: 14px;
    color: var(--pss-text-secondary);
}

/* 支付详情 */
.pss-pay-details {
    background: var(--pss-bg);
    border-radius: var(--pss-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.pss-pay-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.pss-pay-item .label {
    color: var(--pss-text-secondary);
}

.pss-pay-item .value {
    color: var(--pss-text);
    font-weight: 500;
}

.pss-pay-item.total {
    border-top: 1px dashed var(--pss-border);
    margin-top: 8px;
    padding-top: 12px;
}

.pss-pay-item.total .value {
    color: var(--pss-primary);
    font-size: 24px;
    font-weight: 700;
}

/* 支付状态 */
.pss-pay-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(var(--pss-primary-rgb), 0.1);
    border-radius: var(--pss-radius);
    color: var(--pss-primary);
    font-size: 14px;
    font-weight: 500;
}

.pss-pay-status.success {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-pay-status.timeout {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

/* 倒计时样式 */
.pss-countdown {
    margin-left: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--pss-primary);
}

.pss-countdown.warning {
    color: #f59e0b;
    background: #fef3c7;
}

.pss-countdown.danger {
    color: #ef4444;
    background: #fee2e2;
    animation: pss-countdown-pulse 1s ease-in-out infinite;
}

@keyframes pss-countdown-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 截图上传区域 */
.pss-proof-upload {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--pss-border);
}

.pss-upload-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pss-text);
}

.pss-upload-area {
    border: 2px dashed var(--pss-border);
    border-radius: var(--pss-radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--pss-bg);
}

.pss-upload-area:hover {
    border-color: var(--pss-primary);
    background: rgba(var(--pss-primary-rgb), 0.02);
}

.pss-upload-area.dragover {
    border-color: var(--pss-primary);
    background: rgba(var(--pss-primary-rgb), 0.05);
}

.pss-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--pss-text-secondary);
}

.pss-upload-icon-large {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
}

.pss-upload-hint {
    font-size: 12px;
    color: var(--pss-text-muted);
}

.pss-upload-preview {
    position: relative;
    display: inline-block;
}

.pss-upload-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--pss-radius-sm);
}

.pss-upload-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--pss-danger);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pss-proof-upload .pss-btn {
    margin-top: 16px;
    width: 100%;
}

.pss-upload-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--pss-radius-sm);
    font-size: 14px;
    text-align: center;
}

.pss-upload-status.success {
    background: var(--pss-success-light);
    color: var(--pss-success);
}

.pss-upload-status.error {
    background: var(--pss-danger-light);
    color: var(--pss-danger);
}

/* 支付成功状态 */
.pss-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--pss-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--pss-success);
}

.pss-success-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--pss-text);
    margin: 0 0 24px 0;
}

.pss-success-info {
    background: var(--pss-bg);
    border-radius: var(--pss-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: left;
}

.pss-success-actions {
    margin-top: 24px;
}

.pss-success-actions .pss-btn {
    min-width: 160px;
}

/* 授权码显示优化 */
.pss-payment-modal .pss-license-display {
    margin: 20px 0;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .pss-buy-page {
        padding: 16px 12px;
    }
    
    .pss-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .pss-plan-card {
        padding: 20px 16px;
    }
    
    .pss-plan-price {
        font-size: 36px;
    }
    
    .pss-payment-modal {
        padding: 12px;
    }
    
    .pss-payment-modal .pss-modal-dialog {
        max-height: 95vh;
    }
    
    .pss-payment-modal .pss-modal-body {
        padding: 20px 16px;
    }
    
    .pss-qrcode-display {
        width: 200px;
        height: 200px;
    }
    
    .pss-pay-method-tabs {
        flex-wrap: wrap;
    }
    
    .pss-pay-tab {
        padding: 8px 14px;
        font-size: 13px;
    }
}
