/* ============================================
   Chinese Zodiac — Main Stylesheet
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #C0392B;
  --red-light: #E74C3C;
  --gold: #D4AC0D;
  --gold-light: #F4D03F;
  --bg: #FAFAFA;
  --white: #FFFFFF;
  --gray-50: #F5F5F5;
  --gray-100: #E8E8E8;
  --gray-200: #D1D1D1;
  --gray-300: #B0B0B0;
  --gray-500: #6B6B6B;
  --gray-700: #3D3D3D;
  --gray-900: #1A1A1A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-900);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

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

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

/* ============================================
   Header
   ============================================ */
.header {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 100;
  border-bottom: 1px solid var(--gray-100);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.logo:hover { color: var(--red); }

.logo-icon { font-size: 1.5rem; }

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

.nav-link {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

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

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: var(--white);
  padding: 80px 0 60px;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.hero-date {
  margin-top: 20px;
  font-size: 1rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-date .date-separator {
  color: var(--gold-light);
  font-weight: 600;
}

.hero-date .lunar-text {
  color: var(--gold-light);
}

/* ============================================
   Zodiac Grid (Homepage)
   ============================================ */
.zodiac-section {
  padding: 60px 0 80px;
}

.zodiac-section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gray-900);
}

.zodiac-section-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 40px;
}

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

.zodiac-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 16px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--gray-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.4s ease forwards;
}

.zodiac-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--gold);
  color: var(--gray-900);
}

.zodiac-card:hover .zodiac-card-emoji {
  transform: scale(1.15);
}

.zodiac-card-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
  transition: transform var(--transition);
  line-height: 1;
}

.zodiac-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.zodiac-card-element {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.zodiac-card-years {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.zodiac-card-yinyang {
  font-size: 0.72rem;
  color: var(--gray-300);
  margin-top: 4px;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Zodiac List Page
   ============================================ */
.zodiac-list-header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: var(--white);
  padding: 50px 0 40px;
  text-align: center;
}

.zodiac-list-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.zodiac-list-header .zodiac-emoji-large {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.zodiac-list-header .date-display {
  margin-top: 12px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.zodiac-list-header .date-display .lunar-text {
  color: var(--gold-light);
}

.filter-section {
  padding: 24px 0 0;
  border-bottom: 1px solid var(--gray-100);
}

.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
  background: var(--white);
}

.search-box input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.search-box input::placeholder {
  color: var(--gray-300);
}

.time-filter {
  display: flex;
  gap: 6px;
}

.time-btn {
  padding: 8px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  background: var(--white);
  color: var(--gray-500);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.time-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.time-btn.active {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}

/* ============================================
   Content Layout
   ============================================ */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* ============================================
   Articles Grid
   ============================================ */
.articles-section {
  padding: 40px 0 80px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.4s ease forwards;
}

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

.article-card-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--gray-300);
  overflow: hidden;
}

.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

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

.article-card-body {
  padding: 20px;
}

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

.article-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--gray-300);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  position: sticky;
  top: 84px;
}

.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gray-900);
}

.sidebar-widget p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.related-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
  color: var(--gray-700);
  transition: color var(--transition);
}

.related-item:last-child { border-bottom: none; }
.related-item:hover { color: var(--red); }

/* Zodiac Quick Nav in Sidebar */
.zodiac-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.zodiac-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.zodiac-nav-item:hover {
  background: var(--gray-50);
  border-color: var(--gold);
  color: var(--red);
}

.zodiac-nav-item.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.zodiac-nav-item .nav-emoji {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

/* ============================================
   Article Detail
   ============================================ */
.article-detail {
  padding: 40px 0 80px;
}

.article-main {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}

.article-main h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
  color: var(--gray-900);
}

.article-featured-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.article-meta .category-tag {
  background: var(--red);
  color: var(--white);
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.article-meta .lunar-date-tag {
  background: var(--gold);
  color: var(--white);
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--gray-900);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--gray-700);
}

.article-content p {
  margin-bottom: 16px;
  color: var(--gray-700);
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--gray-700);
}

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

.article-content strong {
  color: var(--gray-900);
}

.article-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--gray-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--gray-500);
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-img {
  height: 180px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 16px;
  margin: 20px 20px 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.title { height: 24px; margin-top: 40px; width: 80%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   No Results
   ============================================ */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-300);
  font-size: 1.1rem;
}

/* ============================================
   Static Pages (About)
   ============================================ */
.page-content {
  padding: 60px 0 80px;
}

.page-content .container {
  max-width: 800px;
}

.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--gray-900);
}

.page-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--gray-900);
}

.page-content p {
  margin-bottom: 16px;
  color: var(--gray-700);
  line-height: 1.8;
}

.page-content ul {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--gray-700);
}

.page-content li {
  margin-bottom: 8px;
}

/* ============================================
   Ad Slots
   ============================================ */
.ad-slot {
  margin: 20px 0;
  min-height: 20px;
}

.ad-slot a {
  display: block;
}

.ad-slot img {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

.ad-mid-content {
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 16px 0;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--gray-300);
  font-size: 0.88rem;
}

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

.footer p {
  font-size: 0.82rem;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    gap: 12px;
  }
  .menu-btn { display: block; }

  .hero h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero { padding: 50px 0 40px; }

  .zodiac-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .zodiac-card {
    padding: 24px 12px 18px;
  }

  .zodiac-card-emoji {
    font-size: 2.8rem;
  }

  .zodiac-card-name {
    font-size: 0.95rem;
  }

  .zodiac-card-years {
    font-size: 0.72rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .time-filter {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .article-main {
    padding: 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .zodiac-list-header h1 {
    font-size: 1.6rem;
  }

  .zodiac-nav-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .zodiac-grid {
    gap: 8px;
  }

  .zodiac-card {
    padding: 18px 8px 14px;
  }

  .zodiac-card-emoji {
    font-size: 2.2rem;
  }

  .zodiac-card-name {
    font-size: 0.85rem;
  }

  .zodiac-card-element,
  .zodiac-card-yinyang {
    display: none;
  }

  .hero-date {
    font-size: 0.85rem;
  }
}
