/**
 * inoodle3 Photography Blog Styles
 * 双语 FSE 摄影博客主题样式
 * 
 * 设计特点：
 * - 左侧固定侧边栏 + 右侧内容区
 * - 深浅两套配色（CSS 变量切换）
 * - 移动端抽屉式导航
 * - 无限滚动加载
 */

/* ===== CSS 变量定义 ===== */
:root {
  /* 布局尺寸 */
  --sidebar-width: 320px;
  --header-height: 56px;

  /* 浅色模式（默认） */
  --color-bg: #f7f7f7;
  --color-bg-secondary: #f0f0f0;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-border: #e0e0e0;
  --color-accent: #e74c3c;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  /* 间距 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;

  /* WordPress 预设变量（从 global-styles 转移） */
  --wp--preset--aspect-ratio--square: 1;
  --wp--preset--aspect-ratio--4-3: 4/3;
  --wp--preset--aspect-ratio--3-4: 3/4;
  --wp--preset--aspect-ratio--3-2: 3/2;
  --wp--preset--aspect-ratio--2-3: 2/3;
  --wp--preset--aspect-ratio--16-9: 16/9;
  --wp--preset--aspect-ratio--9-16: 9/16;
  --wp--preset--color--light-bg: #FFFFFF;
  --wp--preset--color--light-sidebar: #F5F5F5;
  --wp--preset--color--dark-bg: #1A1A1A;
  --wp--preset--color--dark-sidebar: #2D2D2D;
  --wp--preset--color--light-text: #333333;
  --wp--preset--color--light-text-secondary: #666666;
  --wp--preset--color--dark-text: #E5E5E5;
  --wp--preset--color--dark-text-secondary: #999999;
  --wp--preset--color--accent: #E74C3C;
  --wp--preset--font-size--small: 0.875rem;
  --wp--preset--font-size--medium: 1rem;
  --wp--preset--font-size--large: 1.125rem;
  --wp--preset--font-size--xl: 1.5rem;
  --wp--preset--font-size--2-xl: 2rem;
  --wp--preset--font-size--xs: 0.75rem;
  --wp--preset--font-family--system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wp--preset--spacing--10: 4px;
  --wp--preset--spacing--20: 8px;
  --wp--preset--spacing--30: 16px;
  --wp--preset--spacing--40: 24px;
  --wp--preset--spacing--50: 32px;
  --wp--preset--spacing--60: 48px;
  --wp--preset--spacing--70: 64px;
  --wp--preset--spacing--80: 96px;
  --wp--style--global--content-size: 720px;
  --wp--style--global--wide-size: 1200px;
  --wp--style--block-gap: 0;
}

/* 深色模式 */
[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-bg-secondary: #2d2d2d;
  --color-text: #e5e5e5;
  --color-text-secondary: #999999;
  --color-text-muted: #666666;
  --color-border: #404040;
}

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

/* 无障碍跳转链接：默认视觉隐藏（只给读屏软件读），Tab 聚焦时显示为左上角浮层 */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 16px;
  clip: auto;
  clip-path: none;
  background: var(--color-bg, #fff);
  color: var(--color-text, #000);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== 布局结构 ===== */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏（桌面端） */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  z-index: 100;
  overflow: hidden;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--space-8);
}

/* Logo 区域 */
.site-logo {
  margin-bottom: var(--space-4);
}

.site-logo img {
  max-width: 160px;
  height: auto;
}

.site-branding {
  margin-bottom: var(--space-8);
}

.site-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

/* 有 logo 时隐藏站点大标题 */
.sidebar-top:has(.site-logo:not(:empty)) .site-title {
  display: none;
}

