/*
Theme Name: 杏林名方 TCM Classic
Theme URI: https://example.com/tcm-theme
Author: TCM Studio
Description: 古中医风格 WordPress 主题。宣纸底色、朱砂印章、楷体题名、线装书式装帧，专为中医名方典籍类内容设计，兼顾可读性与收录友好。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tcm-theme
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ===================== 基础 ===================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'FangSong', 'STFangsong', 'SimSun', 'Songti SC', 'Noto Serif SC', serif;
  font-size: 16px;
  line-height: 1.9;
  color: #2d2a26;
  background-color: #efe7d4;
  background-image:
    radial-gradient(ellipse at 18% 8%, rgba(198,165,90,.08), transparent 55%),
    radial-gradient(ellipse at 85% 92%, rgba(150,105,60,.07), transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; }
a { color: #8a3a2f; text-decoration: none; transition: color .2s; }
a:hover { color: #5f241d; text-decoration: underline; }

.site { max-width: 1100px; margin: 0 auto; padding: 18px 18px 40px; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; clip: rect(1px,1px,1px,1px); overflow: hidden;
}

/* ===================== 顶部 ===================== */
.site-header {
  position: relative;
  text-align: center;
  padding: 34px 20px 22px;
  background: linear-gradient(180deg, #f9f3e5 0%, #f2e7cf 100%);
  border-bottom: 3px double #a83a32;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 12px rgba(90,60,30,.12);
}
.site-header::before, .site-header::after {
  /* 回纹角饰 */
  content: ""; position: absolute; width: 56px; height: 56px; pointer-events: none;
  border: 2px solid rgba(168,58,50,.55);
}
.site-header::before { top: 8px; left: 8px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.site-header::after { bottom: 8px; right: 8px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }

.brand { display: inline-flex; align-items: center; gap: 16px; }
.seal {
  flex: 0 0 auto;
  width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  background: #a83a32;
  color: #f7efe0;
  font-family: 'KaiTi', 'STKaiti', 'KaiTi_GB2312', serif;
  font-size: 24px; line-height: 1.05;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(247,239,224,.6), 0 2px 6px rgba(90,30,20,.35);
  transform: rotate(-2deg);
}
.site-title {
  margin: 0; font-size: 34px; font-weight: normal;
  font-family: 'KaiTi', 'STKaiti', 'KaiTi_GB2312', 'SimSun', serif;
  letter-spacing: 6px; color: #2b1f16;
}
.site-title a { color: inherit; }
.site-description { margin: 8px 0 0; font-size: 14px; color: #7a6a54; letter-spacing: 2px; }

/* 导航 */
.main-nav { margin-top: 18px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.main-nav li a {
  display: inline-block; padding: 6px 18px; color: #4a3826; font-size: 15px;
  font-family: 'KaiTi', 'STKaiti', serif; letter-spacing: 2px;
  border: 1px solid transparent; border-radius: 3px;
}
.main-nav li.current-menu-item > a,
.main-nav li a:hover { color: #a83a32; border-color: #d8b98a; background: #fbf5e8; text-decoration: none; }

/* 汉堡菜单按钮(默认隐藏, 移动端显示) */
.nav-toggle {
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 42px; height: 42px; padding: 0;
  background: #fbf5e8; border: 1px solid #d8b98a; border-radius: 6px; cursor: pointer;
  position: absolute; top: 18px; right: 14px;
  box-shadow: 0 1px 4px rgba(90,60,30,.12);
}
.nav-toggle-bar {
  width: 20px; height: 2px; background: #a83a32; border-radius: 1px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===================== 主体布局 ===================== */
.site-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 26px;
  margin-top: 26px;
}
.main-content { min-width: 0; }
.sidebar { }
/* 移动端顶部搜索(默认隐藏, 860px 以下显示在页头下方) */
.mobile-search { display: none; }
@media (max-width: 860px) {
  .site-main { grid-template-columns: 1fr; }
  /* 移动端: 顶部大搜索栏, 隐藏侧栏重复的搜索小工具 */
  .mobile-search {
    display: block;
    margin-top: 16px;
    padding: 12px 14px;
    background: #f9f3e4;
    border: 1px solid #e2d3b4;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(90,60,30,.08);
  }
  .mobile-search .search-form input[type="search"] {
    height: 44px; padding: 8px 14px; font-size: 16px; /* 16px 避免 iOS 聚焦自动放大 */
  }
  .mobile-search .search-form button,
  .mobile-search .search-form .search-submit {
    height: 44px; padding: 0 22px; font-size: 15px;
  }
  .sidebar .widget_search { display: none; }
}

/* 文章卡 */
.card {
  background: #f9f3e4;
  border: 1px solid #e2d3b4;
  border-radius: 8px;
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: 0 1px 8px rgba(90,60,30,.08);
  position: relative;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card::before {
  content: "☯"; position: absolute; right: 14px; top: 10px;
  font-size: 18px; color: rgba(168,58,50,.35);
}
.card:hover {
  box-shadow: 0 4px 16px rgba(90,60,30,.16);
  transform: translateY(-2px);
  border-color: #d8b98a;
}

.entry-title { margin: 0 0 10px; font-size: 26px; font-weight: normal; font-family: 'KaiTi','STKaiti',serif; letter-spacing: 1px; }
.entry-title a { color: #2b1f16; }
.entry-title a:hover { color: #a83a32; text-decoration: none; }
.entry-meta { font-size: 13px; color: #9a8a70; margin-bottom: 12px; border-bottom: 1px dashed #d8c9a6; padding-bottom: 10px; }
.entry-meta a { color: #8a6d4f; }
.entry-content { font-size: 16.5px; }
.entry-content p { margin: 0 0 14px; text-align: justify; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: 'KaiTi','STKaiti','SimSun',serif; font-weight: normal; color: #2b1f16; margin: 24px 0 10px;
}
.entry-content h2 { font-size: 22px; border-left: 4px solid #a83a32; padding-left: 10px; }
.entry-content blockquote {
  margin: 16px 0; padding: 12px 18px; color: #5f4a33;
  background: #f2e9d4; border-left: 3px solid #b5905a; font-style: normal;
}
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.entry-content th, .entry-content td { border: 1px solid #d8c9a6; padding: 8px 10px; }
.entry-content th { background: #f0e5cb; font-weight: normal; }
.entry-content img { border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* 免责声明 (文章页) */
.tcm-disclaimer {
  margin-top: 18px; padding: 12px 16px;
  background: #f6ecd9; border: 1px dashed #c9a86a; border-radius: 6px;
  color: #7a6244; font-size: 14px; line-height: 1.8; text-align: justify;
}
.tcm-disclaimer strong {
  color: #a83a32; font-weight: normal;
  font-family: 'KaiTi','STKaiti',serif;
  margin-right: 10px; letter-spacing: 1px;
}

/* 摘要列表 (归档/首页) */
.posts-list .card { padding: 18px 22px; margin-bottom: 16px; border-left: 3px solid transparent; }
.posts-list .card:hover { border-left-color: #a83a32; }
.posts-list .entry-title { font-size: 21px; }
.posts-list .entry-title .num { color: #a83a32; font-style: normal; margin-right: 6px; font-family: 'KaiTi','STKaiti',serif; }
.excerpt { color: #5c4f3d; font-size: 15px; }
.read-more { display: inline-block; margin-top: 6px; color: #a83a32; font-size: 14px; }
.read-more:hover { color: #5f241d; }

/* 分页 */
.pagination, .nav-links { text-align: center; margin: 10px 0 30px; font-family: 'KaiTi','STKaiti',serif; }
.pagination .page-numbers, .nav-links .page-numbers {
  display: inline-block; padding: 4px 12px; margin: 0 2px;
  border: 1px solid #d8c9a6; border-radius: 3px; color: #5c4f3d;
}
.pagination .current, .nav-links .current { background: #a83a32; color: #f7efe0; border-color: #a83a32; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-family: 'KaiTi','STKaiti',serif; }
.prev-next a { color: #5c4f3d; }

/* 侧栏 */
.widget { background: #f9f3e4; border: 1px solid #e2d3b4; border-radius: 8px; padding: 18px 20px; margin-bottom: 20px; }
.widget-title { margin: 0 0 12px; font-size: 18px; font-weight: normal; font-family: 'KaiTi','STKaiti',serif; color: #a83a32; letter-spacing: 2px; border-bottom: 2px solid #a83a32; display: inline-block; padding-bottom: 4px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 5px 0; border-bottom: 1px dashed #e6d8b8; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: #4a3826; }

/* 归档标题 */
.archive-header, .page-header { padding: 14px 0; margin-bottom: 16px; border-bottom: 2px solid #a83a32; }
.archive-title, .page-title { margin: 0; font-size: 24px; font-weight: normal; font-family: 'KaiTi','STKaiti',serif; letter-spacing: 2px; }

/* 搜索框 */
.search-form { display: flex; }
.search-form label { flex: 1; display: flex; }
.search-form input[type="search"] { flex: 1; width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #d8c9a6; border-radius: 4px 0 0 4px; background: #fdf8ec; font-family: inherit; }
.search-form button, .search-form .search-submit {
  padding: 8px 18px; border: 1px solid #a83a32; background: #a83a32; color: #f7efe0;
  border-radius: 0 4px 4px 0; cursor: pointer; font-family: inherit; letter-spacing: 2px;
}
.search-form button:hover, .search-form .search-submit:hover { background: #8f2b22; border-color: #8f2b22; }

/* 评论 (简单) */
.comments-area { margin-top: 20px; }
.comments-title { font-family: 'KaiTi','STKaiti',serif; font-weight: normal; }

/* ===================== 首页 ===================== */
.hero {
  text-align: center; padding: 34px 20px;
  background: linear-gradient(180deg, #f4ebd6, #efe2c6);
  border: 1px solid #e2d3b4; border-radius: 8px; margin-bottom: 26px;
  position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: normal; font-family: 'KaiTi','STKaiti',serif; letter-spacing: 6px; }
.hero p { margin: 0; color: #7a6a54; letter-spacing: 1px; }
.home-section-title {
  font-size: 22px; font-weight: normal; font-family: 'KaiTi','STKaiti',serif;
  color: #a83a32; letter-spacing: 3px; margin: 26px 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.home-section-title::before { content: "❖"; font-size: 14px; color: #c9a86a; }
.home-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #c9a86a, transparent); }

/* ===================== 首页 banner (ComfyUI 古风图) ===================== */
.hero-banner {
  position: relative;
  min-height: 400px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
  background-image: url('images/banner-hero.webp');
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 18px rgba(90,60,30,.2);
  border: 1px solid #b28a5c;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 深色叠加保证文字可读 */
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40,26,10,.38), rgba(40,26,10,.62));
}
/* 两侧竖排装饰小字 */
.hero-banner .hero-side {
  position: absolute; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: 'KaiTi','STKaiti','SimSun',serif;
  font-size: 14px; letter-spacing: 8px;
  color: rgba(242,217,160,.85);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  z-index: 1;
}
.hero-banner .hero-side.left { left: 26px; }
.hero-banner .hero-side.right { right: 26px; }
/* 回纹内框 */
.hero-banner .hero-frame {
  position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px;
  border: 1px solid rgba(247,239,224,.4);
  border-radius: 6px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: 56px 28px 64px;
  text-align: center;
  color: #f7efe0;
}
.hero-kicker { font-size: 14px; letter-spacing: 6px; color: #f2d9a0; margin: 0 0 12px; }
.hero-title { font-family: 'KaiTi','STKaiti','SimSun',serif; font-size: 40px; letter-spacing: 8px; margin: 0 0 10px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero-sub { font-size: 15px; color: #f0e4cc; margin: 0 0 24px; text-shadow: 0 1px 4px rgba(0,0,0,.4); letter-spacing: 1px; }
.hero-btn {
  display: inline-block;
  padding: 10px 30px;
  font-size: 14px;
  letter-spacing: 3px;
  color: #5f241d;
  background: linear-gradient(180deg, #f7e7c4, #f2d9a0);
  border: 1px solid #d9b76a;
  border-radius: 26px;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  transition: transform .15s, box-shadow .15s;
}
.hero-btn:hover { background: #f7e7c4; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.4); }

/* 装饰 banner (ComfyUI 中药材图) */
.deco-banner {
  position: relative;
  height: 120px;
  border-radius: 10px;
  margin: 4px 0 24px;
  overflow: hidden;
  border: 1px solid #b28a5c;
  background-image: url('images/banner-herb.webp');
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 12px rgba(90,60,30,.15);
}
/* 轻微叠加突出印章 */
.deco-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(40,26,10,.18);
}
/* 中央印章 */
.deco-banner::after {
  content: "本草";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'KaiTi','STKaiti','SimSun',serif;
  font-size: 26px; letter-spacing: 10px;
  color: #fdf6e8;
  padding: 7px 16px 7px 22px;
  border: 2px solid rgba(247,239,224,.85);
  background: rgba(168,58,50,.55);
  border-radius: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* 分类页 banner (ComfyUI 书法图) */
.archive-banner {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  padding: 44px 26px;
  margin-bottom: 24px;
  color: #f7efe0;
  background-image: url('images/banner-calligraphy.webp');
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 12px rgba(90,60,30,.2);
  border: 1px solid #b28a5c;
}
.archive-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(40,26,10,.55);
}
.archive-banner::after {
  content: "";
  position: absolute; left: 12px; right: 12px; top: 12px; bottom: 12px;
  border: 1px solid rgba(247,239,224,.35);
  border-radius: 5px;
  pointer-events: none;
}
.archive-banner .archive-title,
.archive-banner .archive-description { position: relative; z-index: 1; color: #f7efe0; }

/* ===================== 文章页页头 banner ===================== */
.page-banner {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  padding: 36px 26px;
  margin-bottom: 24px;
  color: #f7efe0;
  background: linear-gradient(150deg, #7a5230 0%, #96663c 45%, #ab7a4e 100%);
  box-shadow: 0 3px 12px rgba(90,60,30,.2);
  border: 1px solid #b28a5c;
}
.page-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(40% 60% at 85% 10%, rgba(242,217,160,.16), transparent 70%);
}
.page-banner::after {
  content: "";
  position: absolute; left: 12px; right: 12px; top: 12px; bottom: 12px;
  border: 1px solid rgba(247,239,224,.35);
  border-radius: 5px;
  pointer-events: none;
}
.page-banner .breadcrumb,
.page-banner .page-banner-title { position: relative; z-index: 1; }

/* 面包屑 */
.breadcrumb { font-size: 13px; color: #e8dcc2; margin-bottom: 10px; letter-spacing: .5px; }
.breadcrumb a { color: #f2d9a0; }
.breadcrumb a:hover { color: #fff; text-decoration: none; }
.bc-sep { color: rgba(247,239,224,.6); margin: 0 6px; }
.page-banner-title { font-family: 'KaiTi','STKaiti','SimSun',serif; font-size: 30px; letter-spacing: 3px; margin: 0; color: #fff; }

/* ===================== 响应式微调 ===================== */
@media (max-width: 640px) {
  .site-header { padding: 22px 12px 16px; }
  .brand { gap: 12px; }
  .seal { width: 48px; height: 48px; font-size: 18px; }
  .site-title { font-size: 24px; letter-spacing: 4px; }
  .site-description { margin-top: 6px; font-size: 12px; letter-spacing: 1px; }
  .main-nav { margin-top: 12px; }
  .nav-toggle { display: flex; }
  .main-nav {
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease, margin-top .35s ease;
    border-top: 1px dashed #e2d3b4;
  }
  .main-nav.open { max-height: 500px; overflow-y: auto; margin-top: 14px; }
  .main-nav ul { flex-direction: column; align-items: center; gap: 2px; }
  .main-nav li { width: 100%; }
  .main-nav li a {
    display: block; padding: 9px 12px; font-size: 15px; letter-spacing: 2px;
  }
  .hero-banner { min-height: 240px; }
  .hero-inner { padding: 40px 18px 56px; }
  .hero-title { font-size: 26px; letter-spacing: 3px; }
  .hero-kicker { letter-spacing: 4px; }
  .deco-banner { height: 72px; }
  .deco-banner::after { font-size: 18px; }
  .page-banner { padding: 28px 18px; }
  .page-banner-title { font-size: 23px; }
  .archive-banner { padding: 32px 18px; }
  .cat-grid { grid-template-columns: 1fr; }
}

/* 首页疾病分类 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.cat-card {
  background: #f9f3e4;
  border: 1px solid #e2d3b4;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 6px rgba(90,60,30,.07);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #a83a32, #c9a86a);
  opacity: 0; transition: opacity .2s;
}
.cat-card:hover {
  box-shadow: 0 4px 14px rgba(90,60,30,.15);
  transform: translateY(-2px);
  border-color: #d8b98a;
}
.cat-card:hover::before { opacity: 1; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cat-title {
  font-family: 'KaiTi','STKaiti','SimSun',serif;
  font-size: 18px; letter-spacing: 1px; color: #a83a32;
}
.cat-title::before { content: "◆ "; color: rgba(168,58,50,.5); font-size: 10px; vertical-align: 2px; }
.cat-title:hover { text-decoration: none; color: #5f241d; }
.cat-count { font-size: 12px; color: #9a8a70; white-space: nowrap; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-tags a {
  font-size: 12.5px; padding: 2px 9px; color: #5c4f3d;
  background: #f2e9d4; border: 1px solid #e2d3b4; border-radius: 20px;
}
.cat-tags a em { font-style: normal; color: #a83a32; font-size: 11px; margin-left: 2px; }
.cat-tags a:hover { background: #a83a32; color: #f7efe0; text-decoration: none; border-color: #a83a32; }
.cat-tags a:hover em { color: #f2d9a0; }
.cat-tags a.cat-more { color: #a83a32; border-style: dashed; background: transparent; }
.cat-tags a.cat-more:hover { color: #f7efe0; }

/* 分类页：系统分类下按疾病分组展示 */
.archive-summary {
  margin: 0 0 16px;
  padding: 10px 16px;
  font-size: 13px; color: #7a6a52;
  background: #f2e9d4; border: 1px solid #e2d3b4; border-radius: 6px;
}
.disease-blocks { column-count: 2; column-gap: 16px; margin-bottom: 10px; }
.disease-block {
  break-inside: avoid;
  margin: 0 0 16px;
  background: #f9f3e4;
  border: 1px solid #e2d3b4;
  border-radius: 8px;
  padding: 14px 16px 14px 18px;
  box-shadow: 0 1px 6px rgba(90,60,30,.07);
  transition: box-shadow .2s, border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.disease-block::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #a83a32, #c9a86a);
  opacity: .55;
}
.disease-block:hover {
  box-shadow: 0 4px 14px rgba(90,60,30,.14);
  border-color: #d8b98a;
  transform: translateY(-2px);
}
.disease-block:hover::before { opacity: 1; }
.disease-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.disease-title {
  font-family: 'KaiTi','STKaiti','SimSun',serif;
  font-size: 19px; letter-spacing: 1px; margin: 0;
}
.disease-title a { color: #a83a32; }
.disease-title a::before { content: "◆ "; color: rgba(168,58,50,.5); font-size: 10px; vertical-align: 2px; }
.disease-title a:hover { text-decoration: none; color: #5f241d; }
.disease-count {
  font-size: 12px; color: #9a8a70; white-space: nowrap;
  background: #efe3c8; border-radius: 10px; padding: 1px 9px;
}
.disease-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.disease-posts li { margin: 0; }
.disease-posts a {
  display: inline-block;
  font-size: 13.5px; padding: 3px 12px; color: #5c4f3d;
  background: #f2e9d4; border: 1px solid #e2d3b4; border-radius: 20px;
  transition: background .2s, color .2s, border-color .2s;
}
.disease-posts a:hover {
  background: #a83a32; color: #f7efe0; text-decoration: none; border-color: #a83a32;
}
@media (max-width: 768px) {
  .disease-blocks { column-count: 1; }
}

/* 阅读时间 */
.reading-time::before { content: " · "; color: #c9b489; }

/* ===================== 页脚 ===================== */
.site-footer {
  margin-top: 34px; text-align: center; padding: 24px 16px 20px;
  border-top: 3px double #a83a32; color: #7a6a54; font-size: 14px;
  background: linear-gradient(0deg, #f2e7cf, #f8f2e4); border-radius: 0 0 6px 6px;
  position: relative;
}
.site-footer::before {
  content: "❖  ☯  ❖";
  display: block; font-size: 13px; letter-spacing: 10px;
  color: rgba(168,58,50,.4); margin-bottom: 10px;
}
.site-footer a { color: #8a6d4f; }
.site-footer a:hover { color: #a83a32; }
.footer-nav ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 10px 0 0; }
.footer-nav a { font-family: 'KaiTi','STKaiti',serif; letter-spacing: 1px; }
.site-info { margin: 10px 0 0; font-size: 13px; color: #9a8a70; }

/* ===================== 全局细节 ===================== */
::selection { background: rgba(168,58,50,.25); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #efe7d4; }
::-webkit-scrollbar-thumb { background: #c9b489; border-radius: 5px; border: 2px solid #efe7d4; }
::-webkit-scrollbar-thumb:hover { background: #a83a32; }

/* 图片淡入 */
.hero-banner, .deco-banner, .archive-banner {
  background-repeat: no-repeat;
  animation: tcm-fadein 1s ease both;
}
@keyframes tcm-fadein { from { opacity: 0; } to { opacity: 1; } }

/* 404 */
.error404 .site-main { display: block; }
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 h1 { font-size: 60px; margin: 0; color: #a83a32; font-family: 'KaiTi','STKaiti',serif; font-weight: normal; }

/* ===================== 付费解锁 ===================== */
.tcm-summary {
  padding: 16px 20px;
  margin: 0 0 20px;
  background: #fbf6ea;
  border: 1px solid #e2d3b4;
  border-left: 4px solid #c9a86a;
  border-radius: 6px;
  color: #4c4032;
  font-size: 16px;
  line-height: 2;
}
.tcm-summary p { margin: 0 0 8px; }
.tcm-summary p:last-child { margin-bottom: 0; }

.tcm-lock-box {
  position: relative;
  text-align: center;
  padding: 34px 26px;
  margin: 26px 0 10px;
  background:
    repeating-linear-gradient(45deg, rgba(168,58,50,.035) 0 10px, transparent 10px 20px),
    #fbf6ea;
  border: 2px dashed #c9a86a;
  border-radius: 10px;
  box-shadow: 0 2px 14px rgba(90,60,30,.10);
}
.tcm-lock-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.tcm-lock-title {
  margin: 0 0 8px;
  font-family: 'KaiTi','STKaiti',serif;
  font-size: 23px; font-weight: normal; letter-spacing: 3px;
  color: #8a3a2f;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.tcm-lock-note { margin: 0 auto 22px; font-size: 13.5px; color: #7d6b50; letter-spacing: .5px; line-height: 1.8; }
.tcm-lock-price { color: #c0392b; font-weight: bold; }
.tcm-lock-btn {
  display: inline-block;
  padding: 11px 34px;
  background: linear-gradient(180deg, #b0453c, #8a2f28);
  color: #fdf6e8 !important;
  border: 1px solid #7a2922;
  border-radius: 6px;
  font-family: 'KaiTi','STKaiti',serif;
  font-size: 16px; font-weight: bold; letter-spacing: 3px;
  text-shadow: 0 1px 1px rgba(90,20,10,.35);
  box-shadow: 0 2px 8px rgba(138,47,40,.35), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.tcm-lock-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #b84a40, #963329);
  box-shadow: 0 5px 16px rgba(138,47,40,.45), inset 0 1px 0 rgba(255,255,255,.18);
  text-decoration: none; color: #fff !important;
}
.tcm-lock-tip { margin: 6px 0 2px; font-size: 13.5px; color: #a87c3a; }

/* ---- SPPP 支付方式选择(古风样式) ---- */
.tcm-pay-methods {
  margin: 6px auto 16px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.tcm-pay-method {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #fff8e8;
  border: 1px solid #d9c394;
  border-radius: 20px;
  font-size: 13.5px; color: #6a5230;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tcm-pay-method:hover { background: #fdf0d0; }
.tcm-pay-method input[type="radio"] { margin: 0; accent-color: #a83a32; }
.tcm-pay-method input[type="radio"]:checked + span { color: #8a2f28; font-weight: bold; }

/* ---- 支付收款区 ---- */
.tcm-pay { margin: 20px auto 0; max-width: 480px; text-align: center; }
.tcm-pay-head {
  margin: 0 0 14px; font-family: 'KaiTi','STKaiti',serif;
  font-size: 17px; letter-spacing: 3px; color: #8a3a2f;
}
.tcm-pay-group { margin-bottom: 16px; }
.tcm-pay-label {
  margin: 0 0 10px; font-size: 13px; letter-spacing: 1px; color: #7a6a52;
}
.tcm-pay-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tcm-pay-btn {
  flex: 0 1 auto; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px;
  width: 178px;
  padding: 9px 10px 9px 12px;
  background: linear-gradient(180deg, #fffef9, #faf3e2);
  color: #4a3b28;
  border: 1px solid #ddcaa4;
  border-radius: 30px;
  font-size: 14px; font-family: inherit; letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(90,60,30,.08), 0 2px 6px rgba(90,60,30,.06);
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.tcm-pay-btn:hover {
  transform: translateY(-1px);
  border-color: #c9a86a;
  background: linear-gradient(180deg, #fffcf2, #f7ecd2);
  box-shadow: 0 3px 10px rgba(90,60,30,.16);
}
.tcm-pay-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(90,60,30,.12);
}
.tcm-pay-btn:focus-visible {
  outline: 2px solid #c9a86a; outline-offset: 2px;
}
.tcm-pay-ico {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 13px; font-weight: bold; line-height: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 2px rgba(0,0,0,.10);
}
.tcm-pay-ico-wechat { background: linear-gradient(180deg, #2BD36B, #07C160); }
.tcm-pay-ico-alipay { background: linear-gradient(180deg, #4B93FF, #1677FF); }
.tcm-pay-ico-crypto { background: linear-gradient(180deg, #33C795, #26A17B); }
.tcm-pay-ico-paypal { background: linear-gradient(180deg, #1B4DBF, #003087); }
.tcm-pay-btn-text {
  flex: 1 1 auto; text-align: center;
  font-size: 14px; font-weight: 600; white-space: nowrap; line-height: 1;
}
@media (max-width: 480px) {
  .tcm-pay-buttons { gap: 8px; }
  .tcm-pay-btn { flex: 1 1 calc(50% - 8px); width: auto; min-width: 0; padding: 9px 8px; }
  .tcm-pay-btn-text { letter-spacing: 0; }
}
.tcm-crypto-arrow { display: inline-block; font-style: normal; font-size: 11px; margin-left: 2px; transition: transform .18s; }
.tcm-pay-crypto-toggle.open .tcm-crypto-arrow { transform: rotate(180deg); }
.tcm-pay-crypto-wrap { display: inline-block; vertical-align: top; position: relative; }
.tcm-pay-crypto-list {
  position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%);
  z-index: 6; width: 300px; max-width: calc(100vw - 40px);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #fffdf6, #faf3e2);
  border: 1px solid #d9c394; border-radius: 16px;
  box-shadow: 0 10px 28px rgba(90,60,30,.22);
  max-height: 300px; overflow-y: auto;
  animation: tcmCryptoPop .18s ease;
}
.tcm-pay-crypto-list-title {
  grid-column: 1 / -1;
  font-size: 12px; letter-spacing: 2px; color: #9a8a70;
  text-align: center; padding-bottom: 4px; margin-bottom: 2px;
  border-bottom: 1px dashed #e2d3b4;
}
@keyframes tcmCryptoPop {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.tcm-pay-crypto-list::-webkit-scrollbar { width: 6px; }
.tcm-pay-crypto-list::-webkit-scrollbar-thumb { background: #ddcaa4; border-radius: 3px; }
.tcm-pay-crypto-item {
  justify-content: flex-start; gap: 8px;
  width: auto; min-width: 0; padding: 7px 10px 7px 8px;
  background: #fff; border: 1px solid #e6d8b8; border-radius: 12px;
  box-shadow: none;
}
.tcm-pay-crypto-item:hover {
  border-color: #c9a86a; background: #fffaf0;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(90,60,30,.12);
}
.tcm-crypto-coin {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: bold; line-height: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.tcm-crypto-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tcm-crypto-name { font-size: 13.5px; font-weight: bold; color: #4a3b28; letter-spacing: .5px; line-height: 1.1; }
.tcm-crypto-net {
  font-size: 10.5px; color: #8a7a5c; background: #f3ead3;
  border-radius: 8px; padding: 1px 7px; letter-spacing: .5px; line-height: 1.5;
}
.tcm-pay-tip { margin: 10px 0 0; font-size: 12px; color: #9a8a70; text-align: center; }

/* ---- 二维码弹窗 ---- */
.tcm-pay-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,35,20,.55);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.tcm-pay-modal[aria-hidden="false"] { opacity: 1; visibility: visible; }
.tcm-pay-modal-box {
  position: relative; width: 330px; max-width: 92vw;
  background: linear-gradient(180deg, #fdf9ef, #f6ecd8);
  border: 2px solid #c9a86a; border-radius: 14px;
  padding: 24px 24px 22px; text-align: center;
  box-shadow: 0 16px 48px rgba(45,35,20,.45);
}
.tcm-pay-modal-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, #07C160, #1677FF, #003087);
  border-radius: 12px 12px 0 0;
}
.tcm-pay-modal-close {
  position: absolute; right: 8px; top: 6px;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: #9a8a70; cursor: pointer; z-index: 2;
}
.tcm-pay-modal-close:hover { color: #a83a32; }
.tcm-pay-modal-title {
  margin: 0 0 14px; font-family: 'KaiTi','STKaiti',serif;
  font-size: 19px; letter-spacing: 2px; color: #8a3a2f;
}
.tcm-pay-modal-amount {
  margin: -4px 0 12px; font-size: 16px; color: #c0392b; font-weight: bold; letter-spacing: .5px;
}
.tcm-pay-modal-body { display: flex; justify-content: center; }
.tcm-pay-modal-body #tcm-pay-qrcode {
  width: 208px; height: 208px; padding: 10px; background: #fff;
  border: 1px solid #e2d3b4; border-radius: 8px; box-shadow: 0 2px 8px rgba(90,60,30,.10);
}
.tcm-pay-modal-body #tcm-pay-qrcode img,
.tcm-pay-modal-body #tcm-pay-qrcode canvas {
  display: block; width: 100% !important; height: 100% !important;
}
.tcm-pay-modal-status { margin: 16px 0 4px; font-size: 14px; color: #7a6a52; }
.tcm-pay-modal-status.tcm-pay-ok { color: #0a7a3d; font-weight: bold; }
.tcm-pay-modal-status.tcm-pay-err { color: #c0392b; }
.tcm-pay-modal-link {
  display: inline-block; margin-top: 10px; padding: 6px 16px;
  background: #1677FF; color: #fff; border-radius: 18px; font-size: 13px;
  text-decoration: none;
}
.tcm-pay-modal-link:hover { background: #0f66e0; color: #fff; }

/* ---- 加密支付信息 ---- */
.tcm-pay-modal-crypto { margin-top: 14px; text-align: left; }
.tcm-pay-crypto-amount {
  margin: 0 0 6px; font-size: 15px; color: #8a3a2f; font-weight: bold; letter-spacing: .5px;
}
.tcm-pay-crypto-address {
  margin: 0 0 8px; padding: 7px 9px; font-size: 12px; color: #4a3b28;
  background: #fff; border: 1px solid #e2d3b4; border-radius: 6px;
  word-break: break-all; line-height: 1.6;
}
.tcm-pay-copy-btn {
  display: inline-block; padding: 5px 16px; background: #26A17B; color: #fff;
  border: none; border-radius: 16px; font-size: 12.5px; cursor: pointer;
  transition: background .15s;
}
.tcm-pay-copy-btn:hover { background: #1f8a68; }
.tcm-pay-crypto-memo { margin: 9px 0 0; font-size: 12.5px; color: #c0392b; letter-spacing: .5px; }

/* ---- 后台订单状态徽章 ---- */
.tcm-order-status {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; line-height: 1.7;
}
.tcm-order-status-approved { background: #e5f6e9; color: #0a7a3d; }
.tcm-order-status-awaiting { background: #fff4d6; color: #9a6a00; }
.tcm-order-status-expired { background: #f3e2e0; color: #a03a30; }

/* ---- 支付结果浮层 ---- */
.tcm-pay-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 100000; max-width: 88vw;
  padding: 10px 22px; border-radius: 24px;
  background: rgba(45,35,20,.85); color: #f7efe0;
  font-size: 14px; letter-spacing: 1px; text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.tcm-pay-toast-ok { background: rgba(10,122,61,.92); }

/* ---- 用户菜单(页头) ---- */
.user-menu {
  position: absolute; top: 30px; right: 26px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: #5d4e38;
}
.user-menu-name { display: inline-flex; align-items: center; gap: 6px; }
.tcm-member-badge {
  font-style: normal; font-size: 11px; padding: 1px 6px;
  background: #a83a32; color: #f7efe0; border-radius: 3px;
}
.user-menu-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 17px 0 19px; /* 右侧补偿 letter-spacing 尾部空隙 */
  font-family: 'KaiTi','STKaiti',serif;
  font-size: 15px; letter-spacing: 2px; line-height: 1;
  color: #6b5836; text-decoration: none;
  border: 1px solid #cbb488; border-radius: 999px;
  background: rgba(255,252,244,.65);
  transition: color .22s ease, border-color .22s ease, background-color .22s ease,
              box-shadow .22s ease, transform .22s ease;
}
.user-menu-link:hover {
  color: #a83a32; border-color: #d4938c;
  background: rgba(168,58,50,.07);
  text-decoration: none;
}
.user-menu-link:focus-visible {
  outline: 2px solid #a83a32; outline-offset: 2px;
}
.user-menu-register {
  color: #f9f3e4; border-color: transparent;
  background: linear-gradient(180deg, #b0433a 0%, #98291f 100%);
  box-shadow: 0 2px 6px rgba(152,41,31,.32), inset 0 1px 0 rgba(255,255,255,.18);
}
.user-menu-register:hover {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, #b94b41 0%, #a12e24 100%);
  box-shadow: 0 4px 10px rgba(152,41,31,.38), inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.user-menu-register:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(152,41,31,.32), inset 0 1px 0 rgba(255,255,255,.15);
}
@media (max-width: 900px) {
  /* 移动端不再隐藏登录/注册: 居中一行, 保证有登录入口 */
  .user-menu {
    position: static; justify-content: center;
    margin-top: 16px;
  }
  .user-menu-link { height: 30px; padding: 0 15px 0 17px; font-size: 14px; }
}

/* ---- 登录 / 注册 ---- */
.tcm-auth-card { max-width: 460px; margin: 0 auto; }
.tcm-auth-error {
  padding: 10px 14px; background: #fbe9e6; border: 1px solid #e5b4ac;
  color: #a83a32; border-radius: 6px; font-size: 14px;
}
.tcm-auth-ok {
  padding: 10px 14px; background: #eef5e8; border: 1px solid #bfd8a8;
  color: #4a7a2f; border-radius: 6px; font-size: 14px;
}
.tcm-auth-desc { color: #7a6a52; font-size: 14px; }
.tcm-auth-form p { margin: 14px 0; }
.tcm-auth-form label { display: block; margin-bottom: 6px; font-size: 14px; color: #5d4e38; }
.tcm-auth-form input[type="text"],
.tcm-auth-form input[type="email"],
.tcm-auth-form input[type="password"] {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid #d8c9a6; border-radius: 6px;
  background: #fffdf6; font-size: 15px; color: #4a3b28;
}
.tcm-auth-form input:focus { outline: none; border-color: #a83a32; box-shadow: 0 0 0 3px rgba(168,58,50,.12); }
.tcm-auth-remember { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.tcm-auth-remember input { width: auto; }
.tcm-auth-submit {
  width: 100%; padding: 11px 0; cursor: pointer;
  background: linear-gradient(180deg, #a83a32, #8a2f28);
  color: #f7efe0; border: 1px solid #7a2922; border-radius: 24px;
  font-family: 'KaiTi','STKaiti',serif; font-size: 17px; letter-spacing: 4px;
  transition: transform .15s, box-shadow .15s;
}
.tcm-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(138,47,40,.4); }
.tcm-auth-foot { margin-top: 18px; font-size: 13.5px; text-align: center; color: #7a6a52; }
.tcm-auth-foot .sep { margin: 0 8px; color: #c9a86a; }

/* ---- 登录页注册按钮 ---- */
.tcm-auth-reg { margin: 22px 0 0; }
.tcm-auth-reg-btn {
  display: block; text-align: center;
  padding: 11px 0; border: 1px solid #c9a86a; border-radius: 24px;
  color: #a83a32; background: transparent;
  font-family: 'KaiTi','STKaiti',serif; font-size: 16px; letter-spacing: 3px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tcm-auth-reg-btn:hover {
  background: #c9a86a; color: #fff; text-decoration: none;
  box-shadow: 0 3px 10px rgba(201,168,106,.35);
}
