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

:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #6554C0;
    --success-color: #00875A;
    --warning-color: #FF991F;
    --danger-color: #DE350B;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --background: #FAFBFC;
    --surface: #FFFFFF;
    --border-color: #DFE1E6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

main {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--background);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

#searchBtn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

#searchBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.quick-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 8px 16px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.category-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-container {
    min-height: 200px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-message h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.welcome-message p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.feature-card {
    background: var(--background);
    padding: 25px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-card {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 30px;
    transition: all 0.3s ease;
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.char-display {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    height: 120px;
    border: 2px solid var(--border-color);
}

.char-large {
    font-size: 3.5rem;
    line-height: 1;
    color: var(--text-primary);
}

.char-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(223, 225, 230, 0.5);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 140px;
    font-size: 0.95rem;
}

.info-value {
    flex: 1;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-value code {
    background: var(--surface);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.encoding-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.encoding-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.copy-btn {
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.no-results,
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results p,
.error-message p {
    font-size: 1.1rem;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    margin-top: 40px;
}

footer p {
    opacity: 0.9;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .lang-switcher {
        position: static;
        margin-top: 20px;
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    #searchBtn {
        width: 100%;
    }
    
    .result-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .char-display {
        height: 100px;
        width: 100px;
        margin: 0 auto;
    }
    
    .char-large {
        font-size: 2.5rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-label {
        min-width: auto;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}