body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Arial', sans-serif;
    background: linear-gradient(135deg, #e3e9ff 0%, #f7f8fc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 6px 32px #0002, 0 1.5px 6px #1976d220;
    padding: 2.2em 1.2em 2.5em 1.2em;
    max-width: 420px;
    width: 96vw;
    margin: 2em auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container > * {
    width: 100%;
    max-width: 100%;
}

label {
    font-size: 1.1em;
    color: #222;
    margin-bottom: 0.7em;
}

input[type="number"], select {
    font-size: 1.1em;
    padding: 0.5em 0.8em;
    border-radius: 8px;
    border: 1px solid #bfc6d1;
    margin-left: 0.3em;
    outline: none;
    background: #f7f8fc;
    transition: border 0.2s;
}

input[type="number"]:focus, select:focus {
    border: 1.5px solid #1976d2;
}

#loadWordsBtn {
    background: linear-gradient(90deg, #6a8dff 0%, #a084ee 100%);
    color: #fff;
    font-size: 1.2em;
    border: none;
    border-radius: 12px;
    padding: 0.7em 2.2em;
    margin-left: 0.5em;
    box-shadow: 0 2px 8px #a084ee33;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

#loadWordsBtn:hover {
    background: linear-gradient(90deg, #5a7de0 0%, #8a6fd6 100%);
    box-shadow: 0 4px 16px #a084ee44;
}

.meaning {
     font-size: 1.3em;
     font-weight: bold;
     color: #1976d2;
     margin: 0.5em 0 0.1em 0;
     text-align: center;
     letter-spacing: 0.02em;
}

 .type-box {
     font-size: 1em;
     color: #1976d2;
     margin-bottom: 0.2em;
     text-align: center;
}

.image-box {
    display: flex;
    justify-content: center;
    margin: 0.5em 0 0.5em 0;
}

/* 固定图片尺寸，超出裁剪，适配手机 */
.image-box img {
    width: 220px;
    height: 220px;
    max-width: 90vw;
    max-height: 60vw;
    min-width: 120px;
    min-height: 120px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 2px 12px #1976d220;
    background: #f7f8fc;
    display: block;
}

.example-box {
    font-size: 1.1em;
    color: #2a2a2a;
    background: #f7f8fc;
    border-radius: 10px;
    padding: 0.7em 1em;
    margin: 1em 0 0.2em 0;
    min-height: 2.2em;
    box-shadow: 0 1px 4px #1976d210;
}


.selected-kana {
    font-size: 1.5em;
    color: #444;
    min-height: 1.5em;
    margin: 0.1em 0 0.1em 0;
    text-align: center;
    letter-spacing: 0.1em;
    display: flex;
    gap: 0.5em;
    justify-content: center;
}

.kana-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2em;
    height: 2.2em;
    margin: 0 0.1em;
    border: 2px solid #d32f2f;
    border-radius: 8px;
    background: #fff;
    font-size: 1.2em;
    color: #222;
    box-sizing: border-box;
    font-weight: 500;
    transition: background 0.2s, border 0.2s;
}
/* 填入内容时高亮 */
.kana-box:not(:empty) {
    background: #ffe0e0;
    border-color: #a084ee;
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    justify-content: center;
    margin-bottom: 1em;
}

.kana-btn {
    font-size: 1.2em;
    padding: 0.5em 1.1em;
    border-radius: 10px;
    border: 1.5px solid #bfc6d1;
    background: #f7f8fc;
    color: #1976d2;
    margin: 0.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.kana-btn:hover:not(:disabled) {
    background: #e3e9ff;
    color: #333;
    border: 1.5px solid #6a8dff;
}

.kana-btn:disabled {
    background: #dbeafe;
    color: #aaa;
    border: 1.5px solid #bfc6d1;
    cursor: not-allowed;
}

.kana-btn.wrong {
    background: #ffbdbd !important;
    color: #b71c1c !important;
    border: 1.5px solid #e57373 !important;
}

.progress {
    font-size: 1.1em;
    color: #1976d2;
    margin: 0.7em 0 0.2em 0;
    text-align: center;
}

.custom-multiselect {
    min-width: 7em;
    user-select: none;
    position: relative;
    background: #f7f8fc;
    border-radius: 8px;
    border: 1px solid #bfc6d1;
    padding: 0.2em 0.5em;
    font-size: 1.1em;
}

.selected-items {
    min-height: 1.8em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px 24px 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.dropdown-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #1976d2;
}

.dropdown-list {
    display: none;
    position: absolute;
    z-index: 10;
    top: 110%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 2px 8px #0001;
    max-height: 180px;
    overflow: auto;
}

@media (max-width: 600px) {
    .container {
        max-width: 99vw;
        padding: 0.7em 0.1em 1em 0.1em;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    .image-box img {
        width: 98vw;
        height: 60vw;
        min-width: 100px;
        min-height: 100px;
        max-width: 99vw;
        max-height: 65vw;
    }
    .meaning {
        font-size: 1.1em;
        margin: 0.3em 0 0.05em 0;
    }
    .type-box {
        font-size: 0.95em;
        margin-bottom: 0.1em;
    }
    .example-box {
        font-size: 0.98em;
        padding: 0.4em 0.4em;
        margin: 0.7em 0 0.1em 0;
    }
    .kana-btn {
        font-size: 0.95em;
        padding: 0.3em 0.6em;
    }
    .selected-kana {
        font-size: 1em;
        min-height: 1.1em;
        margin: 0.05em 0 0.05em 0;
    }
}

::-webkit-scrollbar {
    width: 8px;
    background: #f7f8fc;
}
::-webkit-scrollbar-thumb {
    background: #e3e9ff;
    border-radius: 8px;
}