.site-tagline {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* 目录区域 */
.sidebar-top {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

.catalog-section {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-8);
  padding-top: 1rem;
  overflow: hidden;
}

.catalog-tabs, :root :where(.is-layout-flex) .catalog-tabs {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.catalog-tab {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid transparent;
  margin-bottom: calc(-1 * var(--space-2) - 1px);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.catalog-tab:hover,
.catalog-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

.catalog-content {
  font-size: var(--font-size-sm);
  flex: 1 1 0;
  min-height: 0;
  /* scroll 而非 auto：强制 Safari 从 overlay 切换为经典滚动条模式，否则 ::-webkit-scrollbar 不生效 */
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 自定义滚动条（Chrome / Safari） */
.catalog-content::-webkit-scrollbar {
  width: 6px;
}
.catalog-content::-webkit-scrollbar-track,
.catalog-content::-webkit-scrollbar-track-piece {
  background: transparent;
}
.catalog-content::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 999px;
}
/* JS 添加 scrollbar-active 类时显示滑块 */
.catalog-content.scrollbar-active::-webkit-scrollbar-thumb {
  background-color: var(--color-text-muted);
}
.catalog-content.scrollbar-active::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text);
}

/* Firefox 专用：细滚动条（-moz-appearance 仅在 Firefox 中生效） */
@supports (-moz-appearance: none) {
  .catalog-content {
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-muted) transparent;
  }
}

.catalog-content.is-hidden {
  display: none;
}

/* 搜索区固定在目录底部，不跟随列表滚动 */
.search-section {
  flex-shrink: 0;
}

.archive-list,
.category-list {
  list-style: none;
}

/* 折叠菜单项 */
.archive-item {
  margin: var(--space-1) 0;
}

.archive-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  user-select: none;
}

.archive-header:hover {
  color: var(--color-text);
}


.archive-label {
  flex: 1;
}

.archive-count {
  font-size: var(--font-size-xs);
  opacity: 0.6;
}

/* 文章列表 */
.archive-posts {
  list-style: none;
  margin-left: var(--space-4);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.archive-item.is-expanded .archive-posts {
  max-height: 1000px;
}


.archive-post-item a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  transition: color var(--transition-fast), font-weight 0s;
}

.archive-post-item a:hover {
  color: var(--color-text);
}

/* 当前文章高亮 */
.archive-post-item.is-current a {
  color: var(--color-text);
  font-weight: 600;
}

/* 分类列表（保持原样） */
.category-list li {
  margin-bottom: var(--space-2);
}

.category-list a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text-secondary);
}

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

/* 搜索区域 */
.search-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.sidebar-search .wp-block-search__label {
  display: none;
}
.sidebar-search .wp-block-search__inside-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-search .wp-block-search__input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  padding-left: 0;
  border: none;

  background-color: transparent;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-fast);
  margin-right: 1rem;
}

.sidebar-search .wp-block-search__input:focus {
  outline: none;
  border-color: var(--color-text);
}

.sidebar-search .wp-block-search__input::placeholder {
  color: var(--color-text-muted);
}
.sidebar-search .wp-block-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-left: 3px;
  cursor: pointer;
  background-color: var(--color-text);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 6L6 18M6 6l12 12' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18 6L6 18M6 6l12 12' stroke='%23000' stroke-width='2.5' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

.sidebar-search .wp-block-search__button,
.sidebar-search .wp-block-search__button.wp-element-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.sidebar-search .wp-block-search__button:hover {
  opacity: 0.7;
}

.sidebar-search .wp-block-search__button:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 1px;
}

.sidebar-search .wp-block-search__button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sidebar-search .wp-block-search__button svg path {
  fill: currentColor;
}


/* 侧边栏底部 */
.sidebar-bottom {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: var(--space-6);
}

.footer-links, :root :where(.is-layout-flex).footer-links{
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.footer-link {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-text);
}

.footer-separator {
  color: var(--color-text-muted);
}

.copyright {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: var(--space-8);
}

/* 文章列表 */
.post-list {
  max-width: 800px;
  margin: 0 auto;
}

.post-item {
  margin-bottom: var(--space-10);
}

.post-thumbnail-wrapper {
  position: relative;
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.post-thumbnail-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
  z-index: 1;
}

