/**
 * 钱包页面样式
 * Wallet.js 专用样式
 * 使用 .wallet- 前缀避免样式冲突
 */

/* ============================================
   CSS 变量定义
   ============================================ */

:root {
    /* 钱包页面专用颜色 */
    --wallet-primary: #667eea;
    --wallet-primary-light: #8794f5;
    --wallet-success: #10b981;
    --wallet-success-light: #34d399;
    --wallet-danger: #ef4444;
    --wallet-danger-light: #f87171;
    --wallet-warning: #f59e0b;
    --wallet-warning-light: #fbbf24;
    --wallet-info: #3b82f6;
    --wallet-purple: #8b5cf6;
    
    /* 渐变 */
    --wallet-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --wallet-success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --wallet-danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --wallet-warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --wallet-purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    /* 间距 */
    --wallet-space-xs: 4px;
    --wallet-space-sm: 8px;
    --wallet-space-md: 16px;
    --wallet-space-lg: 24px;
    --wallet-space-xl: 32px;
    --wallet-space-2xl: 40px;
    
    /* 圆角 */
    --wallet-radius-sm: 8px;
    --wallet-radius-md: 12px;
    --wallet-radius-lg: 16px;
    --wallet-radius-xl: 20px;
    --wallet-radius-full: 9999px;
    
    /* 阴影 */
    --wallet-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --wallet-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --wallet-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* 文字颜色 */
    --wallet-text-primary: #1a202c;
    --wallet-text-secondary: #4a5568;
    --wallet-text-muted: #718096;
}

/* ============================================
   页面容器
   ============================================ */

.wallet-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--wallet-space-xl);
    min-height: 100vh;
}

/* ============================================
   余额卡片
   ============================================ */

.wallet-balance-card {
    background: var(--wallet-gradient);
    border-radius: var(--wallet-radius-xl);
    padding: var(--wallet-space-lg);
    box-shadow: var(--wallet-shadow-lg);
    margin-bottom: var(--wallet-space-xl);
    color: white;
    position: relative;
    overflow: hidden;
}

.wallet-balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--wallet-space-lg);
}

.wallet-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.wallet-actions-header {
    display: flex;
    gap: var(--wallet-space-sm);
}

.wallet-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--wallet-radius-full);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wallet-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.wallet-balance-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.wallet-balance-label {
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

.wallet-balance-amount {
    font-size: 36px;
    font-weight: 800;
    margin: var(--wallet-space-sm) 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wallet-balance-change {
    display: inline-flex;
    align-items: center;
    gap: var(--wallet-space-sm);
    padding: var(--wallet-space-sm) var(--wallet-space-md);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--wallet-radius-full);
    font-size: 14px;
    font-weight: 600;
}

.wallet-balance-change.positive {
    color: #d1fae5;
}

.wallet-balance-change.negative {
    color: #fee2e2;
}

/* ============================================
   快捷操作按钮
   ============================================ */

.wallet-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--wallet-space-md);
    margin-bottom: var(--wallet-space-xl);
}

.wallet-quick-action {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--wallet-radius-lg);
    padding: var(--wallet-space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--wallet-text-primary);
}

.wallet-quick-action:hover {
    transform: translateY(-4px);
    box-shadow: var(--wallet-shadow-md);
}

/* 充值按钮样式 */
.wallet-quick-action.deposit {
    border-color: #10b981;
    color: #10b981;
}

.wallet-quick-action.deposit:hover {
    background: #f0fdf4;
    border-color: #059669;
}

/* 提现按钮样式 */
.wallet-quick-action.withdraw {
    border-color: #ef4444;
    color: #ef4444;
}

.wallet-quick-action.withdraw:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* ============================================
   筛选器
   ============================================ */

.wallet-filters {
    background: white;
    border-radius: var(--wallet-radius-lg);
    padding: var(--wallet-space-md);
    box-shadow: var(--wallet-shadow-sm);
    margin-bottom: var(--wallet-space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--wallet-space-sm);
}

