:root {
  --brand: #b40000;
  --brand-dark: #8e0000;
  --ink: #2d2d2d;
  --muted: #777;
  --line: #e4e4e4;
  --surface: #fff;
  --soft: #f5f5f5;
  --page: #f1f1f1;
  --content-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button, input { font: inherit; }

.container { width: min(calc(100% - 32px), var(--content-width)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 8px 14px; color: #fff; background: #111; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { background: #fff url("../images/header-bg.jpg") repeat-x top; border-bottom: 1px solid #dedede; }
.header-top { height: 30px; color: #888; font-size: 13px; }
.top-inner { display: flex; justify-content: flex-end; align-items: center; height: 100%; gap: 24px; }
.top-inner > span { margin-right: auto; color: #999; }
.top-inner nav { display: flex; align-items: center; gap: 12px; }
.top-inner a { display: inline-flex; align-items: center; gap: 5px; }

.brand-row { background: #fff; }
.brand-inner { display: flex; min-height: 82px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; object-fit: contain; }

.nav-bar { background: var(--brand) url("../images/menu-bg.jpg") repeat-x; border-top: 1px solid #c90000; box-shadow: 0 2px 4px rgb(0 0 0 / 10%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 46px; }
.primary-nav { display: flex; align-self: stretch; }
.primary-nav a { display: flex; align-items: center; padding: 0 19px; color: #fff; font-weight: 700; text-shadow: 0 1px 0 rgb(0 0 0 / 25%); }
.primary-nav a:hover, .primary-nav a.active { color: #fff; background: rgb(0 0 0 / 18%); }

.site-search { display: flex; flex: 0 1 250px; height: 32px; }
.site-search input { min-width: 0; width: 100%; padding: 5px 10px; border: 2px solid #890000; border-right: 0; outline: 0; }
.site-search input:focus { box-shadow: inset 0 0 0 2px rgb(180 0 0 / 15%); }
.site-search button { width: 44px; border: 0; color: #333; background: #f2f2f2; cursor: pointer; font-size: 22px; line-height: 1; }
.menu-toggle { display: none; width: 42px; height: 38px; padding: 8px; border: 0; background: transparent; }
.menu-toggle span:not(.sr-only) { display: block; height: 2px; margin: 5px 0; background: var(--brand); }

.page-shell { padding-block: 24px 48px; }
.breadcrumbs { margin-bottom: 14px; color: #777; font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { margin-left: 7px; content: "/"; color: #bbb; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 312px; align-items: start; gap: 28px; }
.article-card { min-width: 0; padding: 34px 38px; background: var(--surface); border: 1px solid #ddd; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); }
.article-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article-category { display: inline-block; margin-bottom: 10px; padding: 3px 10px; color: #fff; background: var(--brand); font-size: 13px; }
.article-header h1 { margin: 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(28px, 4vw, 40px); font-weight: 500; line-height: 1.3; letter-spacing: -.02em; }
.dek { margin: 15px 0 12px; color: #666; font-size: 17px; line-height: 1.7; }
.article-meta { display: flex; flex-wrap: wrap; gap: 5px 20px; color: #999; font-size: 13px; }

.answer-summary { margin: 28px 0; padding: 20px 24px; border-left: 4px solid var(--brand); background: #faf5f5; }
.answer-summary h2 { margin: 0 0 8px; color: var(--brand-dark); font-size: 18px; }
.answer-summary p { margin: 0; }
.answer-summary ul { margin: 10px 0 0; padding-left: 20px; }

.article-body { color: #3b3b3b; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 17px; line-height: 1.95; }
.article-body p { margin: 0 0 1.25em; }
.article-body h2 { position: relative; margin: 2.2em 0 .8em; padding-left: 15px; color: #292929; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 24px; line-height: 1.45; }
.article-body h2::before { position: absolute; top: .25em; bottom: .25em; left: 0; width: 4px; background: var(--brand); content: ""; }
.article-body figure { margin: 28px 0; }
.article-body figure img { display: block; width: 100%; border: 1px solid #e3e3e3; background: #f7f7f7; }
.article-body figcaption { margin-top: 8px; color: #888; text-align: center; font-family: sans-serif; font-size: 13px; }
.article-body blockquote { margin: 28px 0; padding: 18px 22px; color: #555; border-left: 3px solid #bbb; background: #f7f7f7; font-size: 18px; }

.faq { margin-top: 36px; }
.faq details { border-top: 1px solid var(--line); font-family: "Microsoft YaHei", sans-serif; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 15px 4px; cursor: pointer; font-weight: 700; }
.faq details p { padding: 0 4px 15px; color: #666; }

.article-footer { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #777; font-size: 14px; }
.tags a { padding: 2px 9px; color: #8a3434; background: #f5eaea; border-radius: 2px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.post-nav a { display: flex; min-width: 0; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); }
.post-nav a.next { text-align: right; }
.post-nav span { color: #999; font-size: 12px; }
.post-nav strong { overflow: hidden; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.sidebar { display: grid; gap: 20px; position: sticky; top: 16px; }
.side-card { padding: 18px 20px; background: var(--surface); border-top: 3px solid var(--brand); box-shadow: 0 1px 3px rgb(0 0 0 / 7%); }
.side-card header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.side-card h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 21px; font-weight: 500; }
.side-card header > a { color: #999; font-size: 12px; }
.rank-list { margin: 3px 0 0; padding: 0; list-style: none; }
.rank-list li { border-bottom: 1px dashed #ddd; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list a { display: grid; grid-template-columns: 28px minmax(0, 1fr); padding: 14px 0; }
.rank-list span { grid-row: 1 / 3; color: #bbb; font: italic 18px Georgia, serif; }
.rank-list li:first-child span, .rank-list li:nth-child(2) span { color: var(--brand); }
.rank-list strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.rank-list a > strong:only-child {
  grid-column: 1 / -1;
  width: auto;
  min-width: 0;
}
.rank-list small { overflow: hidden; color: #999; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.news-list { margin: 6px 0 0; padding: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px dashed #ddd; font-size: 14px; line-height: 1.5; }
.news-list li:last-child { border: 0; }
.news-list time { color: #aaa; font-size: 12px; }

.site-footer { padding: 30px 0; color: #aaa; background: #333; text-align: center; font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-bottom: 14px; }
.site-footer a { color: #ddd; }
.site-footer p { margin: 4px 0; }

/* 内容列表页 */
.list-layout { align-items: start; }
.listing-card { min-width: 0; padding: 0 34px 32px; background: var(--surface); border: 1px solid #ddd; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); }
.listing-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 30px 0 24px; border-bottom: 3px solid var(--brand); }
.listing-kicker { color: var(--brand); font: 700 11px/1.2 Arial, sans-serif; letter-spacing: .16em; }
.listing-header h1 { margin: 5px 0 8px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(28px, 4vw, 38px); font-weight: 500; line-height: 1.25; }
.listing-header p { max-width: 650px; margin: 0; color: #777; font-size: 14px; line-height: 1.7; }
.listing-count { flex: 0 0 auto; padding-bottom: 4px; color: #999; font-size: 12px; white-space: nowrap; }
.listing-count strong { color: var(--brand); font-size: 20px; }
.article-list { margin: 0; padding: 0; list-style: none; }
.article-list-item { border-bottom: 1px solid var(--line); }
.article-list-item article { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 26px; padding: 27px 0; }
.list-date { padding-top: 5px; color: #aaa; font: 13px/1.5 Georgia, serif; border-right: 1px solid #e5e5e5; }
.list-date time { display: block; overflow-wrap: anywhere; }
.list-copy { min-width: 0; }
.list-copy h2 { margin: 0 0 9px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 21px; font-weight: 600; line-height: 1.5; }
.list-copy h2 a:hover { color: var(--brand); }
.list-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #777; font-size: 14px; line-height: 1.8; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; color: #aaa; font-size: 12px; }
.read-more { color: var(--brand); font-weight: 700; }
.read-more span, .guide-home span { transition: transform .2s ease; }
.read-more:hover span, .guide-home:hover span { display: inline-block; transform: translateX(3px); }
.article-list-empty { padding: 70px 20px; color: #999; text-align: center; }
.article-list-empty, .news-list .news-list-empty { display: none; }
.article-list-empty.template-visible, .news-list .news-list-empty.template-visible { display: list-item; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; padding: 0 11px; color: #666; border: 1px solid #ddd; background: #fff; font-size: 13px; }
.pagination a:hover, .pagination a.current { color: #fff; border-color: var(--brand); background: var(--brand); }
.pagination a.current { pointer-events: none; }
.page-edge { min-width: 66px !important; }
.list-guide p { margin: 14px 0; color: #777; font-size: 14px; line-height: 1.8; }
.guide-home { color: var(--brand); font-size: 13px; font-weight: 700; }

@media (max-width: 960px) {
  .primary-nav a { padding-inline: 12px; }
  .site-search { flex-basis: 190px; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
  .article-card { padding-inline: 28px; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 24px), var(--content-width)); }
  .header-top { display: none; }
  .brand-inner { min-height: 66px; }
  .brand img { width: 152px; height: auto; }
  .menu-toggle { display: block; cursor: pointer; }
  .nav-bar { background: var(--brand); }
  .nav-inner { display: block; min-height: 6px; }
  .nav-inner:has(.primary-nav.open) { min-height: 0; padding-bottom: 12px; }
  .primary-nav { display: none; padding: 8px 0; }
  .primary-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); }
  .primary-nav a { min-height: 44px; padding: 8px 14px; border-bottom: 1px solid rgb(255 255 255 / 15%); }
  .site-search { display: none; margin: 0 0 12px; }
  .primary-nav.open + .site-search { display: flex; }
  .page-shell { padding-top: 14px; }
  .content-grid { grid-template-columns: 1fr; }
  .article-card { padding: 24px 20px; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .listing-card { padding-inline: 22px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .breadcrumbs { font-size: 12px; }
  .article-card { padding-inline: 17px; }
  .article-header h1 { font-size: 28px; }
  .dek { font-size: 15px; }
  .article-meta { display: grid; gap: 2px; }
  .answer-summary { margin-inline: -1px; padding: 16px 17px; }
  .article-body { font-size: 16px; line-height: 1.9; }
  .article-body h2 { font-size: 21px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.next { text-align: left; }
  .sidebar { grid-template-columns: 1fr; }
  .listing-card { padding: 0 17px 24px; }
  .listing-header { display: block; padding-top: 23px; }
  .listing-count { display: block; margin-top: 12px; }
  .article-list-item article { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .list-date { padding: 0; border-right: 0; }
  .list-copy h2 { font-size: 18px; }
  .pagination { gap: 6px; }
  .pagination a { min-width: 34px; height: 34px; padding-inline: 9px; }
}

@media print {
  .header-top, .nav-bar, .breadcrumbs, .sidebar, .site-footer, .post-nav, .menu-toggle { display: none !important; }
  body { color: #000; background: #fff; }
  .article-card { padding: 0; border: 0; box-shadow: none; }
  .content-grid { display: block; }
}
.news-list li > a:only-child {
  grid-column: 1 / -1;
  min-width: 0;
}
/* 列表页分页 */
.pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}

.pages a,
.pages .cur,
.pages .off {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.pages a:hover {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.pages .cur {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  font-weight: 700;
}

.pages .off {
  color: #aaa;
  background: #f5f5f5;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .pages {
    gap: 6px;
    margin-top: 24px;
  }

  .pages a,
  .pages .cur,
  .pages .off {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
  }
}