/* 个人中心页面样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
}

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

/* 顶部导航栏 */
.top-bar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #409eff;
}

.logo i {
    font-size: 2rem;
}

.top-bar-right {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: #409eff;
    color: white;
}

.btn-primary:hover {
    background: #66b1ff;
}

.btn-secondary {
    background: #909399;
    color: white;
}

.btn-secondary:hover {
    background: #a6a9ad;
}

.btn-outline {
    background: transparent;
    color: #409eff;
    border: 1px solid #409eff;
}

.btn-outline:hover {
    background: #ecf5ff;
}

.btn-danger {
    background: #f56c6c;
    color: white;
}

.btn-danger:hover {
    background: #f78989;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

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

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: #606266;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: #ecf5ff;
    color: #409eff;
}

.nav-item.active .nav-link {
    background: #409eff;
    color: white;
    border-right: 3px solid #66b1ff;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 2rem;
}

.content-section {
    display: none;
}

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

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #303133;
}

.section-header h3 {
    font-size: 1.4rem;
    color: #606266;
    margin-top: 2rem;
}

/* 个人信息卡片 */
.profile-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 3rem;
}

.profile-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
}

.profile-info {
    flex: 1;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #ebeef5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    width: 120px;
    color: #909399;
    font-weight: 500;
}

.info-row span {
    flex: 1;
    color: #303133;
}

.referral-code {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #409eff;
    font-size: 1.1rem;
}

/* 兑换码卡片 */
.redeem-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.redeem-card h3 {
    font-size: 1.5rem;
    color: #303133;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.redeem-card h3 i {
    color: #f56c6c;
}

.hint {
    color: #909399;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.redeem-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.redeem-input:focus {
    outline: none;
    border-color: #409eff;
}

.redeem-tips {
    margin-top: 2rem;
    padding: 1rem;
    background: #f4f4f5;
    border-radius: 4px;
}

.redeem-tips h4 {
    color: #606266;
    margin-bottom: 0.5rem;
}

.redeem-tips ul {
    list-style: none;
    padding-left: 1rem;
}

.redeem-tips li {
    color: #909399;
    margin-bottom: 0.5rem;
    position: relative;
}

.redeem-tips li:before {
    content: "•";
    position: absolute;
    left: -1rem;
    color: #409eff;
}

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

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

.data-table thead {
    background: #f5f7fa;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #606266;
    border-bottom: 2px solid #ebeef5;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #ebeef5;
    color: #606266;
}

.data-table tbody tr:hover {
    background: #f5f7fa;
}

.data-table code {
    background: #f4f4f5;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #409eff;
}

.loading, .no-data {
    text-align: center;
    padding: 2rem;
    color: #909399;
}

/* 状态徽章 */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-success {
    background: #f0f9ff;
    color: #67c23a;
}

.status-error {
    background: #fef0f0;
    color: #f56c6c;
}

.status-inactive {
    background: #f4f4f5;
    color: #909399;
}

/* 等级网格 */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.level-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    transition: transform 0.3s;
}

.level-card:hover {
    transform: translateY(-5px);
}

.level-card.active {
    border: 2px solid #409eff;
}

.level-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
}

.level-info {
    flex: 1;
}

.level-info h3 {
    font-size: 1.3rem;
    color: #303133;
    margin-bottom: 0.5rem;
}

.level-code {
    color: #909399;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.level-desc {
    color: #606266;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.level-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expires-at {
    font-size: 0.85rem;
    color: #909399;
}

/* 推荐卡片 */
.referral-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.referral-card h3 {
    font-size: 1.5rem;
    color: #303133;
    margin-bottom: 1.5rem;
}

.referral-code-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.referral-code-display code {
    flex: 1;
    font-size: 1.5rem;
    font-weight: bold;
    color: #409eff;
    font-family: 'Courier New', monospace;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* 安全设置卡片 */
.security-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    max-width: 500px;
}

.security-card h3 {
    font-size: 1.5rem;
    color: #303133;
    margin-bottom: 1.5rem;
}

.security-card .form-group {
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.security-card label {
    margin-bottom: 0.5rem;
    color: #606266;
    font-weight: 500;
}

.security-card input {
    padding: 0.75rem 1rem;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 1rem;
}

.security-card input:focus {
    outline: none;
    border-color: #409eff;
}

/* 消息提示 */
.message-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

.message {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.message-success {
    border-left: 4px solid #67c23a;
}

.message-error {
    border-left: 4px solid #f56c6c;
}

.message-info {
    border-left: 4px solid #409eff;
}

.message i {
    font-size: 1.2rem;
}

.message-success i {
    color: #67c23a;
}

.message-error i {
    color: #f56c6c;
}

.message-info i {
    color: #409eff;
}

.message.fade-out {
    animation: slideOut 0.3s ease-out;
}

@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;
    }
}

/* 加载遮罩 */
.loading-overlay {
    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: 2000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

    .sidebar {
        width: 100%;
        padding: 1rem 0;
    }

    .nav-link {
        padding: 0.75rem 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .profile-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .info-row label {
        width: auto;
    }

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

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

    .form-group {
        flex-direction: column;
    }

    .message-container {
        left: 20px;
        right: 20px;
    }
}
