/**
 * 大学导航首页 — 移动端/平板适配（仅缩小字号/尺寸，不改变整体布局结构）
 * 覆盖：手机竖屏、手机横屏、平板横屏
 */

/* ---------- 手机竖屏 / 手机横屏 / 平板横屏（共用紧凑布局） ---------- */
@media screen and (max-width: 768px),
       screen and (orientation: landscape) and (max-height: 520px),
       screen and (orientation: landscape) and (min-width: 769px) and (max-width: 1366px) {
    .header {
        height: 56px;
    }
    .header-center {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 50%;
        top: 4px;
        transform: translateX(-50%);
        z-index: 1000;
        max-width: calc(100vw - 132px);
        width: auto;
        gap: 5px;
        pointer-events: none;
    }
    .header-center .loge,
    .header-center .tt {
        pointer-events: auto;
    }
    .header img.loge {
        position: static;
        height: 38px;
        width: auto;
        margin: 0;
        flex-shrink: 0;
    }
    .header p.sj {
        float: none;
        position: absolute;
        left: 4px;
        top: 9px;
        z-index: 1001;
        margin: 0;
        padding: 0;
        font-size: 9px;
        line-height: 1.25;
        max-width: 30vw;
        white-space: pre-line;
        overflow: visible;
        text-overflow: clip;
    }
    .header p.zhqh {
        float: none;
        position: absolute;
        right: 6px;
        top: 8px;
        margin: 0;
        font-size: 11px;
        line-height: 1.3;
        z-index: 1001;
    }
    .header p.zhqh a {
        margin-left: 3px;
    }
    .header p.zhqh a img {
        width: 12px;
        height: 12px;
        margin-left: 2px;
    }
    .header p.zhqh .tour-user-phone.is-visible {
        font-size: 10px;
        max-width: 48px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
    }

    /* 标题区：与 logo 横排，左对齐 */
    .header .tt {
        position: static !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        height: auto !important;
        flex: 1;
        min-width: 0;
    }
    .header .tt p:first-of-type {
        text-align: left !important;
        font-size: 8px !important;
        margin-top: 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header .tt p:nth-of-type(2) {
        text-align: left !important;
        font-size: 10px !important;
        margin-top: 1px !important;
        line-height: 1.2 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 左右侧栏 */
    .left,
    .right {
        width: 128px;
        top: 40%;
    }
    .left {
        left: 0;
    }
    .right {
        right: 0;
    }
    .lb {
        width: 128px;
        height: auto;
        margin-bottom: 6px;
    }
    .lb p {
        height: 24px;
        line-height: 24px;
        font-size: 9px;
    }
    .lb p img {
        margin: 0 4px;
        max-height: 10px;
        width: auto;
    }
    .lb ul {
        height: auto;
        overflow-y: visible;
    }
    .lb ul li {
        height: auto !important;
    }
    .lb ul li a {
        height: 18px;
        line-height: 18px;
        font-size: 8px;
    }
    .lb ul li a img {
        width: 12px;
        height: 11px;
        margin-left: 6px;
        margin-right: 2px;
    }

    /* 底部 5 按钮：flex 均分一行（display:contents 让 5 个 a 直接参与 flex） */
    .dibu {
        height: auto;
        min-height: 36px;
        bottom: max(4px, env(safe-area-inset-bottom, 0)) !important;
        overflow: visible;
        pointer-events: none;
        padding: 0 2px;
        box-sizing: border-box;
    }
    .dibu .banx {
        pointer-events: auto;
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        transform: none;
        box-sizing: border-box;
        gap: 0;
    }
    .banx p {
        float: none !important;
        display: flex;
        height: auto !important;
        margin: 0 !important;
        width: auto !important;
        min-width: 0;
    }
    .banx p:nth-child(1),
    .banx p:nth-child(3) {
        flex: 2 1 0;
        align-items: flex-end;
    }
    .banx p:nth-child(2) {
        flex: 1.15 0 0;
        align-items: flex-end;
        justify-content: center;
    }
    .banx p:nth-child(1) a,
    .banx p:nth-child(3) a {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        height: 26px !important;
        margin: 0 !important;
        padding: 0;
        font-size: clamp(7px, 2.35vw, 11px) !important;
        line-height: 26px !important;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .banx p:nth-child(1) a.ny,
    .banx p:nth-child(3) a.tow {
        margin-left: -1vw !important;
    }
    .banx p:nth-child(2) a {
        flex: 1 1 auto;
        width: 100% !important;
        height: 34px !important;
        margin: 0 !important;
    }
    .banx p:nth-child(2) a img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    /* 全景区略收窄，避免与侧栏重叠过多 */
    #sand {
        width: 52% !important;
    }
}

/* ---------- 小屏手机 ---------- */
@media screen and (max-width: 480px) {
    .header {
        height: 60px;
    }
    .header-center {
        top: 2px;
        max-width: calc(100vw - 118px);
        gap: 4px;
    }
    .header img.loge {
        height: 34px;
    }
    .header p.sj {
        left: 2px;
        top: 4px;
        font-size: 8px;
        line-height: 1.2;
        max-width: 28vw;
    }
    .header p.zhqh {
        font-size: 10px;
        margin-right: 4px;
        margin-top: 3px;
    }
    .header p.zhqh a:first-child {
        display: none;
    }

    .header .tt p:first-of-type {
        font-size: 7px !important;
    }
    .header .tt p:nth-of-type(2) {
        font-size: 9px !important;
    }

    .left,
    .right {
        width: 108px;
        top: 40%;
    }
    .lb {
        width: 108px;
        height: auto;
        margin-bottom: 4px;
    }
    .lb p {
        height: 20px;
        line-height: 20px;
        font-size: 8px;
    }
    .lb p img {
        margin: 0 3px;
        max-height: 8px;
    }
    .lb ul {
        height: auto;
        overflow-y: visible;
    }
    .lb ul li {
        height: auto !important;
    }
    .lb ul li a {
        height: 16px;
        line-height: 16px;
        font-size: 7px;
    }
    .lb ul li a img {
        width: 10px;
        height: 9px;
        margin-left: 4px;
        margin-right: 2px;
    }

    .banx p:nth-child(1) a,
    .banx p:nth-child(3) a {
        height: 22px !important;
        line-height: 22px !important;
        font-size: clamp(6px, 2.1vw, 9px) !important;
    }
    .banx p:nth-child(2) a {
        height: 30px !important;
        flex: 1.1 0 0;
    }

    #sand {
        width: 48% !important;
    }
}

/* ---------- 手机横屏（宽短视口） ---------- */
@media screen and (orientation: landscape) and (max-height: 520px) {
    .header {
        height: 50px;
    }
    .header-center {
        top: 3px;
        max-width: calc(100vw - 200px);
        gap: 6px;
    }
    .header img.loge {
        height: 36px;
    }
    .header p.sj {
        top: 6px;
        left: 6px;
        font-size: 9px;
        max-width: 20vw;
    }
    .header p.zhqh {
        right: 8px;
        top: 6px;
        font-size: 11px;
    }
    .header .tt p:first-of-type {
        font-size: 9px !important;
    }
    .header .tt p:nth-of-type(2) {
        font-size: 11px !important;
    }

    .left,
    .right {
        width: 142px;
        top: 11%;
    }
    .lb {
        width: 142px;
        margin-bottom: 3px;
    }
    .lb p {
        height: 22px;
        line-height: 22px;
        font-size: 9px;
    }
    .lb ul li a {
        height: 17px;
        line-height: 17px;
        font-size: 8px;
    }
    .lb ul li a img {
        width: 11px;
        height: 10px;
        margin-left: 5px;
    }

    .banx p:nth-child(1) a,
    .banx p:nth-child(3) a {
        height: 28px !important;
        line-height: 28px !important;
        font-size: clamp(8px, 1.6vw, 12px) !important;
    }
    .banx p:nth-child(2) a {
        height: 36px !important;
    }

    #sand {
        width: 56% !important;
    }
}

