/* FEIYU GLOBAL REPAIR V1 */

html.fygrv1-managed body {
    visibility: hidden !important;
}

html.fygrv1-ready body {
    visibility: visible !important;
}

/* 当前控制台启用时，旧 Six 外壳从首次绘制起就不显示。 */
html.fyv4-root body > #header,
html.fyv4-root body > header#header,
html.fyv4-root body > .navbar-main,
html.fyv4-root body > #main-menu,
html.fyv4-root body > section#main-menu,
html.fyv4-root body > #footer,
html.fyv4-root body > footer#footer,
html.fyv4-root body > section#footer {
    display: none !important;
}

/* 登录、注册、找回密码页面也禁止旧外壳闪现。 */
html.fyauth-root body > #header,
html.fyauth-root body > header#header,
html.fyauth-root body > .navbar-main,
html.fyauth-root body > #main-menu,
html.fyauth-root body > section#main-menu,
html.fyauth-root body > #footer,
html.fyauth-root body > footer#footer,
html.fyauth-root body > section#footer {
    display: none !important;
}

/* 只恢复主业务区的正常交互，不覆盖弹窗遮罩。 */
#main-body,
#main-body .main-content,
#main-body .primary-content,
#main-body form,
#main-body a,
#main-body button,
#main-body input,
#main-body select,
#main-body textarea {
    pointer-events: auto;
}

/* 工单操作栏：不依赖旧侧栏和额外点击脚本。 */
.fygrv1-ticket-toolbar {
    display: flex;
    width: 100%;
    margin: 0 0 18px;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid #d7e8f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(6, 75, 124, .08);
}

.fygrv1-ticket-toolbar-left,
.fygrv1-ticket-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fygrv1-ticket-toolbar .btn {
    display: inline-flex;
    min-height: 42px;
    padding: 9px 16px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    pointer-events: auto !important;
}

.fygrv1-ticket-toolbar .fygrv1-close-ticket {
    border-color: #e55252;
    background: #e55252;
    color: #fff !important;
}

.fygrv1-ticket-toolbar .fygrv1-close-ticket:hover,
.fygrv1-ticket-toolbar .fygrv1-close-ticket:focus {
    border-color: #ca3d3d;
    background: #ca3d3d;
    color: #fff !important;
}

/* 防止主题浮层误盖住工单按钮和表单。 */
body.fyv4-body #main-body .fygrv1-ticket-toolbar,
body.fyv4-body #main-body #frmReply,
body.fyv4-body #main-body .ticket-reply {
    position: relative;
    z-index: 4;
}

@media (max-width: 767px) {
    .fygrv1-ticket-toolbar {
        padding: 12px;
        align-items: stretch;
        flex-direction: column;
    }

    .fygrv1-ticket-toolbar-left,
    .fygrv1-ticket-toolbar-right,
    .fygrv1-ticket-toolbar .btn {
        width: 100%;
    }
}
