/* ========================================
   极简风格装饰 - 样式表
   www.jiayisheji.cn
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #333333;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f8f8;
  --border-color: #e5e5e5;
  --link-color: #333333;
  --link-hover: #000000;
  --max-width: 680px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --line-height: 1.8;
}

/* 重置样式 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

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

ul, ol {
  list-style: none;
}

/* ========================================
   布局容器
   ======================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================================
   页头 Header
   ======================================== */
.header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo a {
  color: var(--text-primary);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.search-btn {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 1;
}

/* ========================================
   页脚 Footer
   ======================================== */
.footer {
  margin-top: 5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Hero 区域
   ======================================== */
.hero {
  text-align: center;
  padding: 3rem 0 4rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* ========================================
   内容区块标题
   ======================================== */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* ========================================
   精选内容 Featured
   ======================================== */
.featured-section {
  margin-bottom: 4rem;
}

.featured-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.featured-item:first-child {
  padding-top: 0;
}

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

.featured-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.featured-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.featured-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ========================================
   内容列表
   ======================================== */
.content-section {
  margin-bottom: 4rem;
}

.content-list {
  display: flex;
  flex-direction: column;
}

.content-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.content-item h4 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.content-item a:hover {
  text-decoration: underline;
}

.content-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   侧边栏组件 (推荐/热门/最新)
   ======================================== */
.sidebar-section {
  margin-bottom: 3rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.sidebar-item .num {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.sidebar-item a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
}

.sidebar-item a:hover {
  color: var(--text-primary);
}

/* ========================================
   分类页样式
   ======================================== */
.category-header {
  text-align: center;
  padding: 2rem 0 3rem;
}

.category-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.category-header p {
  font-size: 1rem;
  color: var(--text-secondary);
}

.category-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ========================================
   分页
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 0;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.pagination a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.pagination .current {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.pagination .disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   文章页样式
   ======================================== */
.article-header {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta span {
  margin: 0 0.5rem;
}

.article-featured-image {
  margin-bottom: 2.5rem;
}

.article-featured-image img {
  width: 100%;
  border-radius: 4px;
}

/* 文章正文 */
.article-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

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

.article-body blockquote {
  border-left: 3px solid var(--text-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-body img {
  margin: 2rem 0;
  border-radius: 4px;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* 标签 */
.article-tags {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.article-tags a {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-right: 1rem;
}

.article-tags a::before {
  content: "#";
}

/* 相关文章 */
.related-articles {
  margin-top: 3rem;
}

.related-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.related-nav-item {
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
}

.related-nav-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.related-nav-item a {
  font-weight: 500;
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--border-color);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.error-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-home-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.9rem;
  border-radius: 4px;
}

.error-home-link:hover {
  background-color: var(--link-hover);
  color: var(--bg-primary);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
  :root {
    --max-width: 100%;
  }

  html {
    font-size: 15px;
  }

  .header {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
  }

  .hero {
    padding: 2rem 0 3rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .article-body {
    font-size: 1rem;
  }

  .error-code {
    font-size: 4rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .featured-item h3 {
    font-size: 1.1rem;
  }

  .pagination a,
  .pagination span {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
  .header,
  .footer,
  .sidebar-section,
  .pagination,
  .related-articles {
    display: none;
  }

  .article-body {
    font-size: 12pt;
    line-height: 1.6;
  }

  a {
    text-decoration: none;
    color: var(--text-primary);
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: var(--text-muted);
  }
}
