/*
 * 手机端排版（参照 t.bt.cn 移动端：白色顶栏 + 右侧抽屉菜单、居中大标题、
 * 整宽输入框 + 两等分按钮、地图/统计上下堆叠、卡片化结果），主色为科技蓝。
 * 仅 <992px 生效，桌面布局不受影响。断点与 utils/mobileViewport.ts 保持一致。
 */

:root {
    --m-primary: #2468f2;
    --m-primary-hover: #1a56d6;
    --m-primary-soft: #eaf1ff;
    --m-accent: #00b2ff;
    --m-text: #1f2937;
    --m-text-2: #4b5563;
    --m-muted: #8a94a6;
    --m-border: #e3e8f2;
    --m-input-border: #cfdaf0;
    --m-bg: #eef3fa;
    --m-radius: 10px;
    --m-gutter: 12px;
}

.m-topbar,
.m-drawer,
.m-drawer-mask,
.m-hero,
.m-tool-switch,
.m-only {
    display: none;
}

.m-shot-btn {
    display: none !important;
}

@media (max-width: 991.98px) {
    :root {
        --site-container-width: 100%;
        --site-inner-width: 100%;
        --site-scale: 1;
    }

    html,
    body {
        min-width: 0 !important;
    }

    /* body 也设 hidden 会自成滚动容器，导致顶部栏 sticky 失效；clip 只裁剪不建滚动容器 */
    html {
        overflow-x: hidden !important;
    }

    body {
        overflow-x: visible !important;
        overflow-x: clip !important;
    }

    body {
        background: var(--m-bg) !important;
        color: var(--m-text);
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }

    html.m-drawer-open,
    html.m-drawer-open body {
        overflow: hidden !important;
    }

    .m-only {
        display: block;
    }

    .m-hide,
    .pcoded-header,
    .pcoded-navbar.theme-horizontal,
    .lantern,
    .lantern_left,
    .lantern_right,
    .back_top_small,
    .inner-page-breadcrumb,
    .page-header.inner-page-breadcrumb,
    #takeScreenshot,
    .tool-screenshot-btn {
        display: none !important;
    }

    /* ---------- 通用按钮 ---------- */
    .m-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 42px;
        padding: 0 16px;
        border-radius: 6px;
        border: 1px solid var(--m-primary);
        background: #fff;
        color: var(--m-primary);
        font-size: 15px;
        font-weight: 500;
        line-height: 1;
        text-decoration: none !important;
        cursor: pointer;
    }

    .m-btn-primary {
        background: var(--m-primary);
        color: #fff !important;
    }

    .m-btn-outline {
        background: #fff;
        color: var(--m-primary) !important;
    }

    .m-btn-block {
        display: flex;
        width: 100%;
    }

    /* ---------- 顶栏 ---------- */
    .m-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1030;
        height: 54px;
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
        background: rgba(255, 255, 255, .96);
        border-bottom: 1px solid var(--m-border);
        -webkit-backdrop-filter: saturate(180%) blur(8px);
        backdrop-filter: saturate(180%) blur(8px);
    }

    .m-topbar-logo {
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .m-topbar-logo img {
        display: block;
        height: 30px;
        width: auto;
        max-width: 160px;
        object-fit: contain;
    }

    .m-topbar-brand {
        font-size: 19px;
        font-weight: 700;
        letter-spacing: 1px;
        background: linear-gradient(90deg, var(--m-primary) 0%, var(--m-accent) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    .m-topbar-menu {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 38px;
        height: 38px;
        margin-right: -8px;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .m-topbar-menu span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: var(--m-text);
    }

    /* ---------- 抽屉菜单 ---------- */
    .m-drawer-mask {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .m-drawer-mask.show {
        opacity: 1;
        visibility: visible;
    }

    .m-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1041;
        width: min(82vw, 360px);
        background: #fff;
        box-shadow: -10px 0 30px rgba(15, 23, 42, .14);
        transform: translateX(105%);
        transition: transform .28s ease;
        visibility: hidden;
    }

    .m-drawer.show {
        transform: none;
        visibility: visible;
    }

    .m-drawer-head {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 54px;
        padding: 0 16px;
        border-bottom: 1px solid var(--m-border);
    }

    .m-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: #f1f4f9;
        color: var(--m-text);
        font-size: 18px;
    }

    .m-drawer-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
    }

    .m-drawer-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 24px;
        border: 0;
        background: transparent;
        color: var(--m-text) !important;
        font-size: 15px;
        line-height: 1.4;
        text-align: left;
        text-decoration: none !important;
    }

    .m-drawer-item.active {
        color: var(--m-primary) !important;
        font-weight: 600;
    }

    .m-drawer-chevron {
        color: #9aa4b5;
        font-size: 16px;
        transition: transform .2s ease;
    }

    .m-drawer-item.expanded .m-drawer-chevron {
        transform: rotate(180deg);
    }

    .m-drawer-sub {
        padding: 4px 20px 14px;
        background: #f7f9fd;
    }

    .m-drawer-sub-title {
        margin: 10px 0 6px;
        font-size: 12px;
        color: var(--m-muted);
    }

    .m-drawer-sub-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding-top: 6px;
    }

    .m-drawer-sub-title + .m-drawer-sub-grid {
        padding-top: 0;
    }

    .m-drawer-sub-link {
        display: block;
        padding: 9px 10px;
        border: 1px solid #e8edf5;
        border-radius: 6px;
        background: #fff;
        color: var(--m-text-2) !important;
        font-size: 13px;
        text-decoration: none !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .m-drawer-sub-link.active {
        border-color: #c4d6fb;
        background: var(--m-primary-soft);
        color: var(--m-primary) !important;
    }

    .m-drawer-foot {
        flex-shrink: 0;
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--m-border);
    }

    .m-drawer-auth {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .m-drawer-user {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        font-size: 14px;
    }

    .m-drawer-user img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
    }

    .m-drawer-user span {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .m-drawer-logout {
        border: 0;
        background: none;
        color: var(--m-muted);
        font-size: 13px;
    }

    /* ---------- 页面骨架：去掉桌面固定宽度与大留白 ---------- */
    .container,
    .pcoded-main-container > .pcoded-wrapper.container,
    .pcoded-content > .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .pcoded-main-container {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        background: transparent !important;
    }

    .pcoded-main-container .pcoded-content {
        padding: 0 0 8px !important;
    }

    .pcoded-main-container .pcoded-inner-content,
    .pcoded-main-container .main-body,
    .pcoded-main-container .page-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .pcoded-main-container .page-wrapper > [class*="col-"],
    .pcoded-main-container .page-wrapper > .row > [class*="col-"] {
        padding-left: var(--m-gutter) !important;
        padding-right: var(--m-gutter) !important;
    }

    .pcoded-main-container .page-wrapper > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 非响应式栅格（col-3/4/6/8）在手机上一律整行 */
    .pcoded-main-container .col-2,
    .pcoded-main-container .col-3,
    .pcoded-main-container .col-4,
    .pcoded-main-container .col-5,
    .pcoded-main-container .col-6,
    .pcoded-main-container .col-7,
    .pcoded-main-container .col-8,
    .pcoded-main-container .col-9,
    .pcoded-main-container .col-10 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .pcoded-main-container .card {
        margin-bottom: 12px;
        border: 0;
        border-radius: var(--m-radius);
        box-shadow: 0 2px 10px rgba(30, 60, 120, .05);
    }

    .pcoded-main-container .card .card-header {
        padding: 14px 16px !important;
    }

    .pcoded-main-container .card .card-header h5 {
        font-size: 15px;
    }

    .pcoded-main-container .card .card-header h5.article-detail-title {
        margin-bottom: 8px !important;
        font-size: 19px;
        font-weight: 600;
        line-height: 1.45;
        color: var(--m-text);
    }

    .pcoded-main-container .row > .col-9.pr-2:has(.article-detail-title),
    .pcoded-main-container .row > .right_menu.col-3.pl-2 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .pcoded-main-container .row > .right_menu.col-3.pl-2 {
        margin-top: 12px;
    }

    .pcoded-main-container .article_content {
        font-size: 15px;
        line-height: 1.75;
        word-break: break-word;
    }

    .pcoded-main-container .article_content h1 { font-size: 20px; }
    .pcoded-main-container .article_content h2 { font-size: 18px; }
    .pcoded-main-container .article_content h3 { font-size: 16.5px; }
    .pcoded-main-container .article_content h4,
    .pcoded-main-container .article_content h5,
    .pcoded-main-container .article_content h6 { font-size: 15.5px; }

    .pcoded-main-container .article_content :is(h1, h2, h3, h4, h5, h6) {
        margin: 1em 0 .5em;
        font-weight: 600;
        line-height: 1.45;
    }

    .pcoded-main-container .article_content :is(img, video, iframe) {
        max-width: 100% !important;
        height: auto;
    }

    .pcoded-main-container .article_content :is(pre, table) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    .pcoded-main-container .card .card-body {
        padding: 14px 16px;
    }

    /* 桌面写死的 1000/1130px 宽内容 */
    .pcoded-main-container div[style*="width:1000px"],
    .pcoded-main-container div[style*="width: 1000px"],
    .pcoded-main-container div[style*="width:1130px"],
    .pcoded-main-container div[style*="width: 1130px"],
    .pcoded-main-container div[style*="width:880px"],
    .pcoded-main-container div[style*="width: 880px"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .pcoded-main-container .table {
        font-size: 12.5px;
    }

    .pcoded-main-container .table th,
    .pcoded-main-container .table td {
        padding: 9px 8px;
        vertical-align: middle;
    }

    .pcoded-main-container .table thead th {
        background: #f6f8fc;
        color: var(--m-text-2);
        font-weight: 500;
        border-bottom: 0;
        white-space: nowrap;
    }

    /* ---------- 顶部大标题 ---------- */
    .m-hero {
        display: block;
        margin: 0;
        padding: 30px 20px 18px;
        background: #fff;
        text-align: center;
    }

    .m-hero-title {
        margin: 0 0 14px;
        color: #111827;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: 3px;
        line-height: 1.35;
    }

    .m-hero-title em {
        font-style: normal;
        background: linear-gradient(90deg, var(--m-primary) 0%, var(--m-accent) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    .m-hero-desc {
        margin: 0 auto 10px;
        max-width: 560px;
        color: #6b7280;
        font-size: 13px;
        line-height: 1.75;
    }

    .m-hero-links {
        margin: 0;
        color: #6b7280;
        font-size: 12.5px;
        line-height: 1.7;
    }

    .m-hero-links a {
        color: var(--m-primary);
    }

    .m-hero-links .feather {
        margin-left: 1px;
        font-size: 12px;
    }

    /* ---------- 工具输入区：白底通栏 ---------- */
    .pcoded-main-container .page-wrapper .card.m-form,
    .pcoded-main-container .page-wrapper .card.input-area,
    .pcoded-main-container .page-wrapper .card.tool-batch-input {
        display: block !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 calc(-1 * var(--m-gutter)) !important;
        padding: 6px 16px 20px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        overflow: visible !important;
    }

    .m-form .ipv6-badge,
    .m-form [class*="ipv6-badge"] {
        position: static !important;
        display: inline-flex !important;
        margin: 0 0 10px !important;
    }

    .m-form-row,
    .m-form .tool-traceroute-row,
    .m-form .tool-http-input__row,
    .m-form .ping-form-row {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .m-form-row > .host-history-root,
    .m-form-row > .m-form-host,
    .m-form-row > .float-left {
        float: none !important;
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        position: relative;
    }

    .m-form-row--stack > .m-form-host {
        flex: 0 0 100% !important;
        display: block !important;
    }

    .m-form-row--stack > .m-form-host > .host-history-root {
        float: none !important;
        width: 100% !important;
    }

    .m-form-row--stack .host-history-input {
        width: 100% !important;
        border-radius: 6px !important;
    }

    .m-form-row + .m-form-options {
        margin-top: 12px !important;
    }

    .find-ping-stats-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .find-ping-stats-row > [class*="col-"] {
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
    }

    .find-ping-stats-row > .col-6 {
        grid-column: 1 / -1;
    }

    .find-ping-stats-row .card.p-4 {
        padding: 14px !important;
    }

    .find-ping-result-row .result-card-inner > div[style*="position:absolute"],
    .find-ping-result-row .result-card-inner > div[style*="position: absolute"] {
        position: static !important;
        margin-bottom: 10px;
        text-align: right;
    }

    .find-ping-result-row [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .find-ping-result-row .subnet_ip_list {
        margin-top: 10px;
    }

    .pcoded-main-container .feedback-col-right > .row > .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .pcoded-main-container .feedback-col-right > .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    .m-form-row .host-history-input,
    .m-form-row #host {
        width: 100% !important;
        max-width: 100% !important;
        height: 46px !important;
        padding-left: 12px !important;
        padding-right: 40px !important;
        border: 1px solid var(--m-input-border) !important;
        border-radius: 6px !important;
        background: #fff !important;
        font-size: 14px !important;
        box-shadow: none !important;
    }

    .m-form-row .host-history-input:focus,
    .m-form-row #host:focus {
        border-color: var(--m-primary) !important;
    }

    .m-form-row .clear_input {
        position: absolute !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
    }

    .m-tool-switch {
        position: relative;
        display: block;
        flex: 0 0 auto;
        margin: 0;
    }

    .m-tool-switch-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        height: 46px;
        margin: 0;
        padding: 0 10px 0 12px;
        border: 1px solid var(--m-input-border);
        border-right: 0;
        border-radius: 6px 0 0 6px;
        background: #fff;
        color: var(--m-text);
        font-size: 14px;
        font-weight: 400;
        white-space: nowrap;
        cursor: pointer;
        outline: none;
    }

    .m-tool-switch-btn .feather {
        color: var(--m-primary);
        font-size: 15px;
    }

    .m-tool-switch-btn .m-tool-switch-caret {
        color: var(--m-muted);
        font-size: 14px;
        transition: transform .2s ease;
    }

    .m-tool-switch.open .m-tool-switch-caret {
        transform: rotate(180deg);
    }

    .m-tool-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 1020;
        min-width: 150px;
        margin: 0;
        padding: 6px 0;
        list-style: none;
        border: 1px solid var(--m-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(30, 60, 120, .14);
    }

    .m-tool-menu > li {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 42px;
        padding: 0 16px;
        color: var(--m-text);
        font-size: 14px;
        white-space: nowrap;
        cursor: pointer;
    }

    .m-tool-menu > li .feather {
        width: 16px;
        color: var(--m-text-2);
        font-size: 16px;
        text-align: center;
    }

    .m-tool-menu > li:active {
        background: #f3f6fb;
    }

    .m-tool-menu > li.active,
    .m-tool-menu > li.active .feather {
        color: var(--m-primary);
    }

    .m-tool-menu > li.active {
        background: var(--m-primary-soft);
        font-weight: 500;
    }

    .m-tool-switch + .host-history-root .host-history-input,
    .m-tool-switch + .host-history-root #host {
        border-radius: 0 6px 6px 0 !important;
    }

    .m-form-actions,
    .m-form .tool-traceroute-actions,
    .m-form .tool-http-input__actions,
    .m-form .ping-form-actions {
        float: none !important;
        display: flex !important;
        flex: 0 0 100% !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        width: 100% !important;
        margin: 14px 0 0 !important;
        white-space: normal !important;
    }

    .m-form-actions > .btn,
    .m-form-actions > .btn-group {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .m-form-actions .btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100% !important;
        height: 46px !important;
        margin: 0 !important;
        padding: 0 10px !important;
        border-radius: 6px !important;
        font-size: 15px !important;
        font-weight: 500;
        box-shadow: none !important;
    }

    .m-form-actions .btn-primary {
        border-color: var(--m-primary) !important;
        background: var(--m-primary) !important;
        color: #fff !important;
    }

    .m-form-actions .btn-primary:active {
        background: var(--m-primary-hover) !important;
    }

    .m-form-actions .btn.m-btn-secondary,
    .m-form-actions .m-btn-secondary > .btn {
        border: 1px solid var(--m-primary) !important;
        background: #fff !important;
        color: var(--m-primary) !important;
    }

    .m-form-actions .m-btn-link {
        flex: 0 0 100% !important;
        width: 100% !important;
        height: 28px !important;
        border: 0 !important;
        background: transparent !important;
        color: var(--m-primary) !important;
        font-size: 13px !important;
    }

    .m-form-actions .btn-group .dropdown-menu {
        width: 100%;
        min-width: 0;
    }

    .pcoded-main-container .dropdown-menu {
        margin-top: 6px;
        padding: 6px 0;
        border: 1px solid var(--m-border);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(30, 60, 120, .14) !important;
        z-index: 1020;
    }

    .pcoded-main-container .dropdown-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 16px;
        color: var(--m-text);
        font-size: 14px;
    }

    .pcoded-main-container .dropdown-menu .dropdown-item:active,
    .pcoded-main-container .dropdown-menu .dropdown-item:hover {
        background: #f3f6fb;
        color: var(--m-text);
    }

    .pcoded-main-container .dropdown-menu .dropdown-item.active {
        background: var(--m-primary-soft);
        color: var(--m-primary);
        font-weight: 500;
    }

    .dns_type_change .dropdown-menu {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 6px !important;
    }

    .dns_type_change.show .dropdown-menu {
        display: grid !important;
    }

    .dns_type_change .dropdown-menu .dropdown-item {
        justify-content: center;
        height: 38px;
        padding: 0;
        border-radius: 6px;
    }

    .m-form-actions .btn-group .dropdown-toggle span {
        min-width: 0 !important;
    }

    .m-form-actions .btn i {
        font-size: 15px;
    }

    .m-form-tip {
        flex: 0 0 100%;
        flex-wrap: wrap !important;
        margin-top: 10px;
    }

    .m-form-tip > span {
        display: block !important;
        line-height: 1.7;
    }

    /* 线路勾选 + DNS（http.css 对网站测速写死了 calc(100% - 40px) !important） */
    .m-form .tool-line-select-bar,
    .card.input-area .tool-line-select-bar,
    .pcoded-main-container .card.input-area.tool-http-input > .tool-line-select-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 12px 0;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 14px !important;
    }

    .tool-line-select-bar > .mr-auto {
        display: flex !important;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
        width: 100%;
        margin-right: 0 !important;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tool-line-select-bar > .mr-auto::-webkit-scrollbar {
        display: none;
    }

    .tool-line-select-bar .custom-control {
        flex: 0 0 auto;
        margin: 0 !important;
        min-height: 18px;
        font-size: 12px;
        line-height: 18px;
        color: var(--m-text-2);
        white-space: nowrap;
    }

    .tool-line-select-bar .custom-control .custom-control-label {
        display: inline-flex;
        align-items: center;
        line-height: 18px;
    }

    .tool-line-select-bar .custom-checkbox .custom-control-label::before {
        top: 0;
        flex: 0 0 auto;
        width: 14px;
        height: 14px;
        margin-right: 3px;
        border-radius: 3px;
    }

    .tool-line-select-bar .custom-checkbox .custom-control-label::after {
        left: 2px;
        top: 8.5px;
        width: 4px;
        height: 8px;
        border-right-width: 1.5px;
        border-top-width: 1.5px;
    }

    .tool-line-select-bar > .ml-auto,
    .m-form-options > .ml-auto {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px 14px;
        width: 100%;
        margin-left: 0 !important;
        font-size: 13px;
    }

    .tool-line-select-bar > .ml-auto {
        flex-wrap: nowrap !important;
        gap: 12px;
    }

    .tool-line-select-bar > .ml-auto .form-check-label,
    .m-form-options > .ml-auto .form-check-label {
        flex: 0 0 auto;
        margin-left: 0 !important;
        display: inline-flex;
        align-items: center;
        gap: 2px;
        white-space: nowrap;
    }

    .tool-line-select-bar > .ml-auto > .dns-server-field,
    .m-form-options > .ml-auto > .dns-server-field {
        flex: 1 1 0;
        width: auto !important;
        min-width: 0;
    }

    .tool-line-select-bar #dns_server,
    .m-form-options #dns_server {
        width: 100% !important;
        height: 34px;
        background: #f5f7fb;
    }

    .tool-line-select-bar #dns_server:disabled,
    .m-form-options #dns_server:disabled {
        background: #f3f4f6;
    }

    /* 路由追踪：节点选择 + DNS 上下排列 */
    .m-form-options,
    .m-form .tool-traceroute-row-options {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 14px;
    }

    .m-form-options .node-picker,
    .m-form-options .node-picker.mr-auto {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* HTTP 高级选项：标签在上，输入在下 */
    .m-form-advanced {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 12px;
        padding: 12px;
        border-radius: 8px;
        background: #f6f8fc;
    }

    .m-form-advanced .tool-http-input__field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .m-form-advanced .tool-http-input__field-label,
    .m-form-advanced .tool-http-input__field-body {
        width: 100% !important;
    }

    .m-form-advanced .tool-http-input__field-label {
        line-height: 1.6;
        color: var(--m-text-2);
        font-size: 13px;
    }

    .m-form-advanced .form-check-label {
        white-space: normal !important;
        line-height: 1.6 !important;
        font-size: 13px;
    }

    .m-form-advanced .tool-http-input__redirect-row {
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .m-form-advanced .tool-http-input__redirect-hint {
        line-height: 1.5;
        font-size: 12px;
    }

    /* 批量检测：文本框 + 操作区上下排列 */
    .tool-batch-input .batch-grid {
        flex-direction: column;
        gap: 12px;
    }

    .tool-batch-input .batch-host {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        min-height: 140px !important;
        border-color: var(--m-input-border);
        border-radius: 6px;
        font-size: 14px;
    }

    .tool-batch-input .batch-side {
        flex: 0 0 auto !important;
        width: 100%;
    }

    .tool-batch-input .batch-actions {
        display: flex;
        gap: 10px;
    }

    .tool-batch-input .batch-actions > .btn,
    .tool-batch-input .batch-actions > div {
        flex: 1 1 0;
        min-width: 0;
    }

    .tool-batch-input .batch-actions .btn {
        width: 100% !important;
        height: 46px !important;
        border-radius: 6px;
        font-size: 15px;
    }

    .tool-batch-input .batch-actions .btn-primary {
        border-color: var(--m-primary);
        background: var(--m-primary);
    }

    .tool-batch-input .batch-actions .btn-outline-primary {
        border-color: var(--m-primary);
        color: var(--m-primary);
    }

    .tool-batch-input .batch-actions .advanced {
        position: absolute;
        right: 0;
        left: auto;
        width: calc(100vw - 32px) !important;
        max-width: 380px;
        z-index: 20;
    }

    .tool-batch-input .batch-options {
        font-size: 13px;
    }

    .tool-batch-input .batch-port-row {
        flex-wrap: wrap;
        white-space: normal;
    }

    .tool-batch-input .batch-method-row__label {
        flex: 0 0 auto;
        margin-right: 8px;
    }

    /* 批量结果：目标为行、节点为列，节点多时横向滑动，序号与目标列固定在左侧 */
    .batch-panels .batch-panels__header {
        gap: 10px;
    }

    .batch-panels .batch-panels__toolbar {
        gap: 0;
    }

    .batch-panels .batch-panels__title {
        flex: 1 1 auto;
        margin-left: 10px;
        font-size: 15px;
    }

    .batch-panels .batch-panels__stat {
        font-size: 12.5px;
    }

    .batch-panels .batch-panels__filters {
        display: flex !important;
        flex: 0 0 100%;
        order: 3;
        gap: 6px;
        margin-top: 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .batch-panels .batch-panels__filters::-webkit-scrollbar {
        display: none;
    }

    .batch-panels .batch-panels__filters > * {
        flex: 0 0 auto;
        margin: 0 !important;
        white-space: nowrap;
    }

    .batch-panels .batch-panels__progress {
        width: 100%;
        font-size: 12.5px;
    }

    .batch-panels .batch-panels__progress-text {
        font-size: 12.5px;
    }

    .batch-panels .batch-panels__progress-bar {
        flex: 1 1 auto;
        width: auto;
    }

    .pcoded-main-container .batch-panels .batch-panels__table {
        table-layout: auto !important;
        width: max-content !important;
        min-width: 100% !important;
    }

    .pcoded-main-container .batch-panels .batch-panels__table .batch-panels__col-index {
        position: sticky;
        left: 0;
        z-index: 2;
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        padding: 10px 14px 10px 6px !important;
        text-overflow: clip !important;
    }

    .pcoded-main-container .batch-panels .batch-panels__table .batch-panels__col-target {
        position: sticky;
        left: 50px;
        z-index: 2;
        width: 108px !important;
        min-width: 108px !important;
        max-width: 108px !important;
        padding-left: 6px !important;
        padding-right: 16px !important;
        box-shadow: 1px 0 0 #e3eaef;
        text-align: left;
    }

    .pcoded-main-container .batch-panels .batch-panels__table .batch-panels__col-node {
        width: 124px !important;
        min-width: 124px !important;
        max-width: 124px !important;
        padding-left: 8px !important;
        padding-right: 16px !important;
    }

    .pcoded-main-container .batch-panels .batch-panels__table thead th.batch-panels__col-index,
    .pcoded-main-container .batch-panels .batch-panels__table thead th.batch-panels__col-target {
        z-index: 3;
        background: #f7f7f7;
    }

    .batch-panels .batch-panels__latency {
        font-size: 13px;
    }

    .batch-panels .batch-panels__meta {
        font-size: 11.5px;
    }

    /* ---------- 地图 + 区域统计 ---------- */
    .tool-map-stats-shell,
    #statistics_info {
        margin-top: 0 !important;
    }

    .pcoded-main-container .page-wrapper > .tool-map-stats-shell {
        min-height: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .shared-map-stats {
        display: block !important;
        margin: 0 !important;
    }

    .shared-map-stats > [class*="col-"] {
        padding: 0 !important;
    }

    .shared-map-stats .china-map-wrap {
        min-height: 0 !important;
        margin-bottom: 0 !important;
        background: #fff;
    }

    .shared-map-stats .china-map-card,
    .shared-map-stats .china-map-vchart,
    .shared-map-stats #china_map {
        height: min(88vw, 520px) !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .shared-map-stats .map-marker-toggle {
        top: 12px !important;
        left: auto !important;
        right: 10px !important;
        width: auto !important;
    }

    .shared-map-stats > .col-6.pl-2,
    .shared-map-stats > [class*="col-"]:last-child {
        padding: 12px var(--m-gutter) 0 !important;
    }

    .shared-map-stats .card[style*="height"] {
        height: auto !important;
        margin-bottom: 0 !important;
    }

    .region-stats-header {
        flex-wrap: wrap !important;
        gap: 10px 0;
        margin: 14px 14px 10px !important;
    }

    .region-stats-header .nav-item {
        margin: 0 !important;
    }

    .region-stats-header .nav-link {
        padding: 5px 16px !important;
        border: 1px solid var(--m-primary);
        border-radius: 0 !important;
        background: #fff;
        color: var(--m-primary) !important;
        font-size: 13px;
    }

    .region-stats-header .nav-item:first-child .nav-link {
        border-radius: 4px 0 0 4px !important;
    }

    .region-stats-header .nav-item:nth-child(2) .nav-link {
        margin-left: -1px;
        border-radius: 0 4px 4px 0 !important;
    }

    .region-stats-header .nav-link.active {
        background: var(--m-primary) !important;
        color: #fff !important;
    }

    .region-stats-header .region-progress {
        flex: 0 0 100% !important;
        flex-wrap: wrap;
        gap: 6px 0;
        margin-left: 0 !important;
        white-space: normal !important;
        font-size: 12.5px;
        color: var(--m-text-2);
    }

    .region-stats-header .region-progress .progress-bar2 {
        flex: 1 1 120px !important;
        width: auto !important;
        min-width: 100px !important;
    }

    #pills-tabContent .table {
        margin-bottom: 4px;
    }

    #pills-tabContent .table td:first-child,
    #pills-tabContent .table th:first-child {
        padding-left: 14px;
        color: var(--m-text-2);
    }

    /* ---------- 结果表与面板 ---------- */
    .pcoded-main-container #return_info,
    .pcoded-main-container #tracert_result {
        display: block !important;
    }

    #tool-panels-mount .col-12,
    .pcoded-main-container #return_info > .col-12 {
        padding-left: var(--m-gutter) !important;
        padding-right: var(--m-gutter) !important;
    }

    #tool-panels-mount > .mt-3,
    #tool-panels-mount > div > .mt-3 {
        margin-top: 12px !important;
    }

    .pcoded-main-container .card-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .pcoded-main-container .card-header .float-left,
    .pcoded-main-container .card-header .float-right {
        float: none !important;
    }

    .pcoded-main-container .card-header .float-right {
        margin-left: auto;
    }

    .pcoded-main-container .card .table-responsive,
    .pcoded-main-container .card .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pcoded-main-container .card table.table {
        min-width: 100%;
    }

    /* 节点结果表：横向滑动查看，检测点列固定在左侧 */
    #tool-panels-mount .table-responsive [class*="result-wrap"],
    #tool-panels-mount .table-responsive > div {
        overflow: visible !important;
    }

    #tool-panels-mount .table-responsive > .table,
    #tool-panels-mount .table-responsive [class*="result-wrap"] > .table,
    #tool-panels-mount .table-responsive > div > .table {
        min-width: 680px !important;
        margin-bottom: 0;
        table-layout: auto !important;
    }

    #tool-panels-mount .card-header > .float-left {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    #tool-panels-mount .card-header > .float-left > h5 {
        margin-right: 4px;
    }

    .pcoded-main-container .card-header > .float-left {
        position: relative;
    }

    .pcoded-main-container .card-header > .float-left > span.class_hr {
        top: 1px;
        left: 0;
        background-color: var(--m-primary);
    }

    #tool-panels-mount .card-header .youce-radio,
    #tool-panels-mount .card-header .badge {
        margin: 0 !important;
        white-space: nowrap;
    }

    /* 结果表头：手机端用「运营商 / 状态 / 清除筛选」一行筛选条替代单选标签 */
    .m-filter-header {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
    }

    .m-filter-header > .float-left > label.youce-radio,
    .m-filter-header > .float-left > .time_out,
    .m-filter-header > .float-right {
        display: none !important;
    }

    .m-filter-header > .float-left {
        width: 100%;
    }

    .m-result-filter {
        position: relative;
        flex: 0 0 100%;
        width: 100%;
    }

    .m-result-filter-meta {
        margin: 4px 0 10px 12px;
        color: var(--m-muted);
        font-size: 12px;
    }

    .m-result-filter-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .m-filter-drop {
        position: relative;
        flex: 0 0 auto;
    }

    .m-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        height: 32px;
        padding: 0 10px;
        border: 1px solid var(--m-border);
        border-radius: 4px;
        background: #fff;
        color: var(--m-text-2);
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
        outline: none;
    }

    .m-filter-btn .feather {
        color: var(--m-muted);
        font-size: 13px;
        transition: transform .2s ease;
    }

    .m-filter-drop.open .m-filter-btn .feather {
        transform: rotate(180deg);
    }

    .m-filter-btn.active {
        border-color: var(--m-primary);
        background: var(--m-primary-soft);
        color: var(--m-primary);
    }

    .m-filter-btn.active .feather {
        color: var(--m-primary);
    }

    .m-filter-btn:disabled {
        color: #b8c0cc;
    }

    .m-filter-chip {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .m-filter-count {
        display: inline-block;
        min-width: 16px;
        height: 16px;
        margin-left: 2px;
        padding: 0 4px;
        border-radius: 8px;
        background: #f44336;
        color: #fff;
        font-size: 11px;
        line-height: 16px;
        text-align: center;
    }

    .m-filter-menu {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        z-index: 1020;
        min-width: 130px;
        margin: 0;
        padding: 6px 0;
        list-style: none;
        border: 1px solid var(--m-border);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(30, 60, 120, .14);
    }

    .m-filter-menu > li {
        display: flex;
        align-items: center;
        height: 38px;
        padding: 0 14px;
        color: var(--m-text);
        font-size: 13.5px;
        white-space: nowrap;
        cursor: pointer;
    }

    .m-filter-menu > li:active {
        background: #f3f6fb;
    }

    .m-filter-menu > li.active {
        background: var(--m-primary-soft);
        color: var(--m-primary);
        font-weight: 500;
    }

    .m-result-filter-row {
        position: relative;
    }

    .m-filter-drop:has(> .m-filter-menu--grid) {
        position: static;
    }

    .m-filter-menu.m-filter-menu--grid {
        right: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        max-height: 300px;
        padding: 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .m-filter-menu--grid > span {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 34px;
        border-radius: 4px;
        background: #f5f7fb;
        color: var(--m-text);
        font-size: 13px;
        white-space: nowrap;
        cursor: pointer;
    }

    .m-filter-menu--grid > .m-filter-grid-all {
        grid-column: 1 / -1;
    }

    .m-filter-menu--grid > span.active {
        background: var(--m-primary-soft);
        color: var(--m-primary);
        font-weight: 500;
    }

    #tool-panels-mount .table-responsive .many-result-table {
        min-width: 820px !important;
    }

    #tool-panels-mount .table-responsive .table thead th {
        position: static !important;
    }

    #tool-panels-mount .table-responsive .table th:first-child,
    #tool-panels-mount .table-responsive .table td:first-child {
        position: sticky !important;
        left: 0;
        z-index: 2;
        background: #fff;
        box-shadow: 1px 0 0 #edf1f7;
    }

    #tool-panels-mount .table-responsive .table thead th:first-child {
        background: #f6f8fc;
    }

    /* 节点结果表（参照 t.bt.cn）：只保留关键列，列宽按内容舒展、不换行，超出屏幕时整表横向滑动 */
    #tool-panels-mount .table-responsive,
    #pills-tabContent .table-responsive,
    #tracert_result .table-responsive {
        container-type: inline-size;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    #tool-panels-mount .table-responsive::-webkit-scrollbar,
    #pills-tabContent .table-responsive::-webkit-scrollbar,
    #tracert_result .table-responsive::-webkit-scrollbar {
        display: none;
    }

    #tool-panels-mount .table-responsive .table.once-result-table,
    #tool-panels-mount .table-responsive .table.many-result-table,
    #tool-panels-mount .table-responsive .table.tcping-result-table,
    #tool-panels-mount .table-responsive .table.boce-ping-result-table,
    #tool-panels-mount .table-responsive .table.http-result-table,
    #tool-panels-mount .table-responsive .table.http-ipv6-result-table,
    #tool-panels-mount .table-responsive .table.dns-result-table,
    #tool-panels-mount .table-responsive .table.trace-result-table {
        width: max-content !important;
        min-width: 100% !important;
        max-width: none !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 13px !important;
    }

    #tool-panels-mount .table-responsive .table > :is(thead, tbody) > tr > :is(th, td),
    #pills-tabContent .table > :is(thead, tbody) > tr > :is(th, td),
    #tracert_result .table > :is(thead, tbody) > tr > :is(th, td) {
        border: 0 !important;
        border-bottom: 1px solid #eef1f6 !important;
    }

    #tool-panels-mount .table-responsive .table > thead > tr > th,
    #pills-tabContent .table > thead > tr > th,
    #tracert_result .table > thead > tr > th {
        background: #f6f8fc !important;
    }

    #tool-panels-mount .table-responsive .table > tbody > tr:not(.head_info):not(.dns_info) > td {
        background: #fff !important;
    }

    #tool-panels-mount .table-responsive .table > thead > tr > th:first-child {
        text-align: left !important;
        padding-left: 14px !important;
    }

    .once-result-table > colgroup,
    .many-result-table > colgroup,
    .tcping-result-table > colgroup,
    .boce-ping-result-table > colgroup,
    .http-result-table > colgroup,
    .http-ipv6-result-table > colgroup,
    .dns-result-table > colgroup,
    .trace-result-table > colgroup {
        display: none;
    }

    .once-result-table tr > :nth-child(3),
    .once-result-table tr > :nth-child(5),
    .many-result-table tr > :nth-child(3),
    .many-result-table tr > :nth-child(n+5):nth-child(-n+8),
    .many-result-table tr > :nth-child(n+10),
    .tcping-result-table tr > :nth-child(3),
    .tcping-result-table tr > :nth-child(n+5):nth-child(-n+8),
    .tcping-result-table tr > :nth-child(n+10),
    .boce-ping-result-table tr > :nth-child(4),
    .boce-ping-result-table tr > :nth-child(5),
    .boce-ping-result-table tr > :nth-child(n+8),
    .http-result-table tr > :nth-child(3),
    .http-result-table tr > :nth-child(n+6):nth-child(-n+9),
    .http-ipv6-result-table tr > :nth-child(n+5):nth-child(-n+7),
    .dns-result-table tr > :nth-child(2),
    .dns-result-table tr > :nth-child(3),
    .dns-result-table tr > :nth-child(5),
    .dns-result-table tr > :nth-child(8),
    .trace-result-table tr > :nth-child(3),
    .trace-result-table tr > :nth-child(5),
    .trace-result-table tr > :nth-child(n+7):nth-child(-n+10) {
        display: none !important;
    }

    #tool-panels-mount .table-responsive .table.once-result-table th,
    #tool-panels-mount .table-responsive .table.once-result-table td,
    #tool-panels-mount .table-responsive .table.many-result-table th,
    #tool-panels-mount .table-responsive .table.many-result-table td,
    #tool-panels-mount .table-responsive .table.tcping-result-table th,
    #tool-panels-mount .table-responsive .table.tcping-result-table td,
    #tool-panels-mount .table-responsive .table.boce-ping-result-table th,
    #tool-panels-mount .table-responsive .table.boce-ping-result-table td,
    #tool-panels-mount .table-responsive .table.http-result-table th,
    #tool-panels-mount .table-responsive .table.http-result-table td,
    #tool-panels-mount .table-responsive .table.http-ipv6-result-table th,
    #tool-panels-mount .table-responsive .table.http-ipv6-result-table td,
    #tool-panels-mount .table-responsive .table.dns-result-table th,
    #tool-panels-mount .table-responsive .table.dns-result-table td,
    #tool-panels-mount .table-responsive .table.trace-result-table th,
    #tool-panels-mount .table-responsive .table.trace-result-table td {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        padding: 12px 14px !important;
        overflow: visible !important;
        text-align: center;
        text-overflow: clip !important;
        white-space: nowrap !important;
        word-break: normal !important;
        vertical-align: middle;
        line-height: 1.45;
    }

    #tool-panels-mount .table-responsive .table thead th {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
        background: #f6f8fc;
        color: var(--m-text-2);
        font-size: 13px;
        font-weight: 500;
    }

    #tool-panels-mount .table-responsive .table.once-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.many-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.tcping-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.boce-ping-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.http-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.http-ipv6-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.dns-result-table tr > :first-child,
    #tool-panels-mount .table-responsive .table.trace-result-table tr > :first-child {
        position: sticky !important;
        left: 0;
        z-index: 2;
        padding-left: 14px !important;
        background: #fff;
        text-align: left;
        box-shadow: 1px 0 0 #edf1f7;
    }

    #tool-panels-mount .table-responsive .table thead tr > th:first-child {
        z-index: 3;
        background: #f6f8fc;
    }

    #tool-panels-mount .table-responsive .table tbody tr:hover > td:first-child {
        background: #fff;
    }

    /* 展开的详情行：内容宽度锁在可视区并跟随横滑停在左侧，避免被整表宽度撑开 */
    #tool-panels-mount .table-responsive .table tr.head_info > td:first-child,
    #tool-panels-mount .table-responsive .table tr.dns_info > td:first-child {
        position: static !important;
        padding: 0 !important;
        box-shadow: none;
        text-align: left !important;
        white-space: normal !important;
        background: #f8fafd;
    }

    #tool-panels-mount .table-responsive .table tr.head_info > td > *,
    #tool-panels-mount .table-responsive .table tr.dns_info > td > * {
        position: sticky;
        left: 0;
        box-sizing: border-box;
        width: calc(100vw - 2 * var(--m-gutter)) !important;
        max-width: calc(100vw - 2 * var(--m-gutter)) !important;
        width: 100cqw !important;
        max-width: 100cqw !important;
        margin: 0 !important;
        padding: 12px 14px !important;
        font-size: 12.5px;
        line-height: 1.65;
        white-space: pre-wrap !important;
        overflow-wrap: anywhere;
    }

    #tool-panels-mount .table-responsive .table .badge {
        margin-right: 6px;
        padding: 3px 6px;
        font-size: 11.5px;
        font-weight: 500;
        vertical-align: 1px;
    }

    /* 扳手悬停菜单依赖鼠标 hover，触屏上会误触或整串摊开，手机端不提供 */
    .pcoded-main-container .hover-button {
        display: none !important;
    }

    .dns-result-table .dns_str .address-hidden {
        max-width: 140px !important;
    }

    #pills-tabContent .table,
    #tracert_result .table.trace-result-table {
        width: max-content !important;
        min-width: 100% !important;
        max-width: none !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        font-size: 13px !important;
    }

    #pills-tabContent .table th,
    #pills-tabContent .table td,
    #tracert_result .trace-result-table th,
    #tracert_result .trace-result-table td {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 12px 14px !important;
        text-align: left;
        white-space: nowrap !important;
        word-break: normal !important;
        vertical-align: middle;
        line-height: 1.45;
    }

    #pills-tabContent .table thead th,
    #tracert_result .trace-result-table thead th {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
        background: #f6f8fc;
        color: var(--m-text-2);
        font-size: 13px;
        font-weight: 500;
    }

    #tracert_result .trace-result-table th,
    #tracert_result .trace-result-table td {
        text-align: center;
    }

    #tracert_result .table-responsive > .float-left,
    #tool-panels-mount .table-responsive > .float-left.p-3 {
        position: sticky;
        left: 0;
        float: none !important;
        display: block;
        box-sizing: border-box;
        width: 100cqw;
        padding: 12px 14px !important;
        font-size: 13px;
        line-height: 1.8;
    }

    #tracert_result .table-responsive > .float-left .ml-3,
    #tool-panels-mount .table-responsive > .float-left.p-3 .ml-3 {
        display: block;
        margin-left: 0 !important;
    }

    /* 域名解析统计：两列卡片 */
    .resolve_ip_list {
        padding: 10px 12px 12px !important;
    }

    .resolve_ip_list .ip_list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .resolve_ip_list .ip_list > li,
    .resolve_ip_list .ip_list > a {
        display: block !important;
        float: none !important;
        flex: none !important;
        justify-self: stretch;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 6px;
        background: #f6f8fc;
    }

    .resolve_ip_list .ip_list > a > li,
    .resolve_ip_list .resolve-ip-filter {
        display: flex !important;
        float: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 8px 10px !important;
        background: transparent !important;
        font-size: 12.5px;
        line-height: 1.4;
    }

    .resolve_ip_list .ip_list .real_ip,
    .resolve_ip_list .ip_list .resolve-ip-pct {
        float: none !important;
        margin: 0 !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .resolve_ip_list.resolve-ip-list-ipv6 .ip_list {
        grid-template-columns: 1fr;
    }

    .pcoded-main-container .nav-pills {
        flex-wrap: wrap;
    }

    .pcoded-main-container .nav-pills .nav-link {
        font-size: 13px;
    }

    .pcoded-main-container .btn {
        touch-action: manipulation;
    }

    /* ---------- 广告与公告 ---------- */
    /* 手机版暂不投放广告：横幅、灯笼、顶部图片、结果表赞助商列统一带 .gg_link */
    .gg_link {
        display: none !important;
    }

    .site-recruit-banner {
        width: auto !important;
        height: auto !important;
        margin: 10px var(--m-gutter) 0 !important;
        padding: 10px 14px !important;
        line-height: 1.5 !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        background: linear-gradient(90deg, var(--m-primary), var(--m-accent)) !important;
    }

    .site-announcement-bar {
        width: auto !important;
        margin: 10px var(--m-gutter) 0 !important;
        font-size: 13px !important;
    }

    /* ---------- 页脚 ---------- */
    .footer {
        height: auto !important;
        margin-top: 8px !important;
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom)) !important;
        background: #fff;
        color: var(--m-muted);
        font-size: 12px;
    }

    .footer .card-body {
        padding: 0 !important;
    }

    .footer .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        line-height: 1.9;
        margin-bottom: 0 !important;
    }

    .footer .split {
        padding: 0 6px !important;
    }

    .footer a {
        color: var(--m-text-2);
    }

    /* ---------- 返回顶部 ---------- */
    .back_top {
        z-index: 1030 !important;
        top: auto !important;
        right: 14px !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
    }

    .back_top #scroll-to-top {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px !important;
        height: 42px !important;
        padding: 0;
        border: 1px solid var(--m-border) !important;
        border-radius: 50%;
        background: rgba(255, 255, 255, .96) !important;
        color: var(--m-primary) !important;
        font-size: 0 !important;
        box-shadow: 0 4px 14px rgba(30, 60, 120, .14);
    }

    .back_top #scroll-to-top i {
        font-size: 18px;
    }

    html.m-drawer-open .back_top {
        display: none !important;
    }

    /* 弹窗、提示 */
    .layui-layer {
        max-width: calc(100vw - 24px) !important;
    }

    /* ---------- 首页 ---------- */
    .home-tool-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 0 !important;
    }

    .home-tool-grid > .element-item {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .home-tool-grid > .element-item[style*="display: none"] {
        display: none !important;
    }

    .home-tool-grid > .element-item > .card {
        min-height: 0 !important;
        height: auto !important;
        padding: 14px 16px !important;
        box-shadow: 0 1px 3px rgba(30, 60, 120, .06) !important;
    }

    .home-tool-grid .media i.iconfont {
        margin-right: 10px !important;
        font-size: 26px !important;
        color: var(--m-primary);
    }

    .home-tool-grid h4 {
        margin: 0;
        color: var(--m-text);
        font-size: 16px;
        line-height: 26px;
    }

    .home-tool-grid .badge {
        margin-top: 2px !important;
        font-size: 11px;
    }

    .home-tool-grid p.text-secondary {
        color: var(--m-muted) !important;
        font-size: 12.5px;
        line-height: 1.7;
    }

    .home-article-row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 var(--m-gutter);
    }

    .home-article-row .card {
        margin-bottom: 12px !important;
    }

    /* ---------- IP 查询页 ---------- */
    .ip-local-row {
        display: block !important;
        margin: 0 !important;
        padding: 4px 0 !important;
    }

    .ip-local-row > [class*="col-"] {
        padding: 0 !important;
    }

    .ip-local-row .more-hidden {
        max-width: 100% !important;
    }

    .ip-local-row > .network_loading {
        padding: 8px 0 0 !important;
    }

    .ip-local-row > .network_first .badge {
        display: block;
        margin: 10px 0 0 !important;
        padding: 10px 12px;
        line-height: 1.6 !important;
        font-size: 13.5px !important;
        white-space: normal;
        text-align: left;
    }

    .ip-leak-row {
        display: block !important;
        margin: 0 !important;
    }

    .ip-leak-row > div {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .ip-leak-row .card-body > .row {
        display: block !important;
        margin: 0 !important;
        padding: 12px 16px !important;
    }

    .ip-leak-row .card-body > .row > div {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .ip-query-bar {
        gap: 10px;
    }

    .ip-query-bar .ip-query-input {
        flex: 1 1 0 !important;
        min-width: 0;
        width: auto !important;
        height: 44px;
    }

    .ip-query-bar .ip-query-btn {
        flex: 0 0 auto;
        height: 44px;
    }

    .ip-m-mine {
        margin: 6px 0 0;
        color: var(--m-text-2);
        font-size: 13px;
        line-height: 1.8;
    }

    .ip-m-mine b {
        color: var(--m-primary);
        font-weight: 500;
        word-break: break-all;
    }

    .ip-m-sep {
        margin: 0 8px;
        color: #cbd5e1;
    }

    .ip-m-form {
        margin-bottom: 12px !important;
    }

    .ip-m-crumb {
        padding: 10px 0 14px;
        color: var(--m-text-2);
        font-size: 13px;
    }

    .ip-m-crumb a {
        color: var(--m-primary);
    }

    .ip-m-crumb span {
        margin: 0 8px;
        color: #cbd5e1;
    }

    .ip-m-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 8px;
        margin-top: 16px;
        color: var(--m-text);
        font-size: 13.5px;
    }

    .ip-m-meta-ip {
        color: var(--m-primary);
        font-weight: 500;
        word-break: break-all;
    }

    .ip-m-meta-time {
        color: var(--m-muted);
        font-size: 12px;
    }

    .ip-m-meta-refresh {
        padding: 0;
        border: 0;
        background: none;
        color: var(--m-primary);
        font-size: 12px;
    }

    .ip-m-meta-refresh:disabled {
        color: var(--m-muted);
    }

    .ip-m-alert {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin-top: 12px;
        padding: 14px 16px;
        border-radius: 8px;
        background: var(--m-primary-soft);
        color: var(--m-primary);
    }

    .ip-m-alert > .fas {
        margin-top: 2px;
        font-size: 17px;
    }

    .ip-m-alert-title {
        font-size: 14px;
        font-weight: 500;
        line-height: 1.5;
    }

    .ip-m-alert-sub {
        margin-top: 2px;
        font-size: 12.5px;
        word-break: break-all;
    }

    .ip-m-alert.is-fail {
        background: #fff1f0;
        color: #e5484d;
    }

    .ip-m-info {
        margin-top: 12px;
        padding: 6px 16px 8px;
        border: 1px solid var(--m-border);
        border-radius: 8px;
    }

    .ip-m-info h6 {
        margin: 10px 0 6px;
        color: var(--m-text);
        font-size: 14px;
        font-weight: 500;
    }

    .ip-m-info dl {
        margin: 0;
    }

    .ip-m-info-row {
        display: flex;
        padding: 9px 0;
        font-size: 13.5px;
    }

    .ip-m-info-row dt {
        flex: 0 0 96px;
        color: var(--m-text-2);
        font-weight: 400;
    }

    .ip-m-info-row dd {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        color: var(--m-text);
        word-break: break-all;
    }

    /* ---------- 在线工具（json-boce 系列） ---------- */
    .pcoded-content.json-page-content {
        padding: 0 var(--m-gutter) 24px !important;
    }

    .pcoded-main-container .pcoded-content.json-page-content:has(> .json-index-hero) {
        padding-top: 0 !important;
    }

    .json-page-content .json-index-hero {
        max-width: none !important;
        margin: 0 calc(-1 * var(--m-gutter)) 14px !important;
        padding: 26px 20px 22px;
        background: #fff;
    }

    .json-page-content .json-index-title {
        font-size: 24px !important;
        letter-spacing: 2px !important;
    }

    .json-page-content .json-index-desc {
        font-size: 13.5px !important;
    }

    .json-page-content .json-menu-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .json-page-content .json-menu-grid > * {
        min-width: 0;
    }

    .json-page-content .menu-item {
        min-height: 0 !important;
        padding: 12px 14px !important;
        border-radius: var(--m-radius) !important;
    }

    .json-page-content .menu-item .card-body {
        padding: 0 !important;
    }

    .json-page-content .menu-icon {
        width: 42px !important;
        height: 42px !important;
        border-radius: 12px !important;
    }

    .json-page-content .card-title {
        font-size: 15.5px !important;
    }

    .json-page-content .card-go {
        opacity: 1 !important;
        transform: none !important;
        height: auto !important;
    }

    .json-page-content .CodeMirror,
    .json-page-content .CodeMirror-scroll {
        max-width: 100%;
    }

    /* ---------- 域名 / 拦截检测（yc 页） ---------- */
    .yc-page .yc-card-intro {
        display: none;
    }

    .yc-page .yc-subnav-wrap {
        width: auto !important;
        max-width: none !important;
        margin: 0 calc(-1 * var(--m-gutter)) !important;
        padding: 0 16px 6px;
        background: #fff;
    }

    .yc-page .yc-subnav {
        gap: 8px;
        padding: 0;
        overflow-x: auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        scrollbar-width: none;
    }

    .yc-page .yc-subnav::-webkit-scrollbar {
        display: none;
    }

    .yc-page .yc-subnav a {
        flex: 0 0 auto;
        padding: 7px 14px;
        border: 1px solid var(--m-border);
        border-radius: 16px;
        background: #f6f8fc;
        color: var(--m-text-2);
        font-size: 13px;
    }

    .yc-page .yc-subnav a.active {
        border-color: var(--m-primary);
        background: var(--m-primary);
        color: #fff;
        box-shadow: none;
    }

    .yc-page .yc-search-card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .yc-page .yc-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .yc-page .yc-search-row .yc-tool-badge {
        display: none;
    }

    .yc-page .yc-search-row .form-control {
        flex: 0 0 auto;
        width: 100%;
        height: 46px;
        border-color: var(--m-input-border);
        border-radius: 6px;
        font-size: 15px;
    }

    .yc-page .yc-detect-btn {
        width: 100%;
        height: 46px;
        border-radius: 6px;
        background: var(--m-primary);
        box-shadow: none;
        font-size: 16px;
        font-weight: 500;
    }

    .yc-page .yc-detect-btn:hover {
        transform: none;
    }

    .yc-page .yc-mode-bar {
        display: flex;
        width: 100%;
        margin-bottom: 14px;
    }

    .yc-page .yc-mode-btn {
        flex: 1 1 0;
        padding: 8px 0;
    }

    .yc-page .yc-mode-btn.active {
        color: var(--m-primary);
    }

    .yc-page .yc-hosts-input {
        border-color: var(--m-input-border);
        font-size: 15px;
    }

    .yc-page .yc-history-card,
    .yc-page .yc-detect-panel {
        padding: 14px !important;
        border-radius: var(--m-radius) !important;
    }

    .yc-page .yc-history-head {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center !important;
        gap: 10px;
    }

    .yc-page .yc-history-title {
        font-size: 16px;
    }

    .yc-page .yc-history-table {
        min-width: 520px;
    }

    .yc-page .yc-history-table:has(.yc-history-empty) {
        min-width: 0;
    }
}

