﻿/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color1: #F5883C;
    --primary-color2: #8882BE;
    --primary-color3: #2ecc71;
    --primary-color4: #e74c3c;
    --primary-color5: #f39c12;
    --primary-color6: #F5883C;
    --primary-dark1: #1abc9c;
    /* 辅助色 */
    --title-color: #0069A6;
    --secondary-light: #BED0E5;
    --accent-color: #6C9AC3;
}

article {
    border: none;
    background-color: gainsboro;
    margin: 0;
}

/* 定义页面容器样式 */
.page {
    margin: auto;
    margin-bottom: 1cm;
    width: 18.5cm;
    /*height: 26.5cm;*/
    min-height: 26cm;
    page-break-after: always;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    display: block;
    page-break-after: always;
    /* 确保内容不溢出 */
    overflow: hidden;
    padding: 2.6cm 2cm;
    z-index: 1;
}

/* 章节页样式 */
.page.chapter-page {
    background-color: var(--bg-color);
}

    .page.chapter-page::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 1.2cm;
        height: 100%;
        background-color: var(--stripe-color);
        z-index: 0;
    }

.chapter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    /* 前面缩进1cm */
    margin: 0 0 0.8cm 1cm;
}

.prefix {
    font-size: 24pt;
    font-family: SimSun, "宋体", serif;
}

.circle-number::before {
    content: attr(data-number);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    color: var(--number-color);
    font-size: 26pt;
    font-family: Arial, Helvetica, sans-serif;
}

.title {
    font-family: SimHei, "黑体", sans-serif;
    font-size: 36pt;
}

.page.chapter-page .chapter-content {
    margin-top: 0.8cm;
}

    .page.chapter-page .chapter-content p {
        color: white;
        font-size: 12pt;
        font-family: 'Times New Roman', 'Microsoft YaHei', serif;
        line-height:2
    }

.page.chapter-page img {
    width: 19cm;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
}
/*节首图*/
.page .section {
    width: 14.5cm;
    height: 8.5cm;
    position: relative;
    margin-top:-1.2cm
}

/* 图片容器 */
.page .section-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 14.5cm;
    height: 8cm;
    background-image: var(--image-url);
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

/* 蓝色圆圈 */
.page .section-circle {
    position: absolute;
    left: 50%;
    bottom: -0.7cm;
    transform: translateX(-50%);
    width: 1.9cm;
    height: 1.9cm;
    background-color: #0069A6;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

    /* 圆圈中的文字 */
    .page .section-circle .section-circle-text {
        color: white;
        font-family: SimSun, "宋体", serif;
        font-size: 13pt;
        line-height: 1;
    }

    /* 圆圈中的数字 */
    .page .section-circle .section-circle-number {
        color: white;
        font-family: 'Times New Roman';
        font-size: 25pt;
        line-height: 1;
        font-weight: normal;
    }

/* 左下角标签 */
.page .image-label {
    position: absolute;
    left: 0;
    bottom: 0;
    background-color: white;
    border-top-right-radius: 12px;
    padding: 0.1cm 0.3cm 0cm 0cm;
    z-index: 10;
}

    .page .image-label::before {
        content: attr(data-number);
        font-weight: normal;
        font-family: Arial,SimHei, "黑体";
        color: #3A7223;
        font-size: 10.5pt;
    }

    .page .image-label::after {
        content: attr(data-desc);
        color: #333;
        font-family: SimHei, "黑体", sans-serif;
        font-size: 10.5pt;
        margin-left: 0.2cm;
    }

/* 奇数页样式 - 右侧有竖条 */
.page[data-chapter="1"]::after {
    background-color: var(--primary-color1);
}

.page[data-chapter="2"]::after {
    background-color: var(--primary-color2);
}

.page[data-chapter="3"]::after {
    background-color: var(--primary-color3);
}

.page[data-chapter="4"]::after {
    background-color: var(--primary-color4);
}

.page[data-chapter="5"]::after {
    background-color: var(--primary-color5);
}

.page[data-chapter="6"]::after {
    background-color: var(--primary-color6);
}

.page.odd {
}

    .page.odd::after {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        width: 1.2cm;
        height: 100%;
    }

    .page.odd .main-content {
        width: 9cm;
    }

.page.even::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 1.2cm;
    height: 100%;
}

.page.even .main-content {
    width: 9cm;
    margin-left: auto;
}

/* 页码 */
.page-number {
    position: absolute;
    color: white;
    font-size: 10pt;
    font-family: 'Times New Roman', Times, serif;
    bottom: 2cm;
    z-index: 1000;
}

    .page-number::before {
        content: attr(data-page);
    }

 .page.odd .page-number {        
        left: 17.6cm;
    }

.page.chapter-page.odd .page-number {
    left: 17.6cm;
}

.page.chapter-page.even .page-number {
    right: 17.6cm;
}

 .page.even .page-number {
        right: 17.6cm; 
    }

