@charset "utf-8";

/* ===== iconfont 图标样式 ===== */
.iconfont {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  font-size: inherit;
}

/* ========================================
 *  Dir 主题 · 21ido.com 风格
 *  白色卡片 + 蓝色主色 + 柔和阴影
 * ======================================== */

/* ===== CSS 变量 ===== */
:root {
  --color-primary: #409eff;
  --color-accent: #e6a23c;

  /* 背景色 */
  --bg-page: #f2f3f5;
  --bg-card: rgba(255, 255, 255, .78);
  --bg-card-rgba: rgba(255, 255, 255, .78);
  --bg-card-solid: #ffffff;
  --bg-hover: rgba(64, 158, 255, .06);
  --bg-code: rgba(245, 247, 250, .8);
  --bg-mute: rgba(240, 242, 245, .6);
  --bg-primary-light: rgba(64, 158, 255, .1);

  /* 文字色 */
  --text-900: #303133;
  --text-700: #303133;
  --text-600: #606266;
  --text-500: #909399;
  --text-400: #a8abb2;
  --text-300: #c0c4cc;

  /* 边框 */
  --border-300: #dcdfe6;
  --border-200: #e4e7ed;
  --border-100: #ebeef5;
  --border-400: #c0c4cc;

  /* 阴影（21ido 风格） */
  --shadow-sm: 0 1px 8px 0 rgba(0, 0, 0, .1);
  --shadow-md: 0 2px 16px 0 rgba(0, 0, 0, .2);
  --shadow-lg: 0px 12px 32px 4px rgba(0,0,0,.04), 0px 8px 20px rgba(0,0,0,.08);

  --navbar-height: 64px;
  --container-max: 1100px;
  --sidebar-width: 300px;

  /* 圆角 */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --card-radius: 12px;

  /* 字体 */
  --font-sans: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", "Consolas", monospace;
}

/* 暗色模式 */
.theme-dark,
.theme-auto[data-theme="dark"] {
  --bg-page: #141414;
  --bg-card: rgba(29, 30, 31, .7);
  --bg-card-rgba: rgba(29, 30, 31, .7);
  --bg-card-solid: #1d1e1f;
  --bg-hover: rgba(64, 158, 255, .1);
  --bg-code: rgba(38, 39, 39, .8);
  --bg-mute: rgba(42, 43, 44, .6);
  --bg-primary-light: rgba(64, 158, 255, .15);

  --text-900: #e5eaf3;
  --text-700: #e0e0e0;
  --text-600: #cfd3dc;
  --text-500: #a3a6ad;
  --text-400: #8b8e94;
  --text-300: #4c4d4f;

  --border-300: #4c4d4f;
  --border-200: #414243;
  --border-100: #313132;
  --border-400: #5c5d5f;

  --shadow-sm: 0 1px 8px 0 rgba(0, 0, 0, .6);
  --shadow-md: 0 2px 16px 0 rgba(0, 0, 0, .7);
  --shadow-lg: 0px 12px 32px 4px rgba(0,0,0,.3), 0px 8px 20px rgba(0,0,0,.4);
}

/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .3s, color .3s;
}

a { color: var(--text-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-primary); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

/* ===== 导航栏（半透明 + 模糊） ===== */
.navbar {
  background: var(--bg-card-rgba);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-100);
  z-index: 100;
  transition: all .3s ease;
}

.navbar-sticky { position: sticky; top: 0; z-index: 100; }
.navbar.scrolled { box-shadow: var(--shadow-sm); }

.navbar-transparent {
  background: transparent;
  border-bottom: none;
}

.navbar-transparent.scrolled {
  background: var(--bg-card-rgba);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-100);
}

.navbar-dark { background: var(--text-900); border-bottom: none; }
.navbar-dark .nav-link,
.navbar-dark .navbar-title { color: #fff; }

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-900);
  flex-shrink: 0;
}

.navbar-logo {
  height: 28px;
  width: auto;
}
.navbar-title { color: var(--text-900); font-size: 18px; font-weight: 600; }

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-600);
  border-radius: var(--radius-md);
  transition: all .2s;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
}

