/*
Theme Name: Zibi Theme
Theme URI: https://example.com/zibi
Author: Zibi
Author URI: https://example.com
Description: 一款现代化、高颜值的中文 WordPress 主题，参考子比主题设计风格：卡片式布局、暗黑模式、点赞互动、热门排行、用户菜单、移动端适配，开箱即用。
Version: 1.0.0
Requires at least: 5.9
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: zibi
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, dark-mode
*/

/* ============ 1. 变量 ============ */
:root {
  --primary: #3f66f9;
  --primary-2: #7a4df8;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1f2329;
  --text-2: #7d838f;
  --border: #edeff4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(31, 41, 74, 0.06);
  --shadow-hover: 0 12px 32px rgba(31, 41, 74, 0.12);
  --header-bg: rgba(255, 255, 255, 0.86);
  --code-bg: #f3f5f9;
  --pre-bg: #1e2230;
  --pre-text: #e6e8ee;
}

html[data-theme="dark"] {
  --bg: #101319;
  --card-bg: #191d27;
  --text: #e6e8ee;
  --text-2: #8a8fa0;
  --border: #262b38;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(16, 19, 25, 0.86);
  --code-bg: #12151d;
  --pre-bg: #0c0e14;
}

/* ============ 2. 基础重置 ============ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary); }

button { font-family: inherit; }

::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(125, 131, 143, 0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(125, 131, 143, 0.7); }
::-webkit-scrollbar-track { background: transparent; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease,
    background-color 0.3s ease, border-color 0.3s ease;
}

/* ============ 3. 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 16px rgba(31, 41, 74, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.custom-logo { display: inline-flex; align-items: center; }
.custom-logo img { max-height: 40px; width: auto; }

.site-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.site-title:hover { color: var(--primary); }

.main-nav { flex: 1; min-width: 0; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu li { position: relative; }

.nav-menu a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.nav-menu a:hover {
  color: var(--primary);
  background: var(--bg);
}

.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  color: var(--primary);
  background: var(--bg);
  font-weight: 600;
}

/* 下拉子菜单 */
.nav-menu ul ul,
.nav-menu .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

.nav-menu li:hover > ul,
.nav-menu li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu ul ul ul { left: calc(100% + 6px); top: -6px; }

.nav-menu ul ul li a {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.icon-btn:hover { background: var(--bg); color: var(--primary); }

/* 暗色切换按钮图标：亮色显示月亮，暗色显示太阳 */
.icon-sun,
.icon-moon { display: inline-flex; }
[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* 用户菜单 */
.user-menu { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.user-btn:hover { border-color: var(--primary); }
.user-btn img { width: 100%; height: 100%; border-radius: 50%; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
  z-index: 60;
}

.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-head {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-head strong { font-size: 14px; }
.user-dropdown-head span {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.user-dropdown a:hover { background: var(--bg); color: var(--primary); }

/* 顶部搜索框 */
.header-search {
  max-height: 0;
  overflow: hidden;
  background: var(--card-bg);
  border-bottom: 1px solid transparent;
  transition: max-height 0.3s ease, border-color 0.3s ease;
}

.header-search.open {
  max-height: 90px;
  border-bottom-color: var(--border);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.search-form svg { color: var(--text-2); flex-shrink: 0; }

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-bottom: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}
.search-form input[type="search"]:focus { border-bottom-color: var(--primary); }

/* 移动端菜单按钮 */
.nav-toggle { display: none; }

/* ============ 4. 布局 ============ */
.site-main { min-height: calc(100vh - 64px - 220px); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding: 24px 0 48px;
}

.layout-narrow {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  margin: 0 auto;
}

.content-area { min-width: 0; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ============ 5. 面包屑 ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-2);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { color: var(--border); font-style: normal; }
.breadcrumb .current { color: var(--text); }

/* ============ 6. 文章卡片 ============ */
.post-card { overflow: hidden; display: flex; flex-direction: column; }

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.post-thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg);
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-thumb img { transform: scale(1.06); }

.post-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.post-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.post-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 16px 18px 18px;
}

.post-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.post-title a { display: block; }
.post-title a:hover { color: var(--primary); }

.sticky .post-title a::after {
  content: "置顶";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 6px;
  vertical-align: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ff9f43);
}

.post-excerpt {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.post-meta span,
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.post-meta svg { opacity: 0.75; }

/* ============ 7. 归档 / 搜索页头 ============ */
.page-head { padding: 20px 24px; margin-bottom: 20px; }

.page-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.page-desc {
  font-size: 14px;
  color: var(--text-2);
}
.page-desc p { margin: 4px 0 0; }

.result-count { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 10px; }

/* ============ 8. 文章详情 ============ */
.single-card { padding: 28px clamp(20px, 4vw, 40px) 32px; }

.entry-header { margin-bottom: 20px; }

.entry-cats { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.entry-cat {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--border);
}
.entry-cat:hover { border-color: var(--primary); }

.entry-title {
  margin: 0 0 14px;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 800;
  line-height: 1.4;
}

.entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-2);
}

.meta-item { display: inline-flex; align-items: center; gap: 5px; }

.meta-item img,
.meta-item .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.entry-thumb {
  margin: 0 -4px 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.entry-thumb img { width: 100%; display: block; }

/* 正文排版 */
.entry-content {
  font-size: 15.5px;
  line-height: 1.95;
  word-wrap: break-word;
}

.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.2em; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 1.6em 0 0.8em;
  font-weight: 700;
  line-height: 1.4;
}
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 19px; }
.entry-content h4 { font-size: 17px; }