/* ========== 手机端截图保存（参考 t.bt.cn 结果长图） ========== */
@media (max-width: 991.98px) {
    .m-form-actions .btn.m-shot-btn,
    .tool-batch-input .batch-actions .btn.m-shot-btn {
        display: inline-flex !important;
    }

    html.m-shot-open,
    html.m-shot-open body {
        overflow: hidden;
    }

    #screenshots.m-shot-capture {
        width: 100%;
        padding-bottom: 12px !important;
        background: #f3f5f9;
    }

    #screenshots.m-shot-capture .m-hero,
    #screenshots.m-shot-capture #tool-page-root > .col-12:has(> .input-area),
    #screenshots.m-shot-capture .m-result-filter,
    #screenshots.m-shot-capture .gg_link,
    #screenshots.m-shot-capture .hover-button,
    #screenshots.m-shot-capture .m-shot-skip,
    #screenshots.m-shot-capture .map-marker-toggle,
    #screenshots.m-shot-capture .m-resolve-toggle,
    #screenshots.m-shot-capture tr.head_info,
    #screenshots.m-shot-capture tr.dns_info {
        display: none !important;
    }

    #screenshots.m-shot-capture .table-responsive {
        overflow: hidden !important;
    }

    #screenshots.m-shot-capture .table-responsive .table {
        width: 100% !important;
        min-width: 0 !important;
    }

    #screenshots.m-shot-capture .table-responsive .table > :is(thead, tbody) > tr > :is(th, td) {
        position: static !important;
        padding: 10px 8px !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        box-shadow: none !important;
    }

    #screenshots.m-shot-capture .table-responsive .table > :is(thead, tbody) > tr > :is(th, td):first-child,
    #screenshots.m-shot-capture #pills-tabContent .table > :is(thead, tbody) > tr > :is(th, td) {
        overflow-wrap: normal !important;
    }

    #screenshots.m-shot-capture .table-responsive .table > :is(thead, tbody) > tr > :is(th, td):first-child {
        padding-left: 12px !important;
    }

    .m-shot-head {
        margin: 0 var(--m-gutter) 12px;
        padding: 16px;
        border-radius: 10px;
        background: linear-gradient(135deg, #2468f2 0%, #3d8bff 100%);
        color: #fff;
    }

    .m-shot-head-brand {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
    }

    .m-shot-head-logo {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 1px;
    }

    .m-shot-head-host {
        font-size: 12px;
        opacity: .8;
    }

    .m-shot-head-tool {
        margin-top: 12px;
        font-size: 16px;
        font-weight: 600;
    }

    .m-shot-head-target {
        margin-top: 4px;
        font-size: 14px;
        word-break: break-all;
        opacity: .95;
    }

    .m-shot-head-time {
        margin-top: 10px;
        font-size: 12px;
        opacity: .8;
    }

    .m-shot-foot {
        margin: 12px var(--m-gutter) 0;
        padding: 16px;
        border-radius: 10px;
        background: #fff;
    }

    .m-shot-foot-note {
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px dashed var(--m-border);
        color: var(--m-text-2);
        font-size: 12.5px;
        text-align: center;
    }

    .m-shot-foot-main {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .m-shot-foot-qr {
        flex: 0 0 auto;
        width: 96px;
        height: 96px;
        border: 1px solid #eef1f6;
        border-radius: 6px;
    }

    .m-shot-foot-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        color: var(--m-text);
        font-size: 13px;
    }

    .m-shot-foot-text strong {
        font-size: 15px;
    }

    .m-shot-foot-text span {
        color: var(--m-text-2);
    }

    .m-shot-foot-text em {
        margin-top: 4px;
        color: var(--m-primary);
        font-style: normal;
        font-size: 12px;
    }
}

