/* ========================================
   油画创作 - 全局样式表
   www.pigebaoyang.cn
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #8b5a2b;
  --accent-light: #d4a574;
  --accent-dark: #5c3d1e;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f5f2;
  --bg-card: #fff;
  --border-color: #e8e4e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

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

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

ul, ol {
  list-style: none;
}

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

/* ========================================
   页头 Header
   ======================================== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-text span {
  color: var(--accent-color);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 20px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  width: 160px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ========================================
   面包屑导航
   ======================================== */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 12px 0;
  font-size: 0.875rem;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 8px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb li:last-child {
  color: var(--text-muted);
}

/* ========================================
   Hero 区域
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #f0ebe5 100%);
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--accent-color);
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 32px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

/* ========================================
   区块标题
   ======================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-more {
  font-size: 0.875rem;
  color: var(--accent-color);
}

/* ========================================
   内容区块
   ======================================== */
.section {
  padding: 48px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

/* ========================================
   作者卡片
   ======================================== */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.author-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.author-role {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.author-bio {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.author-link {
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========================================
   文章列表
   ======================================== */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.content-item:hover {
  box-shadow: var(--shadow);
}

.content-thumb {
  width: 200px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.content-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-color);
  background: rgba(139, 90, 43, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  width: fit-content;
}

.content-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.content-title a {
  color: inherit;
}

.content-title a:hover {
  color: var(--accent-color);
}

.content-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: auto;
}

.content-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================
   侧边栏列表
   ======================================== */
.sidebar-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sidebar-item-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-item-num.top {
  background: var(--accent-color);
  color: #fff;
}

.sidebar-item-content {
  flex: 1;
}

.sidebar-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.sidebar-item-title a {
  color: inherit;
}

.sidebar-item-title a:hover {
  color: var(--accent-color);
}

.sidebar-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   三栏底部布局
   ======================================== */
.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ========================================
   分类页特定样式
   ======================================== */
.category-header {
  text-align: center;
  padding: 40px 0;
  background: var(--bg-secondary);
}

.category-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
}

.category-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.filter-tab {
  padding: 8px 20px;
  font-size: 0.875rem;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--accent-color);
  color: #fff;
}

/* ========================================
   分页
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  text-align: center;
  padding: 40px 0;
  max-width: 800px;
  margin: 0 auto;
}

.article-category {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--accent-color);
  margin-bottom: 16px;
}

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

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.article-featured-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 40px;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  height: auto;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 20px;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.article-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

.article-content ul,
.article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

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

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

.article-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.tag {
  font-size: 0.8125rem;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-radius: 16px;
  color: var(--text-secondary);
}

/* ========================================
   相关文章
   ======================================== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.related-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.related-card-content {
  padding: 16px;
}

.related-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-card-title a {
  color: var(--text-primary);
}

.related-card-title a:hover {
  color: var(--accent-color);
}

.related-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.3;
}

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

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 16px;
  line-height: 1.6;
}

.footer-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.footer-links a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
  .authors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

  .search-box {
    display: none;
  }

  .hero {
    padding: 40px 0;
  }

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

  .hero-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .authors-grid {
    grid-template-columns: 1fr;
  }

  .content-item {
    flex-direction: column;
  }

  .content-thumb {
    width: 100%;
    height: 180px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

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

  .article-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .category-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
