/**
 * 呆窝云个人支付系统 - 主样式表
 * 作者：呆窝云 (service@dwoyun.com)
 * 日期：2026-05-31
 * 设计风格：深色科技感（Dark Theme），类似图片中的暗黑模式
 * 主色调：深蓝灰背景 + 蓝色强调 + 绿色成功提示
 */

/* ========================================
   CSS变量定义 - 全局主题配置
   ======================================== */
:root {
    /* 背景色系 */
    --bg-primary: #0a0e1a;           /* 主背景（深黑蓝） */
    --bg-secondary: #111827;         /* 次级背景（深灰） */
    --bg-card: #1a2332;             /* 卡片背景 */
    --bg-card-hover: #212d42;       /* 卡片悬停态 */
    --bg-input: #151d2e;            /* 输入框背景 */

    /* 文字颜色 */
    --text-primary: #f1f5f9;        /* 主要文字（浅白） */
    --text-secondary: #94a3b8;      /* 次要文字（灰色） */
    --text-muted: #64748b;          /* 弱化文字 */
    --text-accent: #60a5fa;         /* 强调文字（浅蓝） */

    /* 强调色 */
    --color-primary: #3b82f6;       /* 主色调（蓝色） */
    --color-primary-hover: #2563eb; /* 主色调悬停 */
    --color-success: #10b981;       /* 成功（绿色） */
    --color-warning: #f59e0b;       /* 警告（橙色） */
    --color-danger: #ef4444;        /* 错误/危险（红色） */
    --color-info: #06b6d4;          /* 信息（青色） */

    /* 边框和分割线 */
    --border-color: #2d3748;
    --border-light: rgba(59, 130, 246, 0.2);
    --divider-color: rgba(255, 255, 255, 0.05);

    /* 阴影效果 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15); /* 发光效果 */

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 过渡动画 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                   'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue',
                   Helvetica, Arial, sans-serif;
}

/* ========================================
   全局重置和基础样式
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f172a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰效果 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   主容器 - 左右分栏布局
   ======================================== */
.pay-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* ========================================
   左侧：支付表单区域
   ======================================== */
.pay-form-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 35px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* 区域标题 */
.section-header {
    margin-bottom: 25px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ========================================
   预设金额按钮组
   ======================================== */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.amount-btn {
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 18px 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.amount-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.amount-btn:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.amount-btn:hover::before {
    opacity: 1;
}

.amount-btn.active {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: var(--shadow-glow), var(--shadow-md);
}

.amount-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.amount-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.amount-btn.active .amount-value {
    color: var(--color-primary);
}

/* ========================================
   自定义金额输入
   ======================================== */
.custom-amount-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.custom-amount-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
    outline: none;
}

.custom-amount-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-amount-input::placeholder {
    color: var(--text-muted);
}

.use-custom-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.use-custom-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* ========================================
   支付标识码区域
   ======================================== */
.verify-code-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(6, 182, 212, 0.03));
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.verify-code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.verify-icon {
    font-size: 18px;
}

.verify-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
}

.verify-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.verify-code-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 15px 20px;
}

.verify-code-number {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    user-select: all;
}

.refresh-code-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-code-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: rotate(180deg);
}

/* ========================================
   支付方式选择区域
   ======================================== */
.payment-methods-section {
    margin-bottom: 25px;
}

.methods-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.method-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: block;
}

.method-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.method-card.active {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: var(--shadow-glow);
}

.method-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.method-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.method-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    min-height: 36px;
}

.method-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

/* ========================================
   表单输入区域
   ======================================== */
.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 18px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* ========================================
   提交按钮
   ======================================== */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 17px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transition: left 0.5s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 20px;
}

/* 底部链接 */
.footer-links {
    text-align: center;
    margin-top: 20px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-primary);
}

/* ========================================
   右侧：订单摘要面板
   ======================================== */
.order-summary-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    height: fit-content;
    position: sticky;
    top: 40px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-pending {
    background: var(--color-success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-paid {
    background: var(--color-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.status-expired {
    background: var(--color-danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.summary-amount {
    font-size: 26px !important;
    color: var(--text-primary) !important;
    font-weight: 800 !important;
}

.summary-divider {
    height: 1px;
    background: var(--divider-color);
    margin: 5px 0;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.status-pending-text {
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
}

.status-paid-text {
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
}

.status-expired-text {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

.summary-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid var(--color-warning);
    border-radius: var(--radius-sm);
}

.summary-note p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================
   成功弹窗模态框
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 45px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    animation: scaleIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.success-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-success), var(--color-info));
}

.success-icon-wrapper {
    position: relative;
    margin-bottom: 25px;
    display: inline-block;
}

.success-icon {
    font-size: 72px;
    display: block;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.confetti-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.success-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: 12px;
}

.modal-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

.order-details-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.detail-amount {
    font-size: 20px !important;
    color: var(--color-success) !important;
}

.modal-close-btn {
    background: var(--color-success);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
}

.modal-close-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* ========================================
   页脚版权信息
   ======================================== */
.page-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.wechat-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.footer-copyright {
    color: var(--text-muted);
}

/* ========================================
   响应式设计 - 平板适配
   ======================================== */
@media (max-width: 1024px) {
    .pay-container {
        grid-template-columns: 1fr 350px;
        gap: 20px;
        margin: 30px auto;
    }

    .pay-form-section {
        padding: 28px;
    }

    .order-summary-panel {
        padding: 25px;
    }

    .verify-code-number {
        font-size: 40px;
    }
}

/* ========================================
   响应式设计 - 移动端适配
   ======================================== */
@media (max-width: 768px) {
    .pay-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px auto;
        padding: 0 15px;
    }

    .pay-form-section {
        padding: 25px 20px;
    }

    .order-summary-panel {
        position: static;
        order: -1; /* 移到顶部或保持底部根据需求调整 */
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .amount-value {
        font-size: 19px;
    }

    .methods-grid {
        grid-template-columns: 1fr;
    }

    .verify-code-number {
        font-size: 36px;
        letter-spacing: 6px;
    }

    .summary-amount {
        font-size: 22px !important;
    }

    .success-modal {
        padding: 30px 25px;
    }

    .success-icon {
        font-size: 56px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
    }
}

/* ========================================
   加载动画和过渡效果
   ======================================== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

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

.submit-btn.loading .btn-icon {
    display: none;
}

.submit-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* 错误提示样式 */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 10px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 成功提示样式 */
.success-toast {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 10px;
}
