html, body {
    background: #eee;
    margin: 0;
}

body {
    &:not(.with-script) {
        lang-select, .with-script {
            display: none;
        }
    }
    &.with-script {
        .no-script {
            display: none;
        }
    }
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #555;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 50px;
    width: 100vw;
    -webkit-user-select: none;
    user-select: none;
    .back {
        position: fixed;
        left: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: #fff;
        text-decoration: none;
        font-size: 15px;
        font-weight: normal;
        padding: 4px 6px;
        border-radius: 6px;
        &:hover {
            background: #666;
        }
    }
    .title {
        display: flex;
        align-items: center;
        gap: 10px;
        img {
            width: 24px;
            height: 24px;
        }
        font-size: 24px;
        font-weight: bold;
    }
    lang-select {
        position: fixed;
        right: 15px;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        .lang-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            background: none;
            border: none;
            color: #fff;
            font-size: 15px;
            font-family: inherit;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 6px;
            &:hover {
                background: #666;
            }
            .lang-icon {
                width: 20px;
                height: 20px;
            }
            .caret {
                width: 12px;
                height: 12px;
                transition: transform 0.15s;
            }
        }
        .lang-menu {
            display: none;
            position: absolute;
            right: 0;
            margin: 0;
            padding: 4px 0;
            list-style: none;
            background: #666;
            border-radius: 6px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            min-width: 100px;
            z-index: 10;
            li {
                padding: 6px 12px;
                cursor: pointer;
                white-space: nowrap;
                font-weight: normal;
                &:hover {
                    background: #777;
                }
                &.active {
                     font-weight: bold;
                }
            }
        }
        &.open{
            .lang-menu {
                display: block;
            }
            .caret {
                transform: rotate(180deg);
            }
        }
    }
}

main {
    margin-top: 50px;
    padding: 10px;
    min-height: calc(100vh - 100px);
    section {
        margin-bottom: 1.4em;
    }
    h1 {
        font-size: 1.4em;
        margin: 0 0 0.5em;
    }
    h2 {
        font-size: 1.1em;
        margin: 0.8em 0 0.4em;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.2em;
    }
    ul {
        margin: 0.4em 0;
        padding-left: 1.5em;
    }
    li {
        margin: 0.25em 0;
    }
    code {
        background: #ddd;
        border-radius: 4px;
        padding: 0 4px;
    }
    p {
        margin: 0.5em 0;
    }
}

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
    height: 30px;
    a {
        color: #999;
    }
}