.wallet-filter-tabs {
    display: flex;
    gap: var(--wallet-space-xs);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wallet-filter-tab {
    padding: var(--wallet-space-xs) var(--wallet-space-md);
    border: 2px solid #e5e7eb;
    border-radius: var(--wallet-radius-full);
    background: white;
    color: var(--wallet-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 84px;
    text-align: center;
}

.wallet-filter-tab:hover {
    border-color: var(--wallet-primary);
    color: var(--wallet-primary);
}

.wallet-filter-tab.active {
    background: var(--wallet-gradient);
    border-color: var(--wallet-primary);
    color: white;
}

.wallet-filter-date {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: var(--wallet-space-xs);
    align-items: center;
}

/* 原生日期输入样式 */
.wallet-date-input-native {
    padding: 0 var(--wallet-space-sm);
    height: 42px;
    border: 2px solid #e5e7eb;
    border-radius: var(--wallet-radius-full);
    background: white;
    color: var(--wallet-text-primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallet-date-input-native:hover {
    border-color: var(--wallet-primary);
    background: #f9fafb;
}

.wallet-date-input-native:focus {
    outline: none;
    border-color: var(--wallet-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.wallet-date-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 calc(var(--wallet-space-sm) + 6px);
    height: 42px;
    border: none;
    border-radius: var(--wallet-radius-full);
    background: var(--wallet-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallet-date-picker-btn:hover {
    opacity: 0.9;
}

.wallet-date-picker-btn i {
    color: inherit;
}

/* ============================================
   交易记录列表
   ============================================ */

.wallet-transactions-section {
    background: white;
    border-radius: var(--wallet-radius-lg);
    padding: var(--wallet-space-lg);
    box-shadow: var(--wallet-shadow-sm);
    margin-bottom: var(--wallet-space-xl);
}

.wallet-transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--wallet-space-lg);
}

.wallet-transactions-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wallet-text-primary);
    margin: 0;
}

.wallet-transaction-list {
    display: flex;
    flex-direction: column;
    gap: var(--wallet-space-md);
}

.wallet-transaction-item {
    display: flex;
    align-items: center;
    gap: var(--wallet-space-md);
    padding: var(--wallet-space-md);
    border-radius: var(--wallet-radius-md);
    transition: all 0.2s ease;
    background: #f9fafb;
}

.wallet-transaction-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.wallet-transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--wallet-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.wallet-transaction-icon.credit {
    background: var(--wallet-success-gradient);
}

.wallet-transaction-icon.debit {
    background: var(--wallet-danger-gradient);
}

.wallet-transaction-icon.neutral {
    background: var(--wallet-purple-gradient);
}

.wallet-transaction-info {
    flex: 1;
    min-width: 0;
}

.wallet-transaction-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--wallet-text-primary);
    margin-bottom: var(--wallet-space-xs);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 状态指示器（彩色圆圈） */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 审核中 - 黄色 */
.status-indicator.pending {
    background-color: #FCD34D;
    box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.2);
    animation: pulse-yellow 2s infinite;
}

/* 已完成 - 绿色 */
.status-indicator.completed,
.status-indicator.approved {
    background-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* 已拒绝 - 红色 */
.status-indicator.rejected {
    background-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* 审核中的脉动动画 */
@keyframes pulse-yellow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.wallet-transaction-date {
    font-size: 13px;
    color: var(--wallet-text-muted);
}

.wallet-transaction-amount {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.wallet-transaction-amount.positive {
    color: var(--wallet-success);
}

.wallet-transaction-amount.negative {
    color: var(--wallet-danger);
}

/* ============================================
   加载更多按钮
   ============================================ */

.wallet-load-more-section {
    text-align: center;
    margin-top: var(--wallet-space-lg);
}

.wallet-load-more-btn {
    padding: var(--wallet-space-md) var(--wallet-space-2xl);
    border: 2px solid var(--wallet-primary);
    border-radius: var(--wallet-radius-full);
    background: white;
    color: var(--wallet-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: var(--wallet-space-sm);
}

.wallet-load-more-btn:hover {
    background: var(--wallet-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--wallet-shadow-md);
}

.wallet-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   日期选择模态框
   ============================================ */

.wallet-date-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--wallet-space-lg);
}

.wallet-date-modal.show {
    display: flex;
}

.wallet-date-modal-content {
    background: white;
    border-radius: var(--wallet-radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--wallet-shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.wallet-date-modal-header {
    padding: var(--wallet-space-xl);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-date-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--wallet-text-primary);
    margin: 0;
}

.wallet-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--wallet-radius-full);
    background: #f3f4f6;
    border: none;
    color: var(--wallet-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wallet-modal-close:hover {
    background: #e5e7eb;
    color: var(--wallet-text-primary);
}

.wallet-date-modal-body {
    padding: var(--wallet-space-xl);
}

.wallet-date-input-group {
    margin-bottom: var(--wallet-space-lg);
}

.wallet-date-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wallet-text-primary);
    margin-bottom: var(--wallet-space-sm);
}

.wallet-date-input {
    width: 100%;
    padding: var(--wallet-space-md);
    border: 2px solid #e5e7eb;
    border-radius: var(--wallet-radius-md);
    font-size: 15px;
    color: var(--wallet-text-primary);
    transition: all 0.2s ease;
}

.wallet-date-input:focus {
    outline: none;
    border-color: var(--wallet-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wallet-date-quick-select {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--wallet-space-sm);
    margin-top: var(--wallet-space-lg);
}

.wallet-quick-date-btn {
    padding: var(--wallet-space-sm);
    border: 2px solid #e5e7eb;
    border-radius: var(--wallet-radius-md);
    background: white;
    color: var(--wallet-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
}

.wallet-quick-date-btn:hover {
    border-color: var(--wallet-primary);
    color: var(--wallet-primary);
}

.wallet-date-modal-footer {
    padding: var(--wallet-space-xl);
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: var(--wallet-space-md);
}

.wallet-btn-primary,
.wallet-btn-secondary {
    flex: 1;
    padding: var(--wallet-space-md);
    border-radius: var(--wallet-radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
}

.wallet-btn-primary {
    background: var(--wallet-gradient);
    color: white;
}

.wallet-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--wallet-shadow-md);
}

.wallet-btn-secondary {
    background: #f3f4f6;
    color: var(--wallet-text-secondary);
}

.wallet-btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================
   空状态和加载状态
   ============================================ */

.wallet-empty-state {
    text-align: center;
    padding: var(--wallet-space-2xl);
    color: var(--wallet-text-muted);
}

.wallet-empty-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: var(--wallet-space-md);
}

.wallet-empty-text {
    font-size: 16px;
}

.wallet-loading {
    text-align: center;
    padding: var(--wallet-space-xl);
    color: var(--wallet-text-muted);
}

.wallet-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   响应式设计
   ============================================ */

/* 平板 */
@media (max-width: 768px) {
    .wallet-page {
        padding: var(--wallet-space-lg);
    }
    
    .wallet-balance-card {
        padding: var(--wallet-space-xl);
    }
    
    .wallet-balance-amount {
        font-size: 36px;
    }
    
    .wallet-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wallet-space-sm);
    }

    .wallet-quick-action {
        padding: var(--wallet-space-md);
        font-size: 15px;
    }
}