.nav-link:hover { color: var(--color-primary); }

.nav-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-toggle .icon-down {
  width: 12px;
  height: 12px;
  transition: transform .2s;
}

.nav-dropdown:hover .nav-dropdown-toggle .icon-down {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all .2s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-link {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-600);
  border-radius: var(--radius-sm);
  transition: all .15s;
  white-space: nowrap;
}

.nav-dropdown-link:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
}

.nav-dropdown-link.active {
  color: var(--color-primary);
  background: var(--bg-primary-light);
  font-weight: 500;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-600);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all .2s;
  font-size: 20px;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--color-primary); }

.theme-toggle .icon-taiyang { display: none; }
.theme-dark .theme-toggle .icon-taiyang { display: block; }
.theme-dark .theme-toggle .icon-yueliang { display: none; }
.theme-auto .theme-toggle .icon-taiyang { display: none; }
.theme-auto[data-theme="dark"] .theme-toggle .icon-taiyang { display: block; }
.theme-auto[data-theme="dark"] .theme-toggle .icon-yueliang { display: none; }

.navbar-toggle { display: none; }

/* 搜索栏 */
.search-bar {
  max-height: 0;
  overflow: hidden;
  background: var(--bg-card);
  border-top: 1px solid transparent;
  transition: all .3s ease;
}

.search-bar.open {
  max-height: 70px;
  border-top-color: var(--border-100);
}

.search-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-700);
  outline: none;
  transition: border-color .2s;
}

.search-input:focus { border-color: var(--color-primary); }

.search-submit {
  padding: 10px 18px;
  background: var(--bg-page);
  color: var(--text-600);
  border: 1px solid var(--border-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all .2s;
}

.search-submit:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--bg-hover);
}

.search-submit svg { font-size: 18px; }

/* ===== 主布局 ===== */
.main-wrap {
  padding: 32px 0 60px;
  min-height: 50vh;
}

.layout {
  display: grid;
  gap: 24px;
}

.layout.sidebar-right { grid-template-columns: 1fr var(--sidebar-width); }
.layout.sidebar-left { grid-template-columns: var(--sidebar-width) 1fr; }
.layout.sidebar-left .sidebar { order: -1; }
.layout.no-sidebar { grid-template-columns: 1fr; }
.layout.no-sidebar .content-area { max-width: 880px; margin: 0 auto; width: 100%; }

.content-area { min-width: 0; }

/* ===== 文章列表（卡片式，左文右图） ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  position: relative;
  padding: 16px 20px;
  background: var(--bg-card-rgba);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all .3s;
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow: hidden;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.post-card:hover .post-title a {
  color: var(--color-primary);
}

.post-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  margin-left: 24px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.post-card:hover .post-thumb img { transform: scale(1.05); }

.post-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.5;
  color: var(--text-900);
}

.post-title a {
  color: var(--text-900);
  transition: color .2s;
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-500);
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: var(--text-500);
  margin-top: 8px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-item:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 8px;
  margin: 0 10px;
  background: var(--text-300);
}

.meta-item svg { font-size: 13px; opacity: .6; }
.meta-item a { color: var(--text-500); }
.meta-item a:hover { color: var(--color-primary); }

/* 分类标签 */
.meta-category a {
  color: var(--text-500) !important;
  font-size: 13px;
}

.meta-category a:hover {
  color: var(--color-primary) !important;
}

/* 纯文字样式 */
.post-card-text .post-thumb { display: none; }

