/**
 * 知识付费系统 - 统一样式表
 * @version 1.0
 */

/* ==================== 支付页面样式 (pay.php) ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pay-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pay-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.pay-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.pay-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.pay-header .price {
    font-size: 36px;
    font-weight: bold;
}

.pay-body {
    padding: 30px;
}

.product-info {
    text-align: center;
    margin-bottom: 30px;
}

.product-info .resource-name {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.pay-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.pay-method {
    flex: 1;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.pay-method:hover {
    border-color: #667eea;
}

.pay-method.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.pay-method .icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.pay-method .name {
    font-size: 14px;
    color: #333;
}

.pay-method .chevron {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.pay-method.active .chevron {
    color: #667eea;
}

.easypay-types {
    display: none;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.easypay-types.show {
    display: block;
}

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

.easypay-types .title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.easypay-type-option {
    display: inline-block;
    margin-right: 15px;
}

.easypay-type-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 15px 10px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
    position: relative;
}

/* 易支付图标样式 */
.easypay-type-option .easypay-icon {
    position: absolute;
    left: 10px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
}

/* 支付宝图标背景 */
.easypay-type-option:has(input[value="alipay"]) .easypay-icon {
    background: linear-gradient(135deg, #1677FF 0%, #09AAFF 100%);
}

.easypay-type-option:has(input[value="alipay"]) .easypay-icon i {
    color: white;
}

/* 微信图标背景 */
.easypay-type-option:has(input[value="wxpay"]) .easypay-icon {
    background: linear-gradient(135deg, #09BB07 0%, #07A806 100%);
}

.easypay-type-option:has(input[value="wxpay"]) .easypay-icon i {
    color: white;
}

/* QQ支付图标背景 */
.easypay-type-option:has(input[value="qqpay"]) .easypay-icon {
    background: linear-gradient(135deg, #12B7F5 0%, #0E9AD0 100%);
}

.easypay-type-option:has(input[value="qqpay"]) .easypay-icon i {
    color: white;
}

/* 隐藏原生单选按钮 */
.easypay-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

.easypay-type-option label:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* 选中状态样式 - 使用:has()伪类 */
.easypay-type-option:has(input:checked) label {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* 选中时显示右上角勾选标记 */
.easypay-type-option:has(input:checked) label::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: checkBounce 0.3s ease;
    z-index: 10;
}

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

.easypay-type-option:has(input:checked) label span:not(.easypay-icon) {
    color: #667eea !important;
    font-weight: 600;
}

/* 选中时图标放大效果 */
.easypay-type-option:has(input:checked) .easypay-icon {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-pay {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-pay:hover {
    transform: translateY(-2px);
}

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

.btn-pay:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.qrcode-container {
    display: none;
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.qrcode-container.show {
    display: block;
}

.qrcode-container img {
    max-width: 200px;
}

.qrcode-container .tip {
    color: #666;
    margin-top: 10px;
    font-size: 14px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.loading .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.error-msg {
    display: none;
    color: #dc3545;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    background: #f8d7da;
    border-radius: 4px;
}

.error-msg.show {
    display: block;
}

/* ==================== 支付弹窗样式 (pay_modal.php) ==================== */
.payment-option {
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.payment-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.payment-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

.payment-option.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-option .check-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: white;
}

.payment-option.active .check-icon {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.payment-option .pay-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: all 0.3s ease;
}

.payment-option.active .pay-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.price-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.price-display::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10%, -10%); }
}

.price-display h3 {
    margin: 0;
    font-size: 48px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.price-display small {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 1px;
}

#pay-now-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

#pay-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#pay-now-btn:active {
    transform: translateY(0);
}

.easypay-sub-options {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.payment-option.active .easypay-sub-options {
    display: block;
    animation: slideDown 0.3s ease;
}

.easypay-type-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 左侧选中指示条 */
.easypay-type-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.easypay-type-option:last-child {
    margin-bottom: 0;
}

.easypay-type-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(3px);
}

.easypay-type-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

/* 选中时显示左侧指示条 */
.easypay-type-option.active::before {
    transform: scaleY(1);
}

.easypay-type-option input[type="radio"] {
    display: none;
}

.easypay-type-option .type-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    transition: all 0.3s ease;
}

.easypay-type-option .type-icon i {
    font-size: 18px;
    color: #1677FF;
}

.easypay-type-option:hover .type-icon,
.easypay-type-option.active .type-icon {
    transform: rotate(-5deg) scale(1.1);
}

.easypay-type-option.active .type-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.easypay-type-option.active .type-icon i {
    color: white;
}

.easypay-type-option .type-icon i.fa-weixin {
    color: #09BB07;
}

.easypay-type-option .type-icon i.fa-qq {
    color: #12B7F5;
}

.easypay-type-option span {
    font-size: 15px;
    font-weight: 500;
}

/* 选中时文字颜色加粗 */
.easypay-type-option.active span {
    color: #667eea;
    font-weight: 600;
}

/* ==================== 支付成功/等待页面样式 ==================== */
.success-container,
.waiting-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #fff;
}

.waiting-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #fff;
}

.success-title,
.waiting-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.success-message,
.waiting-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.order-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.order-info .label {
    font-size: 14px;
    color: #999;
    margin-bottom: 5px;
}

.order-info .value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
}

.download-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
    margin-right: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.back-btn {
    display: inline-block;
    padding: 15px 40px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateY(-2px);
    background: #5a6268;
}

.close-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: translateY(-2px);
}

.auto-tip {
    font-size: 14px;
    color: #999;
    margin-top: 15px;
}

/* ==================== 下载框样式 ==================== */
.download-box {
    background: #f0f8ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.pay-download-box {
    background: #fff9e6;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.download-box h3,
.pay-download-box h3 {
    color: #28a745;
    margin: 0 0 10px 0;
    font-size: 20px;
}

/* 解压密码提示样式 */
.extract-password-tip {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.extract-password-tip strong {
    color: #856404;
    font-size: 15px;
    margin-right: 8px;
}

.extract-password-tip code {
    background: #fff;
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.extract-password-tip code:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: scale(1.05);
}

.pay-download-box h3 {
    color: #e67e22;
}

.download-box.pay-purchased h3 {
    color: #28a745;
}

.download-box p,
.pay-download-box p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.pay-download-box p strong {
    color: #e67e22;
    font-size: 18px;
    font-weight: bold;
}

.pay-download-box .product-name {
    color: #999;
    font-size: 14px;
    margin: 0 0 15px 0;
}

.download-box .btn-success,
.pay-download-box .btn-primary,
.pay-download-box .btn-success {
    display: inline-block;
    padding: 12px 30px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pay-download-box .btn-primary {
    background: #667eea;
}

.pay-download-box .btn-success {
    background: #28a745;
}

.download-box .btn-success:hover,
.pay-download-box .btn-primary:hover,
.pay-download-box .btn-success:hover {
    opacity: 0.9;
}

.download-locked-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.download-locked-box h3 {
    color: #856404;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.download-locked-box p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.download-locked-box .btn-warning {
    display: inline-block;
    padding: 12px 30px;
    background: #ffc107;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.download-locked-box .btn-warning:hover {
    background: #e0a800;
}

/* 游客提示样式 */
.guest-tip {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    color: #663399;
    font-size: 14px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .pay-methods {
        flex-direction: column;
    }
    
    .pay-method {
        margin-bottom: 10px;
    }
    
    .easypay-type-option {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .payment-option {
        padding: 15px;
    }
    
    .price-display h3 {
        font-size: 36px;
    }
    
    .success-container,
    .waiting-container {
        padding: 30px;
    }
}
