/* 用户中心样式 */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.user-center-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 0;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.menu {
    list-style: none;
}

.menu-item {
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.menu-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.menu-icon {
    font-size: 1.25rem;
}

/* 内容区域 */
.content-area {
    flex: 1;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transition: all 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

.stat-card:hover::before {
    top: -30%;
    right: -30%;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

/* 信息部分 */
.info-section {
    margin: 2rem 0;
}

.info-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.info-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-card p {
    margin: 0.75rem 0;
    color: var(--text-secondary);
}

.info-card strong {
    color: var(--primary-color);
}

.support-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    background: #f0f9ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    color: #0f172a;
}

.tip-icon {
    font-size: 1.25rem;
}

.support-email {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.support-email:hover {
    text-decoration: underline;
}

/* 快速操作 */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* 充值区域 */
.recharge-section {
    max-width: 800px;
}

.amount-selector, .payment-methods {
    margin-bottom: 2rem;
}

.amount-selector h3, .payment-methods h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.amount-option {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.amount-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: var(--primary-color);
    color: white;
}

.amount-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.amount-credits {
    font-size: 0.875rem;
    opacity: 0.8;
}

.custom-amount {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-amount label {
    font-weight: 500;
}

.custom-amount input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

/* 支付方式 */
.method-options {
    display: flex;
    gap: 1rem;
}

.method-option {
    flex: 1;
    cursor: pointer;
}

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

.method-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.method-option input[type="radio"]:checked + .method-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: var(--primary-color);
    color: white;
}

.method-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.method-name {
    font-weight: 500;
}

/* 充值摘要 */
.recharge-summary {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.recharge-summary p {
    margin: 0.5rem 0;
    font-size: 1.125rem;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: var(--bg-light);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.type-recharge {
    color: var(--success-color);
}

.type-consume {
    color: var(--danger-color);
}

.type-refund {
    color: var(--warning-color);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.modal-content h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.qrcode-placeholder {
    width: 250px;
    height: 250px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.payment-info {
    text-align: center;
    margin: 1rem 0;
}

.payment-info p {
    margin: 0.5rem 0;
}

.payment-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .menu {
        display: flex;
        overflow-x: auto;
    }

    .menu-item {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

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

    .quick-actions {
        flex-direction: column;
    }

    .method-options {
        flex-direction: column;
    }
}

/* 收款码显示区域 */
.qrcode-section {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease;
}

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

.qrcode-container {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    text-align: center;
    border: 2px solid var(--primary-color);
}

.qrcode-container h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qrcode-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.amount-display, .credits-display {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.amount-display span, .credits-display span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
}

.qrcode-image {
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-width: 340px;
    border: 3px solid var(--primary-color);
}

.qrcode-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.payment-tips {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbef 100%);
    border: 2px dashed #ffb800;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.tip-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff8c00;
    margin-bottom: 1rem;
    text-align: center;
}

.tip-list {
    margin: 0;
    padding-left: 1.8rem;
    color: #555;
}

.tip-list li {
    margin: 1rem 0;
    line-height: 1.8;
    font-size: 0.95rem;
}

.tip-list .highlight {
    background: #ffeb3b;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.tip-list strong {
    color: var(--primary-color);
}

.qrcode-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.qrcode-actions button {
    min-width: 160px;
}

@media (max-width: 768px) {
    .qrcode-container {
        padding: 1.5rem;
    }
    
    .qrcode-image {
        max-width: 280px;
    }
    
    .qrcode-actions {
        flex-direction: column;
    }
    
    .qrcode-actions button {
        width: 100%;
    }
}

