/* 导入思源黑体(Source Han Sans) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100;300;400;500;700;900&display=swap');

/* ===== 全局样式 ===== */
body {
    font-family: 'Noto Sans SC', 'Source Han Sans', 'Source Han Sans CN', '思源黑体', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

/* 滚动定位相关 */
#header-banner,
#ai-category-section,
#feature-section,
#contact-section {
    scroll-margin-top: 80px; /* 顶部导航栏高度 + 额外空间 */
}

/* ===== 布局样式 ===== */
/* 左侧固定菜单栏 */
.sidebar {
    z-index: 10;
    border-right: 1px solid #f0f0f0;
    margin-top: 0;
    padding-top: 12px;
    overflow-y: auto;
}

/* 内容区域样式 */
.content-area {
    min-height: 100vh;
    background-color: #fff;
    margin-top: 0;
}

/* ===== 菜单项样式 ===== */
/* 菜单项基础样式 */
.menu-item > a {
    color: #4B5563;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.menu-item:hover {
    background-color: #f3f4f6;
    border-radius: 8px;
}

.menu-item:hover > a {
    color: #4B5563;
}

.menu-item.active {
    background-color: #E4F0FF;
    border-radius: 8px;
}

.menu-item.active > a {
    color: #4B5563;
}

.menu-item a {
    color: #6b7280;
    transition: color 0.3s ease;
}

.menu-item:hover a, .menu-item.active a {
    color: #1e40af;
}

/* ===== 卡片样式 ===== */
/* 卡片阴影通用样式 */
.card-shadow {
    background: #FFFFFF;
    box-sizing: border-box;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 16px;
}

/* 功能介绍卡片 */
.feature-card {
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.07);
}

.feature-card img {
    border-radius: 20px;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.feature-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
}


/* 用户中心卡片 */
.user-center-card {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-center-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===== 用户相关样式 ===== */
/* 用户图标和下拉菜单容器 */
#user-icon-wrapper {
    position: relative;
    cursor: pointer;
    z-index: 100;
}

#user-icon-wrapper::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

/* 用户图标样式 */
.user-icon-container {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 用户头像样式 */
.user-avatar-container {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    position: relative;
}


/* 用户下拉菜单样式 */
.user-dropdown-styles {
    position: absolute;
    right: 0;
    top: 100%;
    width: 350px;
    background: white;
    z-index: 99;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none; /* 初始隐藏，由JS控制显示 */
}


/* ===== AI工具相关样式 ===== */
/* AI图标容器 */
.ai-icon-container {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ai-icon-container:hover {
    transform: scale(1.05);
}

.icon-wrapper {
    transition: all 0.3s ease;
    background-color: #f3f4f6;
}

.ai-icon-container:hover .icon-wrapper {
    background-color: #e5e7eb;
    transform: scale(1.1);
}

.ai-icon {
    transition: transform 0.3s ease;
}

.ai-icon-container:hover .ai-icon {
    transform: scale(1.15);
    color: #3b82f6;
}

/* 分类卡片容器 */
.ai-category-card {
    position: relative;
    transition: border-radius 0.3s ease;
}

/* 展开图标层 */
.expanded-icons {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 0 0 16px 16px;
    border: 1px solid #f0f0f0;
    border-top: none;
    z-index: 5;
    height: 0;
    overflow: hidden;
}

/* 展开按钮 */
.expand-button {
    display: none;
    text-align: center;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.expand-button:hover {
    color: #3b82f6;
    background-color: #f0f7ff;
}

/* ===== 登录模态框样式 ===== */
#login-modal {
    transition: opacity 0.3s ease;
}

#login-modal .bg-white {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.qr-code-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qr-code-container::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: #67c23a;
    border-radius: 50%;
    bottom: 5px;
    right: 5px;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="white"><path d="M12,2C6.5,2,2,6.5,2,12c0,5.5,4.5,10,10,10s10-4.5,10-10C22,6.5,17.5,2,12,2z M16.9,8.1l-6.5,6.5c-0.2,0.2-0.5,0.3-0.7,0.3 s-0.5-0.1-0.7-0.3l-3-3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l2.3,2.3l5.8-5.8c0.4-0.4,1-0.4,1.4,0S17.3,7.7,16.9,8.1z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

/* ===== 标签和按钮样式 ===== */
/* 标签按钮 */
.tab-button {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-button:hover:not(.active) {
    color: #6b7280;
}

/* 操作按钮 */
.action-button {
    border-radius: 999px;
    font-size: 0.875rem;
    padding: 0.375rem 1rem;
    transition: all 0.2s;
}

.action-button.primary {
    background-color: #3b82f6;
    color: #fff;
}

.action-button.primary:hover {
    background-color: #2563eb;
}

.action-button.secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.action-button.secondary:hover {
    background-color: #e5e7eb;
}

/* 会员相关 */
.stats-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.stats-label {
    font-size: 0.875rem;
    color: #666;
}

.membership-progress-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.membership-progress-bar-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 999px;
}

.membership-option {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.membership-option:hover {
    border-color: #3b82f6;
    background-color: #f0f7ff;
}

.history-item {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===== 响应式设计 ===== */
/* 移动端导航菜单 */
#mobile-menu {
    transition: opacity 0.3s ease;
}

#mobile-menu.hidden {
    display: none;
}

/* 桌面端悬停显示 */
@media (min-width: 769px) {
    .ai-category-card:hover .expanded-icons {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        height: auto;
        overflow: visible;
    }
    
    .ai-category-card:hover {
        border-radius: 16px 16px 0 0;
    }
}

/* 平板和移动端 */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    
    .content-area {
        margin-left: 0;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 展开按钮显示 */
    .expand-button {
        display: block;
    }
    
    /* AI卡片展开处理 */
    .expanded-icons {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f0f0f0;
        margin-top: 1rem;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0 1rem;
        transform: none;
    }
    
    .ai-category-card:hover .expanded-icons {
        max-height: 0;
        margin-top: 0;
        height: 0;
    }
    
    .ai-category-card.expanded .expanded-icons {
        opacity: 1;
        visibility: visible;
        max-height: 300px;
        height: auto;
        padding: 1rem;
        margin-top: 1rem;
        border-top: 1px solid #f3f4f6;
    }
    
    /* 登录模态框调整 */
    #login-modal .bg-white {
        width: 90%;
    }
}