/* Profile page specific styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 10px; /* 减少底部内边距 */
    position: relative;
    z-index: 1;
    /* Sticky Footer: 让主内容区域填充剩余空间 */
    flex: 1;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h1 {
    margin: 20px 0 10px;
    font-size: 2.5em;
    color: white;
    text-shadow: 
        3px 3px 0 rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 255, 255, 0.8),
        0 0 50px rgba(255, 215, 0, 0.5);
    font-weight: 900;
    letter-spacing: 2px;
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.2);
    animation: titleBounce 1s ease;
}

.profile-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 
        0 6px 0 rgba(0, 0, 0, 0.2),
        0 10px 24px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    animation: fadeInUp 0.5s ease;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 顶部彩色条 */
.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        #FF9500 0%, 
        #FFD700 25%, 
        #4CD964 50%, 
        #4A90E2 75%, 
        #9B59B6 100%);
    border-radius: 24px 24px 0 0;
}

/* 顶部光泽效果 */
.profile-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 0 rgba(0, 0, 0, 0.2),
        0 16px 40px rgba(0, 0, 0, 0.35);
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    /* 确保会员信息在移动端也保持单行显示 */
    .profile-membership {
        flex-wrap: nowrap;
        white-space: nowrap;
        gap: 6px; /* 减小间距以适应移动端 */
        overflow: hidden; /* 防止内容溢出 */
    }
    
    #membership-text {
        font-size: 12px; /* 移动端稍微减小字体 */
    }
    
    #membership-badge {
        flex-shrink: 0; /* 防止图标被压缩 */
    }
}

.profile-basic {
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* When avatar contains membership badge, ensure no background */
.profile-avatar:has(.membership-badge) {
    background: transparent;
    border: none;
    box-shadow: none;
}

.profile-avatar .membership-badge {
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 移除profile-avatar的所有动画和装饰效果 */

.profile-name {
    font-size: 28px;
    font-weight: 900;
    color: #333;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-email {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.profile-joined {
    color: #666;
    font-size: 12px;
}

.profile-membership {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: nowrap; /* 移动端也保持单行显示 */
    white-space: nowrap; /* 防止文字换行 */
}

#membership-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#membership-text {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.upgrade-btn {
    padding: 6px 16px;
    border: none;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    color: white;
    cursor: pointer;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.15s ease;
    box-shadow: 0 3px 0 rgba(255, 140, 0, 0.3);
    display: inline-block;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid #FF8C00;
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(255, 140, 0, 0.3);
    background: linear-gradient(180deg, #FFE44D 0%, #FFB347 50%, #FF9500 100%);
}

.upgrade-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(255, 140, 0, 0.3);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 收藏数卡片特殊样式 - 橙色主题 */
.stat-item:has(#favorite-count) {
    border-top: 4px solid #FF9500;
    position: relative;
}

.stat-item:has(#favorite-count)::before {
    background: linear-gradient(90deg, 
        rgba(255, 149, 0, 0.1) 0%, 
        rgba(255, 149, 0, 0.05) 100%);
}

.stat-item:has(#favorite-count) .stat-value {
    color: #FF9500;
    text-shadow: 0 2px 4px rgba(255, 149, 0, 0.3);
}

.stat-item:has(#favorite-count) .stat-label {
    color: #FF9500;
    font-weight: 700;
}

/* 响应式: 在小屏幕上显示2列 */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 在超小屏幕上显示1列 */
@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    border-radius: 16px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 0 rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* 统计卡片顶部光泽 */
.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 6px 0 rgba(0, 0, 0, 0.2),
        0 10px 20px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: #4A90E2;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}


.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F0 50%, #D0D0D0 100%);
    cursor: pointer;
    border-radius: 16px;
    text-decoration: none;
    color: #4A90E2;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
    display: inline-block;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #A0A0A0;
}

/* 按钮顶部光泽 */
.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.action-btn.primary {
    background: linear-gradient(180deg, #63A4E8 0%, #4A90E2 50%, #357ABD 100%);
    color: white;
    border-bottom: 3px solid #2C5F8F;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(180deg, #74B4F0 0%, #5BA0E8 50%, #4088C5 100%);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #6366F1;
    font-weight: 600;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #C7D2FE;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    font-size: 18px;
}

.nav-links {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    border: 2px solid #C7D2FE;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 15px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-links a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.profile-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.profile-empty h2 {
    color: #333;
    margin-bottom: 10px;
}

/* Edit profile styles */
.edit-name-input {
    padding: 8px 15px;
    border: 2px solid #6366F1;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    max-width: 300px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.edit-name-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    transform: scale(1.02);
}

.edit-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.save-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.save-btn {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
}

.save-btn:hover {
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.cancel-btn {
    background: linear-gradient(135deg, #F5F5F5, #E0E0E0);
    color: #666;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.saving {
    background: #9E9E9E !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Profile Messages Section */
.profile-messages-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 
        0 6px 0 rgba(0, 0, 0, 0.2),
        0 10px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* 顶部彩色条 */
.profile-messages-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        #FF9500 0%, 
        #FFD700 25%, 
        #4CD964 50%, 
        #4A90E2 75%, 
        #9B59B6 100%);
    border-radius: 24px 24px 0 0;
}

/* 顶部光泽效果 */
.profile-messages-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 0;
}

#profile-messages-container {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .profile-messages-section {
        padding: 15px;
        margin-top: 20px;
    }
}

/* Profile Subscription Section */
.profile-subscription-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0F8FF 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 10px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.subscription-header h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.subscription-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.subscription-badge {
    font-size: 32px;
}

.subscription-info {
    flex: 1;
}

.subscription-plan {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.subscription-details {
    font-size: 14px;
    color: #666;
}

.subscription-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.subscription-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn {
    background: #ff4444;
    color: white;
}

.cancel-btn:hover {
    background: #cc0000;
}

.upgrade-btn {
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    color: white;
}

.upgrade-btn:hover {
    background: linear-gradient(180deg, #FFE44D 0%, #FFB347 50%, #FF9500 100%);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .profile-subscription-section {
        padding: 15px;
        margin-top: 20px;
    }
    
    .subscription-actions {
        flex-direction: column;
    }
    
    .subscription-btn {
        width: 100%;
    }
}


/* 匿名用户升级区域 */
.anonymous-upgrade-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #FDE68A;
}

.upgrade-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 16px;
    border: 2px solid #F59E0B;
}

.upgrade-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.upgrade-content {
    flex: 1;
}

.upgrade-content h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #92400E;
    font-weight: 700;
}

.upgrade-content p {
    margin: 0;
    font-size: 14px;
    color: #B45309;
}

.upgrade-action-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.upgrade-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

@media (max-width: 600px) {
    .upgrade-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .upgrade-action-btn {
        width: 100%;
    }
}
