/* 语法模块样式 */

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 3 3 3 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="%23ffffff" fill-opacity="0.1" fill-rule="evenodd"/%3E%3C/svg%3E');
    opacity: 0.3;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100px);
    }
}

.page-header h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease-out;
}

.page-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 语法标签导航 */
.grammar-nav {
    background-color: var(--bg-light);
    padding: 30px 0;
    margin-bottom: 60px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.grammar-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.grammar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.grammar-tab {
    padding: 14px 24px;
    border: 2px solid transparent;
    border-radius: 50px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.grammar-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.4s ease;
    z-index: -1;
    border-radius: 50px;
}

.grammar-tab:hover::before {
    left: 0;
}

.grammar-tab:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.grammar-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.grammar-tab.active::before {
    left: 0;
}

/* 语法内容 */
.grammar-content {
    display: none;
    padding: 40px 0;
    animation: fadeIn 0.5s ease;
}

.grammar-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 语法部分 */
.grammar-section {
    margin-bottom: 60px;
}

.grammar-section h4 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

/* 语法卡片 */
.grammar-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.grammar-card {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.grammar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.grammar-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.grammar-card h5 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

.grammar-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
    font-size: 1rem;
}

.grammar-card .example {
    font-style: italic;
    color: var(--text-color);
    margin-top: 15px;
    padding: 12px;
    background-color: var(--bg-light);
    border-radius: 8px;
    font-size: 0.95rem;
}

.grammar-card ul {
    margin-top: 15px;
    padding-left: 25px;
}

.grammar-card li {
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 练习题 */
.grammar-exercise {
    margin-top: 40px;
    padding: 30px;
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.grammar-exercise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.grammar-exercise h4 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-weight: 600;
}

.exercise-card {
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.exercise-card:hover {
    box-shadow: var(--shadow);
}

.exercise-card p {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.option {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option.correct {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.option.incorrect {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

.feedback {
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 15px;
    transition: var(--transition);
}

.feedback.correct {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
}

.feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

/* 学习进度 */
.grammar-progress {
    padding: 60px 0;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.progress-card {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.progress-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.progress-card h4 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.progress-card p {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .grammar-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .grammar-tab {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .grammar-cards {
        grid-template-columns: 1fr;
    }
    
    .options {
        flex-direction: column;
    }
    
    .option {
        width: 100%;
        text-align: center;
    }
    
    .grammar-exercise {
        padding: 20px;
    }
    
    .exercise-card {
        padding: 20px;
    }
    
    .progress-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .grammar-nav {
        padding: 20px 0;
    }
    
    .grammar-section h4 {
        font-size: 1.5rem;
    }
    
    .grammar-card {
        padding: 20px;
    }
    
    .grammar-card h5 {
        font-size: 1.2rem;
    }
    
    .grammar-exercise h4 {
        font-size: 1.3rem;
    }
    
    .exercise-card p {
        font-size: 1rem;
    }
    
    .progress-card h4 {
        font-size: 1.3rem;
    }
}