/**
 * Copyright (C), 2025, GOSUN CL
 * file: single.css
 * brief: 视评图说主题
 * Theme URI: https://faq7777.com
 * author: 视评图说
 * date: 2025年7月7日
 * version: 7.7.0
 */

/* 主题CSS变量（保留你的自定义配置） */
:root {
  --spt-primary: #2c3e50;
  --spt-primary-dark: #1a252f;
  --spt-secondary: #3498db;
  --spt-text: #333;
  --spt-text-light: #666;
  --spt-text-lighter: #999;
  --spt-bg: #fff;
  --spt-bg-light: #f9f9f9;
  --spt-border: #eee;
  --spt-shadow: rgba(0, 0, 0, 0.1);
}

/* 修复：完整基础样式重置，消除浏览器默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 修复：精简统一无障碍焦点样式，删除冗余代码 - 已禁用 */
:focus-visible {
  outline: none;
}

/* 单篇文章页面样式 */
#wrapper {
  position: relative;
  min-height: 600px;
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 20px;
  /* 修复：删除这里的 flex！禁止顶部栏参与布局 */
  display: block;
}

/* 修复：新增【内容容器】，只给这个容器加 Flex 布局 */
.main-container {
  display: flex;
  gap: 30px;
  margin-top: 30px;
}

/* 主内容区域 */
#content {
  flex: 0 0 70%;
}

/* 侧边栏 */
#sidebar {
  flex: 0 0 30%;
}

/* 文章头部 */
.post-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--spt-border);
}

.post-title {
  margin: 0 0 15px;
  font-size: 28px;
  font-weight: normal;
  line-height: 1.3;
  color: var(--spt-text);
}

.post-meta {
  color: var(--spt-text-lighter);
  font-size: 14px;
  margin-bottom: 15px;
}

/* 文章缩略图 */
.post-thumbnail {
  margin-bottom: 30px;
  overflow: hidden;
  border-radius: 8px;
}

.post-thumbnail img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  display: block;
}

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

/* 文章正文 */
.post-content {
  margin-bottom: 30px;
  line-height: 1.8;
  color: var(--spt-text);
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content h2 {
  margin: 1.5em 0 1em;
  font-size: 24px;
  font-weight: normal;
  color: var(--spt-text);
}

.post-content h3 {
  margin: 1.2em 0 0.8em;
  font-size: 20px;
  font-weight: normal;
  color: var(--spt-text);
}

.post-content ul,
.post-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content a {
  color: var(--spt-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-content a:hover {
  color: var(--spt-primary-dark);
  text-decoration: underline;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 1em 0;
  border-radius: 4px;
  display: block;
}

/* 富文本样式 */
.post-content blockquote {
  margin: 1.5em 0;
  padding: 15px 20px;
  border-left: 4px solid var(--spt-primary);
  background-color: var(--spt-bg-light);
  color: var(--spt-text-light);
  font-style: italic;
}

.post-content pre {
  margin: 1.5em 0;
  padding: 15px;
  background-color: var(--spt-bg-light);
  border: 1px solid var(--spt-border);
  border-radius: 4px;
  overflow-x: auto;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.post-content code {
  padding: 2px 6px;
  background-color: var(--spt-bg-light);
  border: 1px solid var(--spt-border);
  border-radius: 3px;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 13px;
  color: var(--spt-primary-dark);
}

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

.post-content table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  border-spacing: 0;
}

.post-content th,
.post-content td {
  padding: 12px 15px;
  border: 1px solid var(--spt-border);
  text-align: left;
}

.post-content th {
  background-color: var(--spt-bg-light);
  font-weight: 600;
  color: var(--spt-text);
}

.post-content tr:nth-child(even) {
  background-color: var(--spt-bg-light);
}

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

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

/* 分享按钮 */
.share-buttons {
  margin: 20px 0;
}

.share-buttons a {
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background-color: var(--spt-bg-light);
  border-radius: 4px;
  color: var(--spt-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.share-buttons a:hover {
  background-color: var(--spt-primary);
  color: #fff;
}

/* 标签 */
.post-tags {
  margin: 20px 0;
}

.post-tags a {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 4px 12px;
  background-color: var(--spt-bg-light);
  border-radius: 16px;
  font-size: 14px;
  color: var(--spt-text-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* 相关文章 */
.related-posts {
  margin: 40px 0;
  padding: 20px;
  background-color: var(--spt-bg-light);
  border-radius: 8px;
}

.related-posts h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: normal;
  color: var(--spt-text);
}

.related-posts ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-posts li {
  margin-bottom: 10px;
}

.related-posts a {
  color: var(--spt-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.related-posts a:hover {
  color: var(--spt-primary);
}

/* 评论区 */
#comments {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--spt-border);
}

/* 小工具 */
.widget {
  margin-bottom: 30px;
  padding: 20px;
  background-color: rgba(255,255,255,0.8);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--spt-shadow);
}

.widget h3 {
  margin: 0 0 15px;
  font-size: 16px;
  font-weight: normal;
  color: var(--spt-text);
  border-bottom: 2px solid var(--spt-primary);
  padding-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  #content,
  #sidebar {
    flex: 0 0 100%;
  }

  #sidebar {
    margin-top: 20px;
  }

  #wrapper {
    padding: 0 15px;
    margin: 15px auto;
  }

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

  .post-content h2 {
    font-size: 20px;
  }

  .post-content h3 {
    font-size: 18px;
  }

  .widget {
    padding: 15px;
  }
}