﻿/* 页面通用样式 */
.page-container {
    padding: 20px;
    padding-bottom: 72px; /* 与导航栏高度一致 */
    height: calc(100vh - 72px); /* 精确设置高度，防止过度滚动 */
    overflow-y: auto; /* 只在需要时滚动 */
    box-sizing: border-box;
}

/* 对所有主内容区域使用更强的优先级 */
.main-content {
    height: calc(100vh - 72px) !important;
    max-height: calc(100vh - 72px) !important;
    overflow-y: auto !important;
    padding-bottom: 72px !important;
}

/* 模板页面需要能够滚动，覆盖上面的设置 */
.main-content.template-page {
    height: auto !important;
    max-height: none !important;
    min-height: calc(100vh - 72px) !important;
    overflow-y: auto !important;
    padding-bottom: 80px !important;
}

/* 针对个人中心页面，防止不必要的滚动 - 最高优先级 */
body .app-container .main-content .page-container.profile-page {
    height: calc(100vh - 72px) !important;
    max-height: calc(100vh - 72px) !important;
    overflow: hidden !important; /* 禁止所有方向的滚动 */
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    min-height: auto !important;
}

/* 隐藏个人中心页面的滚动条 */
body .app-container .main-content .page-container.profile-page::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body .app-container .main-content .page-container.profile-page {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* 对主容器也应用滚动控制 - 个人中心 */
body .app-container .main-content.profile-page {
    overflow: hidden !important;
    overflow-y: hidden !important;
}

body .app-container .main-content.profile-page::-webkit-scrollbar {
    display: none !important;
}

/* 首页和AI页面统一滚动行为 */
body .app-container .main-content.home-page,
body .app-container .main-content.ai-writer-page {
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important; /* 允许正常滚动 */
    min-height: calc(100vh - 72px) !important; /* 最小高度保证填满屏幕 */
    padding-bottom: 80px !important; /* 给底部导航栏留空间 */
}

/* 确保海报容器在顶部统一位置 */
.main-content.home-page .poster-container {
    margin-top: 0 !important;
    margin-bottom: var(--spacing-xl) !important;
    position: relative;
}

/* AI页面海报单独设置，向上移动20px */
.main-content.ai-writer-page .poster-container {
    margin-top: -20px !important;
    margin-bottom: var(--spacing-xl) !important;
    position: relative;
}

/* 智能体页面也需要更强的优先级 - 完全禁止滚动 */
body .app-container .main-content .page-container.ai-page {
    height: calc(100vh - 72px) !important;
    max-height: calc(100vh - 72px) !important;
    overflow: hidden !important; /* 禁止所有方向的滚动 */
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    padding-bottom: 72px !important;
    min-height: auto !important;
}

/* 隐藏滚动条 - 智能体页面 */
body .app-container .main-content .page-container.ai-page::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body .app-container .main-content .page-container.ai-page {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* 对主容器也应用滚动控制 */
body .app-container .main-content.ai-page {
    overflow: hidden !important;
    overflow-y: hidden !important;
}

body .app-container .main-content.ai-page::-webkit-scrollbar {
    display: none !important;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 700;
}

.page-header p {
    color: #666;
    font-size: 1rem;
    opacity: 0.8;
}

/* AI页面样式 */
.ai-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* AI页面特殊处理，减少底部空间 */
.ai-page .page-container {
    height: calc(100vh - 72px) !important; /* 精确设置高度 */
    overflow-y: hidden !important; /* 禁止滚动，因为内容足够显示 */
    padding-bottom: 72px !important;
    min-height: auto !important;
}

.ai-card {
    background: white;
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.ai-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.ai-card:active {
    transform: translateY(-4px) scale(0.98);
}

.ai-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: all 0.3s ease;
}

.ai-card:hover .ai-icon {
    transform: scale(1.1) rotate(5deg);
}

.ai-icon i {
    font-size: 1.5rem;
    color: white;
}

.ai-card h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.ai-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}



/* 个人中心样式 - 紧凑版本 */
.profile-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: -20px -20px 20px -20px;
    color: white;
    border-radius: 0 0 25px 25px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar i {
    font-size: 1.5rem;
    color: white;
    opacity: 0.9;
}

.profile-header h2 {
    font-size: 1.3rem;
    margin-bottom: 6px;
    font-weight: 600;
    color: white;
}

.user-level {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 25px;
}

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

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
}

.profile-menu {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

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

.menu-item:hover {
    background: rgba(102, 126, 234, 0.05);
    padding-left: 20px;
}

.menu-item:active {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(0.98);
}

.menu-item i:first-child {
    font-size: 1rem;
    color: #667eea;
    margin-right: 12px;
    width: 18px;
    text-align: center;
}

.menu-item span {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.menu-item i:last-child {
    font-size: 0.8rem;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .page-container {
        padding: 15px;
    }
    
    .ai-features, .template-grid {
        gap: 15px;
    }
    
    .ai-card, .template-card {
        padding: 20px 15px;
    }
    
    .category-tabs {
        padding: 3px;
    }
    
    .tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .user-stats {
        gap: 30px;
    }
}