/* 网格布局 */
.post-list.grid-style {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.post-list.grid-style .post-card {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.post-list.grid-style .post-card .post-thumb {
  width: 100%;
  height: 180px;
  margin-left: 0;
  margin-bottom: 0;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  flex-shrink: 0;
  order: -1;
}

.post-list.grid-style .post-body {
  padding: 16px;
}

.post-list.grid-style .post-card .post-excerpt { display: none; }
.post-list.grid-style .post-card .post-meta { margin-top: 8px; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
  padding-top: 20px;
  flex-wrap: wrap;
  list-style: none;
}

.pagination li {
  display: inline-flex;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 18px;
  font-size: 14px;
  color: var(--text-600);
  background: transparent;
  transition: all .2s;
}

.pagination li a:hover {
  background: var(--bg-mute);
  color: var(--text-900);
}

.pagination li.current a {
  background: var(--text-900);
  color: #fff;
  font-weight: 500;
}

.pagination li span {
  background: transparent;
  color: var(--text-400);
}

/* ===== 侧边栏（卡片式） ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget {
  background: var(--bg-card-rgba);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: all .3s;
}

.widget:hover {
  box-shadow: var(--shadow-md);
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-100);
}

.widget-header svg {
  font-size: 16px;
  color: var(--color-primary);
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-900);
  letter-spacing: .5px;
}

.widget-content {
  font-size: 14px;
  color: var(--text-500);
  line-height: 1.7;
}

/* 自定义内容块（广告位） */
.widget-custom .widget-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.widget-custom .widget-content a {
  display: block;
}

.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 热门文章 */
.widget-recent .widget-list li {
  position: relative;
  padding: 7px 0;
}

.widget-recent .widget-list li:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 30px;
  right: 0;
  height: 1px;
  background: var(--border-100);
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-600);
  transition: color .2s;
}

.recent-item:hover {
  color: var(--color-primary);
}

.recent-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-400);
  background: var(--bg-mute);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.recent-num.rank-1 {
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.recent-num.rank-2 {
  color: #fff;
  background: linear-gradient(135deg, #ffa94d, #ff922b);
}

.recent-num.rank-3 {
  color: #fff;
  background: linear-gradient(135deg, #ffd43b, #fab005);
}

.recent-item:hover .recent-num {
  color: var(--color-primary);
  background: rgba(64, 158, 255, .1);
}

.recent-item:hover .recent-num.rank-1 {
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.recent-item:hover .recent-num.rank-2 {
  color: #fff;
  background: linear-gradient(135deg, #ffa94d, #ff922b);
}

.recent-item:hover .recent-num.rank-3 {
  color: #fff;
  background: linear-gradient(135deg, #ffd43b, #fab005);
}

.recent-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-views {
  font-size: 12px;
  color: var(--text-400);
  flex-shrink: 0;
}

/* 分类 */
.category-list li {
  padding: 6px 0;
}

.category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-600);
  transition: color .2s;
}

.category-list li a:hover {
  color: var(--color-primary);
}

.cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-count {
  font-size: 12px;
  color: var(--text-400);
  background: var(--bg-mute);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid var(--border-200);
  border-radius: var(--radius-md);
  color: var(--text-600);
  background: var(--bg-hover);
  transition: all .2s;
}

.tag-item:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(64, 158, 255, .08);
}

/* 最新评论 */
.comment-list li {
  padding: 8px 0;
}

.comment-list li:not(:last-child) {
  border-bottom: 1px solid var(--border-100);
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-600);
  background: var(--bg-mute);
  border-radius: 6px;
  overflow: hidden;
}

.comment-info {
  flex: 1;
  min-width: 0;
}

.comment-author {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-700);
  margin-bottom: 2px;
}

.comment-text {
  display: block;
  font-size: 13px;
  color: var(--text-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 侧边栏最新评论 */
.widget-comments .widget-list li {
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.6;
}

.widget-comments .widget-list li::before {
  display: none;
}

.widget-comments .widget-list li:not(:last-child)::after {
  display: none;
}

.widget-comments .comment-author-link {
  color: var(--text-700);
  font-weight: 500;
}

.widget-comments .comment-author-link a {
  color: var(--text-700);
  font-weight: 500;
  border-bottom: 1px dashed transparent;
  transition: border-color .2s;
}

.widget-comments .comment-author-link a:hover {
  border-bottom-color: var(--text-700);
}

.widget-comments .comment-said {
  color: var(--text-400);
}

.widget-comments .comment-text-link {
  color: var(--text-500);
  border-bottom: 1px dashed transparent;
  transition: border-color .2s;
}

.widget-comments .comment-text-link:hover {
  border-bottom-color: var(--text-500);
}

/* ===== 文章页（卡片式）===== */
.post-single,
.page-single {
  background: var(--bg-card-rgba);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .3s;
}

.post-single:hover,
.page-single:hover {
  box-shadow: var(--shadow-md);
}

.post-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border-100);
}

.post-breadcrumb {
  font-size: 13px;
  color: var(--text-400);
  margin-bottom: 12px;
}

.post-breadcrumb .sep { margin: 0 6px; }
.post-breadcrumb a { color: var(--text-500); }

.post-single-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-900);
  line-height: 1.4;
  margin-bottom: 16px;
}

