body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef2f7;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 520px;
    text-align: center;
}

h1 {
    color: #1c2533;
    margin: 0 0 18px;
}

input {
    width: calc(100% - 132px);
    max-width: 320px;
    padding: 12px 14px;
    border: 1px solid #d1d9e6;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
}

button {
    padding: 12px 18px;
    margin-left: 10px;
    background-color: #3f8efc;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #2e73d6;
}

.hint {
    color: #606d80;
    font-size: 14px;
    margin: 14px 0 0;
}

#results {
    margin-top: 24px;
    text-align: left;
}

.loading,
.error {
    padding: 18px;
    border-radius: 12px;
    font-size: 15px;
}

.loading {
    background-color: #f4f7fe;
    color: #2f4db3;
}

.error {
    background-color: #ffe6e6;
    color: #b42222;
}

.word-card {
    background-color: #f9fbff;
    border: 1px solid #e3e9f5;
    border-radius: 14px;
    margin-bottom: 18px;
    overflow: hidden; /* 이미지가 모서리를 넘지 않도록 */
}

.word-image-container {
    width: 100%;
    height: 240px;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.word-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.word-content {
    padding: 20px;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.word-header h2 {
    margin: 0;
    font-size: 28px;
    color: #172033;
}

.phonetic {
    color: #5d6a82;
    margin-top: 6px;
    font-size: 16px;
}

.word-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.audio-button {
    padding: 10px 16px;
    border: 1px solid #d1d9e6;
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    color: #344767;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.audio-button:hover {
    background-color: #eef3ff;
    transform: translateY(-1px);
}

.meanings {
    display: grid;
    gap: 16px;
}

.meaning-item {
    background-color: #ffffff;
    border: 1px solid #e3e9f5;
    border-radius: 14px;
    padding: 18px;
}

.part-of-speech {
    font-weight: 700;
    color: #243256;
    margin-bottom: 10px;
}

.meaning-item ul {
    padding-left: 18px;
    margin: 0;
    color: #3b4665;
}

.meaning-item li {
    margin-bottom: 16px;
    line-height: 1.5;
}

.en-def {
    font-weight: 600;
    color: #172033;
    margin-bottom: 2px;
}

.ko-def {
    color: #4b5563;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.example {
    background-color: #f8fafc;
    border-left: 3px solid #e2e8f0;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 4px;
}

.en-ex {
    color: #475569;
    font-style: italic;
    font-size: 0.9em;
}

.ko-ex {
    color: #64748b;
    font-size: 0.85em;
    margin-top: 2px;
}

.synonyms {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    color: #47536a;
    font-size: 14px;
}

@media (max-width: 520px) {
    input {
        width: 100%;
        margin: 0 0 10px 0;
    }

    button {
        margin-left: 0;
        width: 100%;
    }

    .word-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .word-actions {
        justify-content: flex-start;
    }
}