/*竖排文本的页眉*/
.page .vertical-text-container {
    position: absolute;
    z-index: 1000;
}

    .page .vertical-text-container p {
        line-height: 0.5;
        color: white;
        font-family: SimSun, "宋体", serif;
        line-height: 1.2;
        letter-spacing: 0;
        font-size: 10.5pt;
        white-space: nowrap;
        text-align: center;
        text-indent: 0;
    }
    /*第5个p开始改变字体*/
        .page.odd .vertical-text-container p:nth-child(n+5) {
            font-family: STZhongsong, sans-serif;
        }

.page.even .vertical-text-container p:nth-child(n+5) {
    font-family: SimHei, "黑体", sans-serif;
}

    .page.odd .vertical-text-container {
        right: 0.5cm;
        top: 4cm;
    }

    .page.even .vertical-text-container {
        left: 0.5cm;
        top: 4cm;
    }

    /* 竖排文本数字带圆圈 */
    .page .vertical-text-container p.digit-with-circle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 0;
        color: var(--primary-color1);
        z-index: 1;
        width: 1.1em; /* 固定宽度确保一致性 */
    }

        .page .vertical-text-container p.digit-with-circle[data-chapter="2"] {
            color: var(--primary-color2);
        }

        .page .vertical-text-container p.digit-with-circle[data-chapter="3"] {
            color: var(--primary-color3);
        }

        .page .vertical-text-container p.digit-with-circle[data-chapter="4"] {
            color: var(--primary-color4);
        }

        .page .vertical-text-container p.digit-with-circle[data-chapter="5"] {
            color: var(--primary-color5);
        }

        .page .vertical-text-container p.digit-with-circle[data-chapter="6"] {
            color: var(--primary-color6);
        }


        .page .vertical-text-container .digit-with-circle::after {
            content: '';
            position: absolute;
            bottom: 1px; /* 调整到数字下方 */
            left: 50%;
            transform: translateX(-50%);
            width: 16px;
            height: 16px;
            background-color: white;
            border-radius: 50%;
            z-index: -1;
        }



/*自主活动*/
.huodong-wrap,.think-wrap {
    margin-top: 1.1cm;
    position: relative;
}

.huodong-title {
    background: url("/images/research/2024沪科版初中/自主活动.svg") no-repeat;
    background-size: 29mm auto;
    width: 29mm;
    height: 1cm;
    position: absolute;
    left: 2mm;
    top: -0.6cm
}

.think-title {
    background: url("/images/research/2024沪科版初中/想一想.svg") no-repeat;
    background-size: 25mm auto;
    width: 25mm;
    height: 1cm;
    position: absolute;
    left: 2mm;
    top: -0.6cm
}

.huodong,.think {
    border: 1px solid #B7CAA9;
    border-radius: 0px 8px 8px 8px;
    padding: 0.7cm 0.6cm 0.3cm 0.6cm;
    margin-bottom:0.8cm
}

/*实验*/
.experiment {
    background: url('/images/research/2024沪科版初中/学生实验.svg') center/contain no-repeat;
    background-size: 13.7cm auto;
    background-position:0.8cm 0.1cm;    
    padding-top:1.2cm
}

    .experiment .title {
        color: var(--title-color);
        font-size: 13pt;
        font-family: SimHei, "黑体", sans-serif;
        text-align: center;
    }

    .experiment .highlight {
        padding-top: 0.4cm;
    }

.experiment-bottom {
    height: 1.52cm;
    background: url('/images/research/2024沪科版初中/学生实验底部.svg') center/contain no-repeat;
    background-size: 100% auto;
    margin-top: -0.5cm;
    margin-bottom: 1cm;
}


/*练一练*/
.exer-wrap {
    margin-top: 1cm;
    position: relative;
}

.exer-title {
    background: url("/images/research/2024沪科版初中/练一练.svg") no-repeat;
    background-size: 17mm;
    width: 17mm;
    height: 5cm;
    position: absolute;
    left: 13mm;
    top: -4mm
}