.post-single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--text-500);
}

.post-single-meta svg { opacity: .6; }

.meta-author a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-700);
  font-weight: 500;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.author-avatar-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* 文章正文 */
.post-content {
  padding: 28px 36px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-700);
  word-wrap: break-word;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--text-900);
  font-weight: 600;
  margin: 1.8em 0 .8em;
  line-height: 1.4;
}

.post-content h1 { font-size: 1.75em; margin-top: 0; }
.post-content h2 { 
  font-size: 1.4em; 
  padding-bottom: .4em; 
  border-bottom: 2px solid var(--border-200);
  position: relative;
}
.post-content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 2px;
  background: var(--text-900);
}
.post-content h3 { font-size: 1.2em; padding-left: 10px; position: relative; }
.post-content h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: .3em;
  width: 3px;
  height: .85em;
  background: var(--text-700);
  border-radius: 2px;
}
.post-content h4 { font-size: 1.05em; }
.post-content h5 { font-size: 1em; }
.post-content h6 { font-size: .9em; color: var(--text-500); font-weight: 500; }

.post-content p { margin: 1em 0; }

.post-content a { 
  color: var(--color-primary); 
  text-decoration: underline;
  text-decoration-color: rgba(64, 158, 255, 0.3);
  text-underline-offset: 2px;
  transition: all .2s;
}
.post-content a:hover { 
  color: #337ecc; 
  text-decoration-color: var(--color-primary); 
}

.theme-dark .post-content a:hover { 
  color: #66b1ff; 
}

.post-content img {
  border-radius: 8px;
  margin: 1.5em auto;
  max-width: 100%;
  height: auto;
  display: block;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 9V3h6'/><path d='M21 9V3h-6'/><path d='M3 15v6h6'/><path d='M21 15v6h-6'/></svg>") 16 16, zoom-in;
  transition: opacity .2s;
}

.post-content img:hover {
  opacity: .9;
}

/* 图片放大图标 */
.img-zoom-wrap {
  position: relative;
  display: block;
  margin: 1.5em auto;
}

.img-zoom-wrap img {
  margin: 0;
}

.img-zoom-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,.6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 2;
}

.img-zoom-wrap:hover .img-zoom-icon {
  opacity: 1;
}

.img-zoom-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

.post-content blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--color-primary);
  background: var(--bg-hover);
  border-radius: 0 8px 8px 0;
  color: var(--text-600);
  font-size: .95em;
}

.post-content blockquote p { margin: .5em 0; }
.post-content blockquote p:first-child { margin-top: 0; }
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--bg-hover);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--color-primary);
}

.post-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 48px 24px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 13.5px;
  line-height: 1.7;
  position: relative;
  max-height: 400px;
  overflow: hidden;
  transition: max-height .3s ease;
}

.post-content pre.code-expanded {
  max-height: none;
  overflow: auto;
}

.code-expand-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, #1e1e2e 0%, transparent 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  color: #9399b2;
  font-size: 12px;
  z-index: 3;
  transition: all .2s;
}

.post-content pre.code-expanded .code-expand-btn {
  position: absolute;
  top: 6px;
  bottom: auto;
  right: 100px;
  left: auto;
  height: auto;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 4px 14px;
  align-items: center;
}

.code-expand-btn:hover {
  color: #cdd6f4;
}

.post-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: rgba(0,0,0,.2);
  border-radius: 10px 10px 0 0;
}

