/* ============================================
   威士忌 - 杂志博客风格样式表
   www.tiaojifang.cn
   ============================================ */

/* CSS 变量定义 */
:root {
  --accent-color: #8B4513;
  --accent-light: #D2691E;
  --accent-dark: #5D3A1A;
  --text-primary: #2C1810;
  --text-secondary: #6B5B4F;
  --text-muted: #9B8B7F;
  --bg-primary: #FAF8F5;
  --bg-secondary: #F5F0EB;
  --bg-card: #FFFFFF;
  --border-color: #E8E0D8;
  --shadow-sm: 0 2px 4px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --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: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

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

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

ul, ol {
  list-style: none;
}

/* ============================================
   布局组件
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.5px;
}

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

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

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

/* Footer */
.footer {
  background: var(--text-primary);
  color: var(--bg-secondary);
  padding: 48px 0 24px;
  margin-top: 64px;
}

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

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--bg-card);
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-card);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   内容组件
   ============================================ */

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* Section Title */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

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

.card-body {
  padding: 20px;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

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

.card-title a {
  color: inherit;
}

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

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

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

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

/* Article List Item */
.article-list-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.article-list-thumb {
  width: 100px;
  height: 75px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.article-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-content {
  flex: 1;
  min-width: 0;
}

.article-list-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.article-list-title a {
  color: var(--text-primary);
}

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

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

/* Tag */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--accent-color);
  color: white;
}

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

/* Widget */
.widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

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

/* Author Card */
.author-card {
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 3px solid var(--border-color);
}

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

.author-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

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

.author-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   首页布局
   ============================================ */

/* Hero Section */
.hero {
  padding: 40px 0;
}

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

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
}

.hero-main .card-image {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.hero-main .card-image img {
  height: 100%;
}

.hero-main .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(44, 24, 16, 0.9));
  padding: 40px;
}

.hero-main .card-category {
  color: var(--accent-light);
}

.hero-main .card-title {
  font-size: 1.75rem;
  color: white;
  margin-bottom: 12px;
}

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

.hero-main .card-excerpt {
  color: rgba(255,255,255,0.8);
  max-width: 80%;
}

.hero-main .card-meta {
  color: rgba(255,255,255,0.6);
}

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

.hero-sidebar .card {
  flex: 1;
}

.hero-sidebar .card-image {
  aspect-ratio: 16 / 9;
}

.hero-sidebar .card-body {
  padding: 16px;
}

.hero-sidebar .card-title {
  font-size: 0.9375rem;
}

/* Features Section */
.features {
  padding: 24px 0 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
}

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

.feature-large .card-image {
  aspect-ratio: 3 / 4;
}

/* Article Sections */
.sections-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

/* ============================================
   分类页布局
   ============================================ */

.category-hero {
  padding: 40px 0;
}

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

.category-hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
}

.category-hero-main .card-image {
  position: absolute;
  inset: 0;
}

.category-hero-main .card-image img {
  height: 100%;
}

.category-hero-main .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(44, 24, 16, 0.9));
  padding: 32px;
}

.category-hero-main .card-title {
  font-size: 1.5rem;
  color: white;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 24px 0 40px;
}

.category-grid .card-image {
  aspect-ratio: 4 / 3;
}

.category-grid .card-title {
  font-size: 1rem;
}

/* ============================================
   文章页布局
   ============================================ */

.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 24px 0 40px;
}

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

.article-category {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 20px;
}

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

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

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

.article-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.article-featured-image img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.article-content {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-primary);
}

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

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

.article-content p {
  margin-bottom: 20px;
}

.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;
}

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

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

.article-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.article-tags-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  height: fit-content;
}

/* ============================================
   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: 80px 24px;
}

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

.error-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.error-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
}

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

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

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

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

/* ============================================
   响应式设计
   ============================================ */

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

  .hero-sidebar {
    flex-direction: row;
  }

  .hero-sidebar .card {
    flex: 1;
  }

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

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

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

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

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

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

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .nav {
    display: none;
  }

  .hero-main {
    min-height: 300px;
  }

  .hero-main .card-body {
    padding: 24px;
  }

  .hero-main .card-title {
    font-size: 1.25rem;
  }

  .hero-main .card-excerpt {
    display: none;
  }

  .hero-sidebar {
    flex-direction: column;
  }

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

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

  .sections-row {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

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

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

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

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

  .article-list-thumb {
    width: 80px;
    height: 60px;
  }
}