.entry-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.entry-content a:hover { text-decoration-color: var(--primary); }

.entry-content blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
  color: var(--text-2);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: #e05561;
}

html[data-theme="dark"] .entry-content code { color: #ff8a97; }

.entry-content pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--pre-bg);
  color: var(--pre-text);
  overflow: auto;
  font-size: 14px;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.entry-content pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.entry-content img { border-radius: var(--radius-sm); }

.entry-content ul,
.entry-content ol { padding-left: 1.5em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: 0.4em; }

.entry-content table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 14px;
}
.entry-content th,
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.entry-content th { background: var(--bg); font-weight: 600; }

.entry-content hr {
  margin: 2em 0;
  border: none;
  border-top: 1px dashed var(--border);
}

.entry-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

.entry-content .wp-block-image,
.entry-content .wp-block-embed { margin: 1.4em 0; }

.entry-content iframe,
.entry-content video { max-width: 100%; border-radius: var(--radius-sm); }

.page-links { font-size: 14px; color: var(--text-2); }
.page-links a { padding: 2px 8px; }

/* 标签 */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

.entry-tags a {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.entry-tags a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

/* 点赞按钮 */
.entry-actions {
  display: flex;
  justify-content: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px dashed var(--border);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.like-btn svg { width: 18px; height: 18px; }

.like-btn:hover,
.like-btn.liked {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent);
}

.like-btn.loading { opacity: 0.6; pointer-events: none; }

.like-btn.pop svg { animation: likePop 0.45s ease; }

@keyframes likePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* 作者信息在相关推荐下方 —— 无独立模块时隐藏 */

/* 相关推荐 */
.related-posts { margin-top: 24px; }

.section-title {
  position: relative;
  margin: 0 0 16px;
  padding-left: 13px;
  font-size: 18px;
  font-weight: 700;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 17px;
  border-radius: 2px;
  background: var(--primary);
}

/* ============ 9. 评论 ============ */
.comments-area { margin-top: 24px; padding: 24px clamp(20px, 4vw, 32px); }

.comment-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.comment-list ul.children {
  margin: 0 0 0 52px;
  padding: 0;
  list-style: none;
}

.comment-list li { margin-bottom: 8px; }

.comment-body {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}
.comment-body:hover { background: var(--bg); }

.comment-avatar { flex-shrink: 0; }
.comment-avatar img { border-radius: 50%; display: block; }

.comment-content { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.comment-author { font-weight: 600; }
.comment-author a:hover { color: var(--primary); }

.comment-badge {
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.comment-date { color: var(--text-2); font-size: 12px; }

.comment-text { font-size: 14px; }
.comment-text p { margin: 0 0 0.5em; }
.comment-text p:last-child { margin-bottom: 0; }

.comment-reply { font-size: 13px; }
.comment-reply a { color: var(--primary); }
.comment-reply a:hover { text-decoration: underline; }

.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.comment-form .submit {
  padding: 11px 32px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.comment-form .submit:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent);
}

.no-comments { font-size: 13.5px; color: var(--text-2); }

.comment-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13.5px;
}

/* ============ 10. 侧边栏 ============ */
.sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }

.widget { padding: 20px; }

.widget-title {
  position: relative;
  margin: 0 0 16px;
  padding-left: 12px;
  font-size: 15.5px;
  font-weight: 700;
}

.widget-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
}

