/* Index / Feed page styles */
.topic-filter-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-card);
}
.topic-filter-header__info { flex: 1; min-width: 200px; }
.topic-filter-header__info h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.topic-filter-header__info p { font-size: 14px; color: var(--color-text-secondary); }
.topic-filter-header__meta { font-size: 13px; color: var(--color-text-secondary); margin-top: 6px; }
.topic-filter-header__link {
  font-size: 14px; color: var(--color-accent); font-weight: 500;
  padding: 8px 16px; border: 1px solid var(--color-border); border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
}
.topic-filter-header__link:hover { background: #f5f8ff; }
.topic-filter-header__actions {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}

.topic-page-header {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-card);
}
.topic-page-header__info { flex: 1; min-width: 200px; }
.topic-page-header__info h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.topic-page-header__info p { font-size: 14px; color: var(--color-text-secondary); line-height: 1.45; }
.topic-page-header__meta { font-size: 13px; color: var(--color-text-secondary); margin-top: 8px; }
.topic-page-header__actions {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}

.banner-top {
  background: #fef1f3; border-radius: var(--radius); min-height: 120px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  color: #333; font-weight: 500; position: relative;
  background-image: linear-gradient(135deg, #fef1f3 0%, #fde8ec 100%);
}
.banner-top .close-btn,
.ad-banner__close {
  position: absolute; top: 8px; right: 12px; color: #888; cursor: pointer;
  background: rgba(255,255,255,0.8); border: 0; border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}

/* Ad banners */
.ad-banner {
  position: relative; border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
  min-height: 100px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ad-banner:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.ad-banner--home_top { min-height: 110px; }
.ad-banner--sidebar { margin-bottom: 16px; min-height: 90px; }
.ad-banner--feed { margin: 8px 0 20px; }
.ad-banner__link {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; min-height: inherit;
  color: inherit; text-decoration: none; width: 100%;
}
.ad-banner__link:hover { opacity: 1; }
.ad-banner__img { max-height: 72px; max-width: 120px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ad-banner__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ad-banner__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.55; font-weight: 600;
}
.ad-banner__label:empty { display: none; }
.ad-banner__title { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.ad-banner__subtitle { font-size: 13px; opacity: 0.75; line-height: 1.4; }

/* Post menu */
.content-header__menu-btn {
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary);
}
.content-header__menu-btn:hover { background: #f0f2f5; }
.content-menu__item {
  display: flex !important; align-items: center; gap: 10px; font-size: 14px;
}
.content-menu__item svg { opacity: 0.7; flex-shrink: 0; }
.content-menu__item--danger { color: #f43f4a !important; }
.content-menu__item--danger svg { opacity: 1; }

.tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px; margin-bottom: 20px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab {
  font-size: 15px; font-weight: 500; padding: 8px 18px; border-radius: 30px;
  white-space: nowrap; color: var(--color-text-secondary); transition: 0.1s;
}
.tabs__tab--active { background: #1a1a1a; color: #fff; }
.tabs__tab:hover:not(.tabs__tab--active) { background: #f0f2f5; }
.tabs__right {
  margin-left: auto; display: flex; gap: 6px; align-items: center;
  font-size: 14px; color: var(--color-text-secondary); cursor: pointer; white-space: nowrap;
}

.news-widget {
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 0; margin-bottom: 24px; box-shadow: var(--shadow-card); overflow: hidden;
}
.news-widget__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid #f0f2f5;
}
.news-widget__heading { display: flex; align-items: center; gap: 8px; }
.news-widget__icon { font-size: 18px; }
.news-widget__title-main { font-size: 15px; font-weight: 600; }
.news-widget__live {
  font-size: 10px; font-weight: 700; color: #f43f4a; background: #ffebee;
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.5px;
  animation: news-pulse 2s ease-in-out infinite;
}
@keyframes news-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.news-widget__refresh {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary); transition: 0.2s;
}
.news-widget__refresh:hover { background: #f0f2f5; color: var(--color-accent); }
.news-widget__refresh.is-spinning svg { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

.news-widget__list { padding: 4px 16px 8px; }
.news-widget__item {
  padding: 12px 0; border-bottom: 1px solid #f0f2f5;
  display: flex; gap: 10px; align-items: flex-start;
  transition: background 0.1s; border-radius: 8px; margin: 0 -8px; padding-left: 8px; padding-right: 8px;
}
.news-widget__item:hover { background: #f8f9fb; }
.news-widget__item:last-child { border-bottom: 0; }
.news-widget__item--hidden { display: none; }
.news-widget.is-expanded .news-widget__item--hidden { display: flex; }

.news-widget__num {
  font-size: 13px; font-weight: 600; color: var(--color-text-secondary);
  min-width: 20px; padding-top: 2px; flex-shrink: 0;
}
.news-widget__body { flex: 1; min-width: 0; }
.news-widget__meta {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap;
}
.news-widget__badge { font-size: 11px; }
.news-widget__source {
  font-size: 11px; color: var(--color-accent); font-weight: 500;
  background: #eef4ff; padding: 1px 8px; border-radius: 20px;
}
.news-widget__time { font-size: 11px; color: var(--color-text-secondary); }
.news-widget__title {
  font-size: 14px; font-weight: 450; color: #1a1a1a; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
a.news-widget__title:hover { color: var(--color-accent); }

.news-widget__stats {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  flex-shrink: 0; min-width: 48px;
}
.news-widget__comments, .news-widget__views {
  font-size: 12px; color: var(--color-text-secondary);
  display: flex; align-items: center; gap: 3px; white-space: nowrap;
}

.news-widget__show-more {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--color-accent); font-weight: 500; font-size: 14px;
  padding: 12px 16px; cursor: pointer; border: none; background: none;
  width: 100%; border-top: 1px solid #f0f2f5; transition: background 0.1s;
}
.news-widget__show-more:hover { background: #f8f9fb; }

.news-widget__empty {
  padding: 24px 16px; text-align: center; color: var(--color-text-secondary); font-size: 14px;
}

.content-list { display: flex; flex-direction: column; gap: 16px; }
.content-card {
  background: var(--color-bg-card); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow-card); transition: box-shadow 0.15s;
}
.content-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.content-card--pro { border-left: 4px solid #000; }
.content-header { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.content-header__menu { margin-left: auto; flex-shrink: 0; position: relative; z-index: 5; }
.content-card { position: relative; }
.author-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: #d0d4db;
}
.author-avatar--sm { width: 32px; height: 32px; }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-info { flex: 1; min-width: 0; }
.author-name {
  font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.author-name .badge, .badge {
  background: #eef0f2; border-radius: 30px; padding: 0 10px;
  font-size: 11px; font-weight: 400; color: var(--color-text-secondary);
  height: 20px; display: inline-flex; align-items: center;
}
.badge--editorial { background: #eef4ff; color: var(--color-accent); }
.badge--pro { background: #000; color: #fff; }
.badge--news { background: #eef4ff; color: var(--color-accent); font-size: 12px; padding: 0 8px; }
.author-detail {
  font-size: 13px; color: var(--color-text-secondary);
  display: flex; gap: 8px; align-items: center;
}
.content-title {
  font-size: 18px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; color: #1a1a1a;
  letter-spacing: -0.02em;
}
.content-title a { color: inherit; }
.content-cover {
  display: block; margin: 0 0 12px; border-radius: 12px; overflow: hidden;
  background: #eef0f2;
}
.content-cover img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  transition: transform 0.2s;
}
.content-cover:hover img { transform: scale(1.02); }
.content-body { font-size: 15px; color: #2a2a2a; line-height: 1.6; font-family: var(--font-serif); }
.content-body p { margin-bottom: 8px; }
.content-body img, .content-body .article-figure img {
  border-radius: 10px; margin: 10px 0; width: 100%;
  background: #eef0f2; aspect-ratio: 16/9; object-fit: cover;
}
.content-body .article-figure { margin: 10px 0; }
.content-body ul { padding-left: 20px; margin: 8px 0; }
.content-body ul li { list-style: disc; margin-bottom: 4px; }

.stat-inline { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.stat-inline .icon-svg { opacity: 0.7; }

.reactions-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 4px; }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px 4px 6px; border-radius: 30px;
  background: #f5f6f8; font-size: 14px; transition: 0.1s; color: #1a1a1a;
}
.reaction-btn:hover { background: #e8ebef; }
.reaction-btn--active { background: #eef4ff; outline: 1px solid var(--color-accent); }
.reaction-btn--add { background: transparent; color: var(--color-accent); }
.reaction-btn .emoji { font-size: 18px; line-height: 1; }
.reaction-btn .count { font-size: 13px; font-weight: 450; }

.content-footer {
  display: flex; align-items: center; gap: 16px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #f0f2f5; flex-wrap: wrap;
}
.content-footer__btn, .content-footer button {
  display: flex; align-items: center; gap: 6px; font-size: 14px;
  color: var(--color-text-secondary); transition: 0.1s;
}
.content-footer__btn:hover, .content-footer button:hover { color: #1a1a1a; }
.bookmark-btn--active { color: var(--color-accent) !important; }
.comment-count { font-weight: 450; }
.content-footer .stats {
  margin-left: auto; font-size: 13px; color: var(--color-text-secondary);
  display: flex; gap: 12px; align-items: center;
}

.top-comment {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f2f5;
  display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--color-text-secondary);
}
.top-comment__label { font-weight: 500; white-space: nowrap; }
.top-comment__text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-comment__reply { color: var(--color-accent); white-space: nowrap; }

.feed-empty {
  text-align: center; padding: 48px 24px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.feed-empty h3 { margin-bottom: 8px; }
.feed-empty p { color: var(--color-text-secondary); margin-bottom: 16px; }
.feed-empty a {
  display: inline-block; padding: 10px 20px; background: var(--color-accent);
  color: #fff; border-radius: 20px; font-weight: 500;
}

@media (max-width: 767px) {
  .banner-top { height: 110px; }
  .content-title { font-size: 16px; }
}
