* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    padding: 30px;
    background: #f5f7fb;
}

h1 {
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background: #4a90e2;
    color: white;
    transition: all 0.2s ease;
}

button:hover {
    background: #4785d5;
}

button:active {
    background: #3278d2;
}

.words {
    cursor: pointer;
    transition: 0.2s;
}

.words:hover {
    color: #e67e22;
    text-decoration: underline;
}

input {
    font-size: 14px;
    background: white;
    padding: 5px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    margin-right: 10px;
    transition: all 0.3s ease;
}

#text {
    margin: 30px auto;
    width: 80%;
    font-size: 20px;
    line-height: 1.8;
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    min-height: 200px;
}

#meaning {
    margin-top: 0;
    font-size: 18px;
    background: #fff3cd;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    flex: 1;
    justify-content: center;
    min-height: 100px;
    min-width: 200px;
    display: flex;

    /* word-break: break-word; 
    overflow-wrap: break-word; */
}

.meaning-cont {
    display: flex;
    gap: 15px;
    align-items: stretch;
    width: 80%;
    margin: 20px auto;
    margin-bottom: 10px;
    min-height: 100px; 
    height: auto;
}

.btn-cont {
    display: flex;
    flex-direction: column;
    flex: 0 0 150px;
    gap: 10px;
}

.small-box {
    margin: 0;
    flex: 1;
    width: 100%;
    padding: 0 15px;
    white-space: nowrap;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    font-size: 14px;
    padding: 5px 15px;
    color: black;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    
    /* 自定义箭头 (使用 SVG 渐变背景或编码) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
    padding-right: 65px; /* 为箭头留出空间 */
}

input:hover, select:hover {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

button:disabled {
    background: #4a90e2;
    color: white;
    cursor: not-allowed;
    opacity: 0.5;
}

#gt {
    margin-right: 0;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    #text {
        width: 95%;
        font-size: 16px;
        padding: 12px 15px;
        line-height: 1.6;
    }

    .meaning-cont {
        width: 95%;
        flex-direction: column;
    }

    #meaning {
        font-size: 15px;
        padding: 12px;
        min-width: unset;
    }

    .btn-cont {
        flex-direction: row;
        width: 100%;
        flex: 1;
        margin-top: 5px;
    }

    .small-box {
        font-size: 14px;
        padding: 10px 10px;
    }

    #top-control {
        width: 80%;
        display: flex; 
        gap: 5px;
        margin: 0 auto;
    }

    input {
        width: 0;
        font-size: 13px;
        flex: 1; 
    }

    select {
        width: 0;
        font-size: 13px;
        flex: 1;
        padding-right: 1px;
    }

    button {
        font-size: 14px;
        padding: 10px 12px;
        margin: 0 3px;
    }

    #gt {
        flex: 1;
    }

    #copytext {
        flex: 1;
    }

    #bot-control {
        display: flex;
        gap: 7px;
        align-items: stretch;
        justify-content: center;
        width: 96%;
        margin: 0 auto;
        white-space: nowrap;
    }
}