/* 重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  background: #fff;
  /* 注意：不要在这里加 padding-bottom:var(--eo-wm-h)，
     那样会在 footer 下方留白，反而把 footer 视觉位置往上推。
     EdgeOne 预览水印避让仅在 .footer / .zoom-bar 等具体控件里用 var(--eo-wm-h) 即可。 */
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* 变量 */
:root {
  --primary: #9c1b1b;
  --primary-dark: #7a1515;
  --accent: #c9a227;
  --text: #333;
  --text-light: #666;
  --bg: #fff;
  --bg-gray: #f7f7f7;
  --border: #e5e5e5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.container {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-logo {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 26px;
  font-weight: 700;
  border-radius: 4px;
}
.site-name {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 20px;
}
.current-date {
  color: var(--text-light);
  font-size: 14px;
  white-space: nowrap;
}
.search-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.search-form input {
  width: 160px;
  padding: 3px 10px;
  border: none;
  outline: none;
  font-size: 13px;
  line-height: 1.4;
}
.search-form button {
  padding: 3px 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}
.search-form button:hover { background: var(--primary-dark); }
.search-info {
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #f8f8f8;
  border-left: 4px solid var(--primary);
  color: var(--text);
  font-size: 14px;
}
.search-info a { color: var(--primary); text-decoration: underline; }

/* 站内页面搜索结果（宗祠简介 / 世系族谱 等正文命中） */
.search-page-results { margin: 8px 0 24px; }
.search-page-results .spr-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.page-result {
  display: block;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
}
.page-result:hover { border-color: var(--primary); }
.page-result .pr-name { font-weight: 700; color: var(--primary); margin-right: 8px; }
.page-result .pr-snippet { color: var(--text-light); font-size: 13px; line-height: 1.6; }
.page-result .pr-snippet mark { background: #fff2c2; color: inherit; padding: 0 1px; }

/* 搜索跳转后正文关键词高亮 */
.search-hit {
  background: #fff3a0;
  color: #333;
  padding: 0 2px;
  border-radius: 2px;
}
.page-result .pr-snippet mark { background: #fff2c2; color: inherit; padding: 0 1px; }

/* 主导航 */
.main-nav {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-inner { position: relative; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 12px 0;
}
.nav-list {
  display: flex;
  justify-content: space-between;
}
.nav-list li { flex: 1; text-align: center; }
.nav-list a {
  display: block;
  padding: 14px 10px;
  color: #fff;
  font-size: 16px;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active {
  background: var(--primary-dark);
}

/* 轮播 */
.hero { position: relative; }
.carousel {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 520px;
  overflow: hidden;
  background: #222;
}
.carousel-track { position: absolute; inset: 0; width: 100%; height: 100%; }
.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: center;
}
.carousel-slide.active { opacity: 1; z-index: 1; }
.slide-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.35) 100%);
}
.slide-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 80px;
  color: #fff;
}
.slide-content h2 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 16px;
}
.slide-content p {
  font-size: 22px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.carousel-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}
.carousel-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
}
.carousel-dots button.active { background: #fff; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 72px;
  border: none;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-arrow:hover { background: rgba(0,0,0,0.45); }
.carousel-arrow.prev { left: 0; border-radius: 0 4px 4px 0; }
.carousel-arrow.next { right: 0; border-radius: 4px 0 0 4px; }

/* 主体内容 */
.main-content { padding: 40px 20px 60px; }
.section { margin-bottom: 56px; scroll-margin-top: 80px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.section-title {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 28px;
  color: var(--primary);
  font-weight: 700;
  padding-left: 14px;
  position: relative;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 5px;
  background: var(--accent);
}
.more {
  color: var(--text-light);
  font-size: 14px;
}
.more:hover { color: var(--primary); }

/* 新闻 */
.news-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}
.news-list {
  background: var(--bg-gray);
  padding: 20px 24px;
  border-radius: 4px;
}
.news-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.news-list li:last-child { border-bottom: none; }
.news-date {
  flex: none;
  width: auto;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: 3px;
  padding: 4px 10px;
  display: inline-block;
  line-height: 1.4;
}
.news-date .news-year {
  font-size: 13px;
  opacity: 0.92;
}
.news-date .news-year::after {
  content: '-';
  opacity: 0.6;
  margin: 0 2px;
}
.news-date .news-md {
  font-size: 13px;
  font-weight: 600;
}
.news-list a {
  color: var(--text);
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-list a:hover { color: var(--primary); text-decoration: underline; }
.news-feature {
  position: relative;
  min-height: 260px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.feature-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 60%);
}
.feature-text {
  position: relative;
  z-index: 2;
  padding: 20px;
  color: #fff;
}
.feature-text h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 22px;
  margin-bottom: 6px;
}

