* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f9f7ff 0%, #e6e0ff 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* Навигация */
.navbar {
    background: white;
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.1);
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid #e6d6ff;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #8a2be2;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #8a2be2;
    background: #f9f7ff;
}

.nav-link.active {
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
    box-shadow: 0 3px 10px rgba(138, 43, 226, 0.3);
}

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

/* Общие стили для заголовков */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.1);
    border: 1px solid #e6d6ff;
}

h1 {
    color: #8a2be2;
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    color: #7b68ee;
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto;
    font-weight: 500;
}

.stats {
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

/* Стили для страницы конструкций */
.table-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15);
    margin-bottom: 30px;
    border: 1px solid #e6d6ff;
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
    table-layout: fixed;
}

thead {
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
}

th {
    padding: 25px 20px;
    text-align: left;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

th:first-child {
    width: 35%;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

th:last-child {
    width: 65%;
}

tbody tr {
    border-bottom: 1px solid #f0eaff;
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: #fcfaff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.1);
}

td {
    padding: 30px 25px;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.construction-number {
    display: inline-block;
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: bold;
    margin-right: 15px;
    font-size: 1.1em;
    box-shadow: 0 3px 8px rgba(138, 43, 226, 0.3);
}

.construction {
    font-size: 1.5em;
    font-weight: bold;
    color: #8a2be2;
    margin-bottom: 12px;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.meaning {
    color: #7b68ee;
    font-style: italic;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 500;
    padding-left: 51px;
}

.structure {
    background: linear-gradient(to right, #f9f7ff, #f0eaff);
    padding: 15px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    margin-top: 15px;
    font-size: 1em;
    border-left: 4px solid #9370db;
    color: #6a5acd;
    word-break: break-word;
    margin-left: 51px;
}

.example {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px dashed #e6d6ff;
}

.example:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.chinese {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #2f004f;
    line-height: 1.5;
    font-weight: 500;
}

.pinyin {
    color: #9370db;
    margin-bottom: 10px;
    font-size: 1.05em;
    line-height: 1.4;
}

.translation {
    color: #555;
    font-size: 1em;
    line-height: 1.5;
    background: #f9f7ff;
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 3px solid #d8bfd8;
}

.example-number {
    display: inline-block;
    background: #e6d6ff;
    color: #8a2be2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    margin-right: 10px;
    font-size: 0.9em;
}

/* Стили для страницы слов */
.words-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.15);
    border: 1px solid #e6d6ff;
}

.words-table {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.word-card {
    border: 2px solid #e6d6ff;
    border-radius: 20px;
    padding: 35px;
    background: #fcfaff;
    transition: all 0.3s;
    text-align: center;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.15);
    border-color: #9370db;
}

.word-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.word-number {
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(138, 43, 226, 0.3);
    flex-shrink: 0;
}

.word-main {
    text-align: center;
    flex: 1;
}

.word-chinese {
    font-size: 4.5em !important; /* Увеличенный шрифт для китайских иероглифов */
    color: #2f004f;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

.word-pinyin {
    font-size: 1.8em;
    color: #9370db;
    margin-bottom: 15px;
    font-weight: 500;
}

.word-meaning {
    font-size: 1.3em;
    color: #666;
    font-style: italic;
    background: #f0eaff;
    padding: 12px 25px;
    border-radius: 50px;
    display: inline-block;
}

.word-example {
    background: white;
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid #9370db;
    text-align: center;
}

.example-label {
    font-size: 1.1em;
    color: #8a2be2;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.example-chinese {
    font-size: 1.6em;
    color: #2f004f;
    margin-bottom: 10px;
    line-height: 1.5;
}

.example-pinyin {
    font-size: 1.2em;
    color: #9370db;
    margin-bottom: 15px;
}

.example-translation {
    font-size: 1.1em;
    color: #555;
    background: #f9f7ff;
    padding: 15px;
    border-radius: 10px;
    font-style: italic;
}

/* Новые стили для кнопок и скрытого контента */
.toggle-btn {
    background: linear-gradient(to right, #9370db, #8a2be2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(138, 43, 226, 0.3);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(138, 43, 226, 0.4);
}

.toggle-btn.active {
    background: linear-gradient(to right, #8a2be2, #9370db);
}

.word-content {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

.word-details {
    background: #f9f7ff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 4px solid #9370db;
}

.word-details div {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #555;
    line-height: 1.5;
}

.word-details div:last-child {
    margin-bottom: 0;
}

.word-details strong {
    color: #8a2be2;
    font-weight: 600;
}

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

.chinese-char {
    font-family: "Microsoft YaHei", "SimHei", "STKaiti", sans-serif;
}

/* Футер */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 25px;
    color: #9370db;
    font-size: 0.95em;
    border-top: 2px solid #e6d6ff;
}

footer p {
    margin-bottom: 10px;
}

/* Адаптивность */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    th, td {
        padding: 20px 15px;
    }
    
    .construction {
        font-size: 1.3em;
    }
    
    .chinese {
        font-size: 1.2em;
    }
    
    .construction-number {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 1em;
        margin-right: 12px;
    }
    
    .meaning, .structure {
        margin-left: 44px;
    }
    
    .word-chinese {
        font-size: 3.8em !important;
    }
    
    .word-pinyin {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .nav-logo {
        margin-bottom: 15px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 1em;
    }
    
    table {
        display: block;
    }
    
    thead {
        display: none;
    }
    
    tbody tr {
        display: block;
        margin-bottom: 30px;
        border: 2px solid #e6d6ff;
        border-radius: 15px;
        padding: 20px;
        background: white;
    }
    
    td {
        display: block;
        width: 100% !important;
        padding: 15px;
    }
    
    td:first-child {
        border-bottom: 2px solid #f0eaff;
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .construction {
        font-size: 1.4em;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .meaning, .structure {
        margin-left: 0;
        padding-left: 0;
    }
    
    .word-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .word-number {
        width: 45px;
        height: 45px;
        font-size: 1.2em;
    }
    
    .word-chinese {
        font-size: 3.2em !important;
    }
    
    .words-container {
        padding: 25px;
    }
    
    .word-card {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    .stats {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .construction {
        font-size: 1.2em;
    }
    
    .chinese {
        font-size: 1.1em;
    }
    
    .pinyin, .translation {
        font-size: 0.95em;
    }
    
    .construction-number {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.9em;
        margin-right: 10px;
    }
    
    .word-chinese {
        font-size: 2.8em !important;
    }
    
    .word-pinyin {
        font-size: 1.3em;
    }
    
    .word-meaning {
        font-size: 1.1em;
        padding: 10px 20px;
    }
    
    .example-chinese {
        font-size: 1.3em;
    }
}