/* ============================================
   无忧杂谈文集 - 现代 Web 风格样式表
   移动端优先 + 大屏适配
   ============================================ */

/* --- CSS 变量 --- */
:root {
  --color-primary: #8B5E3C;
  --color-primary-light: #A67B5B;
  --color-primary-dark: #6B3F1F;
  --color-accent: #D4A574;
  --color-accent-light: #F0E6D3;
  --color-bg: #faf8f5;
  --color-bg-card: #ffffff;
  --color-text: #2c2416;
  --color-text-secondary: #6b5e4f;
  --color-text-muted: #9a8e7f;
  --color-border: #e8e0d5;
  --color-green: #4a9c6c;
  --color-red: #c0392b;
  --color-blue: #3a7ca5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --max-width: 750px;
  --header-height: 52px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-header {
  padding-top: var(--header-height);
}

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

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

/* ============================================
   Header - 固定顶部导航
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  gap: 16px;
}

.nav-link {
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ============================================
   Hero Banner
   ============================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #6B3F1F 0%, #8B5E3C 40%, #A67B5B 100%);
  padding: 48px 24px 60px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 0;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(255,255,255,0.04) 0%, transparent 50%);
  animation: heroShine 8s ease-in-out infinite;
}

@keyframes heroShine {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -10px); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1px;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 40px;
}

/* --- 子页面 Hero（简化版） --- */
.hero-sm {
  position: relative;
  background: linear-gradient(135deg, #6B3F1F 0%, #8B5E3C 40%, #A67B5B 100%);
  padding: 20px 24px 32px;
  text-align: center;
  overflow: hidden;
}

.hero-sm .hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
}

.hero-sm .hero-wave svg {
  width: 100%;
  height: 24px;
}

.hero-sm-title {
  position: relative;
  z-index: 1;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

/* ============================================
   Section 通用
   ============================================ */
.section {
  padding: 32px 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  padding-left: 14px;
}

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

.section-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  display: block;
  margin-top: 4px;
  padding-left: 14px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--color-red);
  border-radius: 4px;
  letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================
   Category Grid - 分类卡片网格
   ============================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 12px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.cat-card:active {
  transform: scale(0.97);
}

.cat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 8px;
  border: 2px solid var(--color-accent-light);
  transition: border-color 0.25s;
}

.cat-card:hover .cat-icon-wrap {
  border-color: var(--color-primary);
}

.cat-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-info {
  text-align: center;
}

.cat-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.cat-desc {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* ============================================
   Feature Card - 推荐专辑卡片
   ============================================ */
.feature-card {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #2d5016 0%, #4a9c6c 40%, #6db87d 100%);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

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

.feature-card:active {
  transform: scale(0.98);
}

.feature-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
}

.feature-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 20px 16px;
  gap: 14px;
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.feature-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-text {
  flex: 1;
  min-width: 0;
}

.feature-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.feature-desc {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-arrow {
  font-size: 22px;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

/* ============================================
   Article Cards - 最新文章列表
   ============================================ */
.article-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-card {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  gap: 12px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.article-card:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.article-card:active {
  transform: scale(0.98);
  background: var(--color-accent-light);
}

.article-tag {
  font-size: 20px;
  flex-shrink: 0;
}

.article-card-body {
  flex: 1;
  min-width: 0;
}

.article-card-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.article-card:hover .article-card-title {
  color: var(--color-primary);
}

.article-card-date {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.article-card-arrow {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.article-card:hover .article-card-arrow {
  transform: translateX(3px);
  color: var(--color-primary);
}

/* ============================================
   List / SubList 文章列表
   ============================================ */
.list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-card {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  gap: 12px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.list-card:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.list-card:active {
  transform: scale(0.98);
  background: var(--color-accent-light);
}

.list-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.list-card-body {
  flex: 1;
  min-width: 0;
}

.list-card-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card:hover .list-card-title {
  color: var(--color-primary);
}

.list-card-arrow {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.list-card:hover .list-card-arrow {
  transform: translateX(3px);
  color: var(--color-primary);
}

.volume-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-accent-light);
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ============================================
   About 页面
   ============================================ */
.about-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px 16px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--color-text-secondary);
}

.about-card p {
  margin-bottom: 12px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 32px 16px 40px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

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

.footer-logo {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.footer-version {
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-links {
  margin-bottom: 12px;
}

.footer-icp {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.footer-icp:hover {
  color: var(--color-primary);
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-card {
  animation: fadeInUp 0.5s ease backwards;
}

.cat-card:nth-child(1) { animation-delay: 0.05s; }
.cat-card:nth-child(2) { animation-delay: 0.1s; }
.cat-card:nth-child(3) { animation-delay: 0.15s; }
.cat-card:nth-child(4) { animation-delay: 0.2s; }
.cat-card:nth-child(5) { animation-delay: 0.25s; }
.cat-card:nth-child(6) { animation-delay: 0.3s; }
.cat-card:nth-child(7) { animation-delay: 0.35s; }
.cat-card:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   大屏适配 (>= 768px)
   ============================================ */
@media screen and (min-width: 768px) {
  .hero {
    padding: 64px 32px 80px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-sm {
    padding: 28px 32px 40px;
  }

  .hero-sm-title {
    font-size: 26px;
  }

  .section {
    padding: 40px 20px;
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .cat-card {
    padding: 20px 12px 16px;
  }

  .cat-icon-wrap {
    width: 64px;
    height: 64px;
  }

  .cat-name {
    font-size: 15px;
  }

  .cat-desc {
    font-size: 12px;
  }

  .feature-content {
    padding: 24px 20px;
  }

  .feature-icon-wrap {
    width: 64px;
    height: 64px;
  }

  .feature-title {
    font-size: 19px;
  }

  .article-card,
  .list-card {
    padding: 16px 20px;
  }

  .article-card-title,
  .list-card-title {
    font-size: 16px;
  }
}

/* ============================================
   小屏适配 (<= 360px)
   ============================================ */
@media screen and (max-width: 360px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 14px;
    letter-spacing: 2px;
  }

  .hero-sm-title {
    font-size: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .cat-card {
    padding: 12px 4px 10px;
  }

  .cat-icon-wrap {
    width: 44px;
    height: 44px;
  }

  .cat-name {
    font-size: 12px;
  }

  .cat-desc {
    font-size: 10px;
  }
}