/**
 * 首页专用样式。
 *
 * 说明:
 * - 从前端 views/home/index.vue + components/home/AgentCard.vue 的 <style scoped> 提取。
 * - 去掉了 Vue scoped 的 data 属性选择器。
 * - 背景图路径从 /images/ 改为 /static/images/。
 * - el-pagination 样式替换为自定义分页组件样式。
 *
 * 学习建议: 对比 Vue SFC 的 <style scoped>，注意以下转换:
 * - :deep(.xxx) → 普通后代选择器
 * - data-v-xxx 属性选择器 → 删除（用 .home-page 命名空间隔离）
 * - v-bind() CSS → CSS 变量或固定值
 */

/* ─── 首页容器 ─── */
.home-page {
    min-height: 100vh;
    display: flex;
    position: relative;
    flex-direction: column;
    background-color: #f5f7fa;
    background-size: cover;
    background-image: url('/static/images/bodybg.png');
}

/* 首页专用 Header 扩展：移动端分类菜单按钮和遮罩默认隐藏。 */
.home-menu-toggle,
.home-sidebar-mask {
    display: none;
}

.home-body {
    flex: 1;
    min-height: 0;
    display: flex;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    margin-left: 240px;
    margin-right: 20px;
}

/* ─── 左侧分类导航 ─── */
.home-sidebar {
    position: fixed;
    left: 20px;
    top: 92px;
    bottom: 20px;
    z-index: 10;
    width: 200px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 1);
    padding: 20px 10px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    color: rgba(51, 51, 51, 1);
    padding-left: 10px;
    margin: 0 0 10px;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-list::-webkit-scrollbar { width: 3px; }
.sidebar-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

.sidebar-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px;
    font-size: 14px;
    line-height: 20px;
    color: rgba(51, 51, 51, 1);
    transition: background 0.15s, color 0.15s;
    border-radius: 4px;
    margin-bottom: 4px;
    text-decoration: none;
}

.sidebar-item:hover a {
    background: rgba(230, 237, 250, 1);
    color: #002fa8;
}

.sidebar-item.active a {
    background: rgba(230, 237, 250, 1);
    color: rgba(0, 47, 168, 1);
    font-weight: 700;
}

.sidebar-item.active .cat-count {
    color: rgba(0, 47, 168, 1);
}

.cat-name {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.cat-count {
    margin-left: 15px;
    font-size: 14px;
    color: rgba(153, 153, 153, 1);
    font-weight: 400 !important;
}

/* ─── 主区域 ─── */
.home-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image: url('/static/images/ai.png');
    background-repeat: no-repeat;
    background-position: 90% 0;
    background-size: auto 260px;
    padding: 0 40px;
}

/* ─── 介绍区域 ─── */
.hero-section {
    padding: 0;
    margin-bottom: 35px;
}

.hero-content {
    padding-top: 20px;
}

.hero-title {
    display: inline-block;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    background: linear-gradient(90deg, rgba(0, 53, 186, 1) 0%, rgba(41, 187, 255, 1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 16px;
    color: rgba(51, 51, 51, 1);
    line-height: 22.72px;
    margin: 0;
}

/* ─── 列表区域 ─── */
.list-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 0 26px;
}

.list-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.list-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(51, 51, 51, 1);
}

.filter-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 47, 168, 0.05);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 1);
    padding: 4px;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.tab-icon { font-size: 16px; }