.post-content pre::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f38ba8;
  box-shadow: 20px 0 0 #f9e2af, 40px 0 0 #a6e3a1;
  z-index: 1;
}

.post-content pre .code-lang-label {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #6c7086;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  z-index: 1;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  display: block;
}

/* 代码高亮基础色 */
.post-content pre .hljs-keyword,
.post-content pre .hljs-selector-tag,
.post-content pre .hljs-built_in,
.post-content pre .hljs-name,
.post-content pre .hljs-tag {
  color: #cba6f7;
}

.post-content pre .hljs-string,
.post-content pre .hljs-title,
.post-content pre .hljs-section,
.post-content pre .hljs-attribute,
.post-content pre .hljs-literal,
.post-content pre .hljs-template-tag,
.post-content pre .hljs-template-variable,
.post-content pre .hljs-type,
.post-content pre .hljs-addition {
  color: #a6e3a1;
}

.post-content pre .hljs-number,
.post-content pre .hljs-selector-attr,
.post-content pre .hljs-selector-pseudo,
.post-content pre .hljs-meta,
.post-content pre .hljs-attr {
  color: #fab387;
}

.post-content pre .hljs-comment,
.post-content pre .hljs-quote,
.post-content pre .hljs-deletion {
  color: #6c7086;
  font-style: italic;
}

.post-content pre .hljs-variable,
.post-content pre .hljs-params,
.post-content pre .hljs-class .hljs-title {
  color: #f5c2e7;
}

.post-content pre .hljs-function,
.post-content pre .hljs-title.function_ {
  color: #89b4fa;
}

.post-content ul,
.post-content ol { 
  margin: 1em 0; 
  padding-left: 1.8em; 
}
.post-content li { 
  margin: .4em 0; 
  line-height: 1.7;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14px;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border-200);
  padding: 10px 14px;
  text-align: left;
}

.post-content th { 
  background: var(--bg-hover); 
  font-weight: 600; 
  color: var(--color-primary);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border-200);
  margin: 2em 0;
}

/* 文章内自定义内容块 */
.post-custom {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-100);
  border-radius: var(--card-radius);
}

.post-custom-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-100);
}

.post-custom-header .iconfont {
  width: 18px;
  height: 18px;
  color: var(--text-500);
}

.post-custom-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-700);
}

.post-custom-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.post-custom-content a {
  display: block;
}

/* 文章底部 */
.post-footer {
  padding: 20px 32px 28px;
  border-top: 1px solid var(--border-100);
}

.post-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.post-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid var(--border-200);
  border-radius: var(--radius-md);
  color: var(--text-600);
  background: var(--bg-hover);
  transition: all .2s;
}

.post-tag:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--bg-card);
}

/* 版权声明 & 更新时间 */
.post-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.post-modified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  background: var(--bg-hover);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-500);
  cursor: help;
  transition: all .2s ease;
  min-width: 160px;
  letter-spacing: .3px;
}

.post-modified:hover {
  background: var(--border-100);
  color: var(--text-700);
}

.post-copyright {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  background: var(--bg-hover);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-500);
  cursor: help;
  transition: all .2s ease;
  min-width: 120px;
  letter-spacing: .3px;
}

.post-copyright:hover {
  background: var(--color-primary);
  color: #fff;
}

/* 通用 tooltip */
.tooltip-box {
  position: fixed;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 99999;
  max-width: 320px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: all .15s ease;
  font-weight: normal;
}

.tooltip-box.show {
  opacity: 1;
  visibility: visible;
}

.tooltip-box::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  transform: none;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

.tooltip-box.tooltip-bottom::after {
  bottom: auto;
  top: -6px;
  border-top-color: transparent;
  border-bottom-color: rgba(0, 0, 0, 0.85);
}