/* ========== 手机端解析统计 / 结果行点击（参考 t.bt.cn） ========== */
@media (max-width: 991.98px) {
    #tool-panels-mount tr.node_tr:active > td {
        background: #f3f6fb !important;
    }

    .m-resolve {
        padding: 12px 14px 14px;
    }

    .m-resolve-metrics {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 12px;
        padding: 12px 0;
        border-radius: 8px;
        background: #f6f8fc;
    }

    .m-resolve-metric {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 0;
    }

    .m-resolve-metric + .m-resolve-metric {
        border-left: 1px solid #e6eaf2;
    }

    .m-resolve-metric strong {
        color: var(--m-primary);
        font-size: 18px;
        font-weight: 700;
        line-height: 1.3;
    }

    .m-resolve-metric span {
        color: var(--m-text-2);
        font-size: 12px;
    }

    .m-resolve-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .m-resolve-list > li {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid #eef1f6;
        border-radius: 6px;
        background: #fff;
        overflow: hidden;
        cursor: pointer;
    }

    .m-resolve-list > li.active {
        border-color: var(--m-primary);
    }

    .m-resolve-bar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        background: var(--m-primary-soft);
        pointer-events: none;
    }

    .m-resolve-list > li.failed .m-resolve-bar {
        background: #fdecec;
    }

    .m-resolve-ip,
    .m-resolve-pct {
        position: relative;
        font-size: 13.5px;
    }

    .m-resolve-ip {
        min-width: 0;
        color: var(--m-text);
        overflow-wrap: anywhere;
    }

    .m-resolve-list > li.failed .m-resolve-ip {
        color: #e61610;
    }

    .m-resolve-pct {
        flex: 0 0 auto;
        color: var(--m-primary);
        font-weight: 600;
    }

    .m-resolve-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
        height: 36px;
        margin-top: 8px;
        border: 0;
        background: transparent;
        color: var(--m-primary);
        font-size: 13px;
    }
}

