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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: white;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding: 1px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 80px;
    width: auto;
    display: block;
}

.search-form {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 500px;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #3498db;
}

.search-btn {
    padding: 7px 10px;
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
    border-radius: 0 4px 4px 0;
    font-size: 1.2em;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.alphabet {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.alphabet-title {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 15px;
    font-weight: 500;
}

.letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.letter {
    display: inline-block;
    padding: 8px 12px;
    color: #3498db;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 1.1em;
}

.letter:hover {
    background: #e8f4f8;
}

.letter.active {
    background: #3498db;
    color: white;
}

.content {
    background: white;
    padding: 30px;
    min-height: 400px;
}

.word-header {
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.word-title {
    font-size: 2.5em;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

.word-meta {
    color: #7f8c8d;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gender-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 15px;
}

.male-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.female-badge {
    background: #fce4ec;
    color: #c2185b;
}

.definition {
    margin-bottom: 20px;
}

.definition-label {
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.definition-text {
    color: #2c3e50;
    font-size: 1.05em;
    line-height: 1.8;
}

.definition-text i {
    color: #555;
    font-style: italic;
}

.name-list {
    list-style: none;
}

.name-item {
    border-bottom: 1px solid #ecf0f1;
    padding: 15px 0;
    transition: background 0.2s;
}

.name-item:hover {
    background: #f8f9fa;
    margin: 0 -10px;
    padding: 15px 10px;
}

.name-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.name-item-title {
    font-size: 1.3em;
    color: #3498db;
    font-weight: 500;
    margin-bottom: 5px;
}

.name-item-desc {
    color: #555;
    font-size: 0.95em;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    color: #3498db;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e8f4f8;
}

.pagination .active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .disabled {
    color: #bdc3c7;
    border-color: #ecf0f1;
    pointer-events: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.empty-title {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-left: 3px solid #3498db;
    margin: 20px 0;
    border-radius: 3px;
}

.related-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.related-title {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 15px;
    font-weight: 500;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.related-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.related-item:hover {
    background: #e8f4f8;
    transform: translateY(-2px);
}

.related-name {
    color: #3498db;
    font-weight: 500;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.related-desc {
    color: #7f8c8d;
    font-size: 0.9em;
}

.breadcrumb {
    padding: 15px 0;
    font-size: 0.9em;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #7f8c8d;
    margin: 0 5px;
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: #95a5a6;
    font-size: 0.9em;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: 100%;
    }

    .logo-img {
        height: 40px;
    }

    .word-title {
        font-size: 2em;
    }

    .letters {
        gap: 5px;
    }

    .letter {
        padding: 6px 10px;
        font-size: 1em;
    }

    .content {
        padding: 20px 15px;
    }
}