/* Home Page */
#page-home {
  background: var(--bg);
}

.home-top {
  background: var(--bg-card);
  padding-bottom: 16px;
  border-radius: 0 0 20px 20px;
}

.home-header {
  padding: 20px 16px 12px;
}

.home-greeting {
  font-size: 13px;
  color: var(--text-muted);
}

.home-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 2px;
}

/* Search */
.search-bar {
  margin: 0 16px 16px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 20px;
  padding: 10px 14px;
  cursor: pointer;
}

.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--text-placeholder);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-bar span {
  color: var(--text-placeholder);
  font-size: 14px;
}

/* Age Capsules */
.age-capsules {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}

/* Section */
.home-section {
  padding: 20px 16px 0;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

/* Topics */
.topics-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.topic-card {
  flex-shrink: 0;
  width: 140px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.2s;
}

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

.topic-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 8px;
}

.topic-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.topic-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* AI Banner */
.ai-banner {
  margin: 20px 16px 0;
  background: linear-gradient(135deg, #0F6E56 0%, #1A8A6E 100%);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-banner:active {
  transform: scale(0.98);
}

.ai-badge {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}

.ai-banner-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.ai-banner-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.ai-banner-arrow {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  flex-shrink: 0;
}

/* Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.2s;
}

.article-item:active {
  transform: scale(0.98);
}

.article-content {
  flex: 1;
  margin-right: 12px;
}

.article-cat {
  display: inline-block;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 6px;
}

.article-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.article-meta .dot {
  margin: 0 4px;
}

.article-emoji {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.home-bottom-spacer {
  height: 20px;
}

/* Desktop */
@media (min-width: 768px) {
  .home-top {
    /* centered */
    border-radius: 0 0 24px 24px;
  }
  .home-header {
    padding: 28px 32px 16px;
  }
  .home-title {
    font-size: 28px;
  }
  .search-bar {
    margin: 0 32px 20px;
    padding: 12px 18px;
  }
  .age-capsules {
    padding: 0 32px;
    gap: 10px;
  }
  .home-section {
    /* centered */
    padding: 24px 32px 0;
  }
  .section-title {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .topic-card {
    width: 180px;
    padding: 18px;
  }
  .topic-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .topic-title {
    font-size: 15px;
  }
  .topic-desc {
    font-size: 12px;
  }
  .ai-banner {
    max-width: var(--content-max);
    margin: 24px auto 0;
    padding: 24px 28px;
    border-radius: 20px;
  }
  .ai-banner-title {
    font-size: 22px;
  }
  .article-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .article-item {
    padding: 16px;
  }
  .article-title {
    font-size: 16px;
  }
  .article-emoji {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }
}

@media (min-width: 1200px) {
  .article-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .topic-card {
    width: 200px;
    padding: 20px;
  }
}
