/*
Theme Name: CTOUY Blog
Theme URI: https://ctouy.com
Description: 黑白灰扁平风格响应式博客主题
Version: 2.6.2
Author: CTOUY
License: GPL v2 or later
Tags: responsive, blog, minimal, black-white-gray, flat-design
*/

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: #333;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #333; text-decoration: none; transition: color .2s; }
a:hover { color: #000; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ========== Header ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}
.site-logo { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; white-space: nowrap; }
.site-logo a { color: #111; }
.site-logo a:hover { color: #555; }

/* 主导航 - 下划线风格，靠左对齐 */
.main-nav { margin-right: auto; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 8px 0;
  margin: 0 10px;
  font-size: 14px;
  color: #444;
  border-radius: 0;
  white-space: nowrap;
  position: relative;
  transition: color .2s;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #333;
  transform: translateX(-50%);
  transition: width .2s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  background: transparent;
  color: #000;
}
.main-nav a:hover::after,
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
  width: 8px;
}

/* 页眉搜索 - 长方形一体化 */
.header-search { display: flex; flex-shrink: 0; }
.header-search form {
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
  background: #fafafa;
  transition: border-color .2s;
}
.header-search form:focus-within { border-color: #999; }
.header-search input[type="search"] {
  width: 180px;
  height: 34px;
  line-height: 1;
  padding: 0 12px;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: transparent;
  box-sizing: border-box;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.header-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.header-search .search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 0;
  border-left: 1px solid #ddd;
  background: #333;
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex-shrink: 0;
  transition: background .2s;
}
.header-search .search-submit:hover { background: #000; }
.header-search .search-submit svg { display: block; width: 16px; height: 16px; }

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  color: #333;
}

/* ========== Main Content ========== */
.site-content { padding: 16px 0; flex: 1 0 auto; }

/* 面包屑 */
.breadcrumb {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
  padding: 16px;
  background: #fff;
}
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #000; }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }
.breadcrumb .current { color: #333; }

/* 内容包装 */
.content-wrapper {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.main-content { flex: 1; min-width: 0; }
.main-content > .page-content {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 28px;
  margin-bottom: 16px;
}

/* ========== 文章列表卡片 ========== */
.post-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* 列表缩略图：长方形 160x120（有图时显示，无图时整块隐藏） */
.entry-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 120px;
  max-width: 160px;
  max-height: 120px;
  overflow: hidden;
  border-radius: 4px;
  background: #f0f0f0;
}
.entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .entry-thumb img { transform: scale(1.03); }

/* 无图时：隐藏缩略图占位，标题占满整行 */
.post-card.no-thumb .entry-thumb { display: none; }

.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-title a { color: #111; }
.post-title a:hover { color: #555; }

.post-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

/* ========== 分页 / 自动加载 ========== */
.pagination {
  text-align: center;
  margin: 24px 0;
  display: none;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
}
.pagination .current { background: #333; color: #fff; border-color: #333; }

.load-more-wrapper { text-align: center; margin: 24px 0; }
.load-more-btn {
  display: none;
  padding: 10px 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}
.load-more-btn:hover { background: #000; }
.load-more-btn:disabled { background: #ccc; cursor: not-allowed; }
.load-more-loading { color: #999; font-size: 14px; padding: 10px; }
.load-more-end { color: #bbb; font-size: 14px; padding: 10px; }

/* ========== 侧边栏 ========== */
.sidebar { width: 300px; flex-shrink: 0; }
.widget {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 16px;
}
.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

/* 小工具内文章列表 */
.widget-post-list { display: flex; flex-direction: column; gap: 12px; }
.widget-post-item { display: flex; gap: 10px; }
.widget-post-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}
.widget-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-post-info { flex: 1; min-width: 0; }
.widget-post-info a {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.widget-post-info a:hover { color: #000; }

/* 快速链接小工具 */
.widget-links { display: flex; flex-direction: column; gap: 8px; }
.widget-links a {
  display: block;
  padding: 8px 12px;
  background: #f8f8f8;
  border-radius: 4px;
  font-size: 13px;
  color: #444;
  transition: background .2s;
}
.widget-links a:hover { background: #eee; color: #000; }

/* 联系我们小工具 */
.widget-contact { font-size: 13px; color: #444; line-height: 1.8; }
.widget-contact .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}
.widget-contact .contact-item:last-of-type { border-bottom: none; }
.widget-contact .contact-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 50%;
  color: #555;
}
.widget-contact .contact-icon svg { width: 14px; height: 14px; }
.widget-contact .contact-info { flex: 1; min-width: 0; }
.widget-contact .contact-label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-bottom: 1px;
}
.widget-contact .contact-value {
  font-size: 13px;
  color: #333;
  word-break: break-word;
}
.widget-contact .contact-value a { color: #333; }
.widget-contact .contact-value a:hover { color: #000; }
.widget-contact .contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.widget-contact .contact-links a {
  display: block;
  padding: 7px 12px;
  background: #f8f8f8;
  border-radius: 4px;
  font-size: 13px;
  color: #444;
  transition: background .2s;
}
.widget-contact .contact-links a:hover { background: #eee; color: #000; }

/* 二维码小工具 */
.widget-qrcode { text-align: center; }
.widget-qrcode img { width: 160px; height: 160px; margin: 0 auto 10px; border: 1px solid #eee; border-radius: 4px; }
.widget-qrcode p { font-size: 13px; color: #666; }

/* 网站简介小工具 */
.widget-site-intro { text-align: center; padding: 4px 0; }
.site-intro-logo { margin-bottom: 12px; }
.site-intro-logo img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  display: inline-block;
}
.site-intro-name {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}
.site-intro-text {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin-bottom: 10px;
}
.site-intro-meta {
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}
.site-intro-meta a { color: #888; border-bottom: 1px solid #ddd; }
.site-intro-meta a:hover { color: #000; border-color: #999; }
.site-intro-since { color: #aaa; }

/* 搜索小工具 */
.widget-search input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  background: #fafafa;
}
.widget-search input[type="search"]:focus { border-color: #999; }
.widget-search button {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

/* ========== 文章详情页 ========== */
.entry-article {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 28px;
  margin-bottom: 16px;
  box-sizing: border-box;
}
.single-title {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  line-height: 1.4;
}
.single-meta {
  font-size: 13px;
  color: #999;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.single-meta span { display: inline-flex; align-items: center; }
.single-content {
  font-size: 16px;
  line-height: 1.85;
  color: #333;
}
.single-content h2, .single-content h3 { margin: 28px 0 14px; color: #111; }
.single-content h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.single-content h3 { font-size: 17px; }
.single-content p { margin-bottom: 16px; }
.single-content img { max-width: 100%; border-radius: 4px; margin: 16px 0; }
.single-content blockquote {
  border-left: 4px solid #ddd;
  padding: 12px 20px;
  background: #f9f9f9;
  color: #666;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}
.single-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
  font-family: "SF Mono", Consolas, monospace;
}
.single-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 18px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}
.single-content pre code { background: none; padding: 0; color: inherit; }
.single-content a { color: #06c; border-bottom: 1px solid #cce; }
.single-content a:hover { color: #004c99; border-color: #004c99; }
.single-content ul, .single-content ol { padding-left: 24px; margin-bottom: 16px; }
.single-content ul li { list-style: disc; margin-bottom: 6px; }
.single-content ol li { list-style: decimal; margin-bottom: 6px; }

/* 标签 */
.single-tags { margin-top: 28px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.single-tags a {
  display: inline-block;
  padding: 4px 14px;
  background: #f5f5f5;
  color: #555;
  font-size: 13px;
  border-radius: 3px;
  margin: 0 6px 6px 0;
  transition: background .2s;
}
.single-tags a:hover { background: #ddd; color: #111; }

/* 下载链接 */
.download-box {
  margin: 28px 0;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}
.download-box-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8e8e8;
}
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}
.download-item:last-child { border-bottom: none; }
.download-info { flex: 1; min-width: 0; }
.download-name { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 4px; }
.download-meta { font-size: 12px; color: #999; }
.download-link {
  display: inline-block;
  padding: 6px 18px;
  background: #333;
  color: #fff !important;
  font-size: 13px;
  border-radius: 4px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.download-link:hover { background: #000; color: #fff !important; }
.download-code {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.download-code strong { color: #555; }

/* 相关文章 + 热门文章（同款5列2行卡片） */
.related-posts { margin-top: 24px; padding: 28px; background: #ffffff; border-radius: 6px; border: 1px solid #ececec; }
.related-posts-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
.related-grid-5x2 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

/* related-card：无边框、hover 无阴影 */
.related-card {
  display: block;
  background: #fff;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  transition: opacity .2s;
  text-decoration: none;
}
.related-card:hover { box-shadow: none; opacity: .85; }

/* 缩略图：固定高度 */
.related-card .entry-thumb {
  display: block;
  width: 100%;
  height: 110px;
  overflow: hidden;
  background: #f0f0f0;
}
.related-card .entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 标题：4行截断 */
.related-card-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  padding: 6px 4px;
  line-height: 1.4;
  color: #333;
}
.related-card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: break-word;
  color: #333;
}
.related-card-title a:hover { color: #000; }

/* 热门文章（文章页内）—— 与"你可能喜欢"同款 */
.single-hot-posts { margin-top: 24px; padding: 28px; background: #ffffff; border-radius: 6px; border: 1px solid #ececec; }

/* 版权声明 */
.copyright-notice {
  margin: 16px 0 0;
  padding: 18px 20px;
  background: #f7f8fc;
  border: 1px solid #e8ecf3;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  box-sizing: border-box;
}
.copyright-notice .copyright-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}
.copyright-notice a { color: #555; border-bottom: 1px solid #ddd; }
.copyright-notice a:hover { color: #000; border-color: #999; }
.copyright-notice p { margin-bottom: 4px; }
.copyright-notice p:last-child { margin-bottom: 0; }

/* ========== 独立页面 ========== */
.page-content {
  margin-bottom: 16px;
}
.page-title { font-size: 22px; font-weight: 700; color: #111; margin-bottom: 20px; }

/* ========== 搜索结果 ========== */
.search-result-notice {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}
.search-result-notice strong { color: #111; }

/* ========== 404 ========== */
.error-404-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}
.error-404 {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  max-width: 520px;
  width: 100%;
}
.error-404 h1 { font-size: 72px; color: #ddd; margin-bottom: 16px; }
.error-404 p { font-size: 16px; color: #888; margin-bottom: 24px; }
.error-404 a {
  display: inline-block;
  padding: 10px 28px;
  background: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
}
.error-404 a:hover { background: #000; }

/* ========== Footer ========== */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 24px 0;
  margin-top: auto;
  text-align: center;
  flex-shrink: 0;
  width: 100%;
}
.footer-copy {
  font-size: 13px;
  color: #888;
  line-height: 1.8;
}
.footer-copy a { color: #666; }
.footer-copy a:hover { color: #000; }
.footer-about {
  font-size: 13px;
  color: #333333;
  line-height: 1.8;
  margin-bottom: 4px;
}

/* ========== 留言板页面 ========== */
.guestbook-form {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}
.guestbook-form .form-row { margin-bottom: 16px; }
.guestbook-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.guestbook-form input[type="text"],
.guestbook-form input[type="email"],
.guestbook-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  transition: border-color .2s;
  box-sizing: border-box;
}
.guestbook-form input[type="text"]:focus,
.guestbook-form input[type="email"]:focus,
.guestbook-form textarea:focus { border-color: #999; }
.guestbook-form textarea { min-height: 140px; resize: vertical; }
.guestbook-form .submit-btn {
  display: inline-block;
  padding: 10px 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}
.guestbook-form .submit-btn:hover { background: #000; }
.guestbook-form .form-hint { font-size: 12px; color: #999; margin-top: 4px; }

/* 留言列表 */
.guestbook-list { margin-top: 8px; }
.guestbook-item {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.guestbook-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.guestbook-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  flex-shrink: 0;
  overflow: hidden;
}
.guestbook-avatar img { width: 100%; height: 100%; object-fit: cover; }
.guestbook-author { font-size: 14px; font-weight: 600; color: #333; }
.guestbook-date { font-size: 12px; color: #999; }
.guestbook-body { font-size: 14px; color: #444; line-height: 1.7; white-space: pre-wrap; }
.guestbook-empty { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

/* ========== 赞赏页面 ========== */
.donate-section {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 32px 28px;
  margin-bottom: 20px;
  text-align: center;
}
.donate-intro {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 28px;
}
.donate-qrcodes {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.donate-qr-item {
  text-align: center;
}
.donate-qr-item img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff;
}
.donate-qr-item .qr-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.donate-thanks {
  font-size: 14px;
  color: #888;
  margin-top: 8px;
}

/* 赞赏名单 */
.donate-list-section {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 24px 28px;
}
.donate-list-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
.donate-list { display: flex; flex-wrap: wrap; gap: 10px; }
.donate-list .donor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 13px;
  color: #444;
}
.donate-list .donor-chip .donor-name { font-weight: 600; color: #333; }
.donate-list .donor-chip .donor-amount { color: #999; font-size: 12px; }
.donate-empty { color: #999; font-size: 14px; padding: 12px 0; }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .content-wrapper { flex-direction: column; }
  .sidebar { width: 100%; }
  .header-search input[type="search"] { width: 140px; }
  .related-grid-5x2 { grid-template-columns: repeat(2, 1fr); }
  .donate-qrcodes { gap: 24px; }
}

@media (max-width: 640px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }
  .site-logo { font-size: 17px; }

  /* 导航菜单 - 移动端下拉 */
  .main-nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
  }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a {
    padding: 10px 0;
    margin: 0;
    border-radius: 0;
  }
  .main-nav a::after {
    left: 0;
    transform: none;
  }
  .main-nav a:hover,
  .main-nav .current-menu-item > a,
  .main-nav .current_page_item > a {
    background: transparent;
  }
  .main-nav a:hover::after,
  .main-nav .current-menu-item > a::after,
  .main-nav .current_page_item > a::after {
    width: 8px;
  }
  .menu-toggle { display: inline-block; order: 3; }

  /* 移动端搜索框：在 LOGO 与菜单按钮中间 */
  .header-search {
    order: 2;
    flex: 1;
    min-width: 0;
    margin: 0 8px;
  }
  .header-search form {
    width: 100%;
    display: flex;
    align-items: center;
    height: 34px;
    border-radius: 3px;
  }
  .header-search input[type="search"] {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 34px;
    line-height: 1;
    font-size: 14px;
    padding: 0 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  .header-search .search-submit {
    width: 36px;
    height: 34px;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  .header-search .search-submit svg { width: 16px; height: 16px; display: block; }

  /* 文章列表 - 缩略图长方形 100x70，无图时隐藏 */
  .post-card { flex-direction: row; gap: 12px; padding: 12px; }
  .entry-thumb { width: 100px; height: 70px; max-width: 100px; max-height: 70px; }
  .post-card.no-thumb .entry-thumb { display: none; }
  .post-title { font-size: 14px; -webkit-line-clamp: 3; }
  .post-excerpt { display: none; }

  .main-content > .entry-article,
  .main-content > .page-content { padding: 18px; }
  .single-title { font-size: 20px; }
  .single-content { font-size: 15px; }

  .related-grid-5x2 { grid-template-columns: 1fr; gap: 10px; }
  .related-card { display: flex; flex-direction: row; }
  .related-card .entry-thumb { width: 100px; height: 70px; flex-shrink: 0; }
  .related-card .entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .related-card-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    margin: 0;
    line-height: 1.4;
  }
  .related-card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .copyright-notice { padding: 14px 16px; font-size: 12px; }

  .download-item { flex-direction: column; align-items: flex-start; }
  .download-link { align-self: flex-start; }

  .error-404 h1 { font-size: 48px; }
  .error-404 { padding: 40px 16px; }

  /* 留言板移动端 */
  .guestbook-form { padding: 18px; }
  .guestbook-form input[type="text"],
  .guestbook-form input[type="email"],
  .guestbook-form textarea { font-size: 14px; }

  /* 赞赏移动端 */
  .donate-section { padding: 24px 16px; }
  .donate-qrcodes { gap: 16px; }
  .donate-qr-item img { width: 140px; height: 140px; }
}

/* ========== 原生评论区（留言板） ========== */
.comments-area {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 28px;
  margin-bottom: 16px;
}
.comments-area .comments-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; }
.comment-list .comment:last-child,
.comment-list .pingback:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: #999; margin-bottom: 6px; }
.comment-meta a { color: #666; }
.comment-author { font-size: 14px; font-weight: 600; color: #333; margin-right: 8px; }
.comment-author .avatar { border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.comment-content { font-size: 14px; color: #444; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.comment-content p { margin-bottom: 8px; }
.comment-respond {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 24px;
  margin-top: 16px;
}
.comment-respond .comment-reply-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
}
.comment-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  box-sizing: border-box;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: #999; }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .form-submit { margin-top: 4px; }
.comment-form .submit {
  display: inline-block;
  padding: 10px 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}
.comment-form .submit:hover { background: #000; }
.comment-form .logged-in-as { font-size: 13px; color: #888; margin-bottom: 12px; }
.comment-form .logged-in-as a { color: #555; }
.no-comments { text-align: center; color: #999; padding: 24px 0; font-size: 14px; }

/* ========== content_hide 短代码样式 ========== */
.ctouy-content-hide {
    margin: 24px 0;
    padding: 32px 24px;
    background: #f8f8f8;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
}
.ctouy-ch-icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.ctouy-ch-tip {
    font-size: 15px;
    color: #555;
    margin-bottom: 16px;
    line-height: 1.6;
}
.ctouy-ch-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ctouy-ch-input {
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 220px;
    max-width: 100%;
    outline: none;
    transition: border-color .2s;
}
.ctouy-ch-input:focus {
    border-color: #333;
}
.ctouy-ch-btn {
    padding: 10px 24px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.ctouy-ch-btn:hover {
    background: #000;
}
.ctouy-ch-error {
    margin-top: 12px;
    color: #c00;
    font-size: 13px;
}
.ctouy-content-hide-unlocked {
    background: #f0faf0;
    border: 2px solid #c8e6c9;
    text-align: left;
    padding: 20px 24px;
}
.ctouy-ch-unlocked-header {
    font-size: 14px;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #c8e6c9;
}
.ctouy-ch-content {
    line-height: 1.8;
    color: #333;
}
.ctouy-ch-content img {
    max-width: 100%;
    height: auto;
}
@media (max-width: 640px) {
    .ctouy-content-hide {
        padding: 24px 16px;
    }
    .ctouy-ch-form {
        flex-direction: column;
    }
    .ctouy-ch-input {
        width: 100%;
    }
    .ctouy-ch-btn {
        width: 100%;
    }
}

