/* ============================================================
   博客前端样式
   - header-bar / footer-text 沿用 roi.touchanbi.com 的相同代码与配色
   - 正文文字配色参考 roi.touchanbi.com 色板：
     背景 #fff9e6 / 正文 #333 / 标题 #222 / 强调红 #e62b2b / 金色 #996b00
   ============================================================ */

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft Yahei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background-color: #fff9e6;
  color: #333;
}

/* ---------------- header-bar（与 roi.touchanbi.com 相同） ---------------- */
.header-bar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 24px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}
.logo-text { display: flex; align-items: center; margin-right: 40px; }
.logo-img { height: 40px; width: auto; display: block; }
.nav-list { flex: 1; display: flex; align-items: center; gap: 30px; }
.nav-item {
  padding: 4px 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  color: #333;
  text-decoration: none;
}
.nav-item.active { color: #e62b2b; font-weight: bold; background: transparent; }

/* ---------------- 博客主体 ---------------- */
.blog-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 12px;
}

/* hero */
.blog-hero { text-align: center; padding: 12px 0 26px; }
.blog-title {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #222;
  line-height: 1.05;
}
.blog-accent { color: #e62b2b; }
.blog-sub {
  max-width: 720px;
  margin: 18px auto 0;
  font-size: 16px;
  line-height: 1.6;
  color: #666;
}
.blog-rss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  color: #996b00;
  text-decoration: none;
}
.blog-rss:hover { color: #e62b2b; }

/* 筛选条 */
.blog-filter { margin: 4px 0 26px; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 8px;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #fff5d0;
  color: #996b00;
  transition: background .15s ease, color .15s ease;
}
.filter-btn:hover { background: #ffe9a8; }
.filter-btn.active { background: #e62b2b; color: #fff; }
.filter-btn .count { margin-left: 4px; opacity: .8; font-weight: 500; }

/* 文章网格 */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 24px;
  padding-bottom: 24px;
}
.post-card { display: flex; }
.post-article {
  display: flex;
  width: 100%;
  background: #fff;
  border: 1px solid #eeeeee;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.post-article:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.post-link { display: flex; flex-direction: column; width: 100%; text-decoration: none; color: inherit; }
.post-cover {
  overflow: hidden;
  background: #f4f4f4;
  border-bottom: 1px solid #eeeeee;
}
.post-cover img {
  width: 100%;
  aspect-ratio: 1.78 / 1;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.post-article:hover .post-cover img { transform: scale(1.02); }
.post-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 188px;
  padding: 20px 20px 16px;
}
.post-time { font-size: 11px; font-weight: 500; color: #9a9a9a; }
.post-title {
  margin: 14px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #111111;
  transition: color .2s ease;
}
.post-article:hover .post-title { color: #e62b2b; }
.post-desc {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #666666;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-tags {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.post-tag {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  border-radius: 6px;
  background: #fff5d0;
  color: #996b00;
}

/* ---------------- footer-text（与 roi.touchanbi.com 相同） ---------------- */
.footer-text {
  text-align: center;
  margin: 40px 0 40px;
  font-size: 13px;
  color: #996b00;
  line-height: 1.8;
}
.footer-text .footer-line { margin: 2px 0; }
.footer-text a {
  color: #996b00;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.footer-text a:hover { color: #e62b2b; border-bottom-color: #e62b2b; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 16px; }
  .logo-text { margin-right: 0; }
  .logo-img { height: 36px; }
  .nav-list { width: 100%; gap: 8px 16px; flex-wrap: wrap; }
  .nav-item { font-size: 15px; padding: 4px 6px; }
  .blog-main { padding: 0 16px 12px; }
  .blog-title { font-size: 32px; }
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .footer-text { margin: 28px 0; font-size: 12px; }
}
@media (max-width: 480px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   文章内页（article.html）—— 结构参考 xianchou 文章页 <main>
   配色沿用 roi 色板：背景 #fff9e6 / 卡片 #fff / 正文 #333 / 标题 #222 / 强调红 #e62b2b / 金 #996b00
   ============================================================ */
.article-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 12px;
}
.article-wrap {
  margin: 8px auto 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 34px 30px 38px;
}
.article-crumbs {
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}
.article-crumbs a { color: #996b00; text-decoration: none; }
.article-crumbs a:hover { color: #e62b2b; }
.crumb-sep { margin: 0 8px; color: #ccc; }
.crumb-cur { color: #555; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.article-tag {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: #fff5d0;
  color: #996b00;
  text-decoration: none;
}
.article-tag:hover { background: #ffe9a8; }

.article-title {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #222;
}
.article-desc {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.6;
  color: #666;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}
.article-meta .meta-dot { color: #ccc; }

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  margin: 4px 0 24px;
  display: block;
  background: #f4f4f4;
}

/* 正文富文本 */
.article-content { font-size: 16px; line-height: 1.8; color: #333; }
.article-content > *:first-child { margin-top: 0; }
.article-content p { margin: 0 0 18px; }
.article-content h2 { font-size: 22px; line-height: 1.3; color: #222; margin: 28px 0 12px; font-weight: 700; }
.article-content h3 { font-size: 18px; color: #222; margin: 22px 0 10px; font-weight: 700; }
.article-content strong { color: #e62b2b; font-weight: 700; }
.article-content a { color: #e62b2b; text-decoration: underline; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.article-content blockquote {
  border-left: 4px solid #e62b2b;
  background: #fff5f5;
  padding: 12px 16px;
  margin: 0 0 18px;
  color: #555;
  border-radius: 0 8px 8px 0;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid #eee; padding: 8px 10px; text-align: left; vertical-align: top; }
.article-content th { background: #fff5d0; color: #996b00; font-weight: 700; }
.article-content hr { border: none; border-top: 1px solid #eee; margin: 24px 0; }
.article-content ul, .article-content ol { padding-left: 22px; margin: 0 0 18px; }
.article-content li { margin: 6px 0; }
.article-content iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; margin: 12px 0; }
.article-content video { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.article-content .attachment { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 16px 0; border: 1px dashed #c9b070; border-radius: 8px; background: #fffaf0; }
.article-content .attachment .att-name { font-weight: 600; color: #222; font-size: 15px; }
.article-content .attachment a { display: inline-block; padding: 6px 16px; background: #e62b2b; color: #fff !important; border-radius: 4px; text-decoration: none; font-size: 14px; }
.article-content .attachment a:hover { background: #c81f1f; }
.article-content .attachment .att-pwd { color: #996b00; font-size: 14px; }
.article-empty-note {
  color: #996b00;
  background: #fff5d0;
  padding: 14px 16px;
  border-radius: 8px;
}

.article-back {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.article-back a { color: #996b00; text-decoration: none; font-weight: 600; }
.article-back a:hover { color: #e62b2b; }

@media (max-width: 768px) {
  .article-main { padding: 0 16px 12px; }
  .article-wrap { padding: 22px 16px 26px; border-radius: 10px; }
  .article-title { font-size: 24px; }
  .article-desc { font-size: 15px; }
  .article-content { font-size: 15px; }
}

/* ============================================================
   返回顶部按钮（首页 + 文章详情页共用）
   ============================================================ */
.back-to-top-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  color: #996b00;
  border: 1px solid #eee;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s, color .2s;
}
.back-to-top-wrap.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top-wrap:hover,
.back-to-top-wrap:focus-visible {
  background: #996b00;
  color: #fff;
}
.back-to-top-wrap svg {
  width: 18px;
  height: 18px;
  margin-bottom: 3px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.back-to-top-wrap .btt-label {
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}

/* 左侧「返回顶部」提示 */
.back-to-top-wrap::after {
  content: "返回顶部";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(34, 34, 34, 0.85);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  pointer-events: none;
}
.back-to-top-wrap:hover::after,
.back-to-top-wrap:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .back-to-top-wrap { right: 16px; bottom: 16px; width: 50px; height: 50px; }
}
