// 全局注入样式

:root {
    color-scheme: light;
    &.ehs-ex {
        color-scheme: dark;
    }
}

button[ehs-input] {
    :is(:root.ehs-eh, :root.ehs-ex) & {
        min-height: 26px;
        line-height: 20px;
        padding: 1px 5px 2px;
        margin: 0 2px;
        border: 2px solid #b5a4a4;
        border-radius: 3px;
        font-size: 9pt;
        color: #5c0d12;
        background-color: #edeada;
        outline: none;
        white-space: pre;

        &:disabled {
            color: #c2a8a4;
            -webkit-text-fill-color: #c2a8a4;
            opacity: 1;
        }

        &:enabled:hover,
        &:enabled:focus {
            background-color: #f3f0e0 !important;
            border-color: #977273 !important;
        }

        &:enabled:active {
            background: radial-gradient(#d7d3c2, #f3f0e0) !important;
            border-color: #5c0d12 !important;
        }
    }

    :root.ehs-ex & {
        border-color: #8d8d8d;
        color: #f1f1f1;
        background-color: #34353b;

        &:enabled:hover,
        &:enabled:focus {
            background-color: #43464e !important;
            border-color: #aeaeae !important;
        }

        &:enabled:active {
            background: radial-gradient(#1a1a1a, #43464e) !important;
            border-color: #c3c3c3 !important;
        }

        &:disabled {
            color: #8a8a8a;
            -webkit-text-fill-color: #8a8a8a;
        }
    }
}

[hidden] {
    display: none;
}

:root.ehs-hide-icon {
    [ehs-icon],
    [ehs-emoji] {
        display: none;
    }
}

body {
    div#gright {
        z-index: 3;
    }

    // 提交删除申请按钮
    #expunge_new button[ehs-input][type='submit'] {
        margin: 6px auto 2px;
    }

    // 题图
    #gleft {
        pointer-events: none;
    }

    // 日文标题
    #gj {
        margin: 3px 4px;
    }

    // 信息框
    #gmid {
        height: auto;
    }

    // 标签输入
    #tagmenu_act,
    #tagmenu_new {
        width: calc(100% - 30px) !important; // 留下右侧 loading 空间
    }

    #tagmenu_new > form {
        display: flex;
        #newtagfield {
            flex: auto;
        }
    }

    // 信息框右侧菜单
    #gd5 {
        display: flex;
        flex-flow: column;

        // 当其他脚本在这里插入过多链接时。修改布局
        &:has(> :nth-child(10)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 18px;
            }
            .gsp {
                padding-top: 0;
            }
        }
        &:has(> :nth-child(11)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 16px;
            }
        }
        &:has(> :nth-child(12)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 12px;
            }
        }
        &:has(> :nth-child(13)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 8px;
            }
        }
        &:has(> :nth-child(14)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 6px;
            }
        }
        &:has(> :nth-child(15)) {
            :is(.g2, .g3):not(:has(+ .gsp)) {
                padding-bottom: 4px;
            }
        }
    }
    .g2,
    .g3 {
        padding-bottom: 20px;
    }
    .gsp {
        padding-top: 10px;
    }

    // 标签组名
    td.tc {
        white-space: nowrap;
    }

    // 标签
    div.gtl,
    div.gtw,
    div.gt {
        line-height: 16px;
        white-space: nowrap;
    }

    // 评论内容
    div.c6 {
        text-align: left;
    }
}

[ehs-icon],
[ehs-emoji] {
    max-height: 1.25em !important;
    max-width: 2em !important;
    margin: -0.25em 1px !important;
}

[ehs-icon] {
    vertical-align: middle;
}

.ehs-new-tag-complete-translate {
    display: block;
    &:empty {
        display: none;
    }

    margin-top: 4px;
    font-weight: bolder;
    opacity: 0.8;
    pointer-events: none;
}

// wiki 样式

:root.ehs-wiki {
    &.ehs-translate-tag [ehs-tag][lang|='zh-hans'] {
        &::after {
            content: ' (' attr(ehs-tag) ')';
            font-size: 80%;
        }
    }
}