/* 上下篇导航 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.nav-prev,
.nav-next {
  padding: 14px 18px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-100);
  transition: all .2s;
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.nav-next { text-align: right; }

.nav-label {
  display: block;
  font-size: 12px;
  color: var(--text-400);
  margin-bottom: 4px;
}

.nav-prev a,
.nav-next a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-700);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 归档页标题 ===== */
.archive-header {
  background: var(--bg-card-rgba);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.archive-title { font-size: 1.4rem; font-weight: 700; color: var(--text-900); }
.archive-desc { font-size: 14px; color: var(--text-500); margin-top: 8px; }

/* ===== 友情链接 ===== */
.friendly-links {
  margin-top: 20px;
  padding: 0 20px 20px;
  font-size: 14px;
}

.fl-section {
  margin-bottom: 20px;
}

.fl-section:last-child {
  margin-bottom: 0;
}

.fl-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-800);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--color-primary);
}

.fl-list {
  list-style: disc;
  padding: 0 0 0 32px;
  margin: 0;
  columns: 4;
  column-gap: 24px;
}

.fl-list li {
  margin: 0 0 6px;
  break-inside: avoid;
  line-height: 1.8;
}

.fl-list a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 15px;
  transition: opacity .15s;
}

.fl-list a:hover {
  text-decoration: underline;
  opacity: .8;
}

@media (max-width: 768px) {
  .fl-list {
    columns: 3;
  }
}

@media (max-width: 480px) {
  .fl-list {
    columns: 2;
  }
}

/* ===== 归档页面 ===== */
.archive-page {
  margin-top: 20px;
  padding: 0 20px 20px;
  font-size: 14px;
}

.archive-year {
  margin-bottom: 16px;
}

.archive-year-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  user-select: none;
  transition: opacity .15s;
}

.archive-year-title:hover {
  opacity: .75;
}

.archive-year-toggle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-400);
}

.archive-months {
  list-style: none;
  padding: 0 0 0 8px;
  margin: 0;
}

.archive-month-item {
  margin-bottom: 10px;
  color: var(--text-700);
  font-weight: 500;
}

.archive-month-name {
  font-size: 14px;
  color: var(--text-700);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.archive-posts {
  list-style: disc;
  padding: 0 0 0 28px;
  margin: 4px 0;
}

.archive-post-item {
  margin: 2px 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-700);
  font-weight: 400;
}

.archive-post-day {
  color: var(--text-500);
  margin-right: 2px;
}

.archive-post-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity .15s;
}

.archive-post-link:hover {
  text-decoration: underline;
  opacity: .8;
}

.archive-post-comments {
  color: var(--text-400);
  font-size: 13px;
  margin-left: 2px;
}

/* ===== 评论区（卡片式） ===== */
.comments {
  background: var(--bg-card);
  border: 1px solid var(--border-100);
  border-radius: var(--card-radius);
  padding: 28px 32px;
  margin-top: 20px;
}

.comments-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-900);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--text-900);
  border-radius: 2px;
}

.comment-list-wrap { display: flex; flex-direction: column; }

.comment-list-wrap > .comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.comment-item { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-200); }

.comment-item:last-child { border-bottom: none; }

.comment-children {
  width: calc(100% - 44px);
  margin-left: 44px;
  padding-left: 0;
  min-width: 0;
}

.comment-children .comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-children .comment-item {
  padding: 12px 0;
}

.comment-children .comment-avatar {
  width: 32px;
  height: 32px;
}

.comment-children .comment-avatar img {
  width: 32px;
  height: 32px;
}

.comment-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-200);
  flex-wrap: wrap;
  list-style: none;
}

.comment-pagination li {
  display: inline-flex;
}

.comment-pagination a,
.comment-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-600);
  background: transparent;
  transition: all .2s;
}

.comment-pagination a:hover {
  background: var(--bg-mute);
  color: var(--text-900);
}

.comment-pagination .current a {
  background: var(--text-900);
  color: #fff;
  font-weight: 500;
}

.comment-pagination .current span {
  background: var(--text-900);
  color: #fff;
  font-weight: 500;
}

.comment-avatar img { width: 40px; height: 40px; border-radius: 6px; }

.comment-main { flex: 1; min-width: 0; }

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author { font-size: 14px; font-weight: 600; color: var(--text-900); }

