/* 全局样式 - 清新淡雅的设计 */
:root {
  --bg-primary: #fafbfc;
  --bg-secondary: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --accent-color: #5b9bd5;
  --accent-light: #e8f4f8;
  --border-color: #e8ebed;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;

  /* D3 schemeCategory10 颜色方案 - 用于不同作者 */
  --author-color-0: #1f77b4;
  --author-color-1: #ff7f0e;
  --author-color-2: #2ca02c;
  --author-color-3: #d62728;
  --author-color-4: #9467bd;
  --author-color-5: #8c564b;
  --author-color-6: #e377c2;
  --author-color-7: #7f7f7f;
  --author-color-8: #bcbd22;
  --author-color-9: #17becf;

  /* 淡色背景版本 (10% opacity) */
  --author-bg-0: rgba(31, 119, 180, 0.08);
  --author-bg-1: rgba(255, 127, 14, 0.08);
  --author-bg-2: rgba(44, 160, 44, 0.08);
  --author-bg-3: rgba(214, 39, 40, 0.08);
  --author-bg-4: rgba(148, 103, 189, 0.08);
  --author-bg-5: rgba(140, 86, 75, 0.08);
  --author-bg-6: rgba(227, 119, 194, 0.08);
  --author-bg-7: rgba(127, 127, 127, 0.08);
  --author-bg-8: rgba(188, 189, 34, 0.08);
  --author-bg-9: rgba(23, 190, 207, 0.08);

  /* 标签背景版本 (20% opacity) */
  --author-tag-0: rgba(31, 119, 180, 0.15);
  --author-tag-1: rgba(255, 127, 14, 0.15);
  --author-tag-2: rgba(44, 160, 44, 0.15);
  --author-tag-3: rgba(214, 39, 40, 0.15);
  --author-tag-4: rgba(148, 103, 189, 0.15);
  --author-tag-5: rgba(140, 86, 75, 0.15);
  --author-tag-6: rgba(227, 119, 194, 0.15);
  --author-tag-7: rgba(127, 127, 127, 0.15);
  --author-tag-8: rgba(188, 189, 34, 0.15);
  --author-tag-9: rgba(23, 190, 207, 0.15);
}

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

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont,
    'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

/* 头部导航 */
header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.site-title:hover {
  opacity: 0.8;
}

/* 汉堡菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
}

.menu-toggle:hover {
  color: var(--accent-color);
}

nav {
  position: relative;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  font-size: 0.95rem;
}

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

/* 主内容区 */
main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.page-header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

.page-header-icon {
  height: 6rem;
  width: 6rem;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
}

.page-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

/* 文章列表 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-decoration: none !important;
  display: block;
  color: inherit;
}

.post-card * {
  text-decoration: none !important;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.post-author {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
  flex-shrink: 0;
}

/* 为每个作者定义不同的颜色 */
.post-card.author-0 {
  background: var(--author-bg-0);
}

.post-card.author-1 {
  background: var(--author-bg-1);
}

.post-card.author-2 {
  background: var(--author-bg-2);
}

.post-card.author-3 {
  background: var(--author-bg-3);
}

.post-card.author-4 {
  background: var(--author-bg-4);
}

.post-card.author-5 {
  background: var(--author-bg-5);
}

.post-card.author-6 {
  background: var(--author-bg-6);
}

.post-card.author-7 {
  background: var(--author-bg-7);
}

.post-card.author-8 {
  background: var(--author-bg-8);
}

.post-card.author-9 {
  background: var(--author-bg-9);
}

.post-author.author-0 {
  background: var(--author-tag-0);
  color: var(--author-color-0);
}

.post-author.author-1 {
  background: var(--author-tag-1);
  color: var(--author-color-1);
}

.post-author.author-2 {
  background: var(--author-tag-2);
  color: var(--author-color-2);
}

.post-author.author-3 {
  background: var(--author-tag-3);
  color: var(--author-color-3);
}

.post-author.author-4 {
  background: var(--author-tag-4);
  color: var(--author-color-4);
}

.post-author.author-5 {
  background: var(--author-tag-5);
  color: var(--author-color-5);
}

.post-author.author-6 {
  background: var(--author-tag-6);
  color: var(--author-color-6);
}

.post-author.author-7 {
  background: var(--author-tag-7);
  color: var(--author-color-7);
}

.post-author.author-8 {
  background: var(--author-tag-8);
  color: var(--author-color-8);
}

