/* ========== 全局样式 ========== */
:root {
    --primary-blue: #1e6fd8;
    --primary-red: #e74c3c;
    --light-blue: #f0f7ff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-light: #e5e5e5;
    --bg-white: #ffffff;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background-color: #f5f7fa;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 13px; /* 正文字体大小统一为13px */
}

/* ========== 搜索导航栏 ========== */
/* 为index2页面添加特定前缀，避免影响其他页面 */
.index2-page .search-navbar {
    /* 使用与search.html中一致的渐变背景 */
    background: linear-gradient(135deg, #4285f4 0%, #673ab7 100%);
    position: relative;
    overflow: visible;
    /* 增加整体高度 */
    padding: 80px 0 70px 0;
}

.index2-page .search-navbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 使用与search.html中相同的背景图片路径 */
    background-image: url("/img/main/index/nav/search_bg.jpeg");
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.index2-page .search-section {
    position: relative;
    z-index: 2;
}

/* 导航菜单左对齐，搜索框高度增加，背景优化 */
.index2-page .search-navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.index2-page .search-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 3;
    /* 保持导航菜单与搜索框之间的间距 */
    margin-bottom: 20px;
}

.index2-page .nav-menu-compact {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    padding: 10px 0;
    border-radius: 6px;
    backdrop-filter: none;
    width: 100%;
    max-width: 1200px;
    /* 保持导航菜单下方的间距 */
    margin-bottom: 20px;
    z-index: 3;
    position: relative;
}

.index2-page .nav-item-compact {
    /* 保持简单的超链接样式 */
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-weight: 500;
}

.index2-page .nav-item-compact:hover {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.index2-page .nav-item-compact.active {
    color: white;
    border-bottom-color: white;
    font-weight: 600;
}

.index2-page .search-wrapper {
    max-width: 100%;
    padding: 0;
    width: 100%;
    margin-top: 0;
}

/* 保持搜索框高度不变 */
.index2-page .search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
    /* 保持搜索框高度为65px */
    height: 65px;
    border: 2px solid #e0e0e0;
    width: 100%;
    position: relative;
    z-index: 2;
    margin-top: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.index2-page .search-box:hover,
.index2-page .search-box:focus-within {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 2px #4285f4;
    border-color: #4285f4;
}

.index2-page .search-box.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-5px);
    }
    40%, 80% {
        transform: translateX(5px);
    }
}

.index2-page .search-box i {
    color: var(--primary-blue);
    font-size: 22px;
    margin-right: 15px;
}

.index2-page .search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0;
    font-size: 16px; /* 搜索框稍大便于输入 */
    color: var(--text-dark);
    background: transparent;
    /* 保持输入框高度为100%，但不特意增加 */
    height: 100%;
}

.index2-page .search-input::placeholder {
    color: #aaa;
    font-size: 16px; /* 占位符字体与输入框一致 */
}

.index2-page .btn-search {
    background: linear-gradient(135deg, #ea4335, #d93025);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 0 8px 8px 0;
    font-size: 16px; /* 搜索按钮与输入框协调 */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    height: calc(100% - 16px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 122px;
    justify-content: center;
}

.index2-page .btn-search:hover {
    background: linear-gradient(135deg, #d93025, #b71c1c);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 16px rgba(234, 67, 53, 0.3);
}

.index2-page .btn-search:active {
    transform: translateY(0);
}

/* ========== 过滤面板 ========== */
/* 为筛选面板添加特定前缀，避免影响其他页面 */
.index2-page .filter-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    /* 保持筛选面板与下方资源列表的间距 */
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid #f0f0f0;
}

.index2-page .filter-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f5;
}

.index2-page .filter-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
}

.index2-page .filter-label {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    min-width: 75px;
    text-align: right;
    font-size: 14px;
    padding-right: 5px;
    flex-shrink: 0;
}

/* 解决首字母筛选长度超出范围的问题 */
.index2-page .filter-alphabet {
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    flex: 1;
    display: flex;
    /* 保持合理的标签间距 */
    gap: 8px;
    align-items: center;
    /* 隐藏滚动条但保持功能 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.index2-page .filter-alphabet::-webkit-scrollbar {
    display: none;
}

.index2-page .filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.index2-page .filter-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background-color: #f8f9fa;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 26px;
    height: 28px;
}

.index2-page .filter-tag:hover {
    background-color: var(--light-blue);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.index2-page .filter-tag.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .index2-page .search-navbar {
        /* 调整移动端的高度 */
        padding: 60px 0 50px 0;
    }

    .index2-page .nav-menu-compact {
        margin-bottom: 15px;
    }

    .index2-page .search-box {
        flex-direction: column;
        align-items: stretch;
        /* 保持移动端搜索框高度 */
        height: auto;
        padding: 15px;
        border-radius: 12px;
    }

    .index2-page .search-input {
        margin: 8px 0;
        padding: 10px 0;
        font-size: 16px;
        border-bottom: 1px solid #e0e0e0;
    }

    .index2-page .btn-search {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        padding: 12px;
        height: auto;
        border-radius: 0 0 12px 12px;
        font-size: 16px;
        min-width: auto;
    }

    .index2-page .filter-label {
        min-width: 50px;
    }

    .index2-page .resources-header {
        flex-direction: column;
        align-items: flex-start;
    }


    .index2-page .resources-grid {
        grid-template-columns: 1fr;
    }

    .index2-page .resource-card {
        flex-direction: column;
        height: auto;
    }

    .index2-page .card-image {
        width: 100%;
        height: 200px;
    }

    @media (min-width: 576px) {
        .index2-page .resources-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}

@media (max-width: 480px) {
    .index2-page .search-navbar {
        padding: 40px 0;
    }

    .index2-page .search-title {
        font-size: 18px;
    }

    .index2-page .card-title {
        font-size: 14px;
    }

    .index2-page .card-image {
        height: 250px;
    }

    .index2-page .filter-row {
        flex-direction: column;
    }

    .index2-page .filter-group {
        width: 100%;
    }

    .index2-page .filter-label {
        text-align: left;
        margin-bottom: 8px;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
}

/* 页面加载动画 */
.index2-page {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.index2-page .search-navbar {
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.index2-page .filter-panel {
    animation: slideInUp 0.6s ease-out 0.3s both;
}

/* 悬停动画效果 */
.index2-page .search-box:hover {
    animation: pulse 2s infinite;
}