.exer {
    border: 1px solid #B7CAA9;
    background-color: #E7F2DE;
    border-radius: 8px;
    padding: 1cm 0.7cm 0.7cm 0.7cm;
    margin-top: -0.5cm;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* 习题第一行间距变大 */
.page p.exer-p {
    margin-top: 0.3cm;
}

/*回顾与复习*/
.review {
    /* 可自定义的CSS变量 */
    --review-border-color: #FDD6B7;
    --review-bg-color: #FFF1DE;
    /* 基础样式 */
    border: 1px solid var(--review-border-color);
    background-color: var(--review-bg-color);
    border-radius: 15px;
    padding: 1cm 0.7cm 0.7cm 0.7cm;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    /* 背景图片和定位 */
    background-image: url("/images/research/2024沪科版初中/回顾与复习.png");
    background-repeat: no-repeat;
    background-position: center 0cm;
    background-size: 14.5cm auto;
    /* 相对定位用于伪元素 */
    position: relative;
    padding: 3cm 0.8cm 2cm 0.8cm; /* 增加顶部内边距给标题留空间 */
    min-height: 21cm
}

    /* 添加"回顾与复习"文字标题 */
    .review::before {
        content: "回顾与复习";
        position: absolute;
        top: 0.1cm;
        left: 50%;
        transform: translateX(-50%);
        font-size: 21pt;
        font-weight: bold;
        font-family: "黑体", sans-serif;
        white-space: nowrap;
        z-index: 1;
        color: white;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    }

    /* 在下方添加图片 */
    .review::after {
        content: "";
        position: absolute;
        top: 2cm;
        left: 50%;
        transform: translateX(-50%);
        width: 3cm;
        height: 0.7cm;
        background-image: url("/images/research/2024沪科版初中/本章小结.svg");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    .review p.title {
        font-size: 12pt;
        font-family: STZhongsong, sans-serif;
        color: #3A7223;
        margin-top: 0.5cm;
    }
    /*本章练习*/
    .exeres {
        /* 可自定义的CSS变量 */
        --review-border-color: #FDD6B7;
        --review-bg-color: #FFF1DE;
        /* 基础样式 */
        border: 1px solid var(--review-border-color);
        background-color: var(--review-bg-color);
        border-radius: 15px;
        padding: 1cm 0.7cm 0.7cm 0.7cm;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
        /* 背景图片和定位 */
        background-image: url("/images/research/2024沪科版初中/本章练习.svg");
        background-repeat: no-repeat;
        background-position: center 0.5cm;
        background-size: 3cm auto;
        padding: 1.8cm 0.8cm 0.4cm 0.8cm;
    }

/*图片*/
.page figure {
    text-align: center;
}

    .page figure img {
        border: none;
        box-shadow: none;
    }

.page figcaption,.page table caption {
    font-size: 10.5pt;
    font-weight: normal;
    font-family: Arial,SimHei, "黑体";
    text-align: center;
    color: #3A7223
}

    .page figcaption .text, .page table caption .text {
        color: black;
        font-family:'Times New Roman'
    }

    .page figcaption.label {
        color: black;
        font-size: 9pt;
        font-family: 'Times New Roman', SimSun, serif;
        line-height:2
    }

.page .highlight {
    font-family: SimHei, "黑体", sans-serif;
}

.page p {
    font-size: 12pt;
    font-family: Times New Roman, STSong, serif;
    text-indent: 2em;
    line-height: 1.7;
    text-align: justify;
    margin: 0;
    max-width: 100%;
    word-wrap: break-word;
}

.page h1 {
    background: none;
}

/* 跨学科 */
    .page h1.kua {
        background: none;
        font-size: 14pt;
        font-family: STZhongsong;
        color: #678F3B
    }

.page h2 {
    color: var(--title-color);
    font-size: 22pt;
    font-family: SimHei, "黑体", sans-serif;
    text-align: center;
    padding: 0;
    padding-bottom: 0.5cm;
    margin-top: 0.5cm;
    margin-left:0;
    border-bottom: 0.5px solid #6C9AC3;
    background: none;
    font-weight:bold
}

    .page h2.kua {
        font-size: 15pt;
        font-weight: 900;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom:0.5cm;
        text-align: left;
        text-indent: 2em
    }

.page h3 {
    color: var(--title-color);
    font-size: 14pt;
    font-family: SimHei, "黑体", sans-serif;
    position: relative;
    padding: 0.5cm 0 0.5cm 20px;
    margin: 0;
    margin-left: 2em;
    background: none;
    font-weight: bold
}

    .page h3.kua {
        font-size: 14pt;
        font-family: 'Times New Roman',STZhongsong;
        font-weight: normal;
        padding: 0.2cm 0 0.2cm 20px;
    }

    .page h3::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background-color: #BED0E5;
        border-radius: 50%;
    }

/* 表格 */
.page table {
    border-collapse: collapse; /* 重要：合并边框 */
    font-size: 10.5pt;
    text-align: center;
    vertical-align: middle;
}

.page table, th, td {
    border: 1px solid white;
}

    .page th {
        background-color: #6C9355;
        color: white;
        font-family: 'Times New Roman',SimHei, "黑体", sans-serif;
        font-weight: normal;
        padding: 1mm;
    }

.page td {
    font-family: 'Times New Roman',SimSun, "宋体", serif;
    padding: 1.5mm;
}

/* 奇数行 */
.page table.table-row tr:nth-child(odd) {
    background-color: #D3E8C1;
}
/* 偶数行 */
.page table.table-row tr:nth-child(even) {
    background-color: #FFE0B6;
}
/* 奇数列 */
.page table.table-column td:nth-child(odd) {
    background-color: #D3E8C1;
}
/* 偶数列 */
.page table.table-column td:nth-child(even) {
    background-color: #FFE0B6;
}



    