.post-thumbnail {
  margin-bottom: 0;
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.post-thumbnail > a {
  position: relative;
  display: block;
}

.post-thumbnail__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.post-item:hover .post-thumbnail img {
  transform: scale(1.005);
}

.post-header-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #fff;
  z-index: 2;
}

.post-item:not(:has(.post-thumbnail)) .post-thumbnail-wrapper::after {
  display: none;
}

.post-item:not(:has(.post-thumbnail)) .post-header-overlay {
  position: static;
  padding: var(--space-3);
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
}

.post-title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: inherit;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover {
  opacity: 0.85;
}

.vote-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  background: transparent;
  border: none;
  color: inherit;
  padding: 2px 4px;
  font-size: var(--font-size-sm);
  min-width: 0;
  border-radius: 999px;
  transition: background-color var(--transition-fast), gap 200ms ease;
}

.vote-inline.is-open {
  gap: 8px;
}

.vote-inline:hover,
.vote-inline.is-open,
.vote-inline:focus-within {
  background-color: rgba(0, 0, 0, 0.25);
}

.vote-inline .vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  font-size: inherit;
  line-height: 1;
  flex: 0 0 auto;
}

.vote-inline svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.vote-inline .vote-count {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}

/* 默认状态：dislike 折叠隐藏，通过 max-width + opacity 实现 200ms 动画展开 */
.vote-inline .vote-dislike {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-width 200ms ease, opacity 200ms ease;
}

/* is-open：展开 dislike 按钮 */
.vote-inline.is-open .vote-dislike {
  max-width: 100px;
  opacity: 1;
  pointer-events: auto;
}

.vote-inline .vote-btn:hover,
.vote-inline .vote-btn:focus-visible {
  opacity: 0.8;
  outline: none;
}

/* 无图卡片（浅色背景）时，hover 背景用浅色半透明 */
.post-item:not(:has(.post-thumbnail)) .vote-inline:hover,
.post-item:not(:has(.post-thumbnail)) .vote-inline.is-open,
.post-item:not(:has(.post-thumbnail)) .vote-inline:focus-within {
  background-color: rgba(0, 0, 0, 0.06);
}

.post-excerpt {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  padding: var(--space-3);
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
}

.post-excerpt:empty,
.post-excerpt:has(p:only-child:empty),
.post-excerpt:has(> *:only-child:empty) {
  display: none;
}

.post-excerpt p {
  margin: 0;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
/* ===== 分页隐藏 ===== */
.pagination.wp-block-query-pagination{
  display: none;
}


.pagination a,
.pagination span {
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.pagination a:hover {
  color: var(--color-text);
}

.pagination .current {
  color: var(--color-text);
  font-weight: 500;
}

/* ===== 单篇文章页 ===== */
/*
 * 垂直间距韵律：所有主区块之间统一使用 --space-8 (32px) 令牌
 * 避免 margin-bottom + margin-top 双叠加造成视觉不一致
 */
.single-post .post-header {
  max-width: 800px;
  margin: 0 auto var(--space-8);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.back-link {
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
}

.single-post .post-title {
  font-size: var(--font-size-lg);
  margin: 0;
  line-height: 1;
}

.single-post .post-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1;
}

.single-post .post-featured-image {
  max-width: 2000px;
  position: absolute;
  top: calc(-1 * var(--space-8));
  left: 0;
  width: 100%;
  z-index: -2;
  overflow: hidden;
}
.single-post .post-featured-image::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.3);
  z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--color-bg) 95%, var(--color-bg) 100%);
}
.single-post .post-featured-image img {
  opacity: 0.8;
  filter: blur(10px);
  display: block;
  transform: scale(1.1);
}

.single-post .post-body {
  max-width: 800px;
  margin: var(--space-4) auto var(--space-4);
  font-size: var(--font-size-lg);
  line-height: 1.8;
}

.single-post .post-body p {
  margin-bottom: var(--space-6);
}

