/* 独立详情页样式；原站 rem 通过 --dr 换算，不改变现有根字号。 */
@font-face {
  font-family: kt;
  src: url("../resources/fonts/kt.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --dr: 1vh;
  --page-bg: #233f4b;
  --ink: #fff;
  --muted: #c5d3d8;
  --gold: #e6b868;
  --line: #e6b86859;
  --surface: #19333f;
  --card: #142e3bb3;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.detail-site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page-bg) url("../assets/bg_article-DEfOKN2S.png") left top / 100% auto no-repeat;
}
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: #b6975e40; touch-action: manipulation; }
a:hover { color: var(--gold); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
img, video { max-width: 100%; }
img { display: block; height: auto; }
figure, p { margin: 0; }
h1, h2, h3 { font-family: kt, "KaiTi", "STKaiti", serif; font-weight: 400; }
.skip-link { position: fixed; top: -8rem; left: 1rem; z-index: 100; padding: .7rem 1.2rem; background: var(--surface); color: white; }
.skip-link:focus { top: 1rem; color: white; }
/* 保留主导航，限定在 logo 右侧；导航过多时横向滚动而不覆盖正文。 */
.site-header { position: absolute; top: 0; left: 0; width: 100%; z-index: 10; }
.header-inner { margin: calc(3.6 * var(--dr)) calc(5 * var(--dr)) 0 calc(32 * var(--dr)); display: flex; align-items: flex-start; gap: 1.5rem; }
.brand { position: absolute; left: calc(7 * var(--dr)); top: calc(3.6 * var(--dr)); width: calc(21.6 * var(--dr)); height: calc(33.2 * var(--dr)); pointer-events: none; }
/* 33.2dr 是原背景容器高度，不是 logo 图像高度；空白容器不拦截点击。 */
.brand img { width: 100%; height: auto; pointer-events: auto; }
.brand span { font-family: kt, "KaiTi", serif; font-size: 1.45rem; pointer-events: auto; }
.site-nav { display: flex; flex: 1; min-width: 0; gap: 1.3rem; overflow-x: auto; padding: 5px; }
.site-nav a { flex-shrink: 0; white-space: nowrap; padding: .5rem .2rem; min-height: 44px; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-color: var(--gold); }
.home-link { flex-shrink: 0; padding: .65rem 0; min-height: 44px; font-size: .875rem; color: var(--gold); }
.home-link span { margin-left: .6rem; }
/* 180px 下限给极矮桌面保留导航空间；517px 高时仍采用原站 37.5vh。 */
.main-wrap { position: relative; width: min(1184px, calc(100% - 96px)); margin: max(180px, calc(37.5 * var(--dr))) auto 0; padding: 0 0 5rem; flex: 1; }
.breadcrumbs { position: absolute; bottom: calc(100% + 12px); left: 0; right: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .65rem; max-height: 64px; overflow-y: auto; color: var(--muted); font-size: .8125rem; }
.breadcrumbs a { text-decoration: underline; text-underline-offset: 4px; padding: .35rem 0; }
.breadcrumbs [aria-current] { min-width: 0; }
.page-heading { padding: 0 0 2.5rem; }
.eyebrow { font-size: .75rem; letter-spacing: .18em; color: var(--gold); }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: .12em; line-height: 1.35; margin: .55rem 0 .8rem; }
.page-heading > p:last-child { color: var(--muted); font-size: .9375rem; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; margin-bottom: 2rem; }
.filter-nav { display: flex; flex-wrap: wrap; gap: .55rem; }
.filter-nav a { min-width: 88px; min-height: 44px; text-align: center; padding: .55rem 1.35rem; border: 1px solid transparent; color: var(--muted); }
.filter-nav a:hover { border-color: var(--line); color: var(--gold); }
.filter-nav [aria-current="page"] { background: var(--surface); color: var(--gold); border-color: var(--gold); }
.result-count { color: var(--muted); font-size: .8125rem; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.news-card { min-width: 0; background: var(--card); transition: background-color 180ms ease; }
.news-card:hover { background: var(--surface); }
.news-card-link { height: 100%; display: flex; flex-direction: column; }
.news-card-link:hover { color: var(--ink); }
.card-cover { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--surface); }
.card-content { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; font-size: .75rem; color: var(--muted); }
.meta-line time { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.card-content .meta-line time { margin-left: auto; }
.category-tag { display: inline-block; border: 1px solid var(--line); color: var(--gold); padding: 0 .55rem; line-height: 1.9; }
.pinned { color: var(--gold); }
.news-card h2 { font-size: 1.25rem; line-height: 1.65; margin: 1rem 0 .6rem; }
.card-summary { font-size: .875rem; color: var(--muted); margin-bottom: 1.4rem; }
.read-more { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .8rem; color: var(--gold); font-size: .8125rem; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .65rem; padding-top: 2.6rem; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; padding: .5rem .9rem; min-width: 44px; min-height: 44px; border: 1px solid var(--line); font-size: .875rem; }
.pagination [aria-current="page"] { background: var(--surface); border-color: var(--gold); color: var(--gold); }
/* 阅读区通透，不再添加纸张背景、装饰边框和阴影。 */
.reading-sheet { max-width: 960px; margin: 0 auto; padding: 0; }
.article-heading { margin-bottom: max(24px, calc(5.3 * var(--dr))); }
.text-link { font-size: .875rem; color: var(--gold); display: inline-block; padding: .4rem 0; min-height: 44px; }
.article-heading h1 { font-size: clamp(1.65rem, 3.2vw, 2.65rem); line-height: 1.55; margin: 1.2rem 0; text-wrap: pretty; }
.article-heading .meta-line { font-family: kt, "KaiTi", "STKaiti", serif; color: var(--gold); font-size: max(14px, calc(1.8 * var(--dr))); }
.article-cover { margin: 0 0 2rem; }
.article-cover img { width: 100%; height: auto; }
.rich-content { font-size: 1rem; line-height: 2; color: var(--ink); overflow-wrap: anywhere; }
.rich-content p { margin: 0 0 1.15rem; }
.rich-content img { max-width: 100% !important; height: auto !important; margin: 1rem auto; }
.rich-content h1, .rich-content h2 { font-size: 1.5rem; line-height: 1.65; margin: 1.8rem 0 1rem; }
.rich-content h3, .rich-content h4 { font-size: 1.2rem; margin: 1.5rem 0 .8rem; }
.rich-content a { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.rich-content ul, .rich-content ol { padding-left: 1.5rem; }
.rich-content blockquote { margin: 1.4rem 0; padding: .5rem 1rem; border-left: 3px solid var(--line); background: var(--card); }
.rich-content pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; background: var(--card); }
.rich-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.rich-content td, .rich-content th { border: 1px solid var(--line); padding: .5rem; }
.rich-content summary { cursor: pointer; padding: .6rem 0; }
.rich-content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.detail-article .main-wrap { width: min(calc(100 * var(--dr)), calc(100% - 64px)); }
.detail-article .reading-sheet, .detail-article .article-neighbors { max-width: none; }
.detail-article .article-heading h1 { font-size: max(24px, calc(4.8 * var(--dr))); line-height: max(34.49px, calc(6.9 * var(--dr))); margin: calc(1.2 * var(--dr)) 0; }
.detail-article .article-heading .meta-line { gap: calc(2.2 * var(--dr)); line-height: max(24px, calc(3.2 * var(--dr))); }
.detail-article .article-heading .category-tag { min-width: calc(8.2 * var(--dr)); border-color: var(--gold); border-radius: calc(.4 * var(--dr)); text-align: center; line-height: max(22px, calc(2.3 * var(--dr))); }
/* 原 1.6vh/3.6vh 在低矮视口过小，保留正文 14px/28px 可读性下限。 */
.detail-article .rich-content { font-size: max(14px, calc(1.6 * var(--dr))); line-height: max(28px, calc(3.6 * var(--dr))); }
.detail-article .rich-content p { color: var(--ink); }
.article-neighbors { max-width: 960px; margin: 2rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.article-neighbors > * { padding: 1.25rem 0; border-top: 1px solid var(--line); min-width: 0; }
.article-neighbors span { display: block; font-size: .75rem; color: var(--gold); margin-bottom: .5rem; }
.article-neighbors strong { font-weight: 400; font-size: .9375rem; }
.neighbor-empty { color: var(--muted); }
.legal-sheet .article-heading h1 { margin-top: .6rem; }
.page-return { text-align: center; margin-top: 2rem; }
.button-link { display: inline-block; padding: .65rem 1.3rem; min-height: 44px; border: 1px solid var(--line); color: var(--gold); }
.button-link:hover { background: var(--surface); }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem 2rem; }
.resource-card { min-width: 0; background: var(--card); }
.resource-media { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--surface); }
video.resource-media { background: #172426; }
.image-preview { position: relative; display: block; cursor: zoom-in; }
.image-preview:focus-visible { outline-offset: 3px; }
.preview-label { position: absolute; right: .8rem; bottom: .8rem; color: white; background: #142e3be8; padding: .4rem .8rem; font-size: .75rem; }
.preview-label span { padding-left: .6rem; }
.resource-info { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.2rem 1.4rem; }
.resource-info h2 { margin: .2rem 0 0; font-size: 1.2rem; }
.resource-actions { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8125rem; color: var(--gold); }
.resource-actions a { padding: .65rem 0; text-decoration: underline; text-underline-offset: 5px; min-height: 44px; }
.media-unavailable { display: grid; place-items: center; min-height: 180px; padding: 2rem; color: var(--muted); background: var(--surface); }
.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.empty-state p { color: var(--muted); margin: .8rem 0 1.6rem; }
.empty-state .button-link { margin: .4rem; }
.site-footer { background: #1b3541; }
.footer-inner { max-width: 1184px; margin: auto; display: flex; align-items: center; gap: 2rem; padding: 2.4rem 0; }
.footer-logo { width: 140px; max-height: 80px; object-fit: contain; }
.footer-copy { min-width: 0; font-size: .75rem; color: var(--muted); }
.footer-copy p { margin-top: .5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.media-dialog { width: min(1120px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.media-dialog:not([open]) { display: none; }
.media-dialog::backdrop { background: #142021d9; }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-toolbar p { font-family: kt, "KaiTi", serif; font-size: 1.2rem; }
.dialog-close { flex-shrink: 0; background: transparent; color: var(--ink); border: 1px solid var(--line); min-height: 44px; padding: .5rem 1rem; }
.dialog-close:hover { background: var(--card); }
.dialog-close span { margin-left: .6rem; }
.lightbox-image { max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); width: 100%; object-fit: contain; margin: auto; }
.dialog-hint { font-size: .75rem; margin-top: .75rem; text-align: center; color: var(--muted); }
body.has-lightbox { overflow: hidden; }
@media (max-width: 1100px) {
  .site-nav { gap: 1rem; }
  .main-wrap { width: calc(100% - 64px); }
  .footer-inner { padding-inline: 2rem; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}
@media (max-width: 768px) {
  :root { --dr: 10px; }
  .detail-site { background-image: url("../assets/bg_article_mobile-CpVp7MER.png"); }
  .header-inner { margin: 0; padding: 20px 18px 0 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 16px; }
  .brand { position: static; width: 126px; max-width: 100%; height: auto; }
  .home-link { justify-self: end; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; width: 100%; gap: 1.2rem; font-size: .875rem; }
  .main-wrap, .detail-article .main-wrap { width: 100%; margin-top: calc(23.5 * var(--dr)); padding: 0 calc(1.8 * var(--dr)) 3rem calc(1.6 * var(--dr)); }
  .breadcrumbs { left: calc(1.6 * var(--dr)); right: calc(1.8 * var(--dr)); }
  .page-heading { padding-bottom: 1.8rem; }
  .list-toolbar { align-items: flex-start; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; }
  .filter-nav { gap: .4rem; }
  .filter-nav a { min-width: 78px; padding-inline: 1.1rem; }
  .news-grid, .resource-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .card-content { padding: 1.2rem; }
  .news-card h2 { font-size: 1.2rem; }
  .article-heading { margin-bottom: calc(3.3 * var(--dr)); }
  .article-heading h1 { font-size: 1.65rem; }
  .detail-article .article-heading h1 { font-size: calc(2.4 * var(--dr)); line-height: calc(3.449 * var(--dr)); margin: 0 0 calc(.6 * var(--dr)); }
  .detail-article .article-heading .meta-line { gap: calc(.8 * var(--dr)); font-size: 14px; line-height: 24px; }
  .detail-article .article-heading .category-tag { min-width: calc(5 * var(--dr)); line-height: 22px; }
  /* 原站手机正文为 12px/24px，此处仅将字号提高到 14px。 */
  .detail-article .rich-content { font-size: max(14px, calc(1.2 * var(--dr))); line-height: calc(2.4 * var(--dr)); }
  .article-neighbors { grid-template-columns: minmax(0, 1fr); gap: .5rem; margin-top: 1.2rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 1.8rem 1.25rem; }
  .footer-logo { width: 120px; max-height: 66px; }
  .media-dialog { padding: .75rem; }
  .resource-info { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { color-scheme: light; --ink: #000; --muted: #333; --gold: #654818; --line: #999; --card: transparent; --surface: white; }
  .site-header, .site-footer, .breadcrumbs, .article-neighbors, .page-return, .text-link, .skip-link { display: none; }
  .detail-site { background: white; }
  .main-wrap, .detail-article .main-wrap { width: 100%; margin: 0; padding: 0; }
}
