/* ============================================================
   Pro System — 前端 UI 样式
   引入方式：在 <head> 中 <link rel="stylesheet" href="pro-ui.css">
   独立命名空间，不会污染原有样式
   ============================================================ */

/* ---------- Pro 按钮 ---------- */
.pro-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0071e3, #5e5ce6);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,113,227,0.25);
    text-decoration: none;
}
.pro-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,113,227,0.35);
}
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    color: #fff;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
    animation: proPulse 2s ease-in-out infinite;
}
@keyframes proPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,149,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,149,0,0); }
}

/* ---------- 弹窗遮罩 ---------- */
.pro-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: proFadeIn 0.2s ease;
}
.pro-overlay.active { display: flex; }
@keyframes proFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- 弹窗卡片 ---------- */
.pro-modal {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    animation: proSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes proSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pro-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pro-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
}
.pro-modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f7;
    color: #86868b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.pro-modal-close:hover { background: #e8e8ed; }
.pro-modal-body { padding: 20px 24px 24px; }

/* ---------- 步骤 1：套餐选择 ---------- */
.pro-plans {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.pro-plan-card {
    flex: 1;
    padding: 16px 12px;
    border: 2px solid #e8e8ed;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
    position: relative;
}
.pro-plan-card:hover { border-color: #0071e3; }
.pro-plan-card.selected {
    border-color: #0071e3;
    background: rgba(0,113,227,0.04);
}
.pro-plan-card .plan-icon { font-size: 28px; margin-bottom: 6px; }
.pro-plan-card .plan-name { font-size: 15px; font-weight: 600; color: #1d1d1f; margin-bottom: 2px; }
.pro-plan-card .plan-price { font-size: 24px; font-weight: 800; color: #1d1d1f; }
.pro-plan-card .plan-price span { font-size: 13px; font-weight: 400; color: #86868b; }
.pro-plan-card .plan-desc { font-size: 12px; color: #86868b; margin-top: 4px; }
.pro-plan-badge {
    position: absolute;
    top: -10px; right: -10px;
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* ---------- 表单 ---------- */
.pro-form { display: flex; flex-direction: column; gap: 12px; }
.pro-form label { font-size: 13px; font-weight: 600; color: #86868b; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif; }
.pro-form input {
    padding: 12px 16px;
    border: 1px solid #e8e8ed;
    border-radius: 10px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.pro-form input:focus { border-color: #0071e3; }
.pro-form .pro-form-hint {
    font-size: 12px; color: #86868b; margin-top: -6px;
}
.pro-submit-btn {
    width: 100%;
    padding: 14px;
    background: #0071e3;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
    transition: all 0.2s;
    margin-top: 4px;
}
.pro-submit-btn:hover { background: #0077ed; }
.pro-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pro-form-link {
    font-size: 13px; color: #0071e3; text-align: center; cursor: pointer; margin-top: 4px;
}
.pro-form-link:hover { text-decoration: underline; }
.pro-error {
    font-size: 13px; color: #ff3b30; text-align: center; display: none;
}

/* ---------- 步骤 2：扫码支付 ---------- */
.pro-payment { text-align: center; }
.pro-pay-tabs {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.pro-pay-tab {
    flex: 1; padding: 10px 12px;
    border: 2px solid #e8e8ed; border-radius: 10px;
    background: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
}
.pro-pay-tab.active {
    border-color: #07c160; background: #f0fff4;
}
.pro-pay-tab[data-pay="alipay"].active {
    border-color: #1677ff; background: #f0f5ff;
}
.pro-payment .qr-container {
    width: 200px; height: 200px;
    margin: 0 auto 16px;
    border: 2px dashed #e8e8ed;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pro-payment .qr-container img {
    width: 100%; height: 100%; object-fit: contain;
}
.pro-payment .qr-placeholder {
    color: #86868b;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}
.pro-payment .order-info {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: left;
}
.pro-payment .order-info .info-row {
    display: flex; justify-content: space-between; padding: 4px 0;
    font-size: 14px; color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
}
.pro-payment .order-info .info-row .label { color: #86868b; }
.pro-payment .pay-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px; font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", sans-serif;
}
.pro-payment .pay-status.waiting {
    background: #fff3e0; color: #e65100;
}
.pro-payment .pay-status.success {
    background: #e8f5e9; color: #2e7d32;
}
.pro-payment .spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid #e65100;
    border-top-color: transparent;
    border-radius: 50%;
    animation: proSpin 0.8s linear infinite;
}
@keyframes proSpin { to { transform: rotate(360deg); } }

/* ---------- 金额徽章 ---------- */
.pro-amount-badge {
    background: linear-gradient(135deg, #0071e3, #5e5ce6);
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 16px;
    text-align: center;
    color: #fff;
}
.pro-amount-badge .pro-amount-label { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.pro-amount-badge .pro-amount-value { font-size: 40px; font-weight: 800; letter-spacing: 1px; }
.pro-amount-badge .pro-amount-instruction { font-size: 12px; opacity: 0.9; margin-top: 8px; line-height: 1.5; }
.pro-amount-badge .pro-amount-instruction strong { color: #fff; text-decoration: underline; }

/* ---------- 支付状态变体 ---------- */
.pro-payment .pay-status.error {
    background: #ffebee; color: #c62828;
}
.pro-payment .pay-status.timeout {
    background: #fff3e0; color: #e65100;
}
.pro-payment .pay-status.error a, .pro-payment .pay-status.timeout a {
    color: inherit; font-weight: 700;
}

/* ---------- 暗黑模式适配 ---------- */
@media (prefers-color-scheme: dark) {
    .pro-modal { background: #1c1c1e; }
    .pro-modal-header h2, .pro-plan-card .plan-name, .pro-plan-card .plan-price,
    .pro-payment .order-info .info-row { color: #f5f5f7; }
    .pro-plan-card { border-color: #3a3a3c; }
    .pro-plan-card.selected { background: rgba(0,113,227,0.1); }
    .pro-form input { background: #2c2c2e; border-color: #3a3a3c; color: #f5f5f7; }
    .pro-payment .order-info { background: #2c2c2e; }
    .pro-payment .pay-status.error { background: #3e1a1a; color: #ef9a9a; }
    .pro-payment .pay-status.timeout { background: #3e2a1a; color: #ffcc80; }
    .pro-modal-close { background: #2c2c2e; color: #98989d; }
}
