/* 会员中心页面样式 */

.membership-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 待激活充值码区域 */
.pending-codes-section {
    margin: 0 0 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.pending-codes-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.1"/><circle cx="80" cy="30" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.pending-codes-section .section-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.pending-codes-section .section-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.pending-codes-section .section-desc {
    margin: 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.codes-container {
    position: relative;
    z-index: 1;
}

.code-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.code-card:last-child {
    margin-bottom: 0;
}

.code-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.15);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tier-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.duration-badge {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.price-info {
    text-align: right;
}

.price-info .price {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.code-body {
    margin-bottom: 20px;
}

.code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.code-display label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    white-space: nowrap;
}

.code-value {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.recharge-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.order-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.info-item .label {
    color: rgba(255, 255, 255, 0.8);
}

.info-item .value {
    color: white;
    font-weight: 500;
}

.code-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.activate-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.activate-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.activate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.activate-btn .btn-text,
.activate-btn .btn-loading {
    transition: opacity 0.3s ease;
}

.activate-btn .btn-loading {
    display: none;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 成功动画 */
.activate-btn.success {
    background: linear-gradient(45deg, #00b894, #00cec9) !important;
    transform: scale(1.1) !important;
}

.activate-btn.success::after {
    content: '✅';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .pending-codes-section {
        margin: 0 -20px 32px -20px;
        border-radius: 0;
    }
    
    .code-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .price-info {
        text-align: left;
    }
    
    .order-info {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .code-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .activate-btn,
    .copy-code-btn {
        width: 100%;
        text-align: center;
    }
}

/* 会员状态区域 */
.membership-status {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.status-card,
.quota-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.status-header h2 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.tier-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
}

.tier-badge.free {
    background: #f5f5f5;
    color: #666;
}

.tier-badge.standard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tier-badge.premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.status-info {
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #5a6c7d;
    font-size: 15px;
}

.info-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
}

.info-value.expire-soon {
    color: #f56c6c;
}

.status-actions {
    display: flex;
    gap: 12px;
}

.status-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
}

/* 配额卡片 */
.quota-card h3 {
    font-size: 18px;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.quota-progress {
    margin-bottom: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.3s;
}

.progress-bar.warning {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.quota-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.quota-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.stat-label {
    color: #999;
}

.stat-value {
    color: #1a1a1a;
    font-weight: 500;
}

/* 权益区域 */
.benefits-section {
    margin-bottom: 40px;
}

.benefits-section h2 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 24px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.benefit-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}

.benefit-icon {
    font-size: 32px;
}

.benefit-info {
    flex: 1;
}

.benefit-title {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.benefit-desc {
    font-size: 13px;
    color: #999;
}

.benefit-item.disabled {
    opacity: 0.5;
}

/* 订单区域 */
.orders-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    color: #1a1a1a;
    margin: 0;
}

.order-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.orders-list {
    min-height: 200px;
}

.order-item {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.order-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-no {
    font-size: 14px;
    color: #999;
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.completed {
    background: #d4edda;
    color: #155724;
}

.order-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.order-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-info {
    flex: 1;
}

.order-product {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.order-time {
    font-size: 13px;
    color: #999;
}

.order-price {
    font-size: 24px;
    font-weight: 700;
    color: #f56c6c;
}

.order-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.order-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1a1a1a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-tip {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn {
    flex: 1;
    padding: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
    .membership-status {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .order-filters {
        width: 100%;
        overflow-x: auto;
    }

    .order-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }
}
