/* --------------- 主布局 --------------- */
body {
    padding: 0;
    margin: 0;
    background: transparent;
    display: flex;
    overflow: hidden;
}

#title-bar {
    position: fixed;
    left: env(titlebar-area-x, 0);
    top: env(titlebar-area-y, 0);
    height: env(titlebar-area-height, 0);
    width: env(titlebar-area-width, 100%);
    -webkit-app-region: drag;
    backdrop-filter: blur(20px) saturate(120%);
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
}

@media (prefers-color-scheme: dark) {
    #title-bar {
        background: rgba(0, 0, 0, 0.15);
    }
}

#main-frame {
    display: flex;
    flex-direction: row;
    transform: translateX(-0%) translateY(-0%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

#main-frame[index="0"] {
    transform: translateX(-0%) translateY(-0%);
    
}
#main-frame[index="1"] {
    transform: translateX(-100%) translateY(-0%);
}

@media (min-width: 600px) {
    #main-frame {
        flex-direction: column;
    }
    #main-frame[index="0"] {
        transform: translateX(-0%) translateY(-0%);
    }
    #main-frame[index="1"] {
        transform: translateX(-0%) translateY(-50%);
    }
}



iframe.contentFrame {
    flex-shrink: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    border: none;
}


/* --------------- 应用栏 --------------- */
.leftbar {
    user-select: none;
    display: none;
    background-color: rgba(255, 255, 255, 1);
    z-index: 50;
    inset: 0;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    width: 56px;
}

.bottombar {
    user-select: none;
    display: flex;
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    height: 56px;
    box-shadow: none;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    z-index: 50;
    position: absolute;
    bottom: 0;
    width: 100%;
    touch-action: none;
}

.leftbar-logo {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    font-display: block;
}

.bottombar-item {
    flex: 1;
    display: grid;
    text-align: center;
    padding: 10px;
    color: #000000;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;

    .text {
        font-weight: 600;
        font-size: 10px;
    }
}

.leftbar-item {
    flex: 1;
    display: grid;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    color: #000000;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    font-variation-settings: 'FILL' 0, 'wght' 400;

    .text {
        font-weight: 300;
        font-size: 12px;
    }

}

.bottombar-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
    font-size: 24px;
    font-display: block;
}

.leftbar-icon {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 2px;
    width: 28px;
    height: 28px;
    font-display: block;
}

.leftbar-item.nevigation-selected {
    color: var(--oc-blue-5);
}

.bottombar-item.nevigation-selected {
    color: var(--oc-blue-5);
}

@media (prefers-color-scheme: dark) {
    .bottombar {
        background-color: rgba(0, 0, 0, 0.25);
    }

    .leftbar {
        background-color: #242424;
    }

    .leftbar-item.nevigation-selected {
        color: var(--oc-blue-5);
        background-color: rgba(255, 255, 255, 0.05);
    }

    .bottombar-item.nevigation-selected {
        color: var(--oc-blue-5);
    }

    .leftbar-item {
        color: rgba(255, 255, 255, 0.8);
    }

    .bottombar-item {
        color: rgba(255, 255, 255, 0.8);
    }

}

@keyframes color-change {
    from {
        color: #000000;
        font-variation-settings: 'FILL' 0, 'wght' 350;
    }

    to {
        color: var(--oc-blue-6);
        font-variation-settings: 'FILL' 1, 'wght' 500;
    }
}

@keyframes color-change-dark {
    from {
        color: rgba(255, 255, 255, 0.8);
        font-variation-settings: 'FILL' 0;
    }

    to {
        color: var(--oc-blue-5);
        font-variation-settings: 'FILL' 1;
    }
}

.leftbar-item:active {
    animation: button-click 0.4s ease-in-out;
}

.bottombar-item:active {
    animation: button-click 0.4s ease-in-out;
}

.leftbar-item.nevigation-selected {
    animation: color-change 0.4s forwards;
}

.bottombar-item.nevigation-selected {
    animation: color-change 0.4s forwards;
}

@media (prefers-color-scheme: dark) {
    .leftbar-item.nevigation-selected {
        animation: color-change-dark 0.4s forwards;
    }

    .bottombar-item.nevigation-selected {
        animation: color-change-dark 0.4s forwards;
    }
}

@media (min-width: 600px) {
    .leftbar {
        display: flex;
    }

    .bottombar {
        display: none;
    }

    body {
        padding: 0;
    }
}

/* --------------- 对话弹窗 --------------- */
#DialogOverlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    touch-action: none;
    pointer-events: auto;
}

#dialogHandle {
    height: 3px;
    background-color: rgba(0, 0, 0, 0.15);
    margin: 4px 42.5% -4px 42.5%;
    border-radius: 2px;
}

#dialogHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 8px;
    height: 32px;
}

.dialog-header-button {
    user-select: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.1s ease;
}

.dialog-header-button:active {
    transform: scale(.95);
}

#dialogTitle {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 80px);
}

#infoDialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: none;
    align-items: end;
    justify-content: center;
}

#dialogContainer {
    /* 手机 */
    --dialog-animation-pop: translate(0, var(--dialog-height)) translateZ(0);
    --dialog-animation-slide: translate(0, 0%) translateZ(0);
    --dialog-height: 90vh;
    transform: var(--dialog-animation-pop);
    background-color: color-mix(in srgb, var(--superwb-color-bg) 92%, transparent);
    border-radius: 32px 32px 0 0;
    box-shadow: 0px 10px 30px 1px rgba(0, 0, 0, .24);
    width: 100vw;
    height: var(--dialog-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    backdrop-filter: blur(20px);
    border-top: solid 1px var(--superwb-color-cards);
    pointer-events: auto;
}


@media (min-width: 600px) {

    /* PC */
    #infoDialog {
        align-items: center;
    }

    #dialogContainer {
        --dialog-animation-pop: translate(0%, 90vh) translateZ(0);
        --dialog-animation-slide: translate(0%, 0%) translateZ(0);
        border-radius: 32px;
        corner-shape: superellipse(1.4);
        width: 80vw;
        max-width: 680px;
        height: 80vh;
    }

    #dialogHandle {
        display: none;
    }
}

#dialogContent::-webkit-scrollbar {
    display: none;
}

#dialogContent {
    margin: 0 16px;
    overflow-y: auto;
    border: none;
    height: 100%;
    border-radius: 24px 24px 0 0;
}


@media (prefers-color-scheme: dark) {
    #infoDialog {
        background: rgba(0, 0, 0, 0.2);
    }

    #dialogContainer {
        background: color-mix(in srgb, var(--superwb-color-bg) 72%, transparent);
    }


    #title-bar {
        background: rgba(0, 0, 0, 0);
    }

    #dialogHandle {
        background-color: rgba(255, 255, 255, 0.15);
    }
}





.toast {
    display: none;
    position: fixed;
    top: 87vh;
    width: 100%;
    left: 50%;
    z-index: 500;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.toast-message {
    background:
        color-mix(in srgb, var(--superwb-color-bg) 85%, transparent);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    margin: 0 25%;
    border-radius: 16px;
    corner-shape: superellipse(1.4);
    padding: 12px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

#toastContainer.show {
    display: block;
    opacity: 1;
}

#toastMessage.show {
    opacity: 1;
    transform: translateY(0);
}

#toastMessage.hide {
    opacity: 0;
    transform: translateY(8px);
}


@media (min-width: 600px) {
    .toast {
        top: 5vh;
    }

    .toast-message {
        margin: 0 5% 0 75%;
    }
}

@media (prefers-color-scheme: dark) {
    .toast-message {
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }
}