@charset "UTF-8";

:where(ol) {
    --indent1: 2.35em;
    --indent2: 1.95em;
    --counter1: -3.0em;
    --counter2: -2.6em;
}

/* 內文第一層縮排 */
ol.bodytext {
    list-style-type: none;
    counter-reset: section;
    margin-bottom: 1.2em;
    width: calc(100% - var(--indent1));
}

ol.bodytext>li {
    counter-increment: section;
    position: relative;
    left: var(--indent1);
}

ol.bodytext>li:before {
    content: "（" counter(section, cjk-ideographic) "）";
    position: absolute;
    left: var(--counter1);
}

/* 內文第二層縮排 */
ol.bodytext ol {
    list-style-type: none;
    counter-reset: section;
    width: calc(100% - var(--indent2));
}

ol.bodytext ol>li {
    counter-increment: section;
    position: relative;
    left: var(--indent2);
}

ol.bodytext ol>li:before {
    position: absolute;
    left: var(--counter2);
}

ol.upper-alpha>li:before {
    content: "（" counter(section, upper-alpha) "）";
}

ol.decimal>li:before {
    content: "（" counter(section, decimal) "）";
}

/* 修正頁碼縮排 */
ol.bodytext>span.page-number {
    transform: translateX(calc(var(--counter1) / -2));
}

ol.bodytext>li>span.page-number {
    transform: translateX(calc(var(--counter1) / 2));
}

ol.bodytext ol>span.page-number {
    transform: translateX(calc((var(--counter1) - var(--counter2)) / 2));
}

ol.bodytext ol>li>span.page-number {
    transform: translateX(calc(var(--counter2)));
}

/* 美姑娘遺留的文字 */
ol.bodytext>li.meadows:before {
    content: "." counter(section);
    display: inline-block;
    width: 3.6em;
    margin-left: -1.4em;
    text-align: right;
    direction: rtl;
}