* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    background: #e0e5ec;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #e0e5ec;
    border-radius: 30px;
    padding: 20px;
}

header {
    background: #e0e5ec;
    color: #4a5568;
    padding: 40px 30px;
    text-align: center;
    border-radius: 20px;
    box-shadow: inset 8px 8px 16px #bec3c9,
                inset -8px -8px 16px #ffffff;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #4a5568;
    text-shadow: 2px 2px 4px #ffffff,
                -2px -2px 4px #bec3c9;
}

.subtitle {
    font-size: 1.1em;
    color: #718096;
}

main {
    padding: 20px;
}

.input-section {
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    font-size: 1.1em;
    color: #4a5568;
    margin-bottom: 10px;
    font-weight: 500;
}

#chinese-name {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2em;
    border: none;
    border-radius: 15px;
    transition: all 0.3s;
    background: #e0e5ec;
    box-shadow: inset 5px 5px 10px #bec3c9,
                inset -5px -5px 10px #ffffff;
    color: #4a5568;
}

#chinese-name:focus {
    outline: none;
    box-shadow: inset 8px 8px 16px #bec3c9,
                inset -8px -8px 16px #ffffff;
}

#chinese-name::placeholder {
    color: #a0aec0;
}

.preferences {
    margin: 30px 0;
}

.preferences h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.preference-group {
    margin-bottom: 25px;
    padding: 25px;
    background: #e0e5ec;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #bec3c9,
                -8px -8px 16px #ffffff;
}

.preference-group > label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1em;
}

.radio-group, .checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    background: #e0e5ec;
    border-radius: 12px;
    transition: all 0.3s;
    box-shadow: 5px 5px 10px #bec3c9,
                -5px -5px 10px #ffffff;
}

.radio-option:hover, .checkbox-option:hover {
    box-shadow: 3px 3px 6px #bec3c9,
                -3px -3px 6px #ffffff;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #6b46c1;
}

.radio-option input[type="radio"]:checked + span,
.checkbox-option input[type="checkbox"]:checked + span {
    color: #6b46c1;
    font-weight: 500;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
    box-shadow: inset 3px 3px 6px #bec3c9,
                inset -3px -3px 6px #ffffff;
}

.generate-button {
    width: 100%;
    padding: 18px;
    font-size: 1.2em;
    background: #e0e5ec;
    color: #6b46c1;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 8px 8px 16px #bec3c9,
                -8px -8px 16px #ffffff;
}

.generate-button:hover {
    box-shadow: 10px 10px 20px #bec3c9,
                -10px -10px 20px #ffffff;
}

.generate-button:active {
    box-shadow: inset 5px 5px 10px #bec3c9,
                inset -5px -5px 10px #ffffff;
}

.button-icon {
    font-size: 1.3em;
    transition: transform 0.3s;
}

.generate-button:hover .button-icon {
    transform: translateX(5px);
}

.results-section {
    margin-top: 40px;
    padding-top: 40px;
    animation: fadeIn 0.5s;
}

.results-section.hidden {
    display: none;
}

.results-section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5em;
}

.name-results {
    display: grid;
    gap: 20px;
}

.name-card {
    background: #e0e5ec;
    padding: 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    animation: slideIn 0.5s forwards;
    opacity: 0;
    box-shadow: 8px 8px 16px #bec3c9,
                -8px -8px 16px #ffffff;
}

.name-card:nth-child(1) { animation-delay: 0.1s; }
.name-card:nth-child(2) { animation-delay: 0.2s; }
.name-card:nth-child(3) { animation-delay: 0.3s; }
.name-card:nth-child(4) { animation-delay: 0.4s; }
.name-card:nth-child(5) { animation-delay: 0.5s; }

.name-card:hover {
    box-shadow: 10px 10px 20px #bec3c9,
                -10px -10px 20px #ffffff;
}

.name-card.selected {
    background: #e0e5ec;
    box-shadow: inset 8px 8px 16px #bec3c9,
                inset -8px -8px 16px #ffffff;
}

.name-main {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 15px;
}

.english-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #4a5568;
}

.name-card.selected .english-name {
    color: #6b46c1;
}

.pronunciation {
    font-size: 1.1em;
    color: #718096;
    font-style: italic;
}

.name-card.selected .pronunciation {
    color: #805ad5;
}

.name-meaning {
    margin-bottom: 10px;
    color: #4a5568;
    line-height: 1.5;
}

.name-card.selected .name-meaning {
    color: #553c9a;
}

.name-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.tag {
    padding: 6px 14px;
    background: #e0e5ec;
    color: #6b46c1;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    box-shadow: 3px 3px 6px #bec3c9,
                -3px -3px 6px #ffffff;
}

.name-card.selected .tag {
    box-shadow: inset 2px 2px 4px #bec3c9,
                inset -2px -2px 4px #ffffff;
}

footer {
    text-align: center;
    padding: 30px;
    color: #718096;
    background: #e0e5ec;
    font-size: 0.9em;
    margin-top: 40px;
    border-radius: 20px;
    box-shadow: inset 5px 5px 10px #bec3c9,
                inset -5px -5px 10px #ffffff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #bec3c9;
    border-radius: 50%;
    border-top-color: #6b46c1;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    .container {
        padding: 15px;
    }

    .radio-group, .checkbox-group {
        flex-direction: column;
    }

    .english-name {
        font-size: 1.5em;
    }

    .preference-group {
        padding: 20px;
    }
}