/* 个人中心专用样式 */

.profile-main {
    padding: 40px 0;
    min-height: calc(100vh - 70px);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* 个人信息头部 */
.profile-header {
    margin-bottom: 30px;
}

.profile-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f1f5f9;
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid #fff;
}

.avatar-upload:hover {
    background: #4338ca;
    transform: scale(1.1);
}

.avatar-upload i {
    color: #fff;
    font-size: 14px;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.profile-info p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

/* 标签页样式 */
.profile-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tabs {
    border-bottom: 1px solid #e2e8f0;
}

.tab-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-item {
    flex: 1;
}

.tab-link {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-link:hover,
.tab-link.active {
    color: #4f46e5;
    background: #f8fafc;
    border-bottom-color: #4f46e5;
}

.tab-content {
    display: none;
    padding: 30px;
}

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

/* 概览页面 */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.overview-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.overview-card .card-header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overview-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all {
    color: #4f46e5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.overview-card .card-body {
    padding: 20px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-box {
    text-align: center;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 4px;
}

.stat-text {
    font-size: 12px;
    color: #64748b;
}

/* 最近记录 */
.recent-logs {
    max-height: 300px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.log-item:last-child {
    border-bottom: none;
}

.log-info {
    flex: 1;
}

.log-type {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

.log-time {
    font-size: 12px;
    color: #64748b;
}

.log-amount {
    font-size: 14px;
    font-weight: 600;
}

.log-amount.positive {
    color: #10b981;
}

.log-amount.negative {
    color: #ef4444;
}

/* 消费分类 */
.consume-categories {
    max-height: 300px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.category-item:last-child {
    border-bottom: none;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

.category-count {
    font-size: 12px;
    color: #64748b;
}

.category-amount {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
}

/* 快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #64748b;
}

.action-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 20px;
}

.action-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* 积分管理页面 */
.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.credits-balance h3 {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
}

.credits-actions {
    display: flex;
    gap: 12px;
}

/* 积分筛选 */
.credits-filter {
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 20px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

/* 积分记录 */
.credits-logs {
    min-height: 400px;
}

.log-list {
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.log-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.3s;
}

.log-list-item:hover {
    background: #f8fafc;
}

.log-list-item:last-child {
    border-bottom: none;
}

.log-main {
    flex: 1;
}

.log-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.log-desc {
    font-size: 12px;
    color: #64748b;
}

.log-meta {
    text-align: right;
}

.log-amount-large {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.log-amount-large.positive {
    color: #10b981;
}

.log-amount-large.negative {
    color: #ef4444;
}

.log-time-large {
    font-size: 12px;
    color: #64748b;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.page-btn:hover,
.page-btn.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 设置页面 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.settings-card .card-header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.settings-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-card .card-body {
    padding: 20px;
    background: #fff;
}

/* 安全项目 */
.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.security-item:last-child {
    border-bottom: none;
}

.security-info h4 {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.security-info p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

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

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

/* 充值模态框 */
.modal-large {
    max-width: 800px;
}

.recharge-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.recharge-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.recharge-tab:hover,
.recharge-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.recharge-content {
    display: none;
}

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

/* 套餐网格 */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.package-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.package-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.package-card.selected {
    border-color: #4f46e5;
    background: #f0f4ff;
}

.package-card.popular::before {
    content: '推荐';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #4f46e5;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.package-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.package-price {
    font-size: 24px;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 8px;
}

.package-credits {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}

.package-bonus {
    font-size: 12px;
    color: #10b981;
    font-weight: 500;
}

.package-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

/* 自定义充值 */
.credits-preview {
    color: #4f46e5;
    font-weight: 500;
}

/* 加载占位符 */
.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.loading-placeholder i {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .profile-main {
        padding: 20px 0;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 30px;
    }
    
    .profile-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .credits-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .credits-actions {
        justify-content: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-card {
        padding: 20px;
    }
    
    .profile-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .avatar-upload {
        width: 28px;
        height: 28px;
    }
    
    .profile-info h2 {
        font-size: 24px;
    }
    
    .profile-stats {
        gap: 20px;
    }
    
    .tab-link {
        padding: 16px 12px;
        font-size: 13px;
    }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .modal-large {
        max-width: 95%;
    }
}