/* ============================================
   探洞 - 杂志风格样式表
   www.panyanluxian.cn - 专注于探洞爱好者的综合平台
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #e91e63;
  --primary-dark: #1a1a2e;
  --primary-light: #16213e;
  --text-dark: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-light: #f8f9fa;
  --bg-white: #fff;
  --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: 4px;
  --radius-lg: 8px;
  --max-width: 1200px;
  --header-height: 60px;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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(--bg-white);
  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 {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

.nav a {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.2s;
}

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

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

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

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

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

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

/* ============================================
   主内容区
   ============================================ */
.main {
  padding: 24px 0;
}

/* ============================================
   首页 - 杂志非对称布局
   ============================================ */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

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

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

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

.headline-content .tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-color);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.headline-content h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.headline-content p {
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.6;
}

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

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

.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

.widget-list a {
  font-size: 14px;
  color: var(--text-dark);
  display: block;
  transition: color 0.2s;
}

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

.widget-list .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 特色内容区 */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  margin-bottom: 32px;
}

.feature-large {
  grid-row: span 2;
}

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

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

.card-image {
  position: relative;
  overflow: hidden;
}

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

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

.feature-large .card-image img {
  height: 100%;
  min-height: 400px;
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--accent-color);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius);
}

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

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

.card-excerpt {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 三栏文章列表 */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.column-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.column-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

.article-list a {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s;
}

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

.article-list .meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   分类页
   ============================================ */
.category-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.category-info {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: var(--radius-lg);
  padding: 40px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-info h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.category-info p {
  font-size: 16px;
  opacity: 0.9;
  line-height: 1.6;
}

.category-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  opacity: 0.8;
}

/* 文章网格 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.lead-story {
  grid-column: span 1;
  grid-row: span 1;
}

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

/* 推荐区 */
.recommended-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.related-links a {
  padding: 8px 16px;
  background: var(--bg-light);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-dark);
  transition: all 0.2s;
}

.related-links a:hover {
  background: var(--accent-color);
  color: #fff;
}

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

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

.article-main {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-header {
  position: relative;
}

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

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

.article-category {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-color);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

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

.article-body {
  padding: 0 32px 32px;
}

.article-body p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--primary-dark);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-dark);
}

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

.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}

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

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

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

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

.inline-media-caption {
  padding: 12px 16px;
  background: var(--bg-light);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* 侧边栏 */
.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.author-card {
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  object-fit: cover;
}

.author-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.author-bio {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  padding: 6px 12px;
  background: var(--bg-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dark);
  transition: all 0.2s;
}

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

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

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

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

.error-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.error-message {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: #c2185b;
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
}

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

/* ============================================
   页脚
   ============================================ */
.footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 48px 0 24px;
  margin-top: 48px;
}

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

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

.footer-brand p {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.7;
}

.footer-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

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

.footer-links a {
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.7;
}

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

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

  .feature-large {
    grid-row: span 1;
    grid-column: span 2;
  }

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

  .lead-story {
    grid-column: span 2;
  }

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

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

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

  .headline-content h1 {
    font-size: 24px;
  }

  .headline-content {
    padding: 24px;
  }

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

  .feature-large {
    grid-column: span 1;
  }

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

  .lead-story {
    grid-column: span 1;
  }

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

  .article-title {
    font-size: 24px;
  }

  .article-header img {
    height: 240px;
  }

  .error-code {
    font-size: 80px;
  }

  .category-info h1 {
    font-size: 28px;
  }

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

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

  .card-content {
    padding: 16px;
  }

  .article-header-content,
  .article-body {
    padding: 20px;
  }

  .error-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
