/**
 * 移动端响应式优化样式
 * 专门针对移动设备的用户体验优化
 */

/* 基础移动端重置 */
@media screen and (max-width: 767px) {
    /* 字体和基础设置优化 */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }

    body {
        font-size: 14px;
        line-height: 1.6;
        overflow-x: hidden;
    }

    /* 主容器宽度调整 */
    .main_width {
        padding: 0 12px;
        width: 100%;
    }

    /* 顶部导航栏移动端优化 */
    .top_box {
        height: auto;
        min-height: 60px;
        padding: 12px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .top_box .main_width {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 12px;
    }

    .logo {
        float: none;
        margin-bottom: 12px;
    }

    .logo a {
        font-size: 20px;
        line-height: 1.2;
    }

    .top_box .top_bar {
        margin-left: 0;
        text-align: center;
        width: 100%;
    }

    .top_box .top_bar a {
        margin: 0 8px;
        padding: 6px 12px;
        font-size: 13px;
    }

    /* 移动端搜索框 */
    .top_bar-search {
        margin-left: 0;
        text-align: center;
        margin-top: 15px;
        width: 100%;
        order: 3;
    }

    .top_bar-search input {
        width: calc(100% - 50px);
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        padding: 0 16px;
    }

    .top_bar-search button {
        width: 50px;
        height: 40px;
        margin-top: 0;
        border-radius: 0 20px 20px 0;
    }

    /* 首页搜索区域移动端优化 */
    .index-bg-img {
        position: relative;
        height: auto;
        min-height: 100vh;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .index-bg-img img {
        display: none;
    }

    .searchbar-box {
        padding-top: 80px;
        max-width: 100%;
        margin: 0 12px;
    }

    .searchbar-box > h1 {
        font-size: 24px;
        margin-bottom: 30px;
        line-height: 1.3;
    }

    .searchbar-box .searchbar-wrap {
        border-radius: 25px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        margin-bottom: 15px;
    }

    .searchbar-box .searchbar-wrap .searchbar-input {
        width: calc(100% - 80px);
        height: 44px;
        line-height: 44px;
        padding: 0 16px;
        font-size: 15px;
    }

    .searchbar-box .searchbar-wrap .searchbar-btn {
        width: 80px;
        height: 44px;
        line-height: 44px;
        font-size: 14px;
        font-weight: 600;
    }

    .searchbar-box .hot_tag {
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .searchbar-box .hot_tag::-webkit-scrollbar {
        display: none;
    }

    .searchbar-box .hot_tag a {
        margin: 0 8px 0 0;
        padding: 4px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* 功能特色卡片移动端布局 */
    .main_width .row {
        flex-direction: column;
        gap: 15px;
        margin: 30px 0 0 0;
    }

    .main_width .row .card {
        min-width: 100%;
        padding: 25px 20px;
        margin: 0;
    }

    .main_width .row .card div[style*="font-size: 48px"] {
        font-size: 36px !important;
        margin-bottom: 15px;
    }

    .main_width .row .card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .main_width .row .card p {
        font-size: 14px;
        line-height: 1.6;
    }

    /* 统计数据区域移动端优化 */
    .main_width .card[style*="margin-top: 30px"] {
        margin-top: 20px;
        padding: 25px 20px;
    }

    .main_width .card[style*="margin-top: 30px"] h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .main_width .card div[style*="display: flex"] {
        flex-wrap: wrap;
        gap: 15px;
    }

    .main_width .card div[style*="text-align: center"] {
        min-width: calc(50% - 8px);
        padding: 10px;
    }

    .main_width .card div[style*="font-size: 32px"] {
        font-size: 24px !important;
    }

    /* 筛选器移动端优化 */
    .filterBox {
        margin-bottom: 15px;
    }

    .filterBox .filter-title {
        height: auto;
        min-height: 50px;
        line-height: 1.4;
        padding: 12px 16px;
        position: relative;
    }

    .filterBox .filter-title .title-text {
        font-size: 14px;
        padding-right: 40px;
    }

    .filterBox .toggle_btn {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }

    .filterBox .filter-content {
        padding: 15px;
    }

    .filterBox ul {
        padding: 0;
        margin: 0;
    }

    .filterBox ul li {
        width: 100%;
        margin: 0 0 10px 0;
        padding: 12px;
        font-size: 14px;
    }

    .filterBox ul li:last-child {
        margin-bottom: 0;
    }

    .filterBox .conl_btn {
        position: static;
        margin-top: 15px;
        text-align: center;
        display: block;
        width: 100%;
        padding: 10px;
        background: #1ab394;
        color: #fff;
        border-radius: 6px;
    }

    /* 数据源筛选移动端 */
    .datasource {
        padding: 15px;
    }

    .datasource label {
        display: flex;
        align-items: center;
        margin: 0 0 12px 0;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 6px;
        cursor: pointer;
        transition: background 0.3s ease;
    }

    .datasource label:hover {
        background: #e9ecef;
    }

    .datasource label:last-child {
        margin-bottom: 0;
    }

    .datasource input[type="checkbox"] {
        margin-right: 10px;
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

    .datasource .fa {
        margin-left: auto;
        padding: 4px 8px;
        font-size: 11px;
    }

    /* 搜索结果移动端优化 */
    .result-box {
        margin-bottom: 20px;
    }

    .result-title {
        height: auto;
        min-height: 50px;
        line-height: 1.4;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .result-title .result-num {
        float: none;
        margin-top: 8px;
        font-size: 13px;
    }

    .result-content {
        padding: 15px;
    }

    .row {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
    }

    .row-label {
        float: none;
        width: auto;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 600;
    }

    .row-content {
        margin-left: 0;
        font-size: 14px;
        line-height: 1.6;
    }

    /* 分页移动端优化 */
    .pagelist {
        margin: 20px 0;
        text-align: center;
    }

    .pagelist .page-num a,
    .pagelist .page-num span {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
        margin: 0 3px;
    }

    .pagelist .page-input {
        width: 40px;
        height: 32px;
        font-size: 13px;
    }

    .pagelist .page-ok {
        min-width: 60px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
        padding: 0 12px;
    }

    /* 面包屑导航移动端 */
    .crumbs {
        margin-bottom: 15px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .crumbs a {
        font-size: 13px;
    }

    /* 高级查询面板移动端 */
    .advanced-search-panel {
        margin: 15px 0;
        padding: 20px 15px;
    }

    .advanced-search-panel h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .advanced-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .option-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .option-group input,
    .option-group select {
        height: 40px;
        font-size: 14px;
        padding: 10px;
    }

    .option-actions {
        flex-direction: column;
        margin-top: 15px;
        gap: 10px;
    }

    .option-actions .btn {
        width: 100%;
        height: 40px;
        text-align: center;
        font-size: 14px;
    }

    /* 表单移动端优化 */
    #commBox label {
        margin: 12px 0;
    }

    #commBox label span {
        width: auto;
        text-align: left;
        margin-bottom: 8px;
        font-size: 14px;
        height: auto;
        line-height: 1.4;
    }

    #commBox label input,
    #commBox label textarea {
        width: 100%;
        height: 40px;
        font-size: 14px;
        padding: 10px;
        float: none;
        margin-left: 0;
    }

    #commBox .h90 {
        height: 90px;
        min-height: 90px;
    }

    #commBox .submit {
        width: 100%;
        height: 44px;
        margin: 15px 0 0 0;
        font-size: 16px;
        padding: 0 20px;
    }

    /* 弹窗移动端优化 */
    .message-dialog,
    .message-dialog2,
    .message-dialog3,
    .message-dialog4 {
        width: 95vw;
        max-width: none;
        margin: 0 2.5vw;
    }

    .popwrap-box {
        width: 95vw;
        max-width: none;
        margin: 0 2.5vw;
    }

    .message-popModal-title h1 {
        height: auto;
        min-height: 45px;
        line-height: 1.4;
        padding: 12px 16px;
        font-size: 14px;
    }

    .message-dialog-content .article-centent {
        font-size: 13px;
    }

    .message-dialog-content .article-centent td,
    .message-dialog-content .article-centent th {
        padding: 8px;
        font-size: 13px;
    }

    /* 通知提示移动端 */
    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
        font-size: 13px;
        padding: 12px 16px;
    }

    /* 返回顶部按钮移动端 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-top i {
        font-size: 16px;
    }

    /* 底部移动端优化 */
    #footer {
        padding: 30px 0;
        margin-top: 40px;
    }

    .copyright,
    .tel_support {
        float: none;
        text-align: center;
        margin-bottom: 10px;
        font-size: 13px;
    }

    /* 搜索结果卡片移动端 */
    .article-box {
        width: 100%;
        max-width: none;
        margin: 0 0 15px 0;
    }

    .article-box h1 {
        height: auto;
        min-height: 35px;
        line-height: 1.4;
        padding: 10px 15px;
        font-size: 14px;
    }

    .article-box .article-centent {
        font-size: 13px;
    }

    /* 触摸优化 */
    .btn, button, .filterBox ul li, .datasource label {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn:active, button:active {
        transform: scale(0.98);
    }

    /* 防止双击缩放 */
    input, textarea, select {
        touch-action: manipulation;
    }

    /* 滚动优化 */
    .filterBox .filter-content {
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端手势支持 */
    .searchbar-box .searchbar-wrap {
        touch-action: pan-y;
    }
}

/* 小屏幕手机优化 */
@media screen and (max-width: 480px) {
    .main_width {
        padding: 0 8px;
    }

    .searchbar-box {
        margin: 0 8px;
        padding-top: 60px;
    }

    .searchbar-box > h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .searchbar-box .searchbar-wrap .searchbar-input {
        width: calc(100% - 70px);
        height: 40px;
        line-height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }

    .searchbar-box .searchbar-wrap .searchbar-btn {
        width: 70px;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
    }

    .main_width .row .card {
        padding: 20px 15px;
    }

    .main_width .row .card div[style*="font-size: 48px"] {
        font-size: 32px !important;
        margin-bottom: 12px;
    }

    .main_width .row .card h3 {
        font-size: 16px;
    }

    .main_width .row .card p {
        font-size: 13px;
    }

    .filterBox .filter-content {
        padding: 12px;
    }

    .filterBox ul li {
        padding: 10px;
        font-size: 13px;
    }

    .result-content {
        padding: 12px;
    }

    .row {
        padding: 12px;
        margin-bottom: 12px;
    }

    /* 超小屏幕特殊处理 */
    .logo a {
        font-size: 18px;
    }

    .top_box .top_bar a {
        margin: 0 5px;
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* 横屏模式优化 */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .searchbar-box {
        padding-top: 40px;
        padding-bottom: 20px;
    }

    .searchbar-box > h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .main_width .row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .main_width .row .card {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
        padding: 20px 15px;
    }

    .index-bg-img {
        min-height: auto;
        height: 100vh;
    }
}

/* 高分辨率屏幕优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo a {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .btn, button {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* iOS Safari 特殊处理 */
@supports (-webkit-touch-callout: none) {
    .top_box {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .searchbar-box .searchbar-wrap {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Android Chrome 特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    select {
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 30px;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }
}