.widget-title svg { color: #ff9f43; margin-right: 2px; }

/* 站点信息卡 */
.widget-profile { text-align: center; }

.widget-avatar {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg);
  box-shadow: var(--shadow);
}

.widget-avatar img { width: 100%; height: 100%; object-fit: cover; }

.widget-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.widget-profile-name { margin: 0 0 4px; font-size: 16px; }
.widget-profile-desc { margin: 0 0 14px; font-size: 12.5px; color: var(--text-2); }

.widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.widget-stats div { display: flex; flex-direction: column; }
.widget-stats strong { font-size: 17px; font-weight: 800; }
.widget-stats span { font-size: 12px; color: var(--text-2); }

/* 热门文章 */
.hot-list { margin: 0; padding: 0; list-style: none; }

.hot-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}
.hot-list li + li { border-top: 1px dashed var(--border); }

.hot-rank {
  flex-shrink: 0;
  width: 22px;
  font-size: 14px;
  font-weight: 800;
  font-style: italic;
  text-align: center;
  color: var(--text-2);
}
.hot-rank.top { color: var(--primary); }

.hot-item { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.hot-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
}
.hot-thumb img { width: 100%; height: 100%; object-fit: cover; }

.hot-info { display: flex; flex-direction: column; min-width: 0; }

.hot-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-item:hover .hot-title { color: var(--primary); }

.hot-meta { font-size: 12px; color: var(--text-2); }

.widget-empty { font-size: 13px; color: var(--text-2); text-align: center; }

/* 标签云 */
.widget-tags .tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }

.widget-tags .tagcloud a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px !important;
  color: var(--text-2) !important;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.widget-tags .tagcloud a:hover {
  color: var(--primary) !important;
  border-color: var(--primary);
}

/* 通用小工具 */
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.widget ul li:last-child { border-bottom: none; }

/* ============ 11. 分页 ============ */
.pagination { margin-top: 24px; padding: 16px; }

.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  transition: all 0.2s ease;
}

.pagination a.page-numbers:hover { color: var(--primary); background: var(--card-bg); }

.pagination .page-numbers.current {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* ============ 12. 空状态 / 404 ============ */
.empty-state { padding: 60px 24px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; font-size: 20px; }
.empty-state p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; }
.empty-state .search-form {
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
}
.empty-state .search-form input { border-bottom: none; }

.error-card { padding: 72px 24px; text-align: center; }

.error-code {
  font-size: clamp(80px, 14vw, 130px);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-card h1 { margin: 12px 0 8px; font-size: 22px; }
.error-card p { margin: 0 0 24px; color: var(--text-2); }

.error-actions { margin-bottom: 24px; }

.error-search { max-width: 380px; margin: 0 auto; }
.error-search .search-form {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
}
.error-search .search-form input { border-bottom: none; }

/* ============ 13. 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .btn-primary {
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #8a4df8));
  }
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 6px 16px; font-size: 13px; }

/* ============ 14. 页脚 ============ */
.site-footer {
  margin-top: 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 32px 20px 20px;
}

.footer-logo { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.footer-brand p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 420px; }

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-menu a { font-size: 13.5px; color: var(--text-2); }
.footer-menu a:hover { color: var(--primary); }

.footer-meta {
  padding: 14px 20px 22px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  text-align: center;
}
.footer-meta p { margin: 4px 0; }
.footer-meta a { color: var(--text-2); }
.footer-meta a:hover { color: var(--primary); }

/* 返回顶部 */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ 15. 响应式 ============ */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 992px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .header-search { max-height: 0; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 99;
    max-height: calc(100vh - 64px);
    overflow: auto;
    padding: 10px 20px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-130%);
    transition: transform 0.3s ease, background-color 0.3s ease;
  }

  body.nav-open .main-nav { transform: translateY(0); }

  .nav-menu { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-menu a { display: block; width: 100%; padding: 12px 14px; }
  .nav-menu ul ul,
  .nav-menu .sub-menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: none;
    background: var(--bg);
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .nav-menu li:hover > ul,
  .nav-menu li:focus-within > ul { display: block; }
}

@media (max-width: 768px) {
  .container { padding: 0 14px; }

  .post-grid { grid-template-columns: 1fr; }

  .single-card { padding: 20px 16px 24px; }

  .entry-meta { gap: 10px; }

  .comment-list ul.children { margin-left: 24px; }

  .footer-top { flex-direction: column; }

  .user-menu .btn-ghost { display: none; }

  .back-top { right: 16px; bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
