* {
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: #d7dfea;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding-top: 3rem;
    padding-left: 20px;
}

#banner {
    position: absolute;
    top: 12px;
    width: 100%;
    color: #727e8a;
    text-align: center;
    padding: 6px 0;
    z-index: 1;
    pointer-events: none;
}

#tips {
    position: absolute;
    top: 38px;
    left: 140px;
    width: 200px;
    color: #84919d;
    font-size: 0.9rem;
    line-height: 2.4;
    padding: 8px 0;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1;
    display: none;
}

.add {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: #727e8a;
    color: #d7dfea;
    border: none;
    border-radius: 3px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.add:active {
    transform: scale(0.98);
}

#container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.word {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    background-color: #84919d;
    box-shadow: 0 0 5px 0.5px #9e9e9e;
    border-radius: 3px;
    max-width: 110px;
    margin: 3px;
}

.word .tools {
    display: flex;
    justify-content: flex-end;
    padding: 0.1rem;
}

.word .tools button {
    background-color: transparent;
    border: none;
    color: #d7dfea;
    cursor: pointer;
    margin-left: 0.3rem;
}

.main-word, .main-trans, .word-input, .trans-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 1px;
    outline: none;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
    color: white;
    resize: none;
}

.word-input {
    background-color: #84919d;
}

.trans-input {
    background-color: #727e8a;
}

.hidden {
    display: none;
}

@media(max-width:600px) {
    body {
        padding: 1rem;
        font-size: 0.9rem;
    }

    #banner {
        position: fixed;
        top: 0;
        left: 0;
        padding: 8px 4px;
        font-size: 0.8rem;
        width: 100%;
    }

    #tips {
        top: 2rem;
        left: 9rem;
        font-size: 0.6rem;
        line-height: 4;
        color: #d7dfea;
    }

    .add {
        position: fixed;
        top: auto;
        bottom: 1rem;
        right: 1rem;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
        z-index: 2;
    }

    #container {
        padding-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .word {
        flex: 1 1 45%;
        max-width: 45%;
        min-width: 140px;
        margin: 5px;
    }

    .main-word, .main-trans, .word-input, .trans-input {
        font-size: 1rem;
        height: auto;
        padding: 4px;
        line-height: 1.6;
        word-break: break-word;
    }

    .word .tool button {
        font-size: 1rem;
    }
}
