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

nav {
    background-color: #0078d4;
    color: #fff;
    padding: 20px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: flex;
    justify-content: flex-start;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
    font-weight: 600;
}

nav a:hover {
    text-decoration: underline;
}

.container {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    padding: 40px;
    text-align: center;
    width: 95%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    gap: 60px;
    margin-top: 50px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.left-column, .right-column {
    box-sizing: border-box;
}

.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.right-column {
    flex: 1;
}

.intro-section, .form-section, .output-section {
    padding: 25px;
    box-sizing: border-box;
    border-radius: 10px;
    margin-bottom: 20px;
}

.intro-section {
    background-color: #f9f9f9;
    text-align: left;
}

.form-section {
    background-color: #fff;
    text-align: left;
}

.output-section {
    background-color: #f9f9f9;
    text-align: left;
    height: 100%;
}

h1 {
    color: #0078d4;
    margin-bottom: 25px;
    font-size: 26px;
}

h2 {
    color: #0078d4;
    margin-bottom: 15px;
    font-size: 20px;
}

h3 {
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 18px;
}

p {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
}

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

.input-row {
    display: flex;
    justify-content: space-between;
}

.input-row .input-group {
    width: 48%;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 15px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: calc(100% - 12px);
    background-position-y: center;
    padding-right: 30px;
}

.option-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

button {
    background-color: #0078d4;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #005a9e;
    transform: translateY(-2px);
}

.output-container {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f4f4f4;
}

.output-container h3 {
    font-size: 22px;
    color: #0078d4;
    margin-top: 0;
    margin-bottom: 10px;
}

.output-container #name-explanation {
    font-size: 14px;
    color: #333;
    margin: 10px 0;
}

.output-container #chinese-name {
    font-size: 26px;
    font-weight: bold;
    color: #0078d4;
    margin-bottom: 10px;
}

.output-container #pinyin {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    display: block;
}

.output-container #tts-button {
    background-color: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
    color: #0078d4;
    display: none;
}

.output-container #placeholder-message {
    text-align: center;
    color: #999;
    font-style: italic;
}

.name-input-hint {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 40px;
    }

    .left-column, .right-column {
        width: 100%;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row .input-group {
        width: 100%;
    }
}