.comment-level {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  line-height: 1.4;
}

.comment-level.level-gray {
  background: #f3f4f6;
  color: #6b7280;
}

.comment-level.level-green {
  background: #ecfdf5;
  color: #059669;
}

.comment-level.level-blue {
  background: #eff6ff;
  color: #2563eb;
}

.comment-level.level-purple {
  background: #faf5ff;
  color: #7c3aed;
}

.comment-level.level-orange {
  background: #fff7ed;
  color: #ea580c;
}

.comment-level.level-red {
  background: #fef2f2;
  color: #dc2626;
}

.comment-level.level-gold {
  background: #fffbeb;
  color: #d97706;
}

body.theme-dark .comment-level.level-gray {
  background: #374151;
  color: #9ca3af;
}

body.theme-dark .comment-level.level-green {
  background: #064e3b;
  color: #34d399;
}

body.theme-dark .comment-level.level-blue {
  background: #1e3a8a;
  color: #60a5fa;
}

body.theme-dark .comment-level.level-purple {
  background: #4c1d95;
  color: #a78bfa;
}

body.theme-dark .comment-level.level-orange {
  background: #7c2d12;
  color: #fb923c;
}

body.theme-dark .comment-level.level-red {
  background: #7f1d1d;
  color: #f87171;
}

.comment-level.level-author {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
}

body.theme-dark .comment-level.level-author {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
}

.comment-time { font-size: 12px; color: var(--text-400); }
.comment-awaiting { font-size: 12px; color: var(--color-accent); font-style: normal; }

.comment-notice {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}

.comment-notice-waiting {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

body.theme-dark .comment-notice-waiting {
  background: #78350f;
  color: #fde68a;
  border-color: #92400e;
}

.comment-content { font-size: 14px; color: var(--text-700); line-height: 1.7; }

.comment-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.comment-reply a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-400);
}

.comment-reply a:hover { color: var(--text-900); }

/* 评论表单 */
.comment-form-wrap { margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--border-200); width: 100%; min-width: 0; box-sizing: border-box; }

.comment-form-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-900);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-form-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--text-700);
  border-radius: 2px;
}

.comment-user-info { font-size: 13px; color: var(--text-500); margin-bottom: 12px; }
.comment-logout { margin-left: 8px; color: var(--text-400); }
.comment-logout:hover { color: var(--text-700); }

.comment-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }

.input-group label {
  font-size: 12px;
  color: var(--text-500);
  font-weight: 500;
  padding-left: 2px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border-200);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-700);
  outline: none;
  transition: all .2s;
  font-family: inherit;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-300);
}

.input-group input:hover,
.input-group textarea:hover {
  border-color: var(--border-400);
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--text-700);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.textarea-group { margin-bottom: 16px; position: relative; }
.textarea-group textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 10px;
}

.comment-submit-wrap { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--text-900);
  color: #fff;
}

.btn-primary:hover {
  background: var(--text-700);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-300);
  color: var(--text-600);
}

.btn-outline:hover {
  border-color: var(--text-500);
  color: var(--text-700);
}

.btn-cancel {
  background: var(--bg-mute);
  border: 1px solid var(--border-200);
  color: var(--text-500);
}

.btn-cancel:hover {
  background: var(--border-100);
  border-color: var(--border-300);
  color: var(--text-700);
}

.btn-submit {
  background: var(--text-900);
  color: #fff;
  border: 1px solid var(--text-900);
}

.btn-submit:hover {
  background: var(--text-700);
  border-color: var(--text-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-100);
  padding: 40px 0 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-600);
  text-decoration: none;
  transition: all .2s;
}

.footer-links a:hover { 
  color: var(--color-primary); 
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-200);
  border-radius: var(--radius-md);
  color: var(--text-500);
  transition: all .2s;
}

.social-link .social-icon {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--bg-hover);
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-500);
  line-height: 1.8;
}