.tab-icon.icon-yaozhAIquanbushujuku { color: #7A8599; }

.filter-tab:hover { color: #333; }

.filter-tab.active {
    background: #fff;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* ─── 空态 ─── */
.card-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: #bbb;
    font-size: 14px;
    gap: 12px;
}

.empty-icon {
    width: 160px;
    height: 160px;
    opacity: 0.5;
    object-fit: contain;
}

/* ─── 卡片网格 ─── */
.card-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-content: start;
}

@media (min-width: 1680px) {
    .card-grid { grid-template-columns: repeat(4, 1fr); }
    .home-main { padding: 0 60px; }
}

/* ─── Agent 卡片（从 AgentCard.vue 迁移） ─── */
.agent-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0px 2px 8px rgba(233, 238, 247, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
    transition: all .2s;
}

.agent-card:hover {
    box-shadow: 0px 2px 8px rgba(191, 213, 255, 1);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-badges {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 5px;
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}

.card-badge-icon {
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 14px;
    color: rgba(102, 102, 102, 1);
    line-height: 20px;
    height: 40px;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: 22px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-tag {
    font-size: 12px;
    color: rgba(51, 51, 51, 1);
    background: rgba(230, 237, 250, 1);
    padding: 2px 8px;
    line-height: 18px;
    border-radius: 2px;
}

/* ─── 卡片链接区 ─── */
.card-links {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.card-links > a {
    flex: 1;
}

.card-intro-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 16px;
    border: 1px solid rgba(230, 232, 237, 1);
    border-radius: 17px;
    background: #fff;
    font-size: 14px;
    color: rgba(51, 51, 51, 1);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.card-intro-link:hover {
    border-color: #002fa8;
    color: #002fa8;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid rgba(230, 232, 237, 1);
    border-radius: 17px;
    background: #fff;
    font-size: 14px;
    color: rgba(51, 51, 51, 1);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
}

.card-action:hover {
    border-color: #002fa8;
    color: #002fa8;
}

.action-arrow {
    font-size: 16px;
    color: #7A8599;
    transition: color 0.25s, transform 0.25s;
}

.card-action:hover .action-arrow {
    color: #002FA8;
    transform: translateX(2px);
}

/* “立即使用”按钮：蓝色描边 + 渐变悬停背景 */
.card-action.use {
    border-color: rgba(0, 47, 168, 1);
    color: rgba(0, 47, 168, 1);
}

.card-action.use .iconfont {
    color: rgba(0, 47, 168, 1);
}

.card-action.use:hover {
    border: none;
    background: linear-gradient(90deg, rgba(0, 64, 191, 1) 0%, rgba(51, 187, 255, 1) 100%);
    border-color: transparent;
    color: #fff;
}

.card-action.use:hover .iconfont {
    color: #fff;
}

/* ─── 自定义分页组件（替代 el-pagination） ─── */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.pagination-nav {
    display: flex;
    align-items: center;
}

.pagination-list {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item { }

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.2s, color 0.2s;
}

.page-link:hover {
    border-color: #002fa8;
    color: #002fa8;
}

.page-item.active .page-link {
    border-color: #002fa8;
    color: #002fa8;
    font-weight: 600;
}

.page-item.disabled .page-link {
    border-color: #e0e0e0;
    color: #ccc;
    cursor: not-allowed;
    background: #fff;
}

/* ─── 公告栏（从 TheNotice.vue 迁移，jQuery 动画替代 Vue transition） ─── */
.app-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 16px;
    border-radius: 20px;
    background: rgba(0, 47, 168, 0.05);
}

.notice-body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notice-icon {
    font-size: 18px;
    color: rgba(0, 47, 168, 1);
    flex-shrink: 0;
}

.notice-text-wrap {
    position: relative;
    height: 22px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.notice-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    white-space: nowrap;
    font-size: 14px;
    color: rgba(51, 51, 51, 1);
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-text a {
    color: inherit;
    text-decoration: underline;
}

.notice-text a:hover {
    color: rgba(0, 47, 168, 1);
}

.notice-text-hidden {
    display: none;
}

.notice-close {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    margin-left: 16px;
    font-size: 16px;
    color: #7e899d;
    transition: color 0.15s;
}

.notice-close:hover {
    color: rgba(0, 47, 168, 1);
}

/* ─── 底部版权 ─── */
.site-footer {
    padding: 10px 0;
    margin-top: 20px;
}

/* ─── 移动端搜索按钮（PC 隐藏） ─── */
.header-search-toggle {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    padding: 0;
    margin-right: 5px;
}
.header-search-toggle .iconfont {
    font-size: 20px;
    color: #555;
    background: #f3f6fa;
}

/* ─── 移动端搜索下拉 ─── */
.mobile-search-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 99;
    background: #f3f6fa;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-search-bar.open {
    display: flex;
}

.mobile-search-bar .mobile-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.mobile-search-bar .header-search-input {
    flex: 1;
    height: 34px;
    border: 1px solid #e6e8ed;
    border-radius: 17px;
    padding: 0 12px;
    font-size: 14px;
    color: #333;
    outline: none;
    background: #FFF;
}

.mobile-search-bar .header-search-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(90deg, rgba(0, 53, 186, 1) 0%, rgba(41, 187, 255, 1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-search-bar .header-search-btn .iconfont {
    font-size: 16px;
    color: #fff;
}

/* ─── 响应式：移动端 ── */
@media (max-width: 768px) {
    body.home-menu-open { overflow: hidden; }

    /* 搜索：PC 版隐藏，移动端按钮 + 下拉显示 */
    .header-search-pc { display: none !important; }
    .header-search-toggle { display: flex; }

    .home-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        margin-left: -6px;
        padding: 0;
        color: #555;
        background: none;
        border: none;
        cursor: pointer;
    }

    .home-sidebar-mask {
        position: fixed;
        inset: 52px 0 0;
        z-index: 98;
        width: 100%;
        padding: 0;
        background: rgba(0, 0, 0, 0.4);
        border: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .home-sidebar {
        display: flex !important;
        top: 52px;
        bottom: 0;
        left: 0;
        z-index: 99;
        width: min(280px, 85vw);
        padding: 20px 10px;
        background: #fff;
        border: none;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    body.home-menu-open .home-sidebar {
        transform: translateX(0);
    }

    body.home-menu-open .home-sidebar-mask {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .home-body {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .home-main {
        padding: 0 12px !important;
        background-size: auto 100px !important;
    }

    .hero-title { font-size: 20px !important; }
    .hero-desc { font-size: 13px !important; line-height: 1.5 !important; }
    .hero-section { margin-bottom: 24px !important; }
    .hero-content { padding-top: 12px; }

    .list-title { font-size: 15px; }

    .list-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .filter-tabs {
        max-width: 100%;
        width: 100%;
        justify-content: flex-start;
    }
    .filter-tab { padding: 7px 10px; font-size: 12px; gap: 5px; }

    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .agent-card { padding: 12px; }
    .card-top { flex-direction: column; gap: 8px; margin-bottom: 10px; }
    .card-icon { width: 48px; height: 48px; }
    .card-badges { display: none; }
    .card-title { font-size: 12px; margin-bottom: 6px; -webkit-line-clamp: none; }
    .card-desc { font-size: 12px; line-height: 17px; height: 34px; margin-bottom: 6px; }
    .card-tags { gap: 4px; height: 18px; height: 22px;; margin-bottom: 10px; }
    .card-tag { font-size: 10px; padding: 1px 5px; line-height: 16px; }
    .card-links { gap: 6px; }
    .card-intro-link, .card-action { padding: 5px 10px; font-size: 12px; gap: 3px; border-radius: 14px; }
    .action-arrow { font-size: 13px; }

    .empty-icon { width: 100px; height: 100px; }
    .card-empty { padding: 30px 0; font-size: 13px; }

    .app-notice { height: 32px; padding: 0 10px; border-radius: 16px; margin-bottom: 10px; }
    .notice-text { font-size: 12px; line-height: 20px; }
    .notice-text-wrap { height: 20px; }
    .notice-icon { font-size: 14px; }
    .notice-close { font-size: 14px; margin-left: 8px; }

    .pagination-wrap { margin-top: 20px; }

    .site-footer {
        padding: 12px;
    }
}
