:root {
    /* 主题变量 */
    --bg-color: #3d4d8768;
    --main-c: #406eb3;
    --accent: #7195d8;
    --text: #ffffff;
    --muted: #d4d4d4;

    /* 顶部栏高度变量 */
    --top-height: 32px;
}

html,
body {
    height: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text);
    font-family: "微软雅黑", Arial, "Microsoft Yahei", sans-serif;
    display: flex;
    flex-direction: column;
}

.infotext{
    font-size: 13px;
    color: #c1c4c8;
     text-align: right;
}
/* 顶部菜单 -------------------------------------------------- */
.top-menu {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 1px 12px;
    align-items: center;
    background-color: var(--main-c);
    box-shadow: 0 0 7px rgba(0, 0, 0, 0);
    z-index: 1000;
    height: var(--top-height);
}

.menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 1px;
    border: none;
    list-style: none;
    max-width: none;
    padding: 0;
}

.menu-button-f {
    background: transparent;
    border-radius: 4px;
    border: none;
    color: var(--text);
    justify-content: flex-start;
    align-items: center;
    padding: 5px 14px;
    margin: 1px;
}

.menu-button-f:hover {
    background: var(--bg-color);
}

.menu-button-f:focus {
    outline: 1px solid rgba(0, 0, 0, 0.082);
}

/* 下拉菜单 -------------------------------------------------- */
.menu-botton-down-c {
    display: flex;
    position: absolute;
    left: 60%;
    top: calc(100% + 0px);
    transform: translateX(-50%) translateY(-30px);
    min-width: 180px;
    flex-direction: column;
    gap: 2px;
    padding: 4px 4px;
    box-sizing: border-box;
    background-color: #3a425e;
    color: var(--text);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
    z-index: 10;
}

.menu-button.open .menu-botton-down-c,
.menu-button:hover .menu-botton-down-c,
.menu-button:focus-within .menu-botton-down-c {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.menu-botton-down-c .menu-button-c {
    background: transparent;
    color: var(--text);
    border: none;
    padding: 4px 8px;
    width: 100%;
    text-align: left;
    border-radius: 4px;
    cursor: pointer;
}

.menu-botton-down-c .menu-button-c:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 主布局 -------------------------------------------------- */
.content {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: 1fr auto;
    grid-template-areas: "main right" "menu right";
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.mainwindow {
    grid-area: main;
    background-color: #414861;
    box-sizing: border-box;
    padding: 12px;
    min-width: 0;
    overflow: auto;
}

.rightmenu {
    grid-area: right;
    min-width: 300px;
    background-color: #4c567a;
    overflow: auto;
}

.menu {
    grid-area: menu;
    box-sizing: border-box;
    padding: 1px;
    overflow: auto;
}

.down {
    float: none;
}

/* 内容区填充 -------------------------------------------------- */
.mainwindow iframe,
.mainwindow > * {
    width: 100%;
    height: 100%;
}

.rightmenu iframe,
.rightmenu > *,
.menu iframe,
.menu > * {
    width: 100%;
    height: 100%;
    display: block;
}

/* 响应式 -------------------------------------------------- */
@media (max-width: 700px) {
    :root {
        --top-height: 64px;
    }

    .top-menu {
        padding: 10px 14px;
    }

    .content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: "main" "menu" "right";
        gap: 12px;
    }

    .rightmenu {
        min-width: 0;
        width: 100%;
    }

    .mainwindow {
        height: auto;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .rightmenu {
        display: none;
        /* 若需更好的移动体验，可改为抽屉式侧栏 */
    }
}

/* 模态弹窗 -------------------------------------------------- */
.modal-backdrop.hidden {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: #4d577c;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.modal-content {
    position: relative;
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 900px;
    background: #4d5880;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.432), 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.modal-close {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 20100;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
}

@media (max-width: 880px) {
    .modal-content {
        width: 94vw;
        height: 86vh;
        max-width: none;
        max-height: none;
        border-radius: 6px;
    }
}

/* 最后修正 */
.mainwindow {
    padding: 0px;
}