.footer-beian {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-beian p {
  margin: 0;
}

.footer-copyright a { 
  color: var(--text-600); 
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: all .2s;
}
.footer-copyright a:hover { 
  color: var(--color-primary); 
  text-decoration-color: var(--color-primary);
}

.powered-by { margin-top: 8px; }

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-200);
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  color: var(--text-600);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all .3s;
  z-index: 999;
  font-size: 24px;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--text-900);
  background: var(--bg-card-solid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== 图片灯箱 ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all .25s;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: scale(.95);
  transition: transform .25s;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8h5V3'/><path d='M21 8h-5V3'/><path d='M3 16h5v5'/><path d='M21 16h-5v5'/></svg>") 16 16, zoom-out;
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: 14px;
}

/* ===== 404 页面 ===== */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 12px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 8px;
}

.error-desc {
  font-size: 14px;
  color: var(--text-500);
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ===== 暗黑模式特殊样式 ===== */
.theme-dark .btn-submit,
.theme-auto[data-theme="dark"] .btn-submit {
  background: #fff;
  color: #1a1a1a;
  border-color: #fff;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.theme-dark .btn-submit:hover,
.theme-auto[data-theme="dark"] .btn-submit:hover {
  background: #e0e0e0;
  border-color: #e0e0e0;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}

.theme-dark .btn-cancel,
.theme-auto[data-theme="dark"] .btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-500);
}

.theme-dark .btn-cancel:hover,
.theme-auto[data-theme="dark"] .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-700);
}

.theme-dark .input-group input:focus,
.theme-dark .input-group textarea:focus,
.theme-auto[data-theme="dark"] .input-group input:focus,
.theme-auto[data-theme="dark"] .input-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 280px; }
}

@media (max-width: 768px) {
  .navbar-menu {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-200);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
  }

  .navbar-menu.open { display: flex; }

  .nav-link {
    padding: 12px 16px;
    border-radius: var(--radius-md);
  }

  .nav-link.active::after { display: none; }

  .nav-dropdown { position: static; }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0 0 0 16px;
    margin-top: 4px;
    background: transparent;
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-menu { display: block; }

  .nav-dropdown.open .nav-dropdown-toggle .icon-down { transform: rotate(180deg); }

  .nav-dropdown-link { padding: 10px 14px; }

  .navbar-toggle { display: inline-flex; }

  .layout.sidebar-right,
  .layout.sidebar-left {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar { order: 2; }

  .post-card { flex-direction: column; }
  .post-thumb { width: 100%; height: 160px; margin-left: 0; margin-top: 12px; }

  .post-header,
  .post-content,
  .post-footer,
  .comments {
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-single-title { font-size: 1.4rem; }
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: .95rem; }

  .post-nav { grid-template-columns: 1fr; }
  .comment-inputs { grid-template-columns: 1fr; }

  .links-overview {
    margin-bottom: 24px;
    padding-bottom: 14px;
  }

  .links-grid { grid-template-columns: 1fr; gap: 12px; }

  .comment-submit-wrap { justify-content: stretch; }
  .comment-submit-wrap .btn { flex: 1; }

  .footer-links { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 36px; }
  .post-card { padding: 14px 16px; }
  .post-title { font-size: 16px; }
  .error-code { font-size: 4rem; }

  .links-empty { padding: 22px 16px; }
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card {
  animation: fadeInUp .4s ease backwards;
}

.post-list .post-card:nth-child(1) { animation-delay: .05s; }
.post-list .post-card:nth-child(2) { animation-delay: .10s; }
.post-list .post-card:nth-child(3) { animation-delay: .15s; }
.post-list .post-card:nth-child(4) { animation-delay: .20s; }
.post-list .post-card:nth-child(5) { animation-delay: .25s; }

/* ===== 代码复制按钮 ===== */
.code-copy-btn {
  position: absolute;
  top: 6px;
  right: 12px;
  padding: 4px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  color: #9399b2;
  cursor: pointer;
  font-size: 12px;
  z-index: 2;
  opacity: 0;
  transition: all .15s;
}

.post-content pre:hover .code-copy-btn { opacity: 1; }

.code-copy-btn:hover {
  background: rgba(255,255,255,.15);
  color: #cdd6f4;
}