.single-post .post-body img {
  margin: var(--space-8) 0;
}

.single-post .post-footer {
  max-width: 800px;
  margin: var(--space-4) auto var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.post-categories,
.post-tags {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.post-navigation {
  max-width: 800px;
  margin: var(--space-8) auto;
  display: flex;
  justify-content: space-between;
  padding-bottom: var(--space-8);
}
.post-navigation-link-next.wp-block-post-navigation-link {
  display: flex;
  flex-direction: row-reverse;
}
/* ===== 移动端顶栏（桌面隐藏，移动 fixed 顶部） ===== */
.sidebar-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 200;
  padding: 0 var(--space-4);
  align-items: center;
  transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.sidebar-topbar-left,
.sidebar-topbar-right {
  flex: 0 0 48px;
}

.sidebar-topbar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.topbar-logo img {
  max-height: 32px;
  width: auto;
}

.topbar-site-title {
  font-size: var(--font-size-base);
  font-weight: 600;
}

/* 汉堡按钮 */
.menu-toggle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-icon {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  position: relative;
  transition: background-color var(--transition-fast);
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition-fast);
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  bottom: -6px;
}

/* 抽屉关闭按钮（桌面隐藏） */
.drawer-close {
  width: var(--header-height);
  height: var(--header-height);
  font-size: var(--font-size-lg);
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: var(--space-2) 0 0 var(--space-2);
  align-items: center;
  justify-content: center;
}

/* 抽屉遮罩（桌面隐藏） */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== 返回顶部按钮 ===== */
.scroll-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 30px;
  height: 30px;
  background-color: var(--color-text);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-fast);
  z-index: 90;
}

.scroll-to-top.visible {
  opacity: 0.8;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
}

/* ===== 无限滚动加载 ===== */
.infinite-scroll-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-8);
  color: var(--color-text-secondary);
}

.infinite-scroll-loader::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: var(--space-2);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 404 页面 ===== */
.error-page .error-content {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-4);
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1;
}

.error-message {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-3);
}

.error-description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.back-home .wp-block-button__link {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-text);
  color: var(--color-bg);
  font-size: var(--font-size-base);
  transition: opacity var(--transition-fast);
}

.back-home .wp-block-button__link:hover {
  opacity: 0.85;
  color: var(--color-bg);
}

/* ===== 响应式布局 ===== */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: flex !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    overflow: hidden;
    border-right: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-inner {
    height: calc(100vh - var(--header-height));
    padding: var(--space-6);
  }

  .main-content {
    margin-left: 0;
    padding: calc(var(--header-height) + var(--space-4)) var(--space-4) var(--space-4);
  }
  
  .post-list {
    padding: 0;
  }
  
  .post-item {
    margin-bottom: var(--space-8);
  }
  
  .single-post .post-title {
    font-size: var(--font-size-lg);
  }
  
  .single-post .post-body {
    font-size: var(--font-size-base);
  }
  
  .scroll-to-top {
    right: var(--space-4);
    bottom: var(--space-4);
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* ===== 图片滑动浏览 ===== */
.post-thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
}

.post-thumbnail-wrapper .post-thumbnail img {
  transition: opacity 0.15s ease-out;
}

.image-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.post-thumbnail-wrapper:hover .image-counter,
.post-thumbnail-wrapper.swiping .image-counter {
  opacity: 1;
}

/* ===== 赞踩按钮 ===== */
.vote-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.vote-buttons-single .vote-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3) var(--space-1) 0;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  background: none;
  transition: color var(--transition-fast);
}

.vote-buttons-single .vote-btn:hover:not(.voted) {
  color: var(--color-text);
}

.vote-buttons-single .vote-btn.voted {
  opacity: 0.4;
  cursor: not-allowed;
}

.vote-buttons-single .vote-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.vote-buttons-single .vote-count {
  min-width: var(--space-4);
  text-align: center;
}

