/* 卫书 · 在 /assets/ul.css 之上加的样式（由 tools/build_weishu.py 复制到 site/weishu/weishu.css）
   2026-10-15 改版：颜色全用配色变量；卷页一栏 760 宽，保留古籍味道（段首空两格、小节标题居中两边短线）。 */

/* 卷页、对照表、时间轴的文章头 */
.ws .ws-head { max-width: 760px; margin: 0 auto; }
.ws .ws-head.wide { max-width: none; }
.ws .ws-title { font-weight: 400; letter-spacing: .06em; }
.ws .art-head.ws-head { padding-top: 56px; }
.ws .art-head .kicker:hover { color: var(--red); }
.ws .art-head .lede { margin-bottom: 18px; }
.ws-note { display: block; margin: 6px 0 0; padding-top: 8px; border-top: 1px dashed var(--hair); font: 12px/1.7 var(--sans); color: var(--muted); }
.ws .art-head .ws-note { margin-top: 14px; font-size: 13px; }

/* 目录页 */
.ws .page-head .ws-title { font-size: 64px; letter-spacing: .16em; }
.ws-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 32px; border-bottom: 1px solid var(--rule); }
.ws-sec { margin-top: 48px; scroll-margin-top: 24px; }
.ws-sec .sec-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--rule); }
.ws-sec h2 { font-size: 26px; font-weight: 400; letter-spacing: .2em; }
.ws-sec .sec-head span { font: 12px var(--sans); color: var(--muted); }
.ws-sec .sec-note { margin: 14px 0 0; font-size: 16px; line-height: 1.9; color: var(--soft); max-width: 760px; }
.juan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
.juan-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 0 18px; border-bottom: 1px solid var(--hair); }
.juan-card .l { font: 12px var(--sans); letter-spacing: .14em; color: var(--red); }
.juan-card b { font-weight: 400; font-size: 21px; line-height: 1.45; }
.juan-card .s { font-size: 14px; line-height: 1.7; color: var(--muted); }
.juan-card:hover b { color: var(--red); }
.juan-card.big { padding: 26px 28px; gap: 8px; border-bottom: 0; }
.juan-card.big + .juan-card.big { border-left: 1px solid var(--hair); }
.juan-card.big b { font-size: 32px; letter-spacing: .04em; }
.juan-card.big .l { font-weight: 600; }
.juan-card.big .s { font: 14px/1.7 var(--sans); }
.juan-card.dark { background: var(--block); color: var(--block-ink); }
.juan-card.dark .l, .juan-card.dark .s { color: var(--block-kick); }
.juan-card.dark:hover b { color: var(--block-ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.juan-card.big.dark + .juan-card.big { border-left: 0; }
[data-p="dark"] .juan-card.dark { box-shadow: inset 0 0 0 1px var(--hair); }

/* 本卷各节 */
.juan-toc { max-width: 760px; margin: 0 auto 28px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.juan-toc summary { cursor: pointer; padding: 12px 0; font: 600 13px var(--sans); letter-spacing: .08em; color: var(--muted); }
.juan-toc ol { margin: 0; padding: 0 0 16px; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.juan-toc li a { display: inline-block; padding: 3px 12px; box-shadow: inset 0 0 0 1px var(--hair); font-size: 15px; }
.juan-toc li a:hover { box-shadow: inset 0 0 0 1px var(--red); }

/* 卷页正文：古籍味道。ul.css 的首字下沉、末尾小方块在这里不要 */
article.juan { display: block; max-width: 760px; margin: 0 auto; font-size: 19px; line-height: 2.05; }
article.juan > p:first-of-type::first-letter { float: none; font-size: inherit; line-height: inherit; font-weight: inherit; margin: 0; color: inherit; }
article.juan > p:last-child::after, article.juan > :last-child.pull::after { content: none; }
article.juan p { text-indent: 2em; text-align: justify; margin: 0 0 .9em; }
article.juan h2 { display: block; margin: 1.8em 0 .9em; font-weight: 400; font-size: 25px; letter-spacing: .14em; color: var(--red); text-align: center; }
article.juan h2::before, article.juan h2::after { content: ""; display: inline-block; width: 36px; height: 1px; background: currentColor; vertical-align: middle; margin: 0 .9em; opacity: .5; }
article.juan > h2:first-child, article.juan > :first-child h2 { margin-top: 0; }
article.juan h3 { margin: 1.5em 0 .6em; font-weight: 400; font-size: 21px; letter-spacing: .08em; border-left: 3px solid var(--red); padding-left: 12px; scroll-margin-top: 24px; }
article.juan ul, article.juan ol { margin: 0 0 1em; padding-left: 1.6em; }
article.juan section.lun { margin: 1.8em 0 .8em; padding: 26px 32px 14px; background: var(--tint); }
article.juan section.lun h2, article.juan section.lun h3 { margin: 0 0 .6em; border: 0; padding: 0; text-align: left; font-size: 20px; color: var(--red); }
article.juan section.lun h2::before, article.juan section.lun h2::after { content: none; }
article.juan section.lun p { color: var(--soft); }

/* 表格 */
.tbl { overflow-x: auto; margin: .4em 0 1.4em; border-top: 1.5px solid var(--rule); border-bottom: 1px solid var(--rule); -webkit-overflow-scrolling: touch; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.7; }
.tbl th { background: var(--paper); font-weight: 400; color: var(--muted); font-family: var(--sans); font-size: 13px; text-align: left; white-space: nowrap; padding: 9px 12px; position: sticky; top: 0; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 8px 12px; border-top: 1px solid var(--hair); vertical-align: top; }
.tbl td + td, .tbl th + th { border-left: 1px solid var(--hair); }
.tbl tbody tr:nth-child(even) td { background: var(--tint); }
.tbl td a { color: var(--red); }
article.juan .tbl p { text-indent: 0; }

/* 对照表页 */
article.nb { max-width: none; font-size: 17px; }
article.nb p { text-indent: 0; }
article.nb h2 { text-align: left; scroll-margin-top: 80px; }
article.nb h2::before, article.nb h2::after { content: none; }
article.nb .tbl table { min-width: 900px; }
article.nb td:nth-child(1), article.nb td:nth-child(2) { white-space: nowrap; }
.nb-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 12px 0; margin-bottom: 28px; background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.nb-tools .jump { display: flex; gap: 6px; flex-wrap: wrap; }
.nb-tools .jump a { padding: 3px 12px; box-shadow: inset 0 0 0 1px var(--hair); font-size: 15px; }
.nb-tools .jump a:hover { box-shadow: inset 0 0 0 1px var(--red); }
.nb-tools .find { display: flex; align-items: center; gap: 10px; font: 600 13px var(--sans); color: var(--muted); }
.nb-tools input { font: 15px var(--sans); color: var(--ink); padding: 7px 10px; border: 0; border-bottom: 1px solid var(--hair); width: 240px; max-width: 100%; background: var(--tint); border-radius: 0; outline: none; }
.nb-tools input:focus { border-bottom-color: var(--red); }

/* 翻卷 */
.juan-nav { max-width: 760px; margin: 56px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.juan-nav > * { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 16px 0; font-size: 18px; }
.juan-nav a small { font: 12px var(--sans); letter-spacing: .1em; color: var(--muted); }
.juan-nav .next { text-align: right; align-items: flex-end; }
.juan-nav .home { padding: 16px 28px; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); font: 600 13px var(--sans); letter-spacing: .1em; align-items: center; }
.sz ~ .juan-nav, article.nb ~ .juan-nav { max-width: none; }

@media (max-width: 980px) {
  .juan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ws .page-head .ws-title { font-size: 44px; }
  .ws-start { grid-template-columns: minmax(0, 1fr); }
  .juan-card.big { padding: 20px 18px; }
  .juan-card.big + .juan-card.big { border-left: 0; border-top: 1px solid var(--hair); }
  .juan-card.big b { font-size: 26px; }
  .juan-grid { grid-template-columns: minmax(0, 1fr); }
  .juan-card b { font-size: 19px; }
  .ws .art-head.ws-head { padding-top: 32px; }
  article.juan { font-size: 18px; line-height: 2; }
  article.juan h2 { font-size: 21px; }
  article.juan h2::before, article.juan h2::after { width: 20px; margin: 0 .5em; }
  article.juan section.lun { padding: 20px 18px 10px; }
  .tbl table { font-size: 14px; }
  .nb-tools { position: static; }
  .nb-tools .find { width: 100%; }
  .nb-tools input { flex: 1; width: auto; }
  .juan-nav { grid-template-columns: 1fr 1fr; }
  .juan-nav .home { grid-column: 1 / -1; grid-row: 2; border: 0; border-top: 1px solid var(--hair); padding: 12px 0; }
  .juan-nav > * { font-size: 16px; }
}