/* 宗祠动态右侧轮播 */
.news-carousel {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 320px;
  height: 100%;
  background: #222;
}
.news-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
}
.news-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: block;
  z-index: 0;
}
.news-carousel-slide.active { opacity: 1; z-index: 1; }
.news-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-carousel-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  z-index: 1;
}
.news-carousel-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.news-carousel-dots {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.news-carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.85);
  background: transparent;
  cursor: pointer;
}
.news-carousel-dots button.active { background: #fff; }
.news-carousel-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
}

/* 简介 */
.intro-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: stretch;
}
.intro-image {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
}
.intro-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.intro-text p {
  margin-bottom: 16px;
  text-indent: 2em;
  color: var(--text);
}
.intro-text p:last-of-type { margin-bottom: 0; }

/* 族规家训 */
.rules-card {
  background: linear-gradient(135deg, #fffaf3, #fff);
  border: 1px solid #f0e6d6;
  border-radius: 4px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.rules-source {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 18px;
}
.rules-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.rules-tab {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 17px;
  padding: 8px 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
}
.rules-tab:hover { color: var(--primary); }
.rules-tab.active {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}
.rules-panel { display: none; }
.rules-panel.active { display: block; }
.rules-intro {
  position: relative;
  margin: 4px 0 18px;
  padding: 18px 20px 16px 22px;
  background: linear-gradient(180deg, #fdfbf7 0%, #faf6ee 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  font-family: "KaiTi", "STKaiti", "楷体", serif;
}
.rules-intro-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 12px;
  font-size: 15px;
  letter-spacing: 2px;
  color: #fff;
  background: var(--primary);
  border-radius: 3px;
}
.rules-intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.95;
  color: var(--text);
  text-indent: 2em;
}
.rule-acc {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}
.rule-acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fdfbf7;
  border: none;
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 17px;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
}
.rule-acc-header:hover { background: #f7f2e9; }
.rule-acc-header .icon {
  font-size: 13px;
  color: var(--text-light);
  transition: transform 0.2s;
}
.rule-acc.open .rule-acc-header .icon { transform: rotate(90deg); }
.rule-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.rule-acc.open .rule-acc-body { max-height: 900px; }
.rule-acc-content {
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  border-top: 1px dashed #e8e0d4;
}
.rule-acc-content p {
  text-indent: 2em;
  margin-bottom: 10px;
}
.rules-appendix {
  margin-top: 18px;
  padding: 16px 18px;
  background: #faf7f2;
  border: 1px dashed #e0d4c0;
  border-radius: 4px;
}
.rules-appendix h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 12px;
}
.rules-appendix-item {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.rules-appendix-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

/* 世系族谱 */
.genealogy-card {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 32px;
  align-items: stretch;
  background: var(--bg-gray);
  border-radius: 4px;
  padding: 32px;
}
.genealogy-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.genealogy-title {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 16px;
  text-align: left;
  margin-left: 7em;
}
.genealogy-info p {
  margin-bottom: 14px;
  color: var(--text);
  text-indent: 2em;
}
.genealogy-info p:last-of-type { margin-bottom: 0; }
.gen-breakdown {
  font-size: 13px !important;
  color: var(--text-light) !important;
  line-height: 1.8 !important;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 10px 14px;
}
.genealogy-image {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
}
.genealogy-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.genealogy-info .btn-primary { align-self: flex-start; }
.btn-primary {
  display: inline-block;
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
  margin-top: 8px;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }

/* 宗祠简介内按钮组 */
.intro-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  justify-content: flex-start;
}
.btn-secondary {
  display: inline-block;
  padding: 10px 28px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

/* 寻根问祖 */
.roots-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}
.roots-form, .roots-tips {
  background: var(--bg-gray);
  padding: 24px;
  border-radius: 4px;
}
.roots-form h4, .roots-tips h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
}
.roots-form p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.roots-form input,
.roots-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}
.roots-form textarea { resize: vertical; margin-bottom: 12px; }
.roots-msg { font-size: 14px; margin-top: 8px; min-height: 20px; }
.roots-form input:focus,
.roots-form textarea:focus { border-color: var(--primary); }
.roots-tips ul li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  font-size: 15px;
}
.roots-tips ul li:last-child { border-bottom: none; }
.roots-tips ul li::before {
  content: '•';
  color: var(--primary);
  margin-right: 8px;
  font-weight: bold;
}

