/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "微软雅黑", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    font-size: 14px;
    line-height: 1.7;
}

/* 导航栏修复：不换行、美观、固定布局 */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav a.active {
    background: #3498db;
}

.nav a:hover {
    background: #3498db;
    opacity: 0.9;
}

/* 内容容器 */
.content {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
}

/* 横幅图片：修复显示不全 */
.learn-banner {
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.learn-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 学习卡片 */
.learn-card {
    background: #fff;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.learn-card h3 {
    color: #2980b9;
    margin-bottom: 15px;
    border-left: 5px solid #3498db;
    padding-left: 12px;
    font-size: 18px;
}

.learn-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 8px;
    margin: 14px 0;
}

.learn-card p,
.learn-card li {
    line-height: 1.8;
    margin: 10px 0;
    font-size: 15px;
}

.learn-card ul {
    padding-left: 22px;
}

/* 答题卡片 */
.exam-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exam-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 19px;
}

.question {
    margin: 20px 0;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.question h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

/* 答题点击范围优化 */
.option {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    width: 100%;
}

.option:hover {
    background: #f0f7ff;
}

.option input {
    margin-right: 10px;
    transform: scale(1.1);
}

/* 解析样式 */
.analysis {
    margin-top: 12px;
}

.analysis-content {
    padding: 14px;
    border-radius: 6px;
    margin-top: 10px;
}

.analysis-content.correct {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.analysis-content.wrong {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

.analysis-content span {
    display: inline-block;
    margin-right: 15px;
    font-size: 14px;
}

.analysis-content p {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* 提交按钮 */
#submitBtn {
    padding: 12px 35px;
    background: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    margin: 30px auto;
    font-size: 17px;
    transition: background 0.2s;
}

#submitBtn:hover {
    background: #27ae60;
}

/* 总分 */
.score-result {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    text-align: center;
    padding: 14px;
    background: #fef9e7;
    border-radius: 6px;
}

/* 电脑端专属优化 */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }

    .logo {
        font-size: 24px;
    }

    .nav a {
        font-size: 16px;
        padding: 9px 18px;
    }

    .learn-banner {
        height: 320px;
    }

    .learn-card {
        padding: 30px;
    }

    .learn-card h3 {
        font-size: 21px;
    }

    .exam-card {
        padding: 40px;
    }

    .question h4 {
        font-size: 18px;
    }

    .option {
        font-size: 16px;
    }
}

/* 手机端小屏优化 */
@media (max-width: 576px) {
    .header {
        padding: 12px 10px;
    }

    .logo {
        font-size: 16px;
    }

    .nav a {
        font-size: 13px;
        padding: 6px 8px;
    }

    .learn-banner {
        height: 160px;
    }
}