/* ============================================================
   首页搜索框布局样式
   覆盖 main.min.css 中的旧规则
   解决搜索框在不同屏幕尺寸下的变形、偏移、聚焦抖动问题
   基准高度 473px，自适应缩放
   ============================================================ */

/* === 搜索 Hero 容器：400px 基准高度 + Flex 居中 === */
.search-hero {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.search-hero-inner {
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 40px 0;
}

/* --- 旧版搜索背景区域（兼容保留） --- */
.search-bg {
    position: relative;
    overflow: hidden;
}
.search-bg .search-bg-overlay,
.search-hero .search-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 0;
}

/* --- 搜索容器：居中 + 宽度约束 --- */
.search-warp {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.search-hero .search-warp {
    max-width: 700px;
}

/* --- 搜索表单：弹性布局，禁止换行 --- */
.search-form form {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.search-hero .search-form form {
    border-radius: 50px;
    height: 52px;
}

/* --- 分类下拉容器：固定宽，不伸缩 --- */
.search-select {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
}
.search-select select.form-select {
    height: 100%;
    border: none;
    border-right: 1px solid #e8e8e8;
    border-radius: 50px 0 0 50px;
    background: #f8f9fa;
    padding: 0 28px 0 16px;
    font-size: 0.875rem;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
}
.search-select select.form-select:focus {
    box-shadow: none;
}

/* --- 搜索输入区：弹性伸缩占满，最小宽0防止溢出 --- */
.search-fields {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

/* --- 输入框：满弹性空间，border-box防溢出，聚焦不抖动 --- */
.search-fields input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    padding: 0 16px;
    font-size: 0.9375rem;
    background: #fff;
    outline: none;
    transition: none;
}
.search-fields input[type="text"]:focus {
    border: none;
    box-shadow: none;
}
.search-fields input[type="text"]::placeholder {
    color: #b0b0b0;
}

/* --- 搜索按钮：固定宽，不伸缩，居中图标 --- */
.search-fields button[type="submit"] {
    flex: 0 0 auto;
    width: 54px;
    min-width: 54px;
    padding: 0;
    border-radius: 0 50px 50px 0;
    background: var(--ri-primary, #2163e8);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s ease;
}
.search-fields button[type="submit"]:hover {
    background: var(--ri-primary-text, #1a4fba);
}

/* --- 无分类下拉时，输入框左圆角恢复 --- */
.search-form form:not(:has(.search-select)) .search-fields input[type="text"] {
    border-radius: 50px 0 0 50px;
    padding-left: 20px;
}
.search-form form:not(:has(.search-select)) .search-fields button[type="submit"] {
    border-radius: 0 50px 50px 0;
}

/* --- Hero 内标题、描述样式 --- */
.search-hero .search-title {
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}
.search-hero .search-desc {
    margin-bottom: 24px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
    line-height: 1.6;
}

/* --- 搜索热词区域（Hero 版） --- */
.search-hero .search-hots {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.search-hero .search-hots-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 4px;
    white-space: nowrap;
}
.search-hero .search-hot-tag {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.search-hero .search-hot-tag:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
}

/* --- 旧版搜索热词兼容 --- */
.search-hots {
    margin-top: 16px;
    font-size: 0.8125rem;
    opacity: 0.75;
}
.search-hots a {
    margin: 0 4px;
    white-space: nowrap;
}

/* --- 手机端响应式 --- */
@media (max-width: 991.98px) {
    .search-hero {
        min-height: 400px;
    }
}
@media (max-width: 767.98px) {
    .search-hero {
        min-height: 360px;
    }
    .search-hero .search-title {
        font-size: 1.5rem;
    }
    .search-hero .search-desc {
        font-size: 0.875rem;
        margin-bottom: 18px;
    }
    .search-hero .search-form form {
        height: 46px;
    }
    .search-hero .search-warp {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    .search-select {
        min-width: 80px;
        max-width: 110px;
    }
    .search-fields input[type="text"] {
        padding: 0 12px;
        font-size: 0.875rem;
    }
    .search-fields button[type="submit"] {
        width: 46px;
        min-width: 46px;
    }
    .search-hero .search-hots {
        gap: 6px;
    }
    .search-hero .search-hot-tag {
        padding: 3px 10px;
        font-size: 0.75rem;
    }
}
@media (max-width: 480px) {
    .search-hero {
        min-height: 320px;
    }
    .search-hero .search-title {
        font-size: 1.25rem;
    }
    .search-hero .search-form form {
        height: 42px;
        border-radius: 30px;
    }
    .search-select select.form-select {
        border-radius: 30px 0 0 30px;
        font-size: 0.8125rem;
        padding: 0 24px 0 12px;
    }
    .search-fields button[type="submit"] {
        width: 42px;
        min-width: 42px;
        border-radius: 0 30px 30px 0;
        font-size: 1rem;
    }
    .search-form form:not(:has(.search-select)) .search-fields input[type="text"] {
        border-radius: 30px 0 0 30px;
    }
    .search-form form:not(:has(.search-select)) .search-fields button[type="submit"] {
        border-radius: 0 30px 30px 0;
    }
}

/* ============================================================
   横条图标模块（division）布局修复
   解决图标与文字不对齐、卡片变形走位问题
   参照原版样式：图标左置 + 文字右置 + 等高校准
   ============================================================ */

/* --- 整体容器：清除 Bootstrap 容器冗余间距 --- */
.home-division > .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* --- 网格行：子元素间距固定 10px --- */
.home-division .row {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 10px;
}

/* --- 单个卡片项：弹性布局，图标左 + 内容右 --- */
.home-division .division-item {
    display: flex !important;
    align-items: center !important;
    gap: 15px;
    padding: 20px 18px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}
.home-division .division-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
/* hover 时图标旋转动画 */
.home-division .division-item:hover .division-icon > i {
    transform: rotate(360deg) scale(1.15);
    transition: all 0.3s ease-in-out;
}

/* --- 图标容器：固定方/圆，flex居中图标（覆盖 main.min.css 的 display:block） --- */
.home-division .division-icon {
    flex: 0 0 auto !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 1.35rem;
    color: #fff;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
    border-radius: 10px;
}
.home-division .division-icon.rounded-circle {
    border-radius: 50% !important;
}
.home-division .division-icon > i {
    width: auto !important;
    height: auto !important;
    line-height: 1;
}

/* --- 内容区：弹性占满剩余空间 --- */
.home-division .division-warp {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
}

/* --- 标题 --- */
.home-division .division-title {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ri-gray-dark, #191a1f);
    line-height: 1.4;
}
.home-division .division-title a {
    color: inherit;
    text-decoration: none;
}
.home-division .division-title a:hover {
    color: var(--ri-primary, #2163e8);
}

/* --- 描述 --- */
.home-division .division-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ri-gray-500, #a1a1a8);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- 响应式适配 --- */
@media (max-width: 991.98px) {
    .home-division .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }
    .home-division .division-item {
        padding: 16px 14px;
        gap: 12px;
    }
    .home-division .division-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.15rem;
    }
    .home-division .division-title {
        font-size: 0.875rem;
    }
    .home-division .division-desc {
        font-size: 0.75rem;
    }
}
@media (max-width: 575.98px) {
    .home-division .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }
    .home-division .division-item {
        padding: 14px 12px;
        gap: 10px;
    }
    .home-division .division-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem;
    }
    .home-division .division-title {
        font-size: 0.8125rem;
    }
    .home-division .division-desc {
        font-size: 0.6875rem;
    }
}

/* ============================================================
   网站动态模块（home-dynamic）布局修复
   解决徽标与轮播条不对齐、文字溢出走位问题
   ============================================================ */

/* --- 模块自身：下方留 25px 间距与后续模块分离 --- */
.home-dynamic {
    margin-bottom: 25px;
}

/* --- 动态包装器：徽标与轮播 Flex 同行排列 --- */
.home-dynamic .dynamic-warp {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    position: relative;
}

/* --- 徽标：固定宽度不压缩 --- */
.home-dynamic .dynamic-warp > .me-3 {
    flex: 0 0 auto;
}
.home-dynamic .badge {
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 6px 14px;
    line-height: 1.4;
    border-radius: 6px;
}

/* --- 轮播容器：弹性占满剩余宽度 --- */
.home-dynamic .dynamic-slider {
    flex: 1 1 auto !important;
    min-width: 0;
    width: 100%;
    position: relative;
}

/* --- 轮播内部条目：水平排列 --- */
.home-dynamic .dynamic-slider-item .d-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}

/* --- 头像：固定尺寸不压缩 --- */
.home-dynamic .dynamic-slider-item .avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
}
.home-dynamic .dynamic-slider-item .avatar .avatar-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
}