/* 移动端 */
@media (max-width: 480px) {
    .wallet-page {
        padding: var(--wallet-space-md);
    }
    
    .wallet-balance-card {
        padding: var(--wallet-space-lg);
    }
    
    .wallet-header h2 {
        font-size: 20px;
    }
    
    .wallet-balance-amount {
        font-size: 32px;
    }
    
    .wallet-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wallet-quick-action {
        flex-direction: row;
        justify-content: center;
    }
    
    .wallet-filter-tabs {
        justify-content: center;
    }
    
    .wallet-filter-tab {
        font-size: 13px;
        padding: var(--wallet-space-sm) var(--wallet-space-md);
    }
    
    .wallet-transaction-item {
        padding: var(--wallet-space-sm);
    }
    
    .wallet-transaction-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .wallet-transaction-title {
        font-size: 14px;
    }
    
    .wallet-transaction-amount {
        font-size: 16px;
    }
    
    .wallet-date-quick-select {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wallet-pagination {
        gap: var(--wallet-space-xs);
        padding: var(--wallet-space-sm);
    }
    
    .wallet-pagination-btn {
        width: 32px;
        height: 32px;
    }
    
    .wallet-pagination-number {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* ============================================
   新增：页面头部样式
   ============================================ */

.wallet-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.wallet-header {
    text-align: center;
    margin-bottom: var(--wallet-space-xl);
}

.wallet-header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: var(--wallet-space-md);
}

.wallet-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--wallet-text-primary);
    margin: 0;
}

.wallet-subtitle {
    font-size: 14px;
    color: var(--wallet-text-muted);
    margin: 0;
}

/* ============================================
   新增：分页控件样式
   ============================================ */

.wallet-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wallet-space-sm);
    margin-top: var(--wallet-space-lg);
    padding: var(--wallet-space-md);
}

.wallet-pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--wallet-radius-full);
    border: 2px solid #e5e7eb;
    background: white;
    color: var(--wallet-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-pagination-btn:hover:not(:disabled) {
    border-color: var(--wallet-primary);
    color: var(--wallet-primary);
    transform: scale(1.05);
}

.wallet-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wallet-pagination-numbers {
    display: flex;
    gap: var(--wallet-space-xs);
}

.wallet-pagination-number {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--wallet-space-sm);
    border-radius: var(--wallet-radius-md);
    border: 2px solid #e5e7eb;
    background: white;
    color: var(--wallet-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.wallet-pagination-number:hover {
    border-color: var(--wallet-primary);
    color: var(--wallet-primary);
}

.wallet-pagination-number.active {
    background: var(--wallet-gradient);
    border-color: var(--wallet-primary);
    color: white;
}

.wallet-pagination-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wallet-text-muted);
}

@media (max-width: 520px) {
    .wallet-summary {
        grid-template-columns: 1fr;
        gap: var(--wallet-space-md);
    }

    .wallet-balance-card {
        padding: var(--wallet-space-lg);
        min-height: auto;
    }

    .wallet-balance-amount {
        font-size: 32px;
    }

    .wallet-filter-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--wallet-space-xs);
        overflow: hidden;
    }

    .wallet-filter-tab {
        font-size: 13px;
        padding: var(--wallet-space-sm) var(--wallet-space-md);
        min-width: 0;
        white-space: normal;
    }

    .wallet-filter-date {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
        gap: var(--wallet-space-sm);
    }

    .wallet-date-picker-btn {
        padding: 0 calc(var(--wallet-space-sm) + 4px);
    }

    .wallet-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wallet-space-md);
    }
}

