/*公共h5的样式，必须前面带body.h5-page*/
@media screen {
    body.h5-page {
        --h5-form-control-height: 38px;
        --h5-button-height: 34px;
        --h5-td1-background: #1677c8;
        --h5-special-button-background: #FF8A00;
        --h5-danger-button-background: #FF0000;
    }

    /*
     * H5 区块标题（td1）背景统一入口。
     * 两个 :not() 仅用于提高公共规则优先级，确保它能覆盖各页面及主题 CSS 中已有的 !important 背景；
     * 后续需要调整所有 H5 标题颜色时，只修改 --h5-td1-background 即可。
     */
    body.h5-page:not(#h5-keep-web-td1-theme):not(#h5-keep-page-td1-theme) .td1 {
        background: var(--h5-td1-background) !important;
        background-color: var(--h5-td1-background) !important;
        color:#ffffff!important;
    }

    /* 这两处 td1 是普通表单单元格，不属于区块标题，保留各自原有背景。 */
    body.h5-page:not(#h5-keep-web-td1-theme):not(#h5-keep-page-td1-theme) .h5-quotation-form td.td1 {
        background: #eef7ff !important;
        background-color: #eef7ff !important;
    }

    body.h5-page:not(#h5-keep-web-td1-theme):not(#h5-keep-page-td1-theme) table.flight-index-search .td1 {
        background: transparent !important;
        background-color: transparent !important;
    }

    /* H5 普通操作按钮统一使用全局按钮高度；图标、悬浮和抽屉控制按钮保留独立尺寸。 */
    body.h5-page input[type="button"],
    body.h5-page input[type="submit"],
    body.h5-page input[type="reset"],
    body.h5-page button:not(.el-dialog__headerbtn):not(.el-message-box__headerbtn):not(.ui-dialog-close):not(.d-close):not(.layui-layer-close):not(.h5-float-menu-toggle):not(.h5-main-toggle-drawer-handle):not(.h5-main-menu-float-button):not(.h5-main-menu-primary-item):not(.h5-main-menu-secondary-item),
    body.h5-page .button_a1,
    body.h5-page .button_b1,
    body.h5-page .button_100,
    body.h5-page .button_120,
    body.h5-page .SK_button_a1,
    body.h5-page .SK_button_b1,
    body.h5-page .danger_btn,
    body.h5-page .book_btn,
    body.h5-page .book_btn1,
    body.h5-page .book_btn2,
    body.h5-page .ui-dialog-footer .ui-dialog-button button.ui-dialog-autofocus,
    body.h5-page .el-button:not(.el-dialog__headerbtn):not(.el-message-box__headerbtn) {
        height: var(--h5-button-height) !important;
        min-height: var(--h5-button-height) !important;
        line-height: var(--h5-button-height) !important;
        padding: 0 10px;
    }

    body.h5-page .h5-small-fs {
        font-size: 12px;
    }

    body.h5-page .h5-normal-fs {
        font-size: 14px;
    }

    body.h5-page .h5-normal-fw {
        font-weight: 400;
    }

    body.h5-page .h5-flex {
        display: flex !important;
        align-items: center;
    }

    body.h5-page .h5-grid {
        display: grid !important;
    }

    body.h5-page .button_a1, body.h5-page .button_b1, body.h5-page .SK_button_b1, body.h5-page .button_100, body.h5-page .ui-dialog-footer .ui-dialog-button button {
        letter-spacing: 0px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.h5-page .td1::before {
        display: none;
    }

    body.h5-page .font-weight-normal {
        font-weight: 400 !important;
    }

    /*移动端强制不设高度*/
    body.h5-page .h5-height-auto {
        height: auto !important;
    }

    body.h5-page .h5-min-width-none {
        min-width: 0 !important;
    }

    body.h5-page .h5-white {
        color: #ffffff !important;
    }

    body.h5-page .h5-line-height {
        line-height: 1 !important;
    }

    /*移动端强制不设宽度*/
    body.h5-page .h5-full-width {
        width: 100% !important;
    }

    body.h5-page .button_a1 {
        letter-spacing: 0 !important;
    }

    body.h5-page .h5-width-fit-content {
        width: fit-content !important;
    }

    /*移动端强制靠右*/
    body.h5-page .h5-align-right {
        text-align: right !important;
    }

    /*移动端强制居中*/
    body.h5-page .h5-align-center {
        text-align: center !important;
    }

    body.h5-page table.list tr td {
        padding: 0 5px;
    }

    /*移动端强制靠左*/
    body.h5-page .h5-align-left {
        text-align: left !important;
    }

    body.h5-page .h5-bg-none {
        background-color: transparent !important;
    }

    /*移动端强制不换行*/
    body.h5-page .h5-nowrap {
        white-space: nowrap !important;
    }

    /*移动端强制变成块元素*/
    body.h5-page .h5-block {
        display: block !important;
    }

    /*移动端强制隐藏*/
    body.h5-page .h5-hidden {
        display: none !important;
    }

    body.h5-page table#navTab .h5-hidden {
        display: none !important;
    }

    /*移动端强制隐藏padding*/
    body.h5-page .h5-hidden-padding-left {
        padding-left: 0 !important;
    }

    /*移动端强制隐藏padding*/
    body.h5-page .h5-hidden-padding-right {
        padding-right: 0 !important;
    }

    /*移动端强制隐藏padding*/
    body.h5-page .h5-hidden-padding-top {
        padding-top: 0 !important;
    }

    /*移动端强制隐藏padding*/
    body.h5-page .h5-hidden-padding-bottom {
        padding-bottom: 0 !important;
    }

    /*移动端强制隐藏margin*/
    body.h5-page .h5-hidden-margin-left {
        margin-left: 0 !important;
    }

    body.h5-page div.h5-normal-fs, body.h5-page td.h5-normal-fs, body.h5-page span.h5-normal-fs, body.h5-page button.h5-normal-fs {
        font-size: 14px !important;
    }

    body.h5-page div.h5-normal-fw, body.h5-page td.h5-normal-fw, body.h5-page span.h5-normal-fw, body.h5-page button.h5-normal-fw {
        font-weight: 400 !important;
    }

    /*移动端强制隐藏margin*/
    body.h5-page .h5-hidden-margin-right {
        margin-right: 0 !important;
    }

    /*移动端强制隐藏margin*/
    body.h5-page .h5-hidden-margin-top {
        margin-top: 0 !important;
    }

    body.h5-page .h5-big-font-size {
        font-size: 24px !important;
    }

    /*移动端强制隐藏margin*/
    body.h5-page .h5-hidden-margin-bottom {
        margin-bottom: 0 !important;
    }

    html.h5-page-root {
        background: #f4f6f8;
        -webkit-text-size-adjust: 100%;
    }

    body.h5-page,
    body.h5-page * {
        box-sizing: border-box;
    }

    body.h5-page * {
        font-size: 14px;
    }

    body.h5-page .tip-yellow {
        max-height: none !important;
    }

    body.h5-page {
        min-width: 0 !important;
        width: 100% !important;
        margin: 0;
        padding: 12px;
        background: #f4f6f8;
        color: #1f2937;
        font-size: 14px;
        line-height: 1.5;
        overflow-x: hidden;
    }

    body.h5-page .ui-dialog .ui-dialog-grid .ui-dialog-header {
        border-bottom: none !important;
    }

    body.h5-page .el-dialog__wrapper .el-dialog .el-dialog__header .el-dialog__headerbtn,
    body.h5-page .el-message-box__headerbtn,
    body.h5-page .ui-dialog-header .ui-dialog-close,
    body.h5-page .d-titleBar .d-close {
        top: 6px !important;
        right: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #b9d8f0 !important;
        border-radius: 50% !important;
        outline: none !important;
        background: #ffffff !important;
        background-image: none !important;
        color: #1677c8 !important;
        font-size: 0 !important;
        line-height: 36px !important;
        text-align: center !important;
        text-decoration: none !important;
        text-indent: 0 !important;
        opacity: 1 !important;
        box-shadow: 0 2px 8px rgba(15, 110, 199, 0.2) !important;
        cursor: pointer !important;
        z-index: 5 !important;
        box-sizing: border-box !important;
    }

    body.h5-page .el-dialog__headerbtn::before,
    body.h5-page .el-message-box__headerbtn::before,
    body.h5-page .ui-dialog-header .ui-dialog-close::before,
    body.h5-page .d-titleBar .d-close::before {
        content: "×" !important;
        display: block !important;
        color: #1677c8 !important;
        font-family: Arial, sans-serif !important;
        font-size: 26px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
    }

    body.h5-page .el-dialog__headerbtn > i,
    body.h5-page .el-message-box__headerbtn > i {
        display: none !important;
    }

    body.h5-page .layui-layer-setwin {
        top: 6px !important;
        right: 8px !important;
        height: 36px !important;
    }

    body.h5-page .layui-layer-setwin a.layui-layer-close {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        margin: 0 0 0 8px !important;
        border: 1px solid #b9d8f0 !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        background-image: none !important;
        color: #1677c8 !important;
        font-size: 0 !important;
        line-height: 36px !important;
        opacity: 1 !important;
        box-shadow: 0 2px 8px rgba(15, 110, 199, 0.2) !important;
        box-sizing: border-box !important;
    }

    body.h5-page .layui-layer-setwin a.layui-layer-close::before {
        content: "×" !important;
        display: block !important;
        color: #1677c8 !important;
        font-family: Arial, sans-serif !important;
        font-size: 26px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
    }

    body.h5-page .el-dialog__headerbtn:active,
    body.h5-page .el-message-box__headerbtn:active,
    body.h5-page .ui-dialog-header .ui-dialog-close:active,
    body.h5-page .d-titleBar .d-close:active,
    body.h5-page .layui-layer-setwin a.layui-layer-close:active {
        background: #e8f4fd !important;
        transform: scale(0.94);
    }

    body.h5-page #mask {
        left: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        right: auto !important;
        box-sizing: border-box !important;
    }

    body.h5-page .ac_results,
    body.h5-page .city-picker,
    body.h5-page .cityPicker,
    body.h5-page .city-picker-box,
    body.h5-page .address_hot,
    body.h5-page #tuna_address,
    body.h5-page #tuna_address #address_warp {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        min-width: 0 !important;
    }

    body.h5-page .address_hot {
        left: 12px !important;
        overflow: hidden;
    }

    body.h5-page .address_hot ul,
    body.h5-page .address_hot li {
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    body.h5-page .address_hotlist,
    body.h5-page .address_hot_abb,
    body.h5-page .address_hot_adress {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.h5-page .address_hot_abb {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding-bottom: 8px !important;
    }

    body.h5-page .address_hot_abb li {
        width: auto !important;
        height: 28px !important;
        line-height: 28px !important;
    }

    body.h5-page .address_hot_abb li span,
    body.h5-page .address_hot_abb li .hot_selected {
        display: block;
        padding: 0 8px !important;
    }

    body.h5-page .address_hot_adress {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding-top: 8px !important;
    }

    body.h5-page #jsContainer .address_hot .address_hotlist .address_hot_adress.layoutfix {
        box-sizing: border-box !important;
        padding: 6px !important;
        gap: 4px !important;
    }

    body.h5-page .address_hot_adress li {
        float: none !important;
        width: auto !important;
        height: 30px !important;
    }

    body.h5-page .address_hot_adress li a {
        height: 30px !important;
        line-height: 30px !important;
        padding-left: 6px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.h5-page .WdateDiv,
    body.h5-page .WdateDiv2,
    body.h5-page .layui-layer,
    body.h5-page .ui-dialog,
    body.h5-page .aui_outer,
    body.h5-page .aui_state_focus {
        max-width: calc(100vw - 24px) !important;
    }

    body.h5-page .WdateDiv,
    body.h5-page .WdateDiv2 {
        width: auto !important;
        min-width: 0 !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.h5-page .WdateDiv .WdayTable,
    body.h5-page .WdateDiv .WdayTable2 {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.h5-page .WdateDiv .WdayTable2 > tbody > tr > td {
        display: block;
        width: 100% !important;
    }

    body.h5-page .WdateDiv .WdayTable2 > tbody > tr > td + td {
        margin-top: 8px;
    }

    body.h5-page iframe[hidefocus],
    body.h5-page iframe[src*="My97DatePicker"] {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: auto !important;
    }

    body.h5-page input.button_100,
    body.h5-page input[type="button"].button_100 {
        width: 100% !important;
        height: var(--h5-button-height) !important;
        margin: 0;
        border: 0;
        border-radius: 8px;
        background: #0f6ec7;
        color: #ffffff;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        box-shadow: 0 8px 16px rgba(15, 110, 199, 0.22);
    }

    body.h5-page .move-right-3 {
        transform: translateX(3px) !important;
    }

    body.h5-page .move-right-5 {
        transform: translateX(5px) !important;
    }

    body.h5-page .td1,body.h5-page td2 {
        font-weight: 400!important;
    }
}

/*
 * H5 日期输入框统一不显示日历图标。
 * 以 h5-page 作为端类型判断，不依赖屏幕宽度，切换回 Web 后规则自动失效。
 */
body.h5-page input.Wdate,
body.h5-page input.WdateCus,
body.h5-page input.myWdate,
body.h5-page input.date,
body.h5-page input[type="date"],
body.h5-page input[type="datetime-local"],
body.h5-page input[type="month"],
body.h5-page input[type="week"] {
    padding-right: 10px !important;
    background-image: none !important;
}

body.h5-page input[type="date"]::-webkit-calendar-picker-indicator,
body.h5-page input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.h5-page input[type="month"]::-webkit-calendar-picker-indicator,
body.h5-page input[type="week"]::-webkit-calendar-picker-indicator {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
}

body.h5-page .el-date-editor .el-icon-date,
body.h5-page .el-date-editor .el-range__icon {
    display: none !important;
}

body.h5-page .el-date-editor--date .el-input__inner,
body.h5-page .el-date-editor--datetime .el-input__inner,
body.h5-page .el-date-editor--dates .el-input__inner,
body.h5-page .el-date-editor--week .el-input__inner,
body.h5-page .el-date-editor--month .el-input__inner,
body.h5-page .el-date-editor--year .el-input__inner {
    padding-left: 10px !important;
}

/*
 * H5 特殊按钮颜色保护：各业务页可以调整尺寸和布局，但不能被统一主按钮色覆盖。
 * 重复 H5/语义 class 是为了让本公共规则稳定高于后加载的页面级按钮规则。
 */
body.h5-page.h5-page.h5-page.h5-page.h5-page.h5-page .SK_button_b1.SK_button_b1,
body.h5-page.h5-page.h5-page.h5-page.h5-page.h5-page .button_100.button_100 {
    background: var(--h5-special-button-background, #FF8A00) !important;
    background-color: var(--h5-special-button-background, #FF8A00) !important;
    color: #ffffff !important;
}

body.h5-page.h5-page.h5-page.h5-page.h5-page.h5-page .danger_btn.danger_btn {
    background: var(--h5-danger-button-background, #FF0000) !important;
    background-color: var(--h5-danger-button-background, #FF0000) !important;
    color: #ffffff !important;
}

/* 国内、国际航班列表的筛选和排序仅在 H5 端默认收起。 */
@media screen {
    body.h5-page .h5-flight-filter-toggle {
        display: inline-flex !important;
        flex: 0 0 auto;
        min-width: 86px;
        height: var(--h5-button-height) !important;
        min-height: var(--h5-button-height) !important;
        align-items: center;
        justify-content: center;
        margin: 0 0 0 8px;
        padding: 0 10px !important;
        border: 1px solid rgba(255, 255, 255, .65);
        border-radius: 7px;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 400;
        line-height: calc(var(--h5-button-height) - 2px) !important;
        white-space: nowrap;
    }

    body.h5-page .h5-flight-filter-panel.h5-flight-filter-collapsed > tbody > tr:not(:first-child),
    body.h5-page .h5-flight-sort-panel.h5-flight-sort-collapsed {
        display: none !important;
    }
}
