/* ==================== 用户等级系统样式 ==================== */

/* 等级展示区域 */
.level-display {
    background: linear-gradient(135deg, var(--secondary-light) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.level-display::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    flex-shrink: 0;
}

.level-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--gold-color);
    animation: levelIconRotate 3s linear infinite;
}

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

/* 各等级颜色 */
.level-yashi {
    background: linear-gradient(135deg, #AED581 0%, #7CB342 100%);
}

.level-xiucai {
    background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%);
}

.level-juren {
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
}

.level-jinshi {
    background: linear-gradient(135deg, #BA68C8 0%, #AB47BC 100%);
}

.level-hanlin {
    background: linear-gradient(135deg, #FF7043 0%, #D4A574 50%, #EF5350 100%);
}

.level-info {
    flex: 1;
}

.level-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-left: 0.5rem;
}

/* 等级进度条 */
.level-progress-section {
    margin-top: 1rem;
}

.level-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.level-progress-label {
    color: var(--text-secondary);
}

.level-progress-value {
    color: var(--primary-color);
    font-weight: 600;
}

.level-progress-bar {
    height: 8px;
    background: var(--secondary-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
}

.level-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 升级条件 */
.level-requirements {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.level-requirements h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.requirement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.requirement-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.requirement-item.completed {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-color: #81C784;
    color: #2E7D32;
}

.requirement-item.completed::before {
    content: '✓';
    color: #4CAF50;
    font-weight: bold;
}

/* 等级权益 */
.level-benefits {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold-color);
}

.level-benefits h4 {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.benefit-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.benefit-item::before {
    content: '•';
    color: var(--gold-color);
    font-size: 1.2rem;
}

/* ==================== 升级弹窗样式 ==================== */
.level-up-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-up-modal.show {
    opacity: 1;
}

.level-up-content {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 50%, #FFE082 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(212, 165, 116, 0.3),
        inset 0 0 60px rgba(255, 255, 255, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 2px solid var(--gold-color);
}

.level-up-modal.show .level-up-content {
    transform: scale(1);
}

.level-up-decoration {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: lanternSwing 2s ease-in-out infinite;
}

@keyframes lanternSwing {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.level-up-title {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: var(--font-family);
}

.level-up-icon {
    margin: 1.5rem 0;
    animation: levelIconPulse 1s ease-in-out;
}

@keyframes levelIconPulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.level-up-level {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.level-up-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.level-up-message {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold-color);
}

.level-up-benefits {
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
}

.level-up-benefits h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.level-up-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.level-up-benefits li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.level-up-benefits li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold-dark);
}

.level-up-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(201, 55, 44, 0.4);
    font-family: var(--font-family);
    letter-spacing: 0.2rem;
}

.level-up-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 55, 44, 0.5);
}

/* 装饰性边角 */
.level-up-content::before,
.level-up-content::after {
    content: '❧';
    position: absolute;
    font-size: 1.5rem;
    color: var(--gold-dark);
    opacity: 0.5;
}

.level-up-content::before {
    top: 1rem;
    left: 1rem;
}

.level-up-content::after {
    bottom: 1rem;
    right: 1rem;
    transform: rotate(180deg);
}

/* ==================== 数字名片样式 ==================== */
.digital-card {
    background: linear-gradient(135deg, var(--secondary-light) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.digital-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.digital-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.digital-card-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.digital-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.1rem;
}

.digital-card-body {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.digital-card-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold-color);
}

.digital-card-level-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.digital-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.digital-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.digital-card-level {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.digital-card-title-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.digital-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.digital-card-stat {
    text-align: center;
}

.digital-card-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.digital-card-stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.digital-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-light);
}

.digital-card-id {
    font-family: monospace;
    letter-spacing: 0.05rem;
}

.digital-card-seal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--accent-color);
    transform: rotate(15deg);
    opacity: 0.6;
    font-weight: 600;
}

/* 数字名片模态框 */
.digital-card-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.digital-card-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    position: relative;
}

.digital-card-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.digital-card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.digital-card-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-download-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-share-card {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ==================== 等级图标小尺寸 ==================== */
.level-icon-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

.level-icon-medium {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* 等级标签 */
.level-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

/* 响应式适配 */
@media (max-width: 640px) {
    .level-header {
        flex-direction: column;
        text-align: center;
    }

    .level-icon-wrapper {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .level-up-content {
        padding: 1.5rem;
    }

    .level-up-title {
        font-size: 1.5rem;
        letter-spacing: 0.3rem;
    }

    .level-up-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .digital-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .digital-card-seal {
        width: 50px;
        height: 50px;
        font-size: 0.65rem;
    }
}

/* 等级成就徽章 */
.level-achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(212, 165, 116, 0.1));
    border: 1px solid var(--gold-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.level-achievement .icon {
    font-size: 1.25rem;
}

/* 等级时间线 */
.level-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.level-timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.level-timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.level-timeline-item.completed:not(:last-child)::after {
    background: linear-gradient(90deg, var(--gold-color), var(--border-color));
}

.level-timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    color: var(--text-light);
}

.level-timeline-item.completed .level-timeline-icon {
    border-color: var(--gold-color);
    color: var(--gold-dark);
}

.level-timeline-item.current .level-timeline-icon {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(43, 95, 117, 0.2);
}

.level-timeline-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

.level-timeline-item.completed .level-timeline-label,
.level-timeline-item.current .level-timeline-label {
    color: var(--text-primary);
    font-weight: 500;
}
