/* 琳凯蒂亚语语法页面样式 */

/* 语法页面特殊样式 */
.grammar-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.grammar-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: sparkleFloat 20s linear infinite;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* 语法导航选项卡 */
.grammar-navigation {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.grammar-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.tab-btn {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.tab-btn:hover::before {
    left: 100%;
}

/* 语法内容区域 */
.grammar-content {
    padding: 40px 0;
    min-height: 80vh;
}

.grammar-section {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.grammar-section.active {
    display: block;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
    font-style: italic;
}

/* 语法卡片 */
.grammar-card {
    background: rgba(102,126,234,0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(102,126,234,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grammar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
}

.grammar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.grammar-card h3 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 字母表样式 */
.alphabet-section {
    margin-bottom: 30px;
}

.alphabet-section h4 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2rem;
}

.alphabet-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.letter-group {
    background: rgba(102,126,234,0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(102,126,234,0.1);
}

.letter-group h5 {
    text-align: center;
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 600;
}

.letter-group.basic-vowels {
    background: rgba(255,107,107,0.05);
    border-color: rgba(255,107,107,0.2);
}

.letter-group.basic-vowels h5 {
    color: #ff6b6b;
}

.letter-group.extended-vowels {
    background: rgba(255,193,7,0.05);
    border-color: rgba(255,193,7,0.2);
}

.letter-group.extended-vowels h5 {
    color: #ffc107;
}

.letter-group.complex-vowels {
    background: rgba(156,39,176,0.05);
    border-color: rgba(156,39,176,0.2);
}

.letter-group.complex-vowels h5 {
    color: #e91e63; /* 改为较亮的粉红色 */
}

.letter-group.consonant-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 15px;
}

.letter {
    display: inline-block;
    background: rgba(102,126,234,0.1);
    padding: 8px 12px;
    margin: 4px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(102,126,234,0.2);
    color: #ffd700; /* 改为金色 */
}

.magic-letter {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.magic-letter:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

/* 转写方案样式 */
.transcription-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.transcription-item {
    background: rgba(102,126,234,0.1);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.transcription-item:hover {
    background: rgba(102,126,234,0.2);
    transform: translateY(-2px);
}

.original {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.transcribed {
    font-family: 'Courier New', monospace;
    color: #ffb74d; /* 改为浅金色 */
    font-weight: 600;
}

/* 音节结构样式 */
.phonetic-structure {
    background: rgba(240,248,255,0.8);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.structure-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.component {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    /* 确保足够的对比度 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.component.optional {
    background: rgba(102,126,234,0.6);
    font-style: italic;
}

.connector {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.note {
    font-style: italic;
    color: #666;
    text-align: center;
    font-size: 0.9rem;
}

/* 发音特点网格 */
.pronunciation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pronunciation-feature {
    background: rgba(102,126,234,0.15);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #f093fb;
    /* 确保文字颜色对比度足够 */
    color: #333;
}

.pronunciation-feature h5 {
    color: #764ba2;
    margin-bottom: 10px;
}

.pronunciation-feature p {
    color: #333;
    line-height: 1.5;
}

.pronunciation-feature strong {
    color: #667eea;
    font-weight: 600;
}

/* 词类分类样式 */
.word-class-grid {
    display: grid;
    gap: 25px;
    margin-top: 20px;
}

.word-class-category {
    background: rgba(102,126,234,0.1);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(102,126,234,0.2);
}

.word-class-category h4 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.class-item:last-child {
    border-bottom: none;
}

.class-name {
    font-weight: 600;
    color: #ffd700; /* 改为金色 */
    font-size: 1rem;
}

.class-desc {
    color: #ffcc80; /* 改为浅金色 */
    font-size: 0.9rem;
    text-align: right;
    flex: 1;
    margin-left: 15px;
}

/* 转义规则样式 */
.transformation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.transformation-rule {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(102,126,234,0.2);
    transition: all 0.3s ease;
}

.transformation-rule:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102,126,234,0.2);
}

.transformation-rule h4 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rule-details {
    margin-bottom: 12px;
}

.suffix {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 8px;
    /* 确保足够的对比度 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.example {
    font-style: italic;
    color: #ffcc80; /* 改为浅金色 */
    font-size: 0.9rem;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* 代词表格样式 */
.pronoun-section {
    margin-bottom: 30px;
}

.pronoun-section h4 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.pronoun-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(102,126,234,0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pronoun-table th,
.pronoun-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.pronoun-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.pronoun-table td {
    background: rgba(102,126,234,0.05);
}

.pronoun-table tr:hover td {
    background: rgba(102,126,234,0.1);
}

/* 修饰词网格 */
.modifier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.modifier {
    background: rgba(102,126,234,0.1);
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modifier:hover {
    background: rgba(102,126,234,0.2);
    transform: translateY(-2px);
}

/* 指示代词网格 */
.demonstrative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.demonstrative-item {
    background: rgba(102,126,234,0.1);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(102,126,234,0.2);
}

.type {
    display: block;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.word {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    margin: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* 疑问代词网格 */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.question-word {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.question-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255,107,107,0.3);
}

/* 数词样式 */
.number-section {
    margin-bottom: 25px;
}

.number-section h4 {
    color: #ffd700; /* 改为金色 */
    margin-bottom: 15px;
    text-align: center;
}

.number-grid, .unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.number-item, .unit-item {
    background: rgba(102,126,234,0.1);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s ease;
}

.number-item:hover, .unit-item:hover {
    background: rgba(102,126,234,0.2);
    transform: scale(1.05);
}

/* 修饰词示例 */
.modifier-examples {
    margin-top: 20px;
}

.modifier-type {
    background: rgba(102,126,234,0.1);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.prefix, .suffix {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-right: 10px;
}

/* 声叹词示例 */
.interjection-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.interjection-item {
    background: rgba(240,248,255,0.8);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(102,126,234,0.2);
    transition: all 0.3s ease;
}

.interjection-item:hover {
    background: rgba(102,126,234,0.1);
    transform: translateY(-2px);
}

.linkaitiya {
    display: block;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.meaning {
    color: #ffcc80; /* 改为浅金色 */
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grammar-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 8px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .grammar-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .transformation-grid,
    .pronunciation-grid,
    .number-grid,
    .unit-grid {
        grid-template-columns: 1fr;
    }
    
    .letter-group.consonant-group {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 魔法特效增强 */
.magic-letter {
    position: relative;
    overflow: hidden;
}

.magic-letter::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.magic-letter:hover::before {
    left: 100%;
}

/* 语法卡片悬浮效果增强 */
.grammar-card {
    position: relative;
}

.grammar-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
    pointer-events: none;
}

.grammar-card:hover::after {
    opacity: 1;
}