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

body {
    font-family: Arial, sans-serif;
    background: #C0C0C0;
    padding: 20px;
    color: #000000;
    overflow-y: scroll;
    height: 100vh;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border: 2px solid black;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid black;
    flex-shrink: 0;
}

h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

header p {
    font-size: 1em;
    color: #000000;
}

.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex: 1;
    min-height: 0;
}

.input-column {
    flex: 0 0 350px;
    border: 2px solid #808080;
    padding: 15px;
    background: #F0F0F0;
}

.results-column {
    flex: 1;
    border: 2px solid #808080;
    padding: 15px;
    background: #F0F0F0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1em;
}

textarea {
    width: 100%;
    padding: 8px;
    font-size: 1.1em;
    border: 2px solid #808080;
    font-family: Arial, sans-serif;
    background: white;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border: 2px solid black;
}

button {
    background: #C0C0C0;
    border: 2px outset #808080;
    padding: 8px 20px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 10px;
    margin-right: 5px;
    font-weight: bold;
}

button:hover {
    background: #D0D0D0;
}

button:active {
    border-style: inset;
}

button:disabled {
    color: #808080;
    cursor: default;
}

.stats-section {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border: 1px solid black;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    line-height: 1.8;
    min-height: 80px;
    visibility: visible;
}

h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    padding: 5px;
    background: #808080;
    color: white;
    border: 1px solid black;
    flex-shrink: 0;
}

#results {
    background: white;
    border: 2px solid black;
    border-right: none;
    flex: 1;
    overflow-y: scroll;
    box-sizing: border-box;
}

#results::-webkit-scrollbar {
    width: 16px;
    background: #F0F0F0;
    border-left: 2px solid black;
}

#results::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border: 2px solid #808080;
    border-radius: 0;
}

#results::-webkit-scrollbar-thumb:hover {
    background: #A0A0A0;
}

.result-group {
    /* Container for simplified/traditional pair */
}

.result-row {
    display: flex;
    border-bottom: 1px solid black;
    background: white;
    min-height: 60px;
    align-items: stretch;
}

.result-char {
    flex: 0 0 10%;
    padding: 10px;
    font-size: 2em;
    font-weight: bold;
    border-right: 1px solid black;
    text-align: center;
    background: #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-code-notfound {
    flex: 1;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #808080;
}

.result-code {
    flex: 1;
    display: flex;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
}

.result-code-radicals {
    flex: 1;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.result-code-qwerty {
    flex: 1;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-left: 1px solid black;
}

.code-asterisk {
    color: #FF0000;
    font-weight: bold;
    font-size: 0.7em;
    cursor: help;
    margin-left: 5px;
}

.code-asterisk:hover {
    color: #CC0000;
}

footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px solid black;
    text-align: center;
    font-size: 0.9em;
    flex-shrink: 0;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #0000FF;
    text-decoration: underline;
}

footer a:visited {
    color: #800080;
}

footer a:hover {
    color: #FF0000;
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column;
    }

    .input-column {
        flex: 1;
    }

    .result-char {
        font-size: 1.5em;
    }

    .result-code {
        font-size: 1em;
    }
}