/* --- 用户名：固定宽度，溢出省略（覆盖 main.min.css margin） --- */
.home-dynamic .dynamic-slider-item .name {
    flex: 0 0 auto;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--ri-gray-dark, #191a1f);
    margin: 0 !important;
}

/* --- 动态信息：弹性占满，溢出省略（覆盖 main.min.css display:inline-block） --- */
.home-dynamic .dynamic-slider-item .info {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--ri-body-color, #595d69);
    margin: 0 !important;
    line-height: 1.4;
}
.home-dynamic .dynamic-slider-item .info a {
    color: var(--ri-primary, #2163e8);
    text-decoration: none;
}
.home-dynamic .dynamic-slider-item .info a:hover {
    text-decoration: underline;
}

/* --- 时间：颜色略淡，前加分隔点 --- */
.home-dynamic .dynamic-slider-item .times {
    display: inline-block;
    color: var(--ri-gray-500, #a1a1a8);
    font-size: 0.75rem;
    margin-left: 6px !important;
}
.home-dynamic .dynamic-slider-item .times::before {
    content: '\2022';
    margin-right: 6px;
    opacity: 0.5;
}

/* --- 响应式适配 --- */
/* 平板竖屏 / 手机：保持徽标与轮播水平对齐，全部 !important 防覆盖 */
@media (max-width: 767.98px) {
    .home-dynamic .dynamic-warp {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px;
        width: 100% !important;
    }
    .home-dynamic .dynamic-warp > .me-3 {
        flex: 0 0 auto !important;
        margin-right: 0 !important;
        min-width: auto !important;
    }
    .home-dynamic .dynamic-warp .badge {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    /* 轮播容器：弹性占满但不超出 */
    .home-dynamic .dynamic-slider,
    .home-dynamic .dynamic-slider.owl-carousel,
    .home-dynamic .dynamic-slider.owl-carousel.owl-loaded {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        display: block !important;
        position: relative !important;
        overflow: hidden !important;
    }
    /* Owl Carousel 内部 stage 不溢出 */
    .home-dynamic .dynamic-slider .owl-stage-outer {
        overflow: hidden !important;
    }
    .home-dynamic .dynamic-slider-item .d-flex {
        flex-wrap: nowrap !important;
        gap: 8px;
    }
    .home-dynamic .dynamic-slider-item .name {
        max-width: 56px;
        font-size: 0.75rem;
    }
    .home-dynamic .dynamic-slider-item .info {
        font-size: 0.75rem;
    }
    .home-dynamic .dynamic-slider-item .times {
        font-size: 0.6875rem;
    }
}

/* ≤480px（小屏手机）：进一步收紧间距与字号 */
@media (max-width: 480px) {
    .home-dynamic .dynamic-warp {
        gap: 8px !important;
    }
    .home-dynamic .dynamic-warp .badge {
        font-size: 0.6875rem !important;
        padding: 3px 8px !important;
    }
    .home-dynamic .dynamic-slider,
    .home-dynamic .dynamic-slider.owl-carousel {
        flex: 1 1 0% !important;
    }
    .home-dynamic .dynamic-slider-item .avatar,
    .home-dynamic .dynamic-slider-item .avatar .avatar-img {
        width: 24px !important;
        height: 24px !important;
    }
    .home-dynamic .dynamic-slider-item .name {
        max-width: 48px;
        font-size: 0.6875rem;
    }
    .home-dynamic .dynamic-slider-item .info {
        font-size: 0.6875rem;
    }
    .home-dynamic .dynamic-slider-item .times {
        font-size: 0.625rem;
    }
    .home-dynamic .owl-nav .owl-prev,
    .home-dynamic .owl-nav .owl-next {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.65rem !important;
    }
}

/* --- Owl Carousel 导航按钮：定位到动态条右侧 --- */
.home-dynamic .owl-nav {
    position: absolute !important;
    top: 50% !important;
    left: auto !important;
    right: 14px !important;
    transform: translateY(-50%) !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: auto !important;
    pointer-events: auto !important;
}
.home-dynamic .owl-nav .owl-prev,
.home-dynamic .owl-nav .owl-next {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 50% !important;
    font-size: 0.875rem !important;
    line-height: 1 !important;
    color: #595d69 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.15s ease !important;
}
.home-dynamic .owl-nav .owl-prev:hover,
.home-dynamic .owl-nav .owl-next:hover {
    background: var(--ri-primary, #2163e8) !important;
    border-color: var(--ri-primary, #2163e8) !important;
    color: #fff !important;
}

/* 手机端 */
@media (max-width: 767.98px) {
    .home-dynamic .owl-nav {
        right: 10px !important;
        gap: 4px !important;
    }
    .home-dynamic .owl-nav .owl-prev,
    .home-dynamic .owl-nav .owl-next {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.75rem !important;
    }
}

/* ============================================================
   首页幻灯片模块（home-owl-slider）内容居中修复
   确保标题、按钮等 _desc 内容始终自适应居中
   ============================================================ */
.home-owl-slider .widget-slider-item .slider-warp {
    width: 100% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
}
.home-owl-slider .widget-slider-item .slider-warp > * {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 手机端：确保内容容器不溢出 */
@media (max-width: 767.98px) {
    .home-owl-slider .widget-slider-item .slider-warp {
        width: calc(100% - 30px) !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .home-owl-slider .widget-slider-item .slider-warp h1,
    .home-owl-slider .widget-slider-item .slider-warp h2,
    .home-owl-slider .widget-slider-item .slider-warp h3,
    .home-owl-slider .widget-slider-item .slider-warp .h1,
    .home-owl-slider .widget-slider-item .slider-warp .h2,
    .home-owl-slider .widget-slider-item .slider-warp .h3 {
        font-size: 1rem !important;
        word-break: break-word;
    }
}

/* ============================================================
   图片背景按钮模块（home-background）响应式居中修复
   确保标题、描述、按钮在任意屏幕下水平垂直居中
   ============================================================ */

/* --- bg-warp 容器：Flex 水平垂直居中 --- */
.home-background .bg-warp {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 300px;
    padding: 50px 15px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 0;
}
/* --- 背景暗色遮罩 --- */
.home-background .bg-warp::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 0;
    pointer-events: none;
}

/* --- container 内容层 + 水平居中 + 垂直自适应 --- */
.home-background .bg-warp > .container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: center !important;
}
/* --- 标题样式 --- */
.home-background .bg-title {
    display: block;
    width: 100%;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    word-break: break-word;
}

/* --- 描述文字 --- */
.home-background .bg-desc {
    display: block;
    width: 100%;
    margin: 0 auto 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
}

/* --- 按钮容器：Flex 居中 + 允许换行 --- */
.home-background .bg-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================================
   响应式断点
   ============================================================ */

/* ≥992px (桌面端) — 保持基准 450px 高度 */

/* ≤991.98px (平板横屏) */
@media (max-width: 991.98px) {
    .home-background .bg-warp {
        min-height: 380px;
        padding: 45px 15px;
    }
    .home-background .bg-title {
        font-size: 1.75rem;
    }
    .home-background .bg-desc {
        font-size: 0.9375rem;
    }
}

/* ≤767.98px (平板竖屏 / 大手机) */
@media (max-width: 767.98px) {
    .home-background .bg-warp {
        min-height: 340px;
        padding: 40px 16px;
    }
    .home-background .bg-warp::before {
        background: rgba(0, 0, 0, 0.4);
    }
    .home-background .bg-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    .home-background .bg-desc {
        font-size: 0.875rem;
        margin-bottom: 16px;
    }
    .home-background .bg-btns {
        gap: 8px;
    }
}

/* ≤575.98px (手机) */
@media (max-width: 575.98px) {
    .home-background .bg-warp {
        min-height: 300px;
        padding: 35px 14px;
    }
    .home-background .bg-title {
        font-size: 1.35rem;
    }
    .home-background .bg-desc {
        font-size: 0.8125rem;
        margin-bottom: 14px;
    }
    .home-background .bg-btns {
        gap: 8px;
    }
    .home-background .bg-btns .btn {
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.8125rem;
    }
}

/* ≤480px (小屏手机) */
@media (max-width: 480px) {
    .home-background .bg-warp {
        min-height: 270px;
        padding: 30px 12px;
    }
    .home-background .bg-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    .home-background .bg-desc {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    .home-background .bg-btns {
        gap: 6px;
    }
    .home-background .bg-btns .btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        font-size: 0.75rem;
    }
}