/* ===== 全局样式重置 ===== */
html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-light, #f8f9fa);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 全局页脚样式 ===== */
.footer-fullwidth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-top: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.footer {
    --bulma-footer-background-color: transparent !important;
    background: transparent;
    color: white;
    border-radius: 0;
    box-shadow: none;
}

/* 注意：bulma.min.css 在 exineyi_com.css 之后加载，其 .footer 规则
   padding: 3rem 1.5rem 6rem（底部整整 6rem）与本文件特异性相同但位置更靠后，
   会盖掉这里的 padding —— 页脚底部那一大块空白就是这么来的。
   故用 .footer-fullwidth .footer 提高特异性，稳定覆盖，不受加载顺序影响。 */
.footer-fullwidth .footer {
    padding: 2rem 1.5rem;
}

.footer .content {
    margin-bottom: 0 !important;
}

.footer .title {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-links {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
    padding: 0 0.5rem;
}

.footer-links a:hover {
    color: #ffd700;
    text-decoration: underline;
}

.footer-links .separator {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0.25rem;
}

.footer .copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    margin-top: 0;
    font-size: 0.85rem;
    text-align: center;
}

.footer .copyright a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.footer .copyright a:hover {
    color: #ffd700;
}

.beian-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    line-height: 1;
}

.beian-link:hover {
    color: #ffd700;
}

.beian-link i,
.beian-link img {
    font-size: 0.9rem;
    width: auto;
    height: 0.9rem;
    vertical-align: middle;
}

.beian-link span {
    line-height: 1;
    vertical-align: middle;
}

.beian-separator {
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    margin: 0 0.25rem;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== 全局列表样式修复（覆盖 Bulma minireset） ==================== */
.math-content ol, .math-content ul,
.question-stem ol, .question-stem ul,
.info-content ol, .info-content ul,
.option-content ol, .option-content ul,
.option-text ol, .option-text ul,
.analysis-content ol, .analysis-content ul,
.rich-text ol, .rich-text ul {
    padding-left: 1.5em;
    margin-left: 0;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    list-style-position: outside;
}

/* 当 .content 与 math-content 同时存在时，提高特异性覆盖 Bulma 的 .content ol { margin-left: 2em } */
.content.math-content ol, .content.math-content ul,
.content.info-content ol, .content.info-content ul,
.content.option-content ol, .content.option-content ul {
    padding-left: 1.5em;
    margin-left: 0;
}

.math-content ul,
.question-stem ul,
.info-content ul,
.option-content ul,
.option-text ul,
.analysis-content ul,
.rich-text ul {
    list-style-type: disc;
}

.math-content ol,
.question-stem ol,
.info-content ol,
.option-content ol,
.option-text ol,
.analysis-content ol,
.rich-text ol {
    list-style-type: decimal;
}

/* ==================== text 类型代码块样式（CustomCodeBlock language=text） ==================== */
.plan-text-block {
    margin: 1rem 0;
}

.plan-text-block pre {
    background: #1a1a2e;
    color: #d6dbe8;
    padding: 1rem 1.25rem;
    margin: 0;
    border-radius: 0.5rem;
    border: 1px solid #2d2d3d;
    overflow-x: auto;
    white-space: pre;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.plan-text-block pre code {
    color: inherit;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
}

/* ===== 微信生态推广双卡（小程序 + 公众号，首页/在线题库/编程分享页面末尾） ===== */
.miniapp-qr-wrap {
    display: flex;
    gap: 1.5rem;
    max-width: 1180px;
    /* 上下外边距可用 --miniapp-qr-mt / --miniapp-qr-mb 局部覆盖：
       页面自带留白时防叠加（如首页上方「关于我们」自带 2rem 下内边距、
       关于页底部自带 padding-bottom）。默认 3rem 适合紧邻页脚的场景。 */
    margin: var(--miniapp-qr-mt, 3rem) auto var(--miniapp-qr-mb, 3rem);
    padding: 0 1.5rem;
    align-items: stretch;
    justify-content: center; /* 单卡时居中；双卡 flex:1 撑满不受影响 */
}
.miniapp-qr-banner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 720px;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #eef4ff 0%, #f3f9ff 100%);
    border: 1px solid #d5e3fb;
    border-radius: 16px;
}
.miniapp-qr-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}
.miniapp-qr-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #07c160;
    background: rgba(7, 193, 96, 0.1);
    border-radius: 999px;
    padding: 2px 10px;
}
.miniapp-qr-desc {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem !important;
    white-space: nowrap; /* 单行标语，避免折行 */
}
.miniapp-qr-points {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #7a8494;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: nowrap; /* 亮点文案短句，避免折行破坏行式排版 */
}
.miniapp-qr-points li::before {
    content: '\2713';
    color: #07c160;
    font-weight: 700;
    margin-right: 6px;
}
.miniapp-qr-code {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.miniapp-qr-code img {
    width: 132px;
    height: 132px;
    border-radius: 12px;
    border: 1px solid #e4eaf4;
    background: #fff;
    /* 后台可上传任意尺寸二维码，contain 保证非正方形图不被拉伸 */
    object-fit: contain;
}
.miniapp-qr-caption {
    font-size: 0.8rem;
    color: #7a8494;
}

/* 公众号卡：绿色调 + 官方「微信搜一搜」样式图 */
.miniapp-gzh-banner {
    background: linear-gradient(135deg, #f0fbf4 0%, #f5fdf8 100%);
    border-color: #c9ecd8;
}
.miniapp-gzh-badge {
    color: #07c160;
    background: rgba(7, 193, 96, 0.12);
}
.miniapp-gzh-code img {
    width: 210px;
    height: auto;
    border-radius: 10px;
    background: #fff; /* 白色版为透明底，垫白保证二维码与文字可读 */
    padding: 6px;
}
@media screen and (max-width: 900px) {
    .miniapp-qr-wrap { flex-direction: column; padding: 0; }
}
@media screen and (max-width: 600px) {
    .miniapp-qr-banner { flex-direction: column; text-align: center; gap: 1rem; }
    .miniapp-qr-title { justify-content: center; }
    .miniapp-qr-desc,
    .miniapp-qr-points { text-align: left; white-space: normal; } /* 窄屏放开折行 */
    .miniapp-gzh-code img { width: 100%; max-width: 320px; }
}

/* ==================== 独立图片块的显示 ==================== */

/* 独立的图片块（blocks/article_image_block.html，ArticleImageBlock 用）。
   Wagtail 默认模板写死了 fill-600x338，会裁成 16:9 且锁宽 600px；
   换成等比缩放的完整图之后，这里负责居中与窄屏兜底。
   富文本（richtext）里的图片不在此列，沿用 Wagtail 默认规则。 */
.article-image {
    margin: 1.5rem 0;
    text-align: center;
}

.article-image img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
