html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.page-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-txt {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
}

.search-btn,
.page-btn {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f9f9f9;
    text-decoration: none;
    color: #222;
}

.list-section {
    flex: 1;
    overflow: auto;
    border: 1px solid #aaa;
    background: #fff;
    border-radius: 4px;
}

#ulElement {
    list-style: none;
    margin: 0;
    padding: 0;
    display: table;
    /* width: max-content; */
    width: 100%;
}

.word-li {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #ddd;
    align-items: stretch;
}

.word-li.word-header {
    background: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}

.word-li.word-header .word-cell {
    background: #f2f2f2;
    border-right: 1px solid #aaa;
}

.word-cell {
    padding: 6px 8px;
    font-size: 14px;
    justify-content: center;
    align-items: center;
    position: relative;
    border-right: 1px solid #aaa;
    display: flex;
    word-break: break-word;
    white-space: normal;
    overflow: visible;
    min-width: 0;
    box-sizing: border-box;
}

.word-cell:last-child {
    border-right: none;
}

.word-li:not(.word-header) .word-cell {
    justify-content: flex-start;
}

/* 컬럼별 flex 설정 */
.col-no {
    flex: 0 0 5%;
}

.col-word {
    flex: 0 0 10%;
}

.col-desc {
    flex: 0 0 24%;
}

.col-root {
    flex: 0 0 23%;
}

.col-etymo {
    flex: 0 0 23%;
}

.col-key {
    flex: 0 0 15%;
}

.col-group {
    flex: 0 0 5%;
}

.col-eng {
    flex: 0 0 10%;
}

.col-org-lang {
    flex: 0 0 35%;
}

.col-ex {
    flex: 0 0 40%;
}

.list-footer {
    display: flex;
    margin-top: 5px;
    justify-content: flex-end;
}

.button-row {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.button-row button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

#excel-input,
#radix-input {
    display: none;
}

.cell-input {
    width: 100%;
    height: 100%;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
    box-sizing: border-box;
}

.toast {
    visibility: hidden;
    min-width: 200px;
    max-width: 80%;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 14px 20px;
    position: fixed;
    z-index: 9999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.4s ease-in-out, visibility 0.4s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

.col-resizer {
    position: absolute;
    top: 0;
    right: -1px;
    width: 1.5px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background-color: #ccc;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
}

.modal.open {
    display: flex;
}

.modal-content {
    width: min(720px, 92vw);
    max-height: 80vh;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-header,
.modal-footer {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
    border-bottom: none;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
    overflow: auto;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.modal-field label {
    font-weight: bold;
}

.modal-field input {
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-footer .primary {
    background: #2e7dff;
    color: #fff;
    border: 1px solid #185be0;
}

.word-li.highlight {
    background: #fff8d1;
    transition: background 1.5s ease;
}