/* 文物古迹 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.info-card:hover { transform: translateY(-4px); }
.card-image { height: 200px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; }
.card-body h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 10px;
}
.card-body p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* 名人堂 */
.honor-card {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: center;
  background: linear-gradient(135deg, #fffaf3, #fff);
  border: 1px solid #f0e6d6;
  border-radius: 4px;
  padding: 32px;
}
.honor-image {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.honor-image img { width: 100%; height: auto; }
.honor-text h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 16px;
}
.honor-text p {
  margin-bottom: 14px;
  color: var(--text);
  text-indent: 2em;
}
.btn-outline {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  font-size: 15px;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* 投稿交流 */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.contact-info {
  background: var(--bg-gray);
  padding: 28px;
  border-radius: 4px;
}
.contact-info p {
  margin-bottom: 14px;
  font-size: 16px;
  color: var(--text);
}
.contact-map {
  background: #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
  min-height: 380px;
}
/* 地图容器：必须有固定高度，否则地图不渲染 */
#clanMap {
  width: 100%;
  min-height: 380px;
  height: 100%;
}
/* 地图加载前占位背景 */
.contact-map-loading {
  background-color: #eef0f2;
  background-image: linear-gradient(135deg, #f4f5f7 25%, #e8eaed 25%, #e8eaed 50%, #f4f5f7 50%, #f4f5f7 75%, #e8eaed 75%);
  background-size: 24px 24px;
  animation: contact-map-shimmer 1.1s linear infinite;
}
@keyframes contact-map-shimmer {
  from { background-position: 0 0; }
  to { background-position: 24px 0; }
}
/* key 未配置时的友好提示层 */
.contact-map-fallback {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  background: #faf7f2;
  color: #666;
}
.contact-map-fallback-title {
  font-size: 17px;
  font-weight: 600;
  color: #a8341f;
  margin-bottom: 10px;
}
.contact-map-fallback-text {
  font-size: 14px;
  line-height: 1.7;
  max-width: 420px;
}
.contact-map-fallback a {
  color: #a8341f;
  text-decoration: underline;
}
.contact-map-fallback code {
  background: #f0e9e0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}
/* 信息窗内容 */
.clan-info-window {
  padding: 4px 2px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}

/* 页脚 */
.footer {
  background: #5a1a1a;
  color: #fff;
  /* EdgeOne 预览水印（fixed 底部、高约 80~100px、z-index 9999）避让：
     - transform 把 footer 视觉上移水印高度，让链接出现在水印之上
     - padding-bottom 同步增加水印高度，让原 footer 下方留白变成 footer 内部 padding 区域（继承深色背景），
       视觉上 footer 紧贴水印上方，不出现悬空白条
     备案通过、绑自定义域名后 EdgeOne 不再注入水印，变量自动归零，无副作用。 */
  padding: 32px 0 calc(32px + var(--eo-wm-h, 0px));
  transform: translateY(calc(-1 * var(--eo-wm-h, 0px)));
}
.footer-inner { text-align: center; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #f0d5d5;
  font-size: 15px;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }
.copyright {
  color: #d4b0b0;
  font-size: 14px;
}

/* 谱牒艺文 手风琴 */
.literature { margin-top: 8px; }
.subsection-title {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 8px;
}
.subsection-desc { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.lit-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.lit-filter button {
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-light);
  transition: all 0.2s;
}
.lit-filter button:hover { border-color: var(--accent); color: var(--primary); }
.lit-filter button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item { border: 1px solid var(--border); border-radius: 4px; background: #fff; overflow: hidden; }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #fff;
  border: none;
  text-align: left;
  transition: background 0.15s;
}
.acc-head:hover { background: var(--bg-gray); }
.acc-item.open .acc-head { background: #fffaf3; }
.acc-title {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 19px;
  color: var(--primary);
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.acc-meta { font-size: 13px; color: var(--text-light); white-space: nowrap; }
.acc-toggle {
  font-size: 22px;
  color: var(--accent);
  width: 24px;
  text-align: center;
  flex: none;
  transition: transform 0.2s;
  line-height: 1;
}
.acc-item.open .acc-toggle { transform: rotate(45deg); }
.acc-body { display: none; padding: 0 20px 20px; border-top: 1px dashed var(--border); }
.acc-item.open .acc-body { display: block; }
.acc-orig {
  margin-top: 16px;
  padding: 16px;
  background: #fbf7ef;
  border-left: 3px solid var(--accent);
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 16px;
  line-height: 1.9;
  color: #3a2e1e;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
}
.acc-bai { margin-top: 12px; font-size: 15px; line-height: 1.9; color: var(--text); }
.acc-bai::before {
  content: '【白话】';
  color: var(--primary);
  font-weight: 700;
  font-family: "KaiTi", "STKaiti", "楷体", serif;
}
.acc-sub { font-size: 13px; color: var(--text-light); margin-top: 8px; }

/* 名人堂 网格 */
.honor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.honor-person {
  background: linear-gradient(135deg, #fffaf3, #fff);
  border: 1px solid #f0e6d6;
  border-radius: 4px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.honor-person h4 {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 21px;
  color: var(--primary);
  margin-bottom: 2px;
}
.honor-person .hp-gen { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.honor-person p { font-size: 14px; color: var(--text); line-height: 1.75; }

/* 名人堂分类标签 */
.honor-tabs { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.honor-tab-group { display: flex; gap: 8px; flex-wrap: wrap; }
.honor-tab {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.honor-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.honor-panel { display: none; }
.honor-panel.active { display: block; }
.honor-empty { color: var(--text-light); padding: 30px 0; text-align: center; }

/* 返回顶部 */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 99;
}
.back-to-top.show { display: flex; }

/* 响应式 */
@media (max-width: 1024px) {
  .intro-layout,
  .genealogy-card,
  .honor-card {
    grid-template-columns: 1fr;
  }
  .intro-image { height: auto; }
  .intro-image img { height: auto; object-fit: initial; }
  .intro-text { display: block; height: auto; }
  .genealogy-info { display: block; height: auto; }
  .genealogy-image { height: auto; }
  .genealogy-image img { height: auto; object-fit: initial; }
  .rules-list { grid-template-columns: repeat(2, 1fr); }
  .honor-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid,
  .roots-layout,
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; height: auto; padding: 12px 20px; gap: 12px; }
  .site-name { font-size: 22px; }
  .topbar-tools { width: 100%; justify-content: space-between; }
  .search-form input { width: 140px; }
  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    flex-direction: column;
    background: var(--primary);
    padding-bottom: 8px;
  }
  .nav-list.open { display: flex; }
  .nav-list li { text-align: left; }
  .nav-list a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .carousel { height: 360px; min-height: 360px; }
  .slide-content { padding: 0 24px; }
  .slide-content h2 { font-size: 28px; white-space: nowrap; }
  .slide-content p { font-size: 16px; }
  .news-carousel { min-height: 260px; }
  .news-carousel-track { min-height: 260px; }
  .card-grid { grid-template-columns: 1fr; }
  .honor-grid { grid-template-columns: 1fr; }
  .rules-list { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-links { gap: 12px; }

  /* 世系族谱 section-header 用默认左对齐 + 金色竖条（参照宗祠动态格式） */

  /* 卡片内「家声大振」标题：桌面用 margin-left: 7em 做右侧偏移是设计意图；
     390px 窄屏 7em 太挤会断 3 行。手机端清零偏移、改为居中，避免窄屏留白失衡 */
  .genealogy-title { margin-left: 0; text-align: center; }
}

/* 超窄屏（手机竖屏）进一步缩小轮播大标题，确保单行不折行 */
@media (max-width: 480px) {
  .slide-content h2 { font-size: 24px; }
}

/* 动态新闻摘要 & 世系代表人物 */
.news-summary { margin: 6px 0 0; font-size: 0.9em; color: var(--text-light); line-height: 1.5; }

/* 导航「更多」按钮样式 */
.nav-list a.nav-more {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  margin: 8px 4px;
  padding: 6px 10px;
  line-height: 1.6;
}
.nav-list a.nav-more:hover,
.nav-list a.nav-more.active {
  background: var(--primary-dark);
}

/* 更多页面：返回首页 */
.back-home {
  margin: 20px 0 10px;
}
.back-home a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.back-home a:hover { text-decoration: underline; }

/* 更多页面主内容区微调 */
.more-page { padding-top: 10px; }

/* ===== 新闻详情页 ===== */
.news-detail { max-width: 820px; margin: 0 auto; }
.news-detail-head { padding-bottom: 16px; margin-bottom: 24px; }
.news-detail-title { font-size: 1.9em; color: var(--primary); line-height: 1.4; margin: 0; text-align: center; }
.news-detail-date { color: var(--text-light); font-size: 0.95em; text-align: right; margin-top: 20px; padding-top: 12px; border-top: 1px dashed var(--border); }
.news-detail-images { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.news-detail-images img { max-width: 100%; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.news-detail-body p { font-size: 1.05em; line-height: 2; color: var(--text); margin: 0 0 16px; text-indent: 2em; }
.news-detail-body p:last-of-type { margin-bottom: 0; }
.news-loading { padding: 40px 0; text-align: center; color: var(--text-light); }

/* ===== 动态列表页（带缩略图） ===== */
.news-all-list { background: var(--bg-gray); padding: 20px 24px; border-radius: 4px; }
.news-all-list li { display: flex; align-items: flex-start; gap: 18px; padding: 18px 0; border-bottom: 1px dashed var(--border); }
.news-all-list li:last-child { border-bottom: none; }
.news-thumb { flex: none; width: 140px; height: 96px; overflow: hidden; border-radius: 4px; background: #eee; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-text { flex: 1; min-width: 0; }
.news-text .news-date {
  display: inline-block;
  margin-bottom: 6px;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 13px;
}
.news-text a { display: block; color: var(--text); font-size: 17px; font-weight: 600; }
.news-text a:hover { color: var(--primary); text-decoration: underline; }
.news-text .news-summary { margin: 8px 0 0; font-size: 0.92em; color: var(--text-light); line-height: 1.6; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.page-btn { padding: 7px 14px; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 768px) {
  .nav-list a.nav-more {
    margin: 0 20px;
    border-radius: 0;
    background: transparent;
  }
}
