/*
###################################################
# 样式说明：主样式文件
# 
# 这个样式文件实现了整个主题的视觉效果，包括：
# 1. OnlyFans配色方案（蓝色系为主）
# 2. 响应式三列布局
# 3. 文章卡片样式
# 4. 导航栏和页脚样式
# 5. 侧边栏组件样式
#
# 响应式设计断点：
# - 移动设备：< 768px
# - 平板设备：768px - 1024px
# - 桌面设备：> 1024px
#
# 更新说明：
# 1. 优化移动端导航栏显示
# 2. 改进移动端布局和间距
# 3. 增强移动端阅读体验
# 4. 优化侧边栏在移动端的显示
###################################################
*/

/* ===== 基础样式 ===== */
:root {
  /* OnlyFans配色方案 */
  --of-primary: #00aff0;     /* 主蓝色 */
  --of-secondary: #0088cc;   /* 深蓝色 */
  --of-accent: #39c2f7;      /* 亮蓝色 */
  --of-light: #e6f7ff;       /* 浅蓝色 */
  --of-dark: #1a1a1a;        /* 深灰色 */
  --of-gray: #f2f2f2;        /* 浅灰色 */
  --of-text: #333333;        /* 文本色 */
  --of-white: #ffffff;       /* 白色 */
  
  /* 字体 */
  --font-primary: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  
  /* 间距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* 圆角 */
  --border-radius: 8px;
  --border-radius-sm: 4px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  color: var(--of-text);
  line-height: 1.6;
  background-color: var(--of-gray);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--of-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--of-secondary);
}

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

/* ===== 布局 ===== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  overflow-x: hidden; /* 防止子元素溢出 */
}

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    grid-template-columns: 1fr 2fr;
  }
}

@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr 2fr 1fr;
  }
}

/* ===== 头部 ===== */
.site-header {
  background-color: var(--of-white);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md) 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo a {
  display: flex;
  align-items: center;
}

.site-logo img {
  max-height: 40px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--of-primary);
}

.main-nav .menu {
  display: none;
  list-style: none;
}

.main-nav .menu.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background-color: var(--of-white);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.main-nav .menu li {
  margin-left: var(--spacing-md);
}

.main-nav .menu a {
  display: block;
  padding: var(--spacing-sm);
  color: var(--of-text);
}

.main-nav .menu a:hover,
.main-nav .menu a.active {
  color: var(--of-primary);
}

.menu-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--of-primary);
  cursor: pointer;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  
  .main-nav .menu {
    display: flex;
    flex-direction: row;
  }
  
  .main-nav .menu.active {
    position: static;
    box-shadow: none;
  }
}

/* ===== 侧边栏 ===== */
.sidebar {
  background-color: var(--of-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
}

.sidebar-widget {
  margin-bottom: var(--spacing-xl);
}

.widget-title {
  color: var(--of-primary);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--of-light);
}

/* 作者小部件 */
.author-placeholder {
  text-align: center;
}

.author-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--spacing-sm);
}

.author-name {
  font-weight: bold;
  margin-bottom: var(--spacing-xs);
}

.author-bio {
  font-size: 0.9rem;
  color: var(--of-text);
}

/* 分类和最新文章列表 */
.categories-list,
.recent-posts-list {
  list-style: none;
}

.categories-list li,
.recent-posts-list li {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--of-light);
}

.categories-list li:last-child,
.recent-posts-list li:last-child {
  border-bottom: none;
}

/* 标签云 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.tag {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--of-light);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  transition: background-color 0.3s ease;
}

.tag:hover {
  background-color: var(--of-accent);
  color: var(--of-white);
}

/* 搜索框 */
.search-form {
  display: flex;
}

.search-input {
  flex: 1;
  padding: var(--spacing-sm);
  border: 1px solid var(--of-light);
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  outline: none;
}

.search-button {
  background-color: var(--of-primary);
  color: var(--of-white);
  border: none;
  padding: var(--spacing-sm);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  cursor: pointer;
}

/* 广告占位区域 */
.ad-box {
  background-color: var(--of-light);
  padding: var(--spacing-lg);
  text-align: center;
  border-radius: var(--border-radius);
}

/* ===== 文章列表 ===== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.post-card {
  background-color: var(--of-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.post-card-inner {
  display: flex;
  flex-direction: column;
}

.post-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0;
  /* Use 16:9 aspect ratio (56.25%) instead of 9:16 for list view to avoid overly tall placeholders */
  padding-top: 56.25%;
}

.featured-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .featured-image {
  transform: scale(1.05);
}

