/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式 */
.header {
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.logo a {
  text-decoration: none;
  color: inherit;
}

.nav {
  margin-top: 0.5rem;
}

.nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: #666;
}

.nav a:hover {
  color: #2c3e50;
}

/* 主要内容区 */
.hero {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin: 2rem 0;
  border-radius: 10px;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* 博客列表 */
.blog-list {
  margin: 3rem 0;
}

.blog-list h3 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

.blog-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid #667eea;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.blog-card h4 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.blog-card h4 a {
  text-decoration: none;
  color: inherit;
}

.blog-card h4 a:hover {
  color: #667eea;
}

.blog-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.blog-excerpt {
  color: #555;
  line-height: 1.5;
}

/* 博客内容 */
.blog-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.blog-content h1 {
  color: #2c3e50;
  margin-bottom: 1rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
}

.blog-content h2 {
  color: #2c3e50;
  margin: 1.5rem 0 1rem 0;
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
}

.blog-content pre {
  background: #2c3e50;
  color: white;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1rem 0;
}

.blog-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #666;
  font-style: italic;
}

/* 导航按钮 */
.blog-nav {
  text-align: center;
  margin: 2rem 0;
}

.btn {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
}

.btn:hover {
  background: #5a6fd8;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* 页脚 */
.footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}
/* 博客文章容器 */
.blog-post {
  max-width: 100%;
}

.blog-title {
  color: #2c3e50;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  border-bottom: none;
  padding-bottom: 0;
}

/* 博客元信息 */
.blog-meta {
  color: #666;
  font-size: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e1e4e8;
}

.publish-date {
  font-weight: 500;
}

.blog-tags {
  color: #667eea;
}

/* 博客内容区域 */
.blog-content {
  line-height: 1.7;
  font-size: 1.1rem;
  color: #333;
}

.blog-content h1 {
  color: #2c3e50;
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.blog-content h2 {
  color: #2c3e50;
  font-size: 1.6rem;
  margin: 1.8rem 0 1rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e1e4e8;
}

.blog-content h3 {
  color: #2c3e50;
  font-size: 1.3rem;
  margin: 1.5rem 0 0.8rem 0;
}

.blog-content p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

.blog-content ul,
.blog-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.blog-content blockquote {
  border-left: 4px solid #667eea;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: #f8f9fa;
  border-radius: 0 5px 5px 0;
  font-style: italic;
  color: #555;
}
.blog-content table{
  border-collapse: collapse;
}
.blog-content th, .blog-content td {
  border: 1px solid #000000;
  padding: 0.15rem;
  text-align: auto;
}

/* 代码高亮样式 */
.blog-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

.blog-content pre {
  background: #1a1a1a;
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.blog-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 0.95em;
  line-height: 1.4;
}

/* 代码高亮主题 - 使用 GitHub Dark 的改进版本 */
.hljs {
  background: #1a1a1a;
  color: #f8f8f2;
}

.hljs-keyword {
  color: #ff79c6;
  font-weight: bold;
}
.hljs-built_in {
  color: #50fa7b;
}
.hljs-type {
  color: #8be9fd;
}
.hljs-literal {
  color: #ff79c6;
}
.hljs-number {
  color: #bd93f9;
}
.hljs-string {
  color: #f1fa8c;
}
.hljs-comment {
  color: #6272a4;
  font-style: italic;
}
.hljs-function {
  color: #50fa7b;
}
.hljs-params {
  color: #f8f8f2;
}
.hljs-title {
  color: #f1fa8c;
}
.hljs-attr {
  color: #50fa7b;
}
.hljs-variable {
  color: #f8f8f2;
}
.hljs-symbol {
  color: #f1fa8c;
}
.hljs-meta {
  color: #ff79c6;
}

/* 博客页脚 */
.blog-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e1e4e8;
  text-align: center;
}

.back-link {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid #667eea;
  border-radius: 5px;
  transition: all 0.3s;
}

.back-link:hover {
  background: #667eea;
  color: white;
}

/* 合集页面样式 */
.collection-section {
  margin: 3rem 0;
}

.tag-filter {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid #e1e4e8;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
  font-size: 0.95rem;
}

.tag-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.tag-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.collection-group {
  margin-bottom: 2.5rem;
}

.collection-group-title {
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.collection-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid #667eea;
}

.collection-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.collection-item h4 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.collection-item h4 a {
  text-decoration: none;
  color: inherit;
}

.collection-item h4 a:hover {
  color: #667eea;
}

.collection-item-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.collection-item-excerpt {
  color: #555;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.collection-item-tags {
  margin-top: 0.5rem;
}

.tag-badge {
  display: inline-block;
  background: #f0f0f0;
  color: #667eea;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .blog-title {
    font-size: 2rem;
  }

  .blog-content {
    font-size: 1rem;
  }

  .blog-content h1 {
    font-size: 1.6rem;
  }

  .blog-content h2 {
    font-size: 1.4rem;
  }

  .blog-content pre {
    padding: 1rem;
    margin: 1rem -1rem;
    border-radius: 0;
  }
}

/* 资源页面样式 */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.resource-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  border-top: 4px solid #667eea;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.resource-card h3 {
  color: #2c3e50;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
}

.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  margin-bottom: 1rem;
}

.resource-list a {
  color: #667eea;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.3s, transform 0.3s;
}

.resource-list a:hover {
  color: #5a6fd8;
  transform: translateX(5px);
}

.resource-list a::before {
  content: "→";
  margin-right: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.resource-list a:hover::before {
  opacity: 1;
}