.post-author.author-9 {
  background: var(--author-tag-9);
  color: var(--author-color-9);
}

.post-date {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-left: auto;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.post-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 作者分组 */
.author-section {
  margin-bottom: 4rem;
}

.author-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-light);
}

.author-name {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.author-count {
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
}

/* 文章详情页 - 简洁统一设计 */
.article-header {
  background: var(--accent-light);
  padding: 3rem 2rem 2rem;
  margin: -3rem -3rem 2.5rem -3rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.article-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
}

.article-original-title {
  font-style: italic;
}

/* 文章内页 - 基于作者的主题色 */
article.author-0 .article-header {
  background: var(--author-bg-0);
}

article.author-1 .article-header {
  background: var(--author-bg-1);
}

article.author-2 .article-header {
  background: var(--author-bg-2);
}

article.author-3 .article-header {
  background: var(--author-bg-3);
}

article.author-4 .article-header {
  background: var(--author-bg-4);
}

article.author-5 .article-header {
  background: var(--author-bg-5);
}

article.author-6 .article-header {
  background: var(--author-bg-6);
}

article.author-7 .article-header {
  background: var(--author-bg-7);
}

article.author-8 .article-header {
  background: var(--author-bg-8);
}

article.author-9 .article-header {
  background: var(--author-bg-9);
}

article.author-0 .article-content a {
  color: var(--author-color-0);
}

article.author-1 .article-content a {
  color: var(--author-color-1);
}

article.author-2 .article-content a {
  color: var(--author-color-2);
}

article.author-3 .article-content a {
  color: var(--author-color-3);
}

article.author-4 .article-content a {
  color: var(--author-color-4);
}

article.author-5 .article-content a {
  color: var(--author-color-5);
}

article.author-6 .article-content a {
  color: var(--author-color-6);
}

article.author-7 .article-content a {
  color: var(--author-color-7);
}

article.author-8 .article-content a {
  color: var(--author-color-8);
}

article.author-9 .article-content a {
  color: var(--author-color-9);
}

article.author-0 .article-content a:hover {
  border-bottom-color: var(--author-color-0);
}

article.author-1 .article-content a:hover {
  border-bottom-color: var(--author-color-1);
}

article.author-2 .article-content a:hover {
  border-bottom-color: var(--author-color-2);
}

article.author-3 .article-content a:hover {
  border-bottom-color: var(--author-color-3);
}

article.author-4 .article-content a:hover {
  border-bottom-color: var(--author-color-4);
}

article.author-5 .article-content a:hover {
  border-bottom-color: var(--author-color-5);
}

article.author-6 .article-content a:hover {
  border-bottom-color: var(--author-color-6);
}

article.author-7 .article-content a:hover {
  border-bottom-color: var(--author-color-7);
}

article.author-8 .article-content a:hover {
  border-bottom-color: var(--author-color-8);
}

article.author-9 .article-content a:hover {
  border-bottom-color: var(--author-color-9);
}

article.author-0 .article-content blockquote {
  border-left-color: var(--author-color-0);
  background: var(--author-bg-0);
}

article.author-1 .article-content blockquote {
  border-left-color: var(--author-color-1);
  background: var(--author-bg-1);
}

article.author-2 .article-content blockquote {
  border-left-color: var(--author-color-2);
  background: var(--author-bg-2);
}

article.author-3 .article-content blockquote {
  border-left-color: var(--author-color-3);
  background: var(--author-bg-3);
}

article.author-4 .article-content blockquote {
  border-left-color: var(--author-color-4);
  background: var(--author-bg-4);
}

article.author-5 .article-content blockquote {
  border-left-color: var(--author-color-5);
  background: var(--author-bg-5);
}

article.author-6 .article-content blockquote {
  border-left-color: var(--author-color-6);
  background: var(--author-bg-6);
}

article.author-7 .article-content blockquote {
  border-left-color: var(--author-color-7);
  background: var(--author-bg-7);
}

article.author-8 .article-content blockquote {
  border-left-color: var(--author-color-8);
  background: var(--author-bg-8);
}

article.author-9 .article-content blockquote {
  border-left-color: var(--author-color-9);
  background: var(--author-bg-9);
}

article.author-0 .article-content code {
  background: var(--author-bg-0);
  color: var(--author-color-0);
}

article.author-1 .article-content code {
  background: var(--author-bg-1);
  color: var(--author-color-1);
}

article.author-2 .article-content code {
  background: var(--author-bg-2);
  color: var(--author-color-2);
}

article.author-3 .article-content code {
  background: var(--author-bg-3);
  color: var(--author-color-3);
}

article.author-4 .article-content code {
  background: var(--author-bg-4);
  color: var(--author-color-4);
}

article.author-5 .article-content code {
  background: var(--author-bg-5);
  color: var(--author-color-5);
}

article.author-6 .article-content code {
  background: var(--author-bg-6);
  color: var(--author-color-6);
}

article.author-7 .article-content code {
  background: var(--author-bg-7);
  color: var(--author-color-7);
}

article.author-8 .article-content code {
  background: var(--author-bg-8);
  color: var(--author-color-8);
}

article.author-9 .article-content code {
  background: var(--author-bg-9);
  color: var(--author-color-9);
}

article.author-0 .back-link:hover {
  color: var(--author-color-0);
}

article.author-1 .back-link:hover {
  color: var(--author-color-1);
}

article.author-2 .back-link:hover {
  color: var(--author-color-2);
}

article.author-3 .back-link:hover {
  color: var(--author-color-3);
}

article.author-4 .back-link:hover {
  color: var(--author-color-4);
}

article.author-5 .back-link:hover {
  color: var(--author-color-5);
}

article.author-6 .back-link:hover {
  color: var(--author-color-6);
}

article.author-7 .back-link:hover {
  color: var(--author-color-7);
}

article.author-8 .back-link:hover {
  color: var(--author-color-8);
}

article.author-9 .back-link:hover {
  color: var(--author-color-9);
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
}

.article-content h1 {
  font-size: 2rem;
}

/* 只对正文中的 h1 添加底部边框(不包括 .article-title) */
.article-content>h1:not(.article-title) {
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.5rem;
}

.article-content h2 {
  font-size: 1.6rem;
}

.article-content h3 {
  font-size: 1.3rem;
}

.article-content p {
  margin-bottom: 1.2rem;
}

.article-content a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.article-content a:hover {
  border-bottom-color: var(--accent-color);
}

.article-content ul,
.article-content ol {
  margin-left: 2rem;
  margin-bottom: 1.2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--accent-light);
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}

