/* 硅藻泥 - 杂志博客风格样式表 */
/* 基础变量 */
:root {
  --accent-color: #8B9A46;
  --primary-color: #2C3E50;
  --secondary-color: #5D6D7E;
  --bg-color: #F8F9FA;
  --card-bg: #FFFFFF;
  --text-color: #333333;
  --text-light: #666666;
  --border-color: #E0E0E0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 70px;
}

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

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

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

ul {
  list-style: none;
}

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

/* 头部 */
.header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

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

.nav ul {
  display: flex;
  gap: 30px;
}

.nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}

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

/* 面包屑 */
.breadcrumb {
  background: var(--card-bg);
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
}

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

.breadcrumb .separator {
  color: var(--border-color);
}

/* 主要内容区 */
.main {
  padding: 30px 0;
}

/* 首页 - 杂志非对称布局 */
.hero-section {
  margin-bottom: 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.headline-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 400px;
}

.headline-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.headline-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.headline-content .category {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.headline-content h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  line-height: 1.3;
}

.headline-content .meta {
  font-size: 0.85rem;
  opacity: 0.8;
}

.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

.widget-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

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

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

/* 文章网格 */
.article-section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.3rem;
  color: var(--primary-color);
  position: relative;
  padding-left: 15px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 2px;
}

.view-more {
  color: var(--accent-color);
  font-size: 0.9rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.article-card.featured {
  grid-column: span 1;
  grid-row: span 2;
}

.article-card.featured .card-image {
  height: 200px;
}

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

.card-image {
  height: 150px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: 15px;
}

.card-category {
  display: inline-block;
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-content h3 {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--primary-color);
}

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

/* 三栏推荐区 */
.recommend-section {
  background: var(--card-bg);
  padding: 40px 0;
  margin-bottom: 40px;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.recommend-column h4 {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.recommend-column ul li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.recommend-column ul li:last-child {
  border-bottom: none;
}

.recommend-column a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-color);
  font-size: 0.9rem;
}

.recommend-column a::before {
  content: '•';
  color: var(--accent-color);
}

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

/* 分类页 */
.category-hero {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.category-hero h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.category-hero p {
  color: var(--text-light);
  max-width: 600px;
}

.category-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

.lead-story {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.lead-story .card-image {
  height: 300px;
}

.lead-story .card-content {
  padding: 25px;
}

.lead-story h2 {
  font-size: 1.4rem;
  margin-bottom: 15px;
}

.lead-story p {
  color: var(--text-light);
  margin-bottom: 15px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 文章页 */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

.article-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.article-header-image {
  height: 400px;
}

.article-header-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-header-content {
  padding: 30px;
}

.article-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-body {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-body h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 30px 0 15px;
}

.article-body h3 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin: 25px 0 12px;
}

.article-body p {
  margin-bottom: 15px;
  color: var(--text-color);
  line-height: 1.8;
}

.article-body ul,
.article-body ol {
  margin: 15px 0;
  padding-left: 25px;
}

.article-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.inline-media {
  margin: 30px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.inline-media img {
  width: 100%;
}

.inline-media-caption {
  background: var(--bg-color);
  padding: 10px 15px;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
}

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

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

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card h4 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.author-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.tags-widget .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags-widget .tag {
  display: inline-block;
  background: var(--bg-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-color);
  transition: all 0.3s;
}

.tags-widget .tag:hover {
  background: var(--accent-color);
  color: #fff;
}

/* 404页面 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-content {
  max-width: 500px;
}

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

.error-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

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

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.3s;
}

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

/* 页脚 */
.footer {
  background: var(--primary-color);
  color: #fff;
  padding: 50px 0 20px;
}

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

.footer-brand .logo {
  margin-bottom: 15px;
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-column h4 {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #fff;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

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

  .headline-card {
    height: 300px;
  }

  .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .headline-content h2 {
    font-size: 1.3rem;
  }

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

  .article-card.featured {
    grid-column: span 2;
    grid-row: span 1;
  }

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

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

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

  .article-body {
    padding: 25px;
  }

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

@media (max-width: 480px) {
  .article-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .article-card.featured {
    grid-column: span 1;
  }

  .headline-card {
    height: 250px;
  }

  .headline-content {
    padding: 20px;
  }

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