/* ========== 手机端工具页底部「常用工具」 ========== */
@media (max-width: 991.98px) {
    #screenshots.m-shot-capture .m-common-tools {
        display: none !important;
    }

    .m-common-tools {
        margin: 12px var(--m-gutter) 0;
        padding: 14px;
        border-radius: 10px;
        background: #fff;
    }

    .m-common-tools-title {
        position: relative;
        margin: 0 0 12px;
        padding-left: 10px;
        color: var(--m-text);
        font-size: 15px;
        font-weight: 600;
    }

    .m-common-tools-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 3px;
        bottom: 3px;
        width: 3px;
        border-radius: 2px;
        background: var(--m-primary);
    }

    .m-common-tools-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .m-common-tool {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        padding: 10px;
        border: 1px solid #eef1f6;
        border-radius: 8px;
        text-decoration: none !important;
    }

    .m-common-tool:active {
        background: #f6f8fc;
    }

    .m-common-tool-icon {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        font-size: 16px;
    }

    .m-common-tool-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .m-common-tool-text strong {
        color: var(--m-text);
        font-size: 13.5px;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .m-common-tool-text em {
        color: var(--m-text-2);
        font-size: 11.5px;
        font-style: normal;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ========== 窄屏（iPhone SE 等 ≤374px）：按钮 / 筛选 / 常用工具紧凑排布 ========== */
@media (max-width: 374.98px) {
    :is(.m-form-actions, .ping-form-actions, .tool-traceroute-actions, .batch-actions) .btn {
        padding: 0 4px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
    }

    :is(.m-form-actions, .ping-form-actions, .tool-traceroute-actions, .batch-actions) .btn > i {
        display: none;
    }

    .m-result-filter-row {
        gap: 5px;
    }

    .m-filter-btn {
        gap: 2px;
        padding: 0 6px;
        font-size: 12.5px;
    }

    .m-common-tool {
        gap: 8px;
        padding: 9px 8px;
    }

    .m-common-tool-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .m-common-tool-text strong {
        font-size: 13px;
    }

    .m-common-tool-text em {
        display: none;
    }
}