.post-content {
  padding: 0;
}

.post-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

.post-title a {
  color: var(--of-dark);
}

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
  color: var(--of-text);
}

.post-date,
.post-categories,
.post-tags {
  display: flex;
  align-items: center;
}

.post-meta i {
  margin-right: var(--spacing-xs);
  color: var(--of-primary);
}

.post-excerpt {
  margin-bottom: var(--spacing-md);
  color: var(--of-text);
  line-height: 1.6;
}

.read-more-btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--of-primary);
  color: var(--of-white);
  border-radius: var(--border-radius-sm);
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.read-more-btn:hover {
  background-color: var(--of-secondary);
  color: var(--of-white);
}

@media (min-width: 768px) {
  .post-card-inner {
    flex-direction: row;
  }
  
  .post-image {
    width: 40%;
    height: auto;
  }
  
  .post-content {
    width: 100%;
  }
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--spacing-xl);
}

.prev-page,
.next-page {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--of-primary);
  color: var(--of-white);
  border-radius: var(--border-radius-sm);
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.prev-page:hover,
.next-page:hover {
  background-color: var(--of-secondary);
  color: var(--of-white);
}

.prev-page i {
  margin-right: var(--spacing-xs);
}

.next-page i {
  margin-left: var(--spacing-xs);
}

.page-number {
  margin: 0 var(--spacing-md);
  color: var(--of-text);
}

/* ===== 单篇文章 ===== */
.single-post {
  background-color: var(--of-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-xl);
}

.post-header {
  margin-bottom: var(--spacing-lg);
}

.post-featured-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
  /* 9:16 aspect ratio for desktop */
  padding-top: 177.78%;
}

.post-featured-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-of-contents {
  background-color: var(--of-light);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  border-radius: var(--border-radius);
}

.table-of-contents h2 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--of-primary);
}

.post-content {
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: var(--spacing-lg) 0 var(--spacing-md);
  color: var(--of-dark);
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-bottom: var(--spacing-md);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: var(--spacing-md) 0;
}

.post-content blockquote {
  border-left: 4px solid var(--of-primary);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: var(--of-text);
  font-style: italic;
}

.post-content code {
  background-color: var(--of-light);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-family: monospace;
}

.post-content pre {
  background-color: var(--of-dark);
  color: var(--of-white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: var(--spacing-md) 0;
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.post-footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--of-light);
}

/* 分享按钮 */
.social-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.share-label {
  font-weight: bold;
  margin-right: var(--spacing-sm);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--of-white);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.share-btn:hover {
  transform: translateY(-3px);
  color: var(--of-white);
}

.twitter {
  background-color: #1da1f2;
}

.facebook {
  background-color: #3b5998;
}

.linkedin {
  background-color: #0077b5;
}

.pinterest {
  background-color: #bd081c;
}

.email {
  background-color: #333333;
}

/* 文章导航 */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-lg);
}

.prev-post,
.next-post {
  display: inline-flex;
  align-items: center;
  max-width: 45%;
}

.prev-post i,
.next-post i {
  color: var(--of-primary);
}

.prev-post i {
  margin-right: var(--spacing-sm);
}

.next-post i {
  margin-left: var(--spacing-sm);
}

.prev-post span,
.next-post span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 页脚 ===== */
.site-footer {
  background-color: var(--of-dark);
  color: var(--of-white);
  padding: var(--spacing-xl) 0;
  margin-top: var(--spacing-xl);
  position: relative;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-content {
  margin-bottom: var(--spacing-lg);
}

.copyright {
  margin-bottom: var(--spacing-md);
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--of-white);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
  background-color: var(--of-primary);
  transform: translateY(-3px);
}

.icp {
  font-size: 0.8rem;
  opacity: 0.7;
}

.icp a {
  color: var(--of-white);
}

#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--of-primary);
  color: var(--of-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
  z-index: 1000;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background-color: var(--of-secondary);
}

