/**
 * TaylorChen Blog - 自定义样式
 * 基于Minima主题的视觉优化
 */

/* ==================== 主题配色系统 ==================== */
:root {
  /* 主色调 - 蓝紫渐变 */
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #8b5cf6;

  /* 背景色 */
  --bg-color: #fafafa;
  --bg-card: #ffffff;
  --bg-code: #f5f5f5;

  /* 文字色 */
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;

  /* 边框和分割线 */
  --border-color: #e5e5e5;
  --divider-color: #f0f0f0;

  /* 强调色 */
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.15);

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* 过渡动画 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* 暗色模式 */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --bg-card: #2a2a2a;
  --bg-code: #1e1e1e;

  --text-primary: #f5f5f5;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;

  --border-color: #404040;
  --divider-color: #333333;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.6);
}

/* ==================== 全局样式优化 ==================== */
body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color var(--transition-base),
    color var(--transition-base);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

/* 优化字体渲染 */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ==================== 容器优化 ==================== */
.wrapper {
  max-width: 1200px;
  padding: 0 24px;
}

/* ==================== 标题样式 ==================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
}

h2 {
  font-size: 1.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--divider-color);
}

h3 {
  font-size: 1.5rem;
}

/* ==================== 链接优化 ==================== */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== 卡片样式 ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--border-color);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: scale(1.05);
}

/* ==================== 代码块优化 ==================== */
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas',
    'Monaco', monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

pre {
  background: var(--bg-code);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 代码复制按钮样式 */
.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.8;
}

.copy-btn:hover {
  opacity: 1;
  background: var(--primary-dark);
}

/* ==================== 按钮样式 ==================== */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* ==================== 返回顶部按钮优化 ==================== */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 999;
  display: none;
}

#back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ==================== 阅读进度条 ==================== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  z-index: 1000;
  transition: width var(--transition-fast);
}

/* ==================== 主题切换按钮 ==================== */
#theme-toggle {
  position: fixed;
  right: 24px;
  top: 80px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  z-index: 999;
}

#theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  box-shadow: var(--shadow-lg);
}

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

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

.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .wrapper {
    padding: 0 16px;
  }

  #theme-toggle,
  #back-to-top {
    right: 16px;
  }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==================== 选择文本样式 ==================== */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* ==================== 归档页面样式 ==================== */

/* 归档页面容器 */
.archive-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* 页面标题区 */
.archive-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--divider-color);
}

.archive-title {
  font-size: 2.5rem;
  margin: 0 0 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.archive-title svg {
  color: var(--primary-color);
}

.archive-stats {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin: 0;
}

.archive-stats strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* 快速导航（标签页） */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--bg-code);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.alpha-link {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all var(--transition-base);
  border: 1px solid var(--border-color);
}

.alpha-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

/* 分组标题（字母分组） */
.group-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 3rem 0 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
  scroll-margin-top: 100px;
  position: relative;
}

.group-title::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent-color);
}

.tag-group {
  margin-bottom: 3rem;
}

/* 标签/分类章节 */
.tag-section,
.category-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--divider-color);
}

.tag-section:last-child,
.category-section:last-child {
  border-bottom: none;
}

.tag-name,
.category-name {
  font-size: 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.tag-name svg,
.category-name svg {
  color: var(--primary-color);
  flex-shrink: 0;
}

.tag-count,
.category-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.25rem;
}

/* 文章列表 */
.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--divider-color);
  display: flex;
  gap: 1rem;
  align-items: baseline;
  transition: all var(--transition-fast);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item:hover {
  padding-left: 0.5rem;
  background: var(--bg-code);
  margin: 0 -0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.post-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  flex-shrink: 0;
  min-width: 95px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
}

.post-title {
  color: var(--text-primary);
  flex: 1;
  transition: color var(--transition-fast);
  text-decoration: none;
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 400;
}

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

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

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

  .archive-stats {
    font-size: 1rem;
  }

  .alpha-nav {
    padding: 1rem;
    gap: 0.375rem;
  }

  .alpha-link {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.875rem;
  }

  .group-title {
    font-size: 2rem;
    margin: 2rem 0 1.5rem;
  }

  .tag-name,
  .category-name {
    font-size: 1.125rem;
  }

  .post-item {
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.875rem 0;
  }

  .post-date {
    min-width: auto;
    font-size: 0.8125rem;
  }
}

/* 深色模式优化 */
[data-theme="dark"] .alpha-nav {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .alpha-link {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .post-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ==================== 面包屑导航样式 ==================== */

.breadcrumbs {
  margin: 1.5rem 0 2rem;
  padding: 0;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin: 0 0.5rem;
  color: var(--text-muted);
  font-size: 1.1em;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs [aria-current="page"],
.breadcrumbs span[itemprop="name"] {
  color: var(--text-primary);
  font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
  .breadcrumbs {
    margin: 1rem 0 1.5rem;
  }

  .breadcrumbs ol {
    font-size: 0.8125rem;
  }

  .breadcrumbs li:not(:last-child)::after {
    margin: 0 0.375rem;
  }
}