/* ---------- 平板横屏 ---------- */
@media screen and (orientation: landscape) and (min-width: 769px) and (max-width: 1366px) {
    .header {
        height: 62px;
    }
    .header-center {
        top: 6px;
        max-width: calc(100vw - 300px);
        gap: 8px;
    }
    .header img.loge {
        height: 46px;
    }
    .header p.sj {
        top: 10px;
        left: 10px;
        font-size: 11px;
        max-width: 22vw;
        white-space: nowrap;
    }
    .header p.zhqh {
        right: 12px;
        top: 10px;
        font-size: 13px;
    }
    .header .tt p:first-of-type {
        font-size: 10px !important;
    }
    .header .tt p:nth-of-type(2) {
        font-size: 13px !important;
    }

    .left,
    .right {
        width: 168px;
        top: 30%;
    }
    .lb {
        width: 168px;
        margin-bottom: 8px;
    }
    .lb p {
        height: 28px;
        line-height: 28px;
        font-size: 11px;
    }
    .lb p img {
        margin: 0 6px;
        max-height: 12px;
    }
    .lb ul li a {
        height: 21px;
        line-height: 21px;
        font-size: 10px;
    }
    .lb ul li a img {
        width: 14px;
        height: 13px;
        margin-left: 8px;
        margin-right: 4px;
    }

    .banx p:nth-child(1) a,
    .banx p:nth-child(3) a {
        height: 32px !important;
        line-height: 32px !important;
        font-size: clamp(10px, 1.2vw, 15px) !important;
    }
    .banx p:nth-child(2) a {
        height: 42px !important;
    }

    #sand {
        width: 54% !important;
    }
}

/* 弹层窄屏 / 横屏 */
@media screen and (max-width: 768px),
       screen and (orientation: landscape) and (max-height: 520px),
       screen and (orientation: landscape) and (min-width: 769px) and (max-width: 1366px) {
    #tourLoginOverlay .tour-login-panel-wrap,
    #tourVipActivateOverlay .tour-login-panel-wrap,
    #tourConsultantDocsOverlay .tour-consultant-panel-wrap {
        max-width: calc(100vw - 24px);
    }
    #tourConsultantDocsOverlay .tour-doc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    #tourConsultantDocsOverlay .tour-doc-name {
        font-size: 12px;
        word-break: break-all;
    }
}