.vote-buttons-single {
  max-width: 800px;
  margin: var(--space-8) auto 0;
}

/* ===== 打印样式 ===== */
@media print {
  .sidebar,
  .sidebar-topbar,
  .sidebar-overlay,
  .scroll-to-top {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0;
    padding: 0;
  }
}

/* ===== WordPress 块样式（从内联提取）===== */

/* wp-block-group */
.wp-block-group { box-sizing: border-box; }
:where(.wp-block-group.wp-block-group-is-layout-constrained) { position: relative; }
:where(.wp-block-group.has-background) { padding: 1.25em 2.375em; }

/* wp-block-site-title */
.wp-block-site-title { box-sizing: border-box; }
.wp-block-site-title :where(a) {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-decoration: inherit;
}

/* wp-block-post-featured-image */
.wp-block-post-featured-image { margin-left: 0; margin-right: 0; }
.wp-block-post-featured-image a { display: block; height: 100%; }
.wp-block-post-featured-image :where(img) { box-sizing: border-box; height: auto; max-width: 100%; vertical-align: bottom; width: 100%; }
.wp-block-post-featured-image.alignfull img, 
.wp-block-post-featured-image.alignwide img { width: 100%; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim { background-color: #000; inset: 0; position: absolute; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10 { opacity: .1; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20 { opacity: .2; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30 { opacity: .3; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40 { opacity: .4; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50 { opacity: .5; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60 { opacity: .6; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70 { opacity: .7; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80 { opacity: .8; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90 { opacity: .9; }
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100 { opacity: 1; }

/* wp-block-image */
.wp-block-image > a, .wp-block-image > figure > a { display: inline-block; }
.wp-block-image img { box-sizing: border-box; height: auto; max-width: 100%; vertical-align: bottom; }
@media not (prefers-reduced-motion) {
  .wp-block-image img.hide { visibility: hidden; }
  .wp-block-image img.show { animation: show-content-image .4s; }
}
.wp-block-image[style*="border-radius"] img, 
.wp-block-image[style*="border-radius"] > a { border-radius: inherit; }
.wp-block-image.has-custom-border img { box-sizing: border-box; }

/* wp-block-library 核心样式 */
:root {
  --wp-block-synced-color: #7a00df;
  --wp-block-synced-color--rgb: 122, 0, 223;
  --wp-bound-block-color: var(--wp-block-synced-color);
}
.wp-element-button { cursor: pointer; }
:where(.has-border-color), 
:where([style*="border-color"]) { border-style: solid; }
:where([style*="border-top-color"]) { border-top-style: solid; }
:where([style*="border-right-color"]) { border-right-style: solid; }
:where([style*="border-bottom-color"]) { border-bottom-style: solid; }
:where([style*="border-left-color"]) { border-left-style: solid; }
:where([style*="border-width"]) { border-style: solid; }
:where(img[class*="wp-image-"]) { height: auto; max-width: 100%; }
:where(figure) { margin: 0 0 1em; }

/* 对齐工具类 */
.aligncenter { clear: both; }
.items-justified-left { justify-content: flex-start; }
.items-justified-center { justify-content: center; }
.items-justified-right { justify-content: flex-end; }
.items-justified-space-between { justify-content: space-between; }

/* 布局类 */
:root :where(.is-layout-flow) > * { margin-block-start: 0; margin-block-end: 0; }
:root :where(.is-layout-constrained) > * { margin-block-start: 0; margin-block-end: 0; }
:root :where(.is-layout-flex) { gap: 0; }
:root :where(.is-layout-grid) { gap: 0; }

/* ===== EXIF 信息样式 ===== */
.exif-info {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  line-height: 1.6;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-secondary, #f8f8f8);
  border-radius: 4px;
}
.exif-camera {
  font-weight: 500;
  margin-right: var(--space-3);
}
.exif-date {
  margin-right: var(--space-3);
}
.exif-settings {
  letter-spacing: 0.5px;
}
