/* ============================================================
   背景（防亮色闪烁）
   ============================================================ */
html { background: #0c0a08; }
html.light { background: #f7f2eb; }
body { background: transparent !important; }
html.light body { background: transparent !important; }

/* ============================================================
   全局
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
html, body {
  max-width: 100%;
  overflow-x: hidden;
  width: 100%;
}
body {
  font-family: '华文楷体', 'KaiTi', 'Noto Serif SC', 'Georgia', serif;
  color: #d4cdc4;
  line-height: 1.9;
  transition: color 0.5s;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
a { text-decoration: none; transition: color 0.3s; }
img, iframe, video, svg { max-width: 100%; height: auto; }

/* ============================================================
   顶部
   ============================================================ */
.header {
  background: rgba(12, 10, 8, 0.92);
  backdrop-filter: blur(12px);
  padding: 14px 0;
  border-bottom: 1px solid #2a221a;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.5s, border-color 0.5s;
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 1;
  min-width: 0;
}
.logo a { color: inherit; display: flex; align-items: center; gap: 12px; }
.logo-mark {
  font-size: 22px;
  color: #d4b890;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 160, 128, 0.08);
  border: 1.5px solid rgba(184, 160, 128, 0.3);
  flex-shrink: 0;
}
.logo h1 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 6px;
  color: #e8ddd0;
  font-family: '华文楷体', 'KaiTi', 'Georgia', serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #2a221a;
  color: #b8a080;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  flex-shrink: 0;
}
.theme-btn:hover {
  background: rgba(184, 160, 128, 0.15);
  border-color: #b8a080;
}

.language-selector { position: relative; flex-shrink: 0; }
.language-current {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  border: 1px solid #2a221a;
  gap: 6px;
}
.language-current:hover { border-color: #b8a080; }
.language-flag {
  width: 18px;
  height: 13px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  flex-shrink: 0;
}
.language-name {
  font-size: 13px;
  color: #a89888;
  white-space: nowrap;
}
.language-current .fa-chevron-down {
  font-size: 10px;
  color: #6a6058;
  flex-shrink: 0;
}
.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 360px;
  max-height: 440px;
  background: #161210;
  border-radius: 10px;
  border: 1px solid #2a221a;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: 0.3s;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.language-selector.active .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.language-regions-container {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}
.language-region { margin-bottom: 16px; }
.language-region:last-child { margin-bottom: 0; }
.region-title {
  font-size: 12px;
  font-weight: 600;
  color: #b8a080;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a221a;
  letter-spacing: 1px;
}
.region-languages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 3px;
}
.language-option {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  color: #b0a898;
  transition: 0.2s;
  gap: 6px;
  min-width: 0;
}
.language-option:hover { background: rgba(255, 255, 255, 0.05); }
.language-option.active {
  background: rgba(184, 160, 128, 0.12);
  color: #e8ddd0;
}
.language-option .language-flag { width: 16px; height: 12px; }
.language-option span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-language-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.mobile-language-modal.active { display: flex; }
.mobile-language-content {
  background: #161210;
  width: 92%;
  max-width: 380px;
  max-height: 70vh;
  border-radius: 14px;
  border: 1px solid #2a221a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mobile-language-header {
  padding: 14px 20px;
  border-bottom: 1px solid #2a221a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-language-header h3 { color: #e8ddd0; font-size: 15px; font-weight: 400; }
.mobile-language-close {
  background: none;
  border: none;
  color: #a89888;
  font-size: 20px;
  cursor: pointer;
}
.mobile-language-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.mobile-language-option {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid #1a1612;
  cursor: pointer;
  gap: 10px;
}
.mobile-language-option.active { background: rgba(184, 160, 128, 0.08); }
.mobile-language-flag {
  width: 22px;
  height: 16px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  flex-shrink: 0;
}
.mobile-language-name { font-size: 14px; color: #d4cdc4; }

/* ============================================================
   内容区
   ============================================================ */
.content-wrapper { padding: 32px 0 60px; }
.content-main { max-width: 820px; margin: 0 auto; min-width: 0; }

/* 面包屑 */
.breadcrumb-nav {
  font-size: 13px;
  color: #8a7a68;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb-nav a { color: #b8a080; }
.breadcrumb-nav a:hover { color: #e8ddd0; }
.breadcrumb-nav .sep { opacity: 0.5; }

/* 顶部藏经分类 */
.category-nav-section.top-category-nav {
  margin: 0 0 32px;
  padding: 0 0 22px;
  border-top: none;
  border-bottom: 1px solid #2a221a;
}
.category-nav-section.top-category-nav h3 {
  font-size: 13px;
  font-weight: 500;
  color: #8a7a68;
  margin-bottom: 10px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.category-nav-section.top-category-nav h3 i {
  color: #b8a080;
  font-size: 12px;
}
.category-nav-section.top-category-nav .category-nav-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.category-nav-section.top-category-nav .category-nav-item {
  padding: 8px 12px;
  font-size: 13px;
  background: transparent;
  border-color: #2a221a;
}
.category-nav-section.top-category-nav .category-nav-item.active {
  background: rgba(184, 160, 128, 0.12);
  border-color: #b8a080;
  color: #e8ddd0;
  font-weight: 500;
}
.category-nav-section.top-category-nav .category-nav-item:hover {
  background: rgba(184, 160, 128, 0.08);
  border-color: #b8a080;
  color: #e8ddd0;
}

/* 标题 */
.content-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #2a221a;
  text-align: center;
}
.content-header h1 {
  font-size: 30px;
  font-weight: 400;
  color: #e8ddd0;
  line-height: 1.5;
  margin-bottom: 14px;
  letter-spacing: 2px;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.content-header .meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: #8a7a68;
  font-size: 14px;
}
.content-header .meta i { color: #b8a080; margin-right: 4px; }
.content-header .meta a { color: #b8a080; }
.content-header .meta a:hover { color: #e8ddd0; }

/* 配图 */
.content-cover {
  margin: 0 auto 36px;
  max-width: 460px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.content-cover img { width: 100%; display: block; }

/* 正文 */
.content-body {
  font-size: 17px;
  line-height: 2.1;
  color: #d4cdc4;
  min-height: 200px;
}
.content-body p {
  margin-bottom: 20px;
  text-indent: 2em;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.content-body h1 {
  font-size: 22px;
  font-weight: 400;
  color: #e8ddd0;
  margin: 40px 0 20px;
  text-indent: 0;
  text-align: center;
  letter-spacing: 2px;
  word-break: break-word;
}
.content-body h2 {
  font-size: 20px;
  font-weight: 400;
  color: #e8ddd0;
  margin: 32px 0 16px;
  text-indent: 0;
  letter-spacing: 1px;
  word-break: break-word;
}
.content-body .note {
  background: #1a1612;
  padding: 16px 22px;
  border-radius: 10px;
  border-left: 3px solid #b8a080;
  margin: 20px 0;
  font-size: 15px;
  color: #b0a898;
  text-indent: 0;
  word-break: break-word;
}
.content-body .missing-char {
  color: #d97b7b;
  background: rgba(217, 123, 123, 0.12);
  padding: 0 3px;
  border-radius: 2px;
}

/* 原文 */
.source-txt {
  margin: 40px 0 28px;
  padding: 14px 20px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 10px;
  font-size: 14px;
  color: #8a7a68;
  text-align: center;
  word-break: break-word;
}
.source-txt i { color: #b8a080; margin-right: 6px; }
.source-txt a { color: #b8a080; word-break: break-word; }
.source-txt a:hover { color: #e8ddd0; }

/* 上下篇 */
.content-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #2a221a;
}
.content-nav a {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50%;
  color: #b0a898;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 8px;
  transition: 0.3s;
  overflow: hidden;
  line-height: 1.5;
}
.content-nav a .nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.content-nav a i { flex-shrink: 0; }
.content-nav a:hover {
  border-color: #b8a080;
  color: #e8ddd0;
}
.content-nav .prev { justify-content: flex-start; }
.content-nav .next { justify-content: flex-end; text-align: right; }
.content-nav .nav-placeholder { flex: 1 1 0; max-width: 50%; }

/* 相关经文 */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #2a221a;
}
.related-section h3 {
  font-size: 18px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.related-section h3 i { color: #b8a080; margin-right: 8px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.related-item {
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 8px;
  padding: 12px 16px;
  transition: 0.3s;
  min-width: 0;
  overflow: hidden;
}
.related-item:hover {
  border-color: #b8a08055;
  transform: translateY(-1px);
}
.related-item h4 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.related-item h4 a { color: #d4cdc4; }
.related-item h4 a:hover { color: #b8a080; }

/* 通用分类网格（非顶部时用） */
.category-nav-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid #2a221a;
}
.category-nav-section h3 {
  font-size: 18px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.category-nav-section h3 i { color: #b8a080; margin-right: 8px; }
.category-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.category-nav-item {
  display: block;
  padding: 10px 16px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 8px;
  color: #b0a898;
  font-size: 14px;
  text-align: center;
  transition: 0.3s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}
.category-nav-item:hover {
  border-color: #b8a080;
  color: #e8ddd0;
  background: rgba(184, 160, 128, 0.08);
}

/* ============================================================
   列表页
   ============================================================ */
.list-section { margin: 0 0 40px; }
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 8px;
  transition: 0.25s;
  color: #d4cdc4;
  min-width: 0;
  overflow: hidden;
}
.list-item:hover {
  border-color: #b8a080;
  background: rgba(184, 160, 128, 0.06);
  color: #e8ddd0;
}
.list-item-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 40px 0 56px;
  padding: 20px 0;
}
.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 6px;
  color: #b0a898;
  font-size: 14px;
  transition: 0.25s;
  white-space: nowrap;
}
.page-btn:hover,
.page-num:hover {
  border-color: #b8a080;
  color: #e8ddd0;
  background: rgba(184, 160, 128, 0.08);
}
.page-num.active {
  background: #b8a080;
  color: #0c0a08;
  border-color: #b8a080;
  font-weight: 500;
}
.page-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-btn.disabled:hover {
  border-color: #2a221a;
  color: #b0a898;
  background: #161210;
}
.page-ellipsis {
  color: #6a6058;
  padding: 0 4px;
  font-size: 14px;
}

/* ============================================================
   底部
   ============================================================ */
.footer {
  background: #0c0a08;
  padding: 36px 0 24px;
  margin-top: 60px;
  border-top: 1px solid #1a1612;
  transition: background 0.5s, border-color 0.5s;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-bottom: 20px;
}
.footer-links a {
  color: #8a7a68;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.3s;
  white-space: nowrap;
  line-height: 1.5;
}
.footer-links a i { color: #b8a080; font-size: 14px; }
.footer-links a:hover { color: #b8a080; }
.copyright {
  text-align: center;
  font-size: 13px;
  color: #4a4038;
  letter-spacing: 1px;
  word-break: break-word;
}

/* ============================================================
   TTS 朗读
   ============================================================ */
.simple-tts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin: 0 0 28px;
}
.simple-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  background: none;
  color: #a89888;
  border: none;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.25s;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 2px;
}
.simple-tts-btn:hover { color: #e8ddd0; }
.simple-tts-btn[data-action="play"] { color: #d4b890; }
.simple-tts-speed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8a8078;
}
.simple-tts-speed i { color: #b8a080; font-size: 13px; }
.simple-tts-speed input[type="range"] {
  width: 90px;
  height: 4px;
  accent-color: #b8a080;
  cursor: pointer;
}
.simple-tts-speed span {
  min-width: 38px;
  text-align: right;
  color: #a89888;
  font-size: 13px;
}
.simple-tts-active {
  background: rgba(184, 160, 128, 0.10) !important;
  border-radius: 6px !important;
  box-shadow: 0 0 0 1px rgba(184, 160, 128, 0.15);
  transition: background 0.35s;
}

/* ============================================================
   亮色主题
   ============================================================ */
html.light { color: #3d352e; }
html.light .header {
  background: rgba(247, 242, 235, 0.95) !important;
  border-bottom-color: #e0d8cc !important;
}
html.light .logo h1 { color: #3d352e; }
html.light .logo-mark {
  border-color: rgba(90, 57, 33, 0.3);
  color: #5a3921;
  background: rgba(90, 57, 33, 0.05);
}
html.light .theme-btn {
  background: #ede5db;
  border-color: #d6c9b8;
  color: #5a3921;
}
html.light .theme-btn:hover {
  background: #ddd0be;
  border-color: #c4a882;
}
html.light .language-current {
  background: #ede5db;
  border-color: #d6c9b8;
}
html.light .language-name { color: #3d352e; }
html.light .language-dropdown {
  background: #f7f2eb;
  border-color: #d6c9b8;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
}
html.light .region-title {
  color: #5a3921;
  border-bottom-color: #d6c9b8;
}
html.light .language-option { color: #4a4036; }
html.light .language-option:hover { background: #ede5db; }
html.light .language-option.active {
  background: #e5d8c8;
  color: #5a3921;
}
html.light .mobile-language-content {
  background: #f7f2eb;
  border-color: #d6c9b8;
}
html.light .mobile-language-header {
  background: #ede5db;
  border-bottom-color: #d6c9b8;
}
html.light .mobile-language-header h3 { color: #3d352e; }
html.light .mobile-language-name { color: #3d352e; }

html.light .breadcrumb-nav { color: #8a7a6a; }
html.light .breadcrumb-nav a { color: #5a3921; }

html.light .category-nav-section.top-category-nav {
  border-bottom-color: #e0d8cc;
}
html.light .category-nav-section.top-category-nav h3 { color: #8a7a6a; }
html.light .category-nav-section.top-category-nav .category-nav-item {
  background: transparent;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .category-nav-section.top-category-nav .category-nav-item.active {
  background: #e5d8c8;
  border-color: #5a3921;
  color: #5a3921;
}
html.light .category-nav-section.top-category-nav .category-nav-item:hover {
  background: #ede5db;
  border-color: #c4a882;
  color: #5a3921;
}

html.light .content-header { border-bottom-color: #e0d8cc; }
html.light .content-header h1 { color: #3d352e; }
html.light .content-header .meta { color: #8a7a6a; }
html.light .content-header .meta i { color: #5a3921; }
html.light .content-header .meta a { color: #5a3921; }
html.light .content-body { color: #3d352e; }
html.light .content-body h1,
html.light .content-body h2 { color: #3d352e; }
html.light .content-body .note {
  background: #ede5db;
  border-left-color: #c4a882;
  color: #4a4036;
}
html.light .source-txt {
  background: #ede5db;
  border-color: #d6c9b8;
  color: #7a6b5a;
}
html.light .source-txt a { color: #5a3921; }
html.light .content-nav { border-top-color: #e0d8cc; }
html.light .content-nav a {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .content-nav a:hover {
  border-color: #c4a882;
  color: #5a3921;
}
html.light .related-section,
html.light .category-nav-section { border-top-color: #e0d8cc; }
html.light .related-section h3,
html.light .category-nav-section h3 { color: #3d352e; }
html.light .related-item {
  background: #fcf9f5;
  border-color: #e0d8cc;
}
html.light .related-item h4 a { color: #3d352e; }
html.light .related-item h4 a:hover { color: #5a3921; }
html.light .category-nav-item {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .category-nav-item:hover {
  border-color: #c4a882;
  color: #5a3921;
  background: #ede5db;
}

html.light .list-item {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #3d352e;
}
html.light .list-item:hover {
  border-color: #c4a882;
  background: #f5ede0;
}
html.light .page-btn,
html.light .page-num {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .page-btn:hover,
html.light .page-num:hover {
  border-color: #c4a882;
  color: #5a3921;
  background: #ede5db;
}
html.light .page-num.active {
  background: #5a3921;
  color: #fcf9f5;
  border-color: #5a3921;
}
html.light .page-btn.disabled {
  opacity: 0.4;
  color: #b0a898;
}
html.light .page-ellipsis { color: #a89888; }

html.light .footer {
  background: #ede5db;
  border-top-color: #d6c9b8;
}
html.light .footer-links a { color: #7a6b5a; }
html.light .footer-links a:hover { color: #5a3921; }
html.light .copyright { color: #8a7a6a; }
html.light .simple-tts-btn { color: #7a6b5a; }
html.light .simple-tts-btn:hover { color: #3d352e; }
html.light .simple-tts-btn[data-action="play"] { color: #5a3921; }
html.light .simple-tts-speed { color: #8a7a6a; }
html.light .simple-tts-speed i { color: #5a3921; }
html.light .simple-tts-active {
  background: rgba(90, 57, 33, 0.10) !important;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .content-wrapper { padding: 16px 0 32px; }
  .content-main { max-width: 100%; padding: 0; }

  .logo { min-width: 0; flex: 1; }
  .logo h1 { font-size: 16px; letter-spacing: 2px; max-width: 100%; }
  .logo-mark { width: 30px; height: 30px; font-size: 15px; }
  .theme-btn { width: 32px; height: 32px; font-size: 13px; }

  .language-name { display: none; }
  .language-current { padding: 6px 8px; }
  .language-dropdown {
    width: calc(100vw - 28px);
    right: -6px;
  }
  .region-languages { grid-template-columns: 1fr 1fr; }

  .category-nav-section.top-category-nav .category-nav-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .category-nav-section.top-category-nav .category-nav-item {
    padding: 6px 8px;
    font-size: 12px;
  }
  .category-nav-section.top-category-nav h3 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .content-header { padding-bottom: 18px; margin-bottom: 20px; }
  .content-header h1 {
    font-size: 19px;
    line-height: 1.45;
    letter-spacing: 0;
  }
  .content-header .meta { font-size: 12px; gap: 6px 12px; }
  .content-body { font-size: 15px; line-height: 1.95; }
  .content-body p { margin-bottom: 14px; text-indent: 1.6em; }
  .content-body h1 { font-size: 18px; margin: 26px 0 14px; }
  .content-body h2 { font-size: 16px; margin: 22px 0 12px; }

  .content-nav {
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
  }
  .content-nav a,
  .content-nav .prev,
  .content-nav .next {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 13px;
    padding: 10px 12px;
    text-align: left;
    justify-content: flex-start;
  }
  .content-nav a .nav-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.5;
  }
  .content-nav .nav-placeholder { display: none; }

  .related-grid { grid-template-columns: 1fr; gap: 8px; }
  .related-item { padding: 10px 14px; }
  .related-item h4 {
    -webkit-line-clamp: unset;
    white-space: normal;
    overflow: visible;
    font-size: 13px;
    line-height: 1.5;
  }

  .list-grid { grid-template-columns: 1fr; gap: 6px; }
  .list-item { padding: 10px 12px; }
  .list-item-title { font-size: 13px; line-height: 1.45; }
  .pagination { gap: 4px; margin: 28px 0 40px; }
  .page-btn, .page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }
  .page-btn { padding: 0 10px; font-size: 12px; }

  .footer { padding: 24px 0 16px; margin-top: 40px; }
  .footer-links { gap: 8px 16px; padding: 0 8px; }
  .footer-links a { font-size: 12px; white-space: normal; }
  .copyright { font-size: 11px; padding: 0 10px; }

  .simple-tts-bar { gap: 8px 12px; justify-content: center; }
  .simple-tts-btn { font-size: 13px; letter-spacing: 0; }
  .simple-tts-speed { font-size: 12px; }
  .simple-tts-speed input[type="range"] { width: 60px; }

  .source-txt {
    font-size: 12px;
    padding: 10px 12px;
    text-align: left;
  }
}

@media (max-width: 400px) {
  .content-header h1 { font-size: 17px; }
  .content-body { font-size: 14px; }
  .category-nav-section.top-category-nav .category-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-nav a .nav-text { font-size: 12px; }
  .page-btn i + span { display: none; }
  .page-btn { padding: 0 8px; }
  .page-ellipsis { display: none; }
}
/* ============================================================
   地图导航页 & 搜索页
   ============================================================ */
.map-main { max-width: 900px; }

/* 搜索框 */
.search-section {
  margin: 0 0 40px;
}
.search-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 10px;
  padding: 6px;
  transition: border-color 0.25s;
}
.search-form:focus-within {
  border-color: #b8a080;
  box-shadow: 0 0 0 3px rgba(184, 160, 128, 0.1);
}
.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e8ddd0;
  font-size: 15px;
  padding: 10px 14px;
  font-family: inherit;
}
.search-input::placeholder {
  color: #6a6058;
}
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #b8a080;
  color: #0c0a08;
  border: none;
  border-radius: 6px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s;
  font-family: inherit;
  white-space: nowrap;
}
.search-btn:hover {
  background: #d4b890;
}
.search-btn i { font-size: 13px; }

/* 藏经地图 */
.map-section {
  margin: 0 0 40px;
}
.map-title {
  font-size: 22px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 14px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.map-title i { color: #b8a080; font-size: 20px; }
.map-intro {
  color: #8a7a68;
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 28px;
}
.map-intro strong {
  color: #b8a080;
  font-weight: 500;
  padding: 0 4px;
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 12px;
  transition: 0.3s;
  text-align: center;
  min-width: 0;
}
.map-card:hover {
  border-color: #b8a080;
  background: rgba(184, 160, 128, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.map-card-icon {
  font-size: 26px;
  color: #b8a080;
  transition: 0.3s;
}
.map-card:hover .map-card-icon {
  color: #e0c090;
  transform: scale(1.1);
}
.map-card-name {
  font-size: 15px;
  color: #e8ddd0;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.4;
  word-break: break-word;
}
.map-card-count {
  font-size: 12px;
  color: #6a6058;
  letter-spacing: 1px;
}

/* 热搜词 */
.hot-search {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #2a221a;
}
.hot-search-title {
  font-size: 14px;
  color: #8a7a68;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 1px;
}
.hot-search-title i { color: #b8a080; }
.hot-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hot-tag {
  display: inline-block;
  padding: 6px 16px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 20px;
  color: #b0a898;
  font-size: 13px;
  transition: 0.25s;
  white-space: nowrap;
}
.hot-tag:hover {
  border-color: #b8a080;
  color: #e8ddd0;
  background: rgba(184, 160, 128, 0.08);
}

/* 搜索结果 */
.search-result-section {
  margin: 0 0 40px;
}
.search-result-head {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a221a;
}
.search-result-title {
  font-size: 20px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-result-title i { color: #b8a080; }
.search-keyword {
  color: #d4b890;
  font-weight: 500;
}
.search-result-count {
  font-size: 14px;
  color: #8a7a68;
}
.search-result-count strong {
  color: #b8a080;
  font-weight: 500;
  padding: 0 2px;
}
.search-empty {
  text-align: center;
  padding: 80px 20px;
  color: #8a7a68;
}
.search-empty i {
  font-size: 48px;
  color: #4a4038;
  margin-bottom: 20px;
  display: block;
}
.search-empty p {
  font-size: 16px;
  margin-bottom: 8px;
}
.search-empty-hint {
  font-size: 14px;
  color: #6a6058;
}
.search-empty-hint a {
  color: #b8a080;
  margin-left: 6px;
}
.search-empty-hint a:hover { color: #e8ddd0; }

/* 列表项增加分类标签 */
.list-item-cat {
  flex-shrink: 0;
  font-size: 12px;
  color: #6a6058;
  background: rgba(184, 160, 128, 0.06);
  border: 1px solid rgba(184, 160, 128, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  margin-left: 8px;
}

/* ============================================================
   地图/搜索 亮色主题
   ============================================================ */
html.light .search-form {
  background: #fcf9f5;
  border-color: #e0d8cc;
}
html.light .search-input { color: #3d352e; }
html.light .search-input::placeholder { color: #a89888; }
html.light .search-btn {
  background: #5a3921;
  color: #fcf9f5;
}
html.light .search-btn:hover { background: #8a6f3e; }

html.light .map-title { color: #3d352e; }
html.light .map-title i { color: #5a3921; }
html.light .map-intro { color: #7a6b5a; }
html.light .map-intro strong { color: #5a3921; }
html.light .map-card {
  background: #fcf9f5;
  border-color: #e0d8cc;
}
html.light .map-card:hover {
  border-color: #c4a882;
  background: #f5ede0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
html.light .map-card-icon { color: #5a3921; }
html.light .map-card-name { color: #3d352e; }
html.light .map-card-count { color: #a89888; }

html.light .hot-search { border-top-color: #e0d8cc; }
html.light .hot-search-title { color: #8a7a6a; }
html.light .hot-search-title i { color: #5a3921; }
html.light .hot-tag {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .hot-tag:hover {
  border-color: #c4a882;
  color: #5a3921;
  background: #ede5db;
}

html.light .search-result-head { border-bottom-color: #e0d8cc; }
html.light .search-result-title { color: #3d352e; }
html.light .search-keyword { color: #8a6f3e; }
html.light .search-result-count { color: #8a7a6a; }
html.light .search-result-count strong { color: #5a3921; }
html.light .search-empty { color: #8a7a6a; }
html.light .search-empty i { color: #d6c9b8; }
html.light .search-empty-hint a { color: #5a3921; }
html.light .list-item-cat {
  color: #a89888;
  background: rgba(90, 57, 33, 0.05);
  border-color: rgba(90, 57, 33, 0.12);
}

/* ============================================================
   地图/搜索 移动端
   ============================================================ */
@media (max-width: 768px) {
  .map-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .map-card {
    padding: 16px 10px;
    gap: 6px;
  }
  .map-card-icon { font-size: 22px; }
  .map-card-name { font-size: 14px; }
  .map-card-count { font-size: 11px; }

  .map-title { font-size: 18px; }
  .map-intro { font-size: 13px; margin-bottom: 20px; }

  .search-form { padding: 5px; gap: 6px; }
  .search-input { font-size: 14px; padding: 8px 10px; }
  .search-btn {
    padding: 0 14px;
    font-size: 13px;
  }
  .search-btn span { display: none; }

  .hot-tag {
    padding: 5px 12px;
    font-size: 12px;
  }

  .search-result-title { font-size: 17px; }
  .search-result-count { font-size: 13px; }
  .search-empty { padding: 50px 16px; }
  .search-empty i { font-size: 36px; margin-bottom: 14px; }

  .list-item-cat { font-size: 11px; padding: 2px 6px; }
}

@media (max-width: 400px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-card {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  .map-card-icon { font-size: 20px; }
  .map-card-name { font-size: 14px; }
  .map-card-count { margin-left: auto; }
}
/* ============================================================
   搜索页 / 搜索组件（buddhism.php、search.php、index.html 共用）
   ============================================================ */
.search-section {
  margin: 0 0 32px;
}
.search-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 10px;
  padding: 6px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search-form:focus-within {
  border-color: #b8a080;
  box-shadow: 0 0 0 3px rgba(184, 160, 128, 0.1);
}
.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e8ddd0;
  font-size: 15px;
  padding: 10px 14px;
  font-family: inherit;
}
.search-input::placeholder { color: #6a6058; }
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #b8a080;
  color: #0c0a08;
  border: none;
  border-radius: 6px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s;
  font-family: inherit;
  white-space: nowrap;
}
.search-btn:hover { background: #d4b890; }
.search-btn i { font-size: 13px; }

/* 热门搜索区块 */
.search-hot-section {
  margin: 0 0 40px;
}
.search-hot-title {
  font-size: 18px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 20px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-hot-title i { color: #b8a080; }

/* 热门标签（首页、搜索页共用） */
.home-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.home-hot-tag {
  display: inline-block;
  padding: 8px 20px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 24px;
  color: #b0a898;
  font-size: 14px;
  transition: 0.25s;
  white-space: nowrap;
  text-decoration: none;
}
.home-hot-tag:hover {
  border-color: #b8a080;
  color: #e8ddd0;
  background: rgba(184, 160, 128, 0.08);
}
.home-hot-tag i { color: #b8a080; margin-right: 4px; font-size: 12px; }

/* 搜索结果 */
.search-result-section { margin: 0 0 40px; }
.search-result-head {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a221a;
}
.search-result-title {
  font-size: 20px;
  font-weight: 400;
  color: #e8ddd0;
  margin-bottom: 8px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-result-title i { color: #b8a080; }
.search-keyword { color: #d4b890; font-weight: 500; }
.search-result-count {
  font-size: 14px;
  color: #8a7a68;
}
.search-result-count strong {
  color: #b8a080;
  font-weight: 500;
  padding: 0 2px;
}
.search-empty {
  text-align: center;
  padding: 80px 20px;
  color: #8a7a68;
}
.search-empty i {
  font-size: 48px;
  color: #4a4038;
  margin-bottom: 20px;
  display: block;
}
.search-empty p { font-size: 16px; margin-bottom: 8px; }
.search-empty-hint { font-size: 14px; color: #6a6058; }
.search-empty-hint a { color: #b8a080; margin-left: 6px; }
.search-empty-hint a:hover { color: #e8ddd0; }

/* 列表（搜索结果用） */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #161210;
  border: 1px solid #2a221a;
  border-radius: 8px;
  transition: 0.25s;
  color: #d4cdc4;
  min-width: 0;
  overflow: hidden;
}
.list-item:hover {
  border-color: #b8a080;
  background: rgba(184, 160, 128, 0.06);
  color: #e8ddd0;
}
.list-item-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item-cat {
  flex-shrink: 0;
  font-size: 12px;
  color: #6a6058;
  background: rgba(184, 160, 128, 0.06);
  border: 1px solid rgba(184, 160, 128, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  margin-left: 8px;
}

/* 亮色主题 */
html.light .search-form { background: #fcf9f5; border-color: #e0d8cc; }
html.light .search-input { color: #3d352e; }
html.light .search-input::placeholder { color: #a89888; }
html.light .search-btn { background: #5a3921; color: #fcf9f5; }
html.light .search-btn:hover { background: #8a6f3e; }
html.light .search-hot-title { color: #3d352e; }
html.light .search-hot-title i { color: #5a3921; }
html.light .home-hot-tag {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #7a6b5a;
}
html.light .home-hot-tag:hover {
  border-color: #c4a882;
  color: #5a3921;
  background: #ede5db;
}
html.light .home-hot-tag i { color: #5a3921; }
html.light .search-result-head { border-bottom-color: #e0d8cc; }
html.light .search-result-title { color: #3d352e; }
html.light .search-keyword { color: #8a6f3e; }
html.light .search-result-count { color: #8a7a6a; }
html.light .search-result-count strong { color: #5a3921; }
html.light .search-empty { color: #8a7a6a; }
html.light .search-empty i { color: #d6c9b8; }
html.light .search-empty-hint a { color: #5a3921; }
html.light .list-item {
  background: #fcf9f5;
  border-color: #e0d8cc;
  color: #3d352e;
}
html.light .list-item:hover { border-color: #c4a882; background: #f5ede0; }
html.light .list-item-cat {
  color: #a89888;
  background: rgba(90, 57, 33, 0.05);
  border-color: rgba(90, 57, 33, 0.12);
}

/* 移动端 */
@media (max-width: 768px) {
  .search-form { padding: 5px; gap: 6px; }
  .search-input { font-size: 14px; padding: 8px 10px; }
  .search-btn { padding: 0 14px; font-size: 13px; }
  .search-btn span { display: none; }
  .search-hot-title { font-size: 16px; }
  .home-hot { gap: 8px; }
  .home-hot-tag { padding: 6px 14px; font-size: 13px; }
  .search-result-title { font-size: 17px; }
  .search-result-count { font-size: 13px; }
  .search-empty { padding: 50px 16px; }
  .search-empty i { font-size: 36px; margin-bottom: 14px; }
  .list-grid { grid-template-columns: 1fr; gap: 6px; }
  .list-item { padding: 10px 12px; }
  .list-item-title { font-size: 13px; line-height: 1.45; }
  .list-item-cat { font-size: 11px; padding: 2px 6px; }
}
/* 主题过渡 */
html, body, .header, .footer, .content-body, .list-item,
.card, .related-item, .category-nav-item, .page-btn, .page-num {
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
/* ============================================================
   纠正按钮 & 弹窗
   ============================================================ */
.correct-toolbar {
  margin: 24px 0;
  text-align: center;
}
.correct-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: transparent;
  color: #b8a080;
  border: 1px solid #b8a080;
  border-radius: 24px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s;
  font-family: inherit;
}
.correct-btn:hover {
  background: rgba(184, 160, 128, 0.12);
  color: #e8ddd0;
}

.correct-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.correct-modal.active { display: flex; }
.correct-modal-inner {
  background: #161210;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid #2a221a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.correct-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #2a221a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.correct-modal-header h3 {
  font-size: 17px;
  color: #e8ddd0;
  font-weight: 500;
}
.correct-close {
  background: none;
  border: none;
  color: #a89888;
  font-size: 22px;
  cursor: pointer;
}
.correct-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.correct-hint {
  font-size: 13px;
  color: #8a7a68;
  margin-bottom: 14px;
  line-height: 1.7;
}
.missing-char-demo {
  color: #d97b7b;
  background: rgba(217, 123, 123, 0.15);
  padding: 0 4px;
  border-radius: 3px;
}
.correct-textarea {
  width: 100%;
  min-height: 300px;
  padding: 14px 16px;
  background: #0f0d0a;
  border: 1px solid #2a221a;
  border-radius: 8px;
  color: #d4cdc4;
  font-size: 15px;
  line-height: 1.8;
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.correct-textarea:focus {
  border-color: #b8a080;
}
.correct-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: #0f0d0a;
  border: 1px solid #2a221a;
  border-radius: 6px;
  color: #d4cdc4;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}
.correct-input:focus { border-color: #b8a080; }
.correct-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #2a221a;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.correct-cancel,
.correct-submit {
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #2a221a;
  background: #161210;
  color: #a89888;
  transition: 0.25s;
  font-family: inherit;
}
.correct-cancel:hover { color: #e8ddd0; }
.correct-submit {
  background: #b8a080;
  color: #0c0a08;
  border-color: #b8a080;
  font-weight: 500;
}
.correct-submit:hover { background: #d4b890; }
.correct-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 亮色主题 */
html.light .correct-btn {
  color: #5a3921;
  border-color: #c4a882;
}
html.light .correct-btn:hover {
  background: #ede5db;
}
html.light .correct-modal-inner {
  background: #fcf9f5;
  border-color: #e0d8cc;
}
html.light .correct-modal-header { border-bottom-color: #e0d8cc; }
html.light .correct-modal-header h3 { color: #3d352e; }
html.light .correct-close { color: #7a6b5a; }
html.light .correct-textarea,
html.light .correct-input {
  background: #fff;
  border-color: #e0d8cc;
  color: #3d352e;
}
html.light .correct-modal-footer { border-top-color: #e0d8cc; }
html.light .correct-cancel { background: #fcf9f5; color: #7a6b5a; border-color: #e0d8cc; }
html.light .correct-submit { background: #5a3921; color: #fcf9f5; border-color: #5a3921; }

@media (max-width: 768px) {
  .correct-modal-inner { max-height: 95vh; }
  .correct-textarea { min-height: 200px; font-size: 14px; }
  .correct-modal-header,
  .correct-modal-body,
  .correct-modal-footer { padding-left: 16px; padding-right: 16px; }
}
html { scroll-behavior: smooth; }