.article-content code {
  background: var(--accent-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
  color: var(--accent-color);
}

.article-content pre {
  background: #2d3748;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.3s;
}

.back-link:hover {
  transform: translateX(-4px);
}

.original-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.original-link a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* 页脚 */
footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
}

footer .container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s;
  font-size: inherit;
}

footer a:hover {
  opacity: 0.7;
}

.footer-divider {
  width: 60px;
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  main {
    padding: z.5rem 0;
  }

  header {
    padding: 0.75rem 0;
    position: static;
  }

  .site-title {
    font-size: 1.25rem;
  }

  /* 显示汉堡菜单按钮 */
  .menu-toggle {
    display: block;
  }

  /* 隐藏导航，改为下拉菜单 */
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    min-width: 200px;
    margin-top: 0.5rem;
    flex-direction: column;
    gap: 0;
    z-index: 1000;
  }

  nav ul.active {
    display: flex;
  }

  nav li {
    margin: 0;
  }

  nav a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  nav a:hover {
    background: var(--accent-light);
  }

  .page-title {
    font-size: 2rem;
  }

  .page-header-icon {
    height: 4.5rem;
    width: 4.5rem;
  }

  .page-header-content {
    gap: 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .article-content {
    padding: 2rem 1.5rem;
  }

  .article-header {
    padding: 1.5rem 1.5rem 1.25rem;
    margin: -2rem -1.5rem 1.5rem -1.5rem;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-meta {
    font-size: 0.85rem;
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card,
.article-content {
  animation: fadeIn 0.5s ease-out;
}

/* Figure 和 Figcaption 样式 */
.article-content figure {
  margin: 2rem 0;
  padding: 0;
  text-align: center;
}

.article-content figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.article-content figure img:hover {
  box-shadow: var(--shadow-md);
}

.article-content figcaption {
  margin-top: 0.75rem;
  padding: 0 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .article-content figure {
    margin: 1.5rem 0;
  }

  .article-content figcaption {
    font-size: 0.85rem;
    padding: 0 0.5rem;
  }
}

/* 需要更新的文章标记 - 左上角小圆点 */
.post-card.needs-update {
  position: relative;
}

.post-card.needs-update::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  opacity: 0.4;
}