/* ══════════════════════════════════════════════════
   灵语AI · 自定义 Hugo 主题样式
   风格参考: blog.loveteemo.com (Element Plus 风)
   配色: 主色 #409EFF, 标题 #333, 正文 #606266
   ══════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #606266;
  background: #fff;
  min-height: 100vh;
}

a {
  color: #409EFF;
  text-decoration: none;
  transition: color 0.25s;
}

a:hover {
  color: #66b1ff;
}

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

/* ── Header / 导航栏 ───────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #f0f0f0;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333 !important;
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  padding: 8px 16px;
  color: #333;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
  background: #ecf5ff;
  color: #409EFF;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
  padding: 4px 8px;
}

/* ── Main Layout ────────────────────────────────── */

.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  min-height: calc(100vh - 64px - 120px);
}

/* ── Home Layout / 双栏 ────────────────────────── */

.home-layout,
.list-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.home-main,
.list-main {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar / 侧边栏 ──────────────────────────── */

.sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
}

.sidebar-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #409EFF;
}

.sidebar-text {
  font-size: 0.875rem;
  color: #909399;
  line-height: 1.8;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: #606266;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.sidebar-list a:hover {
  color: #409EFF;
}

.sidebar-count {
  font-size: 0.75rem;
  color: #909399;
  background: #f0f2f5;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-hot li {
  display: block;
  padding: 6px 0;
}

.sidebar-hot a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Article Card / 文章卡片 ────────────────────── */

.article-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s, transform 0.3s;
}

.article-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-image {
  margin: -32px -32px 24px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  max-height: 320px;
}

.card-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.4;
}

.card-title a {
  color: #333;
}

.card-title a:hover {
  color: #409EFF;
}

.card-summary {
  font-size: 0.9375rem;
  color: #606266;
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8125rem;
  color: #909399;
  margin-bottom: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-item a {
  color: #909399;
}

.meta-item a:hover {
  color: #409EFF;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  font-size: 0.8125rem;
  color: #409EFF !important;
  background: #ecf5ff;
  padding: 2px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.tag:hover {
  background: #d9ecff;
}

/* ── Pagination / 分页 ──────────────────────────── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
}

.page-link {
  padding: 8px 20px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  color: #606266;
  font-size: 0.875rem;
  transition: all 0.25s;
}

.page-link:hover {
  color: #409EFF;
  border-color: #409EFF;
  background: #ecf5ff;
}

.page-info {
  font-size: 0.875rem;
  color: #909399;
}

/* ── Post Detail / 文章详情页 ───────────────────── */

.post-detail {
  max-width: 880px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.post-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-content {
  font-size: 1rem;
  line-height: 1.9;
  color: #303133;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 28px 0 12px;
}

.post-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 24px 0 8px;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content ul,
.post-content ol {
  margin: 0 0 16px 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  margin: 20px 0;
  padding: 12px 20px;
  border-left: 4px solid #409EFF;
  background: #f8f9fa;
  color: #606266;
  border-radius: 0 4px 4px 0;
}

.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 3px;
  color: #d63384;
}

.post-content pre {
  margin: 20px 0;
  padding: 20px;
  background: #f6f8fa;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: #24292e;
  font-size: 0.875rem;
}

.post-content a {
  color: #409EFF;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  color: #66b1ff;
}

.post-content img {
  display: block;
  margin: 24px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content hr {
  border: none;
  border-top: 1px solid #e4e7ed;
  margin: 32px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.post-content th,
.post-content td {
  padding: 10px 16px;
  border: 1px solid #e4e7ed;
  text-align: left;
}

.post-content th {
  background: #f5f7fa;
  font-weight: 600;
  color: #333;
}

/* ── List Page / 列表页标题 ─────────────────────── */

.list-header {
  margin-bottom: 32px;
}

.list-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.list-desc {
  font-size: 0.9375rem;
  color: #909399;
}

/* ── 404 Error Page ─────────────────────────────── */

.error-page {
  text-align: center;
  padding: 100px 24px;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: #409EFF;
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 12px;
}

.error-desc {
  color: #909399;
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 10px 28px;
  background: #409EFF;
  color: #fff !important;
  border-radius: 6px;
  font-size: 0.9375rem;
  transition: background 0.25s;
}

.btn:hover {
  background: #66b1ff;
}

/* ── Taxonomy List / 分类/标签列表 ──────────────────── */

.taxonomy-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.taxonomy-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s, transform 0.3s;
}

.taxonomy-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.taxonomy-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  color: #333 !important;
}

.taxonomy-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.taxonomy-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.taxonomy-count {
  font-size: 0.8125rem;
  color: #909399;
  background: #f0f2f5;
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

/* ── Footer / 页脚 ──────────────────────────────── */

.site-footer {
  border-top: 1px solid #f0f0f0;
  padding: 24px 0;
  text-align: center;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-copy,
.footer-powered {
  font-size: 0.8125rem;
  color: #909399;
  line-height: 1.8;
}

.footer-powered a {
  color: #909399;
}

.footer-powered a:hover {
  color: #409EFF;
}

.footer-contact {
  font-size: 0.8125rem;
  color: #909399;
  line-height: 1.8;
}

.footer-contact a {
  color: #606266;
  text-decoration: none;
}

.footer-contact a:hover {
  color: #409EFF;
  text-decoration: underline;
}

/* ── Responsive / 响应式 ────────────────────────── */

@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
  }

  .home-layout,
  .list-layout {
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 24px;
    border-radius: 0;
  }

  .menu-toggle {
    display: block;
  }

  .main {
    padding: 20px 16px 48px;
  }

  .home-layout,
  .list-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
    margin-top: 24px;
  }

  .article-card {
    padding: 20px;
  }

  .card-image {
    margin: -20px -20px 16px;
  }

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

  .post-detail {
    max-width: 100%;
  }

  .card-meta {
    gap: 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .post-title {
    font-size: 1.25rem;
  }

  .post-meta {
    gap: 8px;
    font-size: 0.75rem;
    flex-direction: column;
  }
}

/* ── Mobile Menu Toggle JS ──────────────────────── */

/* 点击汉堡菜单展开导航 */
