/* 数学文章样式 - 模仿 Maki 数学讲义风格 */

/* 文章容器 */
.math-article {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Noto Serif SC', 'Source Han Serif SC', serif;
    line-height: 1.8;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #3eaf7c;
}

.article-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.article-meta span {
    margin-right: 1rem;
}

/* 数学盒子通用样式 */
.math-box {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border-left: 4px solid;
    background: #fafafa;
}

.math-box-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.math-box-title::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.math-box-number {
    font-weight: 600;
    margin-left: 0.25rem;
}

/* 定义盒子 - 蓝色 */
.math-definition {
    border-color: #3498db;
    background: linear-gradient(to right, #ebf5fb 0%, #fafafa 100%);
}

.math-definition .math-box-title {
    color: #2980b9;
}

.math-definition .math-box-title::before {
    background: #3498db;
}

/* 定理盒子 - 绿色 */
.math-theorem {
    border-color: #27ae60;
    background: linear-gradient(to right, #eafaf1 0%, #fafafa 100%);
}

.math-theorem .math-box-title {
    color: #1e8449;
}

.math-theorem .math-box-title::before {
    background: #27ae60;
}

/* 引理盒子 - 青色 */
.math-lemma {
    border-color: #17a2b8;
    background: linear-gradient(to right, #e8f4f8 0%, #fafafa 100%);
}

.math-lemma .math-box-title {
    color: #138496;
}

.math-lemma .math-box-title::before {
    background: #17a2b8;
}

/* 推论盒子 - 浅绿 */
.math-corollary {
    border-color: #58d68d;
    background: linear-gradient(to right, #f0faf4 0%, #fafafa 100%);
}

.math-corollary .math-box-title {
    color: #28b463;
}

.math-corollary .math-box-title::before {
    background: #58d68d;
}

/* 例题盒子 - 橙色 */
.math-example {
    border-color: #e67e22;
    background: linear-gradient(to right, #fef5e7 0%, #fafafa 100%);
}

.math-example .math-box-title {
    color: #d35400;
}

.math-example .math-box-title::before {
    background: #e67e22;
}

/* 真题盒子 - 红色 */
.math-exam {
    border-color: #e74c3c;
    background: linear-gradient(to right, #fdedec 0%, #fafafa 100%);
}

.math-exam .math-box-title {
    color: #c0392b;
}

.math-exam .math-box-title::before {
    background: #e74c3c;
}

/* 性质盒子 - 紫色 */
.math-property {
    border-color: #9b59b6;
    background: linear-gradient(to right, #f4ecf7 0%, #fafafa 100%);
}

.math-property .math-box-title {
    color: #7d3c98;
}

.math-property .math-box-title::before {
    background: #9b59b6;
}

/* 公理盒子 - 深蓝 */
.math-axiom {
    border-color: #2c3e50;
    background: linear-gradient(to right, #ebedef 0%, #fafafa 100%);
}

.math-axiom .math-box-title {
    color: #1a252f;
}

.math-axiom .math-box-title::before {
    background: #2c3e50;
}

/* 注释盒子 - 灰色 */
.math-note {
    border-color: #7f8c8d;
    background: linear-gradient(to right, #f8f9f9 0%, #fafafa 100%);
}

.math-note .math-box-title {
    color: #566573;
}

.math-note .math-box-title::before {
    background: #7f8c8d;
}

/* 证明环境 */
.math-proof {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid #bdc3c7;
    background: #fcfcfc;
}

.math-proof-title {
    font-weight: 700;
    color: #5d6d7e;
    margin-bottom: 0.75rem;
}

.math-proof-end {
    text-align: right;
    margin-top: 1rem;
}

.math-proof-end::after {
    content: '□';
    font-size: 1.2rem;
    color: #5d6d7e;
}

/* 解答环境 */
.math-solution {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid #aab7b8;
    background: #fefefe;
}

.math-solution-title {
    font-weight: 700;
    color: #566573;
    margin-bottom: 0.75rem;
}

/* 练习盒子 - 黄色 */
.math-exercise {
    border-color: #f1c40f;
    background: linear-gradient(to right, #fef9e7 0%, #fafafa 100%);
}

.math-exercise .math-box-title {
    color: #b7950b;
}

.math-exercise .math-box-title::before {
    background: #f1c40f;
}

/* 填空题 */
.math-fillblank {
    border-bottom: 2px solid #bdc3c7;
    padding: 0.5rem 0;
    margin: 0.75rem 0;
}

.math-fillblank-line {
    display: inline-block;
    width: 150px;
    border-bottom: 1.5px solid #3498db;
    margin: 0 0.25rem;
}

/* 选择题 */
.math-choice {
    margin: 1rem 0;
}

.math-choice-item {
    display: flex;
    align-items: flex-start;
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.math-choice-item:hover {
    background: #f5f5f5;
}

.math-choice-label {
    font-weight: 600;
    color: #3498db;
    min-width: 2rem;
}

.math-choice-content {
    flex: 1;
}

/* 公式块增强 */
.article-body .MathJax {
    font-size: 1.1em !important;
}

/* 章节标题 */
.math-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.math-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* 暗色模式适配 */
[data-theme="dark"] .math-box,
[data-theme="dark"] .math-proof,
[data-theme="dark"] .math-solution {
    background: #1e293b;
}

[data-theme="dark"] .math-definition {
    background: linear-gradient(to right, #1e3a5f 0%, #1e293b 100%);
}

[data-theme="dark"] .math-theorem {
    background: linear-gradient(to right, #1e4430 0%, #1e293b 100%);
}

[data-theme="dark"] .math-example {
    background: linear-gradient(to right, #3d2f1a 0%, #1e293b 100%);
}

[data-theme="dark"] .math-exam {
    background: linear-gradient(to right, #3d1a1a 0%, #1e293b 100%);
}

[data-theme="dark"] .page-title {
    color: #e2e8f0;
    border-bottom-color: #4ade80;
}

[data-theme="dark"] .math-box-title {
    color: inherit;
}