/* ===== 移动端优化 ===== */
@media (max-width: 767px) {
  .container {
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-content {
    padding: 15px 0;
    margin: 0;
    /* 修复移动端布局问题：
       1. 移除flex-direction，因为它与grid布局冲突
       2. 重置为单列grid布局
       3. 确保子元素不会溢出容器 */
    display: grid;
    grid-template-columns: minmax(0, 1fr); /* 防止内容溢出 */
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  /* 确保侧边栏和主内容区域不会溢出容器 */
  .sidebar, .content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  /* 调整移动端元素显示顺序：
     1. 主内容区域优先显示
     2. 右侧边栏次之
     3. 左侧边栏最后 */
  .content {
    order: 1;
  }
  
  .sidebar-right {
    order: 2;
  }
  
  .sidebar-left {
    order: 3;
  }

  .site-header {
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    padding: 0 15px;
  }

  .site-logo img {
    max-height: 40px;
  }

  .site-title {
    font-size: 20px;
  }

  .main-nav .menu.active {
    display: block;
  }

  .main-nav .menu li {
    margin: 0;
    padding: 10px 0;
  }

  .main-nav .menu li:last-child {
    margin-bottom: 0;
  }

  .main-nav .menu a {
    padding: 5px 0;
  }

  .sidebar {
    margin-top: 20px;
    padding:10px;
  }

  .post-card {
    margin-bottom: 20px;
  }

  .post-card-inner {
    flex-direction: column;
  }

  .post-image {
    width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
    /* 16:9 aspect ratio for mobile (9/16 = 0.5625 = 56.25%) */
    padding-top: 56.25%;
  }

  .post-content {
    width: 100%;
  }

  .post-title {
    font-size: 18px;
  }

  .post-meta {
    font-size: 12px;
  }

  .post-excerpt {
    margin-bottom: 10px;
  }

  .pagination {
    margin-top: 20px;
    padding: 10px 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    margin-top: 10px;
  }

  #back-to-top {
    right: 15px;
    bottom: 15px;
  }

  .post-featured-image {
    /* 16:9 aspect ratio for mobile */
    padding-top: 56.25%;
  }
}

/* ===== 平板端优化 ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  .main-content {
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
  }

  .sidebar {
    margin-top: 0;
  }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) {
  .post-card:hover .featured-image {
    transform: none;
  }

  .read-more-btn:hover {
    transform: none;
  }

  a:hover {
    transition: none;
  }
}

/* ===== 暗色模式支持 ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --of-text: #e0e0e0;
    --of-dark: #121212;
    --of-gray: #1e1e1e;
    --of-white: #242424;
    --of-light: #2a2a2a;
  }

  body {
    background-color: var(--of-dark);
  }

  .site-header,
  .sidebar,
  .post-card,
  .single-post {
    background-color: var(--of-white);
  }

  .post-meta,
  .author-bio {
    color: #999;
  }
}

/* Add this to your existing CSS */

.no-featured-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  color: #999;
  font-size: 16px;
  text-align: center;
  border-radius: 8px;
}

.post-featured-image .no-featured-image {
  height: 300px;
}

/* Adjust the height of the no-featured-image placeholder in list view */
.post-card .post-image {
  padding-top: 56.25%; /* Use 16:9 aspect ratio for all placeholders in list view */
}

/* Single post featured image */
.post-featured-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
  /* 9:16 aspect ratio for desktop */
  padding-top: 177.78%;
}

.post-featured-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile styles */
@media (max-width: 767px) {
  .post-image {
    /* 16:9 aspect ratio for mobile (9/16 = 0.5625 = 56.25%) */
    padding-top: 56.25%;
  }
  
  .post-featured-image {
    /* 16:9 aspect ratio for mobile */
    padding-top: 56.25%;
  }
}

/* ===== 分类法页面样式 ===== */
.taxonomy-terms {
  margin: 2rem 0;
}

.terms-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--of-light);
  border-radius: var(--border-radius);
}

.term-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--of-white);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

/* 根据标签数量设置不同大小 */
.tags-cloud .term-link:nth-child(1),
.tags-cloud .term-link:nth-child(2) {
  font-size: 1.4rem;
  font-weight: bold;
}

.tags-cloud .term-link:nth-child(3),
.tags-cloud .term-link:nth-child(4),
.tags-cloud .term-link:nth-child(5) {
  font-size: 1.2rem;
  font-weight: bold;
}

.tags-cloud .term-link:nth-child(6),
.tags-cloud .term-link:nth-child(7),
.tags-cloud .term-link:nth-child(8),
.tags-cloud .term-link:nth-child(9),
.tags-cloud .term-link:nth-child(10) {
  font-size: 1.1rem;
}

.term-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.term-count {
  font-size: 0.8em;
  opacity: 0.7;
}

.terms-list ul {
  list-style: none;
  padding: 0;
}

.terms-list li {
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--of-light);
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
}

.terms-list li:hover {
  background-color: var(--of-white);
  box-shadow: var(--shadow-sm);
}

.page-title {
  margin-bottom: 2rem;
  text-align: center;
}

.page-title h1 {
  font-size: 2rem;
  color: var(--of-primary);
  margin-bottom: 0.5rem;
} 