/* global template styles */

html {
    user-select: none;
    font-size: calc(100% * var(--font-scale));
    font-size: calc(100vw / 27.5735);
    /* 375/13.6≈27.5735 */

    &.no-transition *:not(.swiper:not(.selection-list) *) {
        transition: none !important;
    }

    &.no-scroll {
        overflow: hidden;
    }

    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 电脑端限制最大字体 */
@media screen and (min-width: 510px) {
    html {
        font-size: calc(100% * var(--font-scale));
        font-size: calc(510px / 27.5735);
        /* 375/13.6≈27.5735 */
        font-size: calc(510px / 375 * 16 * 0.85);
        /* 375/13.6≈27.5735 */

        max-width: 510px;
        margin: 0 auto;
        background-color: #000;

        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        left: 50%;
        transform: translateX(-50%);
    }

    html.landscape-page {
        max-width: 100vh !important;
        left: 0 !important;
        transform: none !important;
    }
}

body {
    background: var(--body);
    color: var(--text);
    font-family: var(--body-font);
    font-size: 0.875rem;
    line-height: 24px;

    // max-width: 510px !important;
    // margin: 0 auto;
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.force-landscape {
    width: calc(100vh - var(--landscape-ios));
    height: 100vw;
    min-height: 100vw;
    transform: rotate(90deg) translateY(-100%) !important;
    transform-origin: top left;
    overflow: hidden;
}

.appHeader {
    max-width: 510px;
    margin: 0 auto;
    position: relative;
    top: 0;
    z-index: 10;
    background-color: black;
    text-align: center;
}

.appMain {
    overflow: hidden;
    max-width: 510px;
    margin: 0 auto;
}

.app {
    max-width: 510px;
    margin: 0 auto;

    // min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), opacity var(--transition);

    &_openSub {
        transform: translateX(-50%) translateZ(0);
        opacity: 0;
        height: 0 !important;
        // display: none;
        // position: absolute;
    }

    &_gestureSub {
        transition: none !important;
    }

    &_container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex: 1;
        // margin: 0px 0px 70px;
        max-height: 100%;
        overflow: hidden;

        &-content {
            //padding: 0px 15px;//防止多处需要修改

            padding: 0px;
            min-height: calc(100vh - 5rem - 2px);
            background-color: var(--widget-bg);
            max-height: 100%;
        }

        &-footer {
            margin-top: 3rem;
            background-color: var(--body);
        }
    }

    &_container_full {
        display: flex;
        min-height: 100vh;
        background-color: var(--widget-bg);
    }

    &.fluid {

        //display: block;
        //display: flex;
        .app_container {
            margin: 0;
        }
    }

    .layout {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    @media screen and (min-width: 510px) {
        .app_container {
            margin-bottom: 40px;
        }

        .layout {
            //margin: 0px 0px;
        }
    }

    // @media screen and (min-width: 1920px) {
    //     display: grid;
    //     grid-template-columns: minmax(0, 250px) minmax(0, (calc(100% - 250px)));

    //     .app_container {
    //         margin: 30px 40px 40px;
    //         grid-area: 1 / 2 / 2 / 3;
    //     }
    // }

    max-height: 100%;
    height: 100%;
    position: relative;
}

.app-top {
    max-width: 510px;
    margin: 0 auto;

    position: fixed;
    //position: absolute;
    inset: 0px;
    // z-index: var(--zindex-in);
    transition: transform var(--transition), opacity var(--transition);
    pointer-events: none;
    z-index: var(--zIndex-top);
}

.app-hash {
    max-width: 510px;
    margin: 0 auto;

    position: fixed;
    // z-index: var(--zindex-second);
    inset: 0px;
    pointer-events: none;

    max-height: 100%;
    height: 100%;
    overflow: hidden;
    //position: relative;
    z-index: var(--zIndex-top);
}

.pop {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    &_content {
        min-width: 100vh;
        min-height: 20vh;
    }
}

.lazy-image {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;

    img {
        height: 100%;
    }
}

input,
input::placeholder {
    color: var(--text);
}

.sidebar-open {
    //margin-left: 250px;
    margin-left: var(--side-open);
    transition: margin 0.3s ease;
}

.sidebar-close {
    //margin-left: 65px;
    margin-left: var(--side-close);
    transition: margin 0.3s ease;
}

.sidebar-noani {
    transition: none !important;
}

.sidebar-nav {
    //padding: 20px 10px 80px;
    padding: 20px 0px 80px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

.sidebar-nav-block {
    position: relative;
    padding: 0px 1rem;
}

.ls-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    fill: var(--text);

    &:hover,
    &:focus,
    &.active {
        fill: var(--header);
    }
}

.m-button {
    &.MuiButton-root {
        gap: 12px;
        text-transform: none !important;
        border: none !important;
        border-radius: var(--border-radius) !important;
        height: 3rem;
        width: 3rem;
        min-width: 3rem;
        //padding: 12px !important;
        color: var(--text);
        font-size: 0.875rem;
        line-height: 1.75;

        &:hover,
        &.active {
            background-color: var(--nav-item-hover) !important;
            color: var(--header);

            & .ls-icon {
                fill: var(--header);
            }
        }
    }
}

.chat-green-dont {
    position: absolute;
    right: 6px;
    top: 6px;
    z-index: 1;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.fold-line {
    width: 100%;
    border-top: 1px solid var(--divider);
    margin: 12px 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.overflow-visible {
    overflow: visible !important;
}

.page-max-width-wrap {
    width: 100%;
    margin: 0 auto;
    padding: 0 25px;
    max-width: 1430px;
}

.grid-list {
    --grid-gap: 0.75rem;
    row-gap: 1.25rem;
}

.progressier_bar_open {
    margin-top: 65px;
}

.loading-in {
    width: 100%;
    height: 75vh;
}

.loading-full {
    width: 100vw;
    height: 100vh;
}

.loading-circular {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0px;
    z-index: var(--zindex-effect);
    background-color: rgba(0, 0, 0, 0);
    transition: all var(--transition);

    &_mask {
        background-color: rgba(0, 0, 0, 0.3);
    }
}

body.progressier-blurring>*:not(.no-blurring) {
    -webkit-filter: none !important;
    filter: none !important;
    pointer-events: none;
    z-index: 888 !important;
}

.page-top {
    margin-top: 1rem;
}

.Toastify {
    width: 100%;
}

.page-scroll-y {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    // min-height: calc(100dvh - 5.5rem);
}