/* ========================================
   Design System — 看看随笔
   ======================================== */

:root {
  /* Color Palette */
  --color-bg: #faf9f7;
  --color-bg-warm: #f5f0eb;
  --color-bg-card: #ffffff;
  --color-text: #2c2c2c;
  --color-text-secondary: #6b6b6b;
  --color-text-muted: #9a9a9a;
  --color-accent: #5b6abf;
  --color-accent-light: #eef0ff;
  --color-border: #e8e4df;
  --color-border-light: #f0ece7;

  /* Typography */
  --font-serif: 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.06);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Reset & Base
   ======================================== */

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ========================================
   Header
   ======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border-light);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--color-accent);
  animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.main-nav {
  display: flex;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: 0.03em;
  position: relative;
  cursor: default;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-link.active {
  color: var(--color-accent);
  font-weight: 500;
}

.nav-link.active::after {
  width: 16px;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  position: relative;
  padding: var(--space-3xl) 0 calc(var(--space-3xl) + 1rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 106, 191, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(240, 147, 251, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 20% 60%, rgba(67, 233, 123, 0.04) 0%, transparent 50%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  color: var(--color-accent);
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s ease-out;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #a18cd1);
  border-radius: 2px;
  margin: 0 auto var(--space-xl);
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

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

/* ========================================
   Sections
   ======================================== */

.section {
  padding: var(--space-3xl) 0;
}

.section--about {
  background: var(--color-bg-warm);
}

.section--categories {
  background: var(--color-bg);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* ========================================
   Post Cards Grid
   ======================================== */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.posts-grid .post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 320px;
}

.post-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.post-card__image {
  height: 180px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  position: relative;
}

.post-card--featured .post-card__image {
  height: auto;
  min-height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.post-card__category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 14px;
  border-radius: 100px;
}

.post-card__content {
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.meta-dot {
  color: var(--color-border);
}

.post-card__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.post-card--featured .post-card__title {
  font-size: 1.45rem;
}

.post-card__excerpt {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card--featured .post-card__excerpt {
  -webkit-line-clamp: 4;
}

/* ========================================
   About Section
   ======================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.about-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
}

.about-text {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.about-stats {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.about-visual {
  display: flex;
  justify-content: center;
}

.about-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
  max-width: 380px;
  position: relative;
}

.about-card__quote {
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.15;
  position: absolute;
  top: 16px;
  left: 28px;
}

.about-card__text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.about-card__author {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ========================================
   Categories Section
   ======================================== */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.category-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.category-icon {
  font-size: 2.2rem;
  margin-bottom: var(--space-md);
}

.category-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.category-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.category-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  background: #2c2c2c;
  color: #ccc;
  padding: var(--space-2xl) 0 0;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo-text {
  color: #fff;
}

.footer-brand .logo-icon {
  color: #8b9cf7;
}

.footer-tagline {
  font-size: 0.85rem;
  color: #888;
  margin-top: var(--space-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-3xl);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-col__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
}

.footer-link {
  font-size: 0.88rem;
  color: #888;
  cursor: default;
  transition: color var(--transition-fast);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
}

.copyright {
  font-size: 0.8rem;
  color: #666;
}

.footer-filing {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.icp {
  font-size: 0.8rem;
}

.icp a {
  color: #888;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.icp a:hover {
  color: #bbb;
}

.icp--gongan {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icp--gongan img {
  vertical-align: middle;
  display: inline-block;
}

/* ========================================
   Responsive Design
   ======================================== */

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

  .posts-grid .post-card--featured {
    grid-column: 1 / -1;
  }

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

@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }

  .main-nav {
    gap: var(--space-lg);
  }

  .nav-link {
    font-size: 0.82rem;
  }

  .hero {
    padding: var(--space-2xl) 0;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

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

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

  .post-card--featured .post-card__image {
    height: 200px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about-visual {
    order: -1;
  }

  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .footer-top {
    flex-direction: column;
    gap: var(--space-xl);
  }

  .footer-links {
    gap: var(--space-2xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .footer-filing {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

@media (max-width: 480px) {
  .main-nav {
    gap: var(--space-md);
  }

  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }

  .about-stats {
    gap: var(--space-xl);
  }

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

/* ========================================
   Scroll Animations (pure CSS)
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
  .post-card,
  .category-card,
  .about-card {
    animation: fadeInUp 0.6s ease-out both;
  }

  .posts-grid .post-card:nth-child(1) { animation-delay: 0.1s; }
  .posts-grid .post-card:nth-child(2) { animation-delay: 0.2s; }
  .posts-grid .post-card:nth-child(3) { animation-delay: 0.3s; }
  .posts-grid .post-card:nth-child(4) { animation-delay: 0.4s; }
  .posts-grid .post-card:nth-child(5) { animation-delay: 0.5s; }
  .posts-grid .post-card:nth-child(6) { animation-delay: 0.6s; }

  .categories-grid .category-card:nth-child(1) { animation-delay: 0.15s; }
  .categories-grid .category-card:nth-child(2) { animation-delay: 0.25s; }
  .categories-grid .category-card:nth-child(3) { animation-delay: 0.35s; }
  .categories-grid .category-card:nth-child(4) { animation-delay: 0.45s; }
}
