﻿/* 轮播图区域优化 */
.search-hero {
    position: relative;
    height: 380px;
    overflow: hidden;
    margin-bottom: 2rem;
    background-color: #f0f0f0;
}

/* 轮播图容器优化 */
#mainCarousel {
    height: 100%;
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
    position: relative;
}

/* 图片容器优化 - 关键修改 */
.carousel-img-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background-color: #000; /* 添加黑色背景确保无缝过渡 */
}

/* 图片样式优化 - 关键修改 */
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

    /* 针对不同比例图片的特殊处理 */
    .carousel-item img.landscape {
        width: 100%;
        height: auto;
        min-height: 100%;
        top: 50%;
        transform: translateY(-50%);
    }

    .carousel-item img.portrait {
        width: auto;
        height: 100%;
        min-width: 100%;
        left: 50%;
        transform: translateX(-50%);
    }


/* 搜索容器 */
.search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1000px;
    /*background-color: rgba(13, 110, 253, 0.25);*/
    padding: 1.5rem;
    border-radius: 12px;
/*    backdrop-filter: blur(5px);*/
    z-index: 10;
}

.search-content {
    color: white;
    text-align: center;
}

    .search-content h1 {
        font-size: 2.2rem;
        font-weight: 600;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        margin-bottom: 0.5rem;
    }

    .search-content p {
        font-size: 1rem;
        opacity: 0.9;
        margin-bottom: 1rem;
    }

/* 搜索框样式 */
.search-box {
    margin-top: 0.5rem;
}

    .search-box .input-group {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        justify-content: center;
        gap: 0.5rem; /* 添加元素间距 */
    }

    .search-box .form-control,
    .search-box .form-select,
    .search-box .btn {
        border-radius: 25px !important;
        border: none;
    }

    .search-box .form-control {
        padding: 0.75rem 1.25rem;
        flex: 2;
        max-width: 680px;
    }

    .search-box .form-select {
        padding: 0.75rem 1.25rem;
        width: 150px !important; /* 固定下拉框宽度 */
        flex: none !important; /* 取消弹性布局 */
    }

    .search-box .btn-warning {
        padding: 0.75rem 1.75rem;
        font-weight: 500;
        flex: none; /* 取消弹性布局 */
    }

/* 高级检索链接 */
.advanced-links {
    margin-top: 0.8rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

    .advanced-links a {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        text-decoration: none;
        transition: all 0.2s;
    }

        .advanced-links a:hover {
            color: white;
            text-decoration: underline;
        }

    .advanced-links i {
        margin-right: 0.3rem;
    }

/* 资源类型选择 */
.resource-types {
    margin: 0.5rem -0.3rem 0;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

    .resource-types .form-check {
        display: inline-block;
        margin: 0 0.3rem;
        white-space: nowrap;
        backdrop-filter: blur(5px);
        background-color: rgba(13, 110, 253, 0.25); /* 半透明背景增强效果 */
    }

    .resource-types .form-check-label {
        color: white;
        opacity: 0.9;
        font-size: 0.9rem;

    }

    .resource-types .form-check-input {
        margin-top: 0.2rem;
        border-radius: 4px;
    }

/* 响应式设计 */
@media (max-width: 1200px) {
    .search-container {
        max-width: 900px;
    }
}

@media (max-width: 992px) {
    .search-content h1 {
        font-size: 1.8rem;
    }

    .search-container {
        padding: 1.2rem;
    }
}

@media (max-width: 768px) {
    .search-hero {
        height: auto;
        min-height: 300px;
    }

    #mainCarousel {
        display: none;
    }

    .search-container {
        position: static;
        transform: none;
        width: 100%;
        margin: 1rem auto;
        background-color: rgba(13, 110, 253, 0.25);
    }

    .search-box .input-group {
        flex-wrap: wrap;
    }

    .search-box .form-select,
    .search-box .form-control,
    .search-box .btn {
        margin: 0.25rem 0;
        width: 100%;
        flex: none;
    }

    .resource-types {
        white-space: normal;
        overflow-x: visible;
    }

        .resource-types .form-check {
            display: inline-block;
            margin: 0.2rem;
        }

    .advanced-links {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .search-content h1 {
        font-size: 1.5rem;
    }

    .search-content p {
        display: none;
    }

    .search-container {
        padding: 1rem;
    }

    .search-box .form-select,
    .search-box .form-control,
    .search-box .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .resource-types .form-check-label {
        font-size: 0.8rem;
    }

    .advanced-links {
        font-size: 0.8rem;
    }
}



.list-group-item .d-flex.w-100.justify-content-between {
    align-items: center;
    flex-wrap: nowrap; /* 防止整个容器换行 */
}

.list-group-item h5.mb-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.text-danger.wider-small {
    white-space: nowrap;
    flex-shrink: 0;
}




/* ======================
   图表容器样式优化
   ====================== */
.chart-container {
    position: relative;
    height: 320px; /* 固定高度 */
    margin: 0 auto;
    padding: 15px;
}

/* ======================
   资源类型饼图专属样式
   ====================== */
#typeChart {
    width: 100%;
    height: 100%;
}

/* 饼图图例样式 */
.echarts-legend {
    padding: 15px !important;
}

.echarts-legend-item {
    margin: 8px 15px !important;
    padding: 3px 0 !important;
}

/* 饼图标签样式 */
.echarts-series-name {
    font-size: 12px !important;
    color: #666 !important;
}

/* 饼图悬浮提示框 */
.echarts-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #eee !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    padding: 10px 15px !important;
}

/* ======================
   年代分布折线图专属样式
   ====================== */
#yearChart {
    width: 100%;
    height: 100%;
}

/* X轴样式 */
.echarts-axis-x {
    font-size: 12px !important;
    color: #666 !important;
}

/* Y轴样式 */
.echarts-axis-y {
    font-size: 12px !important;
    color: #666 !important;
}

/* 折线图线条样式 */
.echarts-line {
    stroke-width: 3px !important;
    stroke-linecap: round !important;
}

/* 折线图区域渐变 */
.echarts-area {
    opacity: 0.7 !important;
}

/* 折线图数据点 */
.echarts-symbol {
    stroke-width: 2px !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
        padding: 10px;
    }

    .echarts-legend {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .echarts-legend-item {
        margin: 5px 8px !important;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 220px;
    }

    .echarts-tooltip {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}




/* 图表卡片统一样式 */
.data-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 24px;
}

/* 图表标题样式 */
.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #2a5298;
    margin-bottom: 1px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* 图表容器响应式设置 */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chart-container {
        height: 280px;
    }

    .chart-title {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 240px;
    }
}




/* 修改在home.css中 */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
    padding: 0; /* 移除内边距 */
    margin: 0; /* 移除外边距 */
}

/* 调整图表元素本身 */
#typeChart, #yearChart {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* 调整饼图图例位置 */
.echarts-legend {
    bottom: 0 !important;
    padding: 5px 15px !important;
}

/* 调整图表标题与图表之间的间距 */
.chart-title {
    margin-bottom: 1px; /* 减少标题下边距 */
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* 移动端适配调整 */
@media (max-width: 768px) {
    .chart-container {
        height: 320px;
    }

    .echarts-legend {
        position: relative !important;
        bottom: auto !important;
        padding: 5px !important;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 320px;
    }

    /* 确保饼图在小屏幕上不会遮盖图例 */
    .echarts-legend {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .echarts-legend-item {
        margin: 3px 8px !important;
    }
}