Files
wpep/templates/mobile_template/style.html
T
2026-11-12 11:13:28 +08:00

315 lines
6.5 KiB
HTML

<style>
/*防止文档流被切断导致上下文割裂*/
h1,
h2,
h2,
h3,
h4,
h5,
h6,
.c_title,
index h1,
.global img,
blockquote {
break-inside: avoid;
break-after: avoid;
orphans: 2;
widows: 2;
}
.global h1 {
line-height: 1.5;
}
.global h2 {
line-height: 1.25;
}
.global h3,
.global h4,
.global h5,
.global h6 {
line-height: 1.4;
}
/* 优化段落分页 */
.global p {
orphans: 2;
widows: 2;
line-height: 2.5rem;
}
/*基础格式部分*/
.global {
font-family: "FangZhengFangSong", sans-serif;
font-size: var(--font-size);
margin: 2rem 2rem 2rem 2rem;
/* letter-spacing: -0.15rem; */
}
/* Use padding instead of adjacent margins so the article separators remain
visible when Chromium fragments the document for printing. */
.passages {
margin: 0 2rem;
padding: 0 0 2.5rem;
break-inside: auto;
page-break-inside: auto;
}
/* Keep the column title with its first article, but start later articles
on a fresh page while allowing each article body to fragment naturally. */
.passages:not(.first-passage) {
break-before: page;
page-break-before: always;
}
.passages.first-passage > :first-child {
margin-block-start: 1.5rem;
}
.global h1 {
line-height: 4rem;
font-family: "HongLei", sans-serif;
}
/* Keep only the title line box atomic. The opening paragraph remains
fragmentable so a large block cannot create blank pages. */
.passages > h1:first-child {
display: table;
width: 100%;
break-inside: avoid;
page-break-inside: avoid;
}
html, body {
margin: 0;
padding: 0;
--font-size: 2rem;
}
/*控件美化部分*/
.index-column page_title {
font-size: calc(var(--font-size) + 0.5rem);
font-weight: bold;
color: red;
}
.c_title {
font-size: 3.5rem;
color: white;
background-color: red;
border: 0.18rem solid red;
display: block;
break-before: page;
page-break-before: always;
width: fit-content;
line-height: 1.5;
padding: 0.08em 0.24em;
white-space: normal;
word-break: break-all;
font-family: "ZCOOL QingKe HuangYou", sans-serif;
margin: 0 1rem 1.5rem 2rem;
border-radius: 0.5rem;
overflow-wrap: break-word;
max-width: 21cm;
}
blockquote {
background-color: #f0f0f0;
border-left: 0.5rem solid #ccc;
padding: 0.5rem 1rem;
margin: 1rem 0;
color: #666;
break-inside: auto;
page-break-inside: auto;
break-after: auto;
page-break-after: auto;
}
/* Material You-inspired table surfaces for Markdown-generated tables. */
.global table {
width: 100%;
margin: 1.5rem 0 2rem;
border: 1px solid #c4c7c5;
border-radius: 0.75rem;
border-spacing: 0;
border-collapse: separate;
background-color: #fdfbff;
color: #1a1b1f;
overflow: hidden;
break-inside: auto;
page-break-inside: auto;
line-height: 1.5;
}
.global table caption {
margin-bottom: 0.75rem;
color: #454746;
font-size: 0.9em;
font-weight: 600;
text-align: left;
}
.global table thead {
display: table-header-group;
background-color: #dcefeb;
color: #00201f;
}
.global table th,
.global table td {
padding: 0.75rem 1rem;
border-right: 1px solid #c4c7c5;
border-bottom: 1px solid #c4c7c5;
text-align: left;
vertical-align: top;
overflow-wrap: anywhere;
}
.global table th {
color: #00504f;
font-weight: 700;
}
.global table tbody tr:nth-child(even) {
background-color: #f3f5f3;
}
.global table tbody tr {
break-inside: avoid;
page-break-inside: avoid;
}
.global table tr > :last-child {
border-right: 0;
}
.global table tbody tr:last-child td {
border-bottom: 0;
}
.global table thead tr:first-child th:first-child {
border-top-left-radius: 0.75rem;
}
.global table thead tr:first-child th:last-child {
border-top-right-radius: 0.75rem;
}
.global table tbody tr:last-child td:first-child {
border-bottom-left-radius: 0.75rem;
}
.global table tbody tr:last-child td:last-child {
border-bottom-right-radius: 0.75rem;
}
.global img {
max-width: 100%;
height: auto;
max-height: 33vh;
object-fit: contain;
padding: 5px;
border: 1px solid #c9d9d5;
border-radius: 10px;
background: #fff;
box-shadow: 0 2px 8px rgba(24, 50, 46, 0.14);
display: block;
margin: 1rem auto;
/* color: transparent; */
overflow: hidden;
}
.global a[href] {
color: rgb(0, 180, 120);
text-decoration: none;
}
/*目录美化部分*/
index h1 {
font-size: 3.5rem;
color: white;
background-color: red;
border: 0.18rem solid red;
display: inline-flex;
width: fit-content;
line-height: 1.5;
padding: 0.08em 0.24em;
white-space: normal;
word-break: break-all;
font-family: "FangZhengFangSong", sans-serif;
margin: 2rem 1rem 0rem 2rem;
border-radius: 0.5rem;
overflow-wrap: break-word;
max-width: 21cm;
}
index a {
text-decoration: none;
font-size: var(--font-size);
display: flex;
font-family: "FangZhengFangSong", sans-serif;
width: 100%;
justify-content: space-between;
align-items: flex-start;
gap: 0.75rem;
}
index ul {
margin: 1rem 2rem 3rem 2rem;
/* padding: 0.5rem 1rem; */
}
index li {
list-style: none;
display: flex;
width: 100%;
justify-content: space-between;
align-items: flex-start;
word-break: break-all;
word-wrap: normal;
line-height: 1.5;
margin-top: 0.5rem;
break-inside: avoid;
page-break-inside: avoid;
}
index li page_title {
color: black;
font-size: var(--font-size);
font-weight: thin;
position: static;
flex: 1 1 auto;
min-width: 0;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
line-height: 1.5;
display: inline-block;
}
index li page_column {
color: #b30000;
font-size: calc(var(--font-size) - 0.4rem);
font-weight: bold;
position: static;
flex: 0 0 auto;
min-width: 8ch;
white-space: nowrap;
}
index li page_num {
color: black;
font-size: var(--font-size);
position: static;
flex: 0 0 auto;
min-width: 4ch;
margin-left: 1rem;
white-space: nowrap;
text-align: right;
font-variant-numeric: tabular-nums;
font-feature-settings: "tnum" 1;
}
index li a {
break-inside: avoid;
page-break-inside: avoid;
line-height: 1.5;
}
</style>