body.home-page {
  --hp-bg: #f0f1f4;
  --hp-card: #fff;
  --hp-text: #1f2328;
  --hp-muted: #68717d;
  --hp-primary: #1a73e8;
  --hp-accent: #db5a23;
  --hp-border: #e1e5eb;
  --hp-media: #e3e5e7;
  --hp-radius: 12px;
  --hp-radius-lg: 16px;
  --hp-shadow: 0 1px 3px rgb(0 0 0 / 6%);
  --hp-shadow-hover: 0 8px 24px rgb(0 0 0 / 10%);
  background: var(--hp-bg);
  color: var(--hp-text);
}
body.home-page.dark {
  --hp-bg: #18191a;
  --hp-card: #242526;
  --hp-text: #e4e6eb;
  --hp-muted: #b0b3b8;
  --hp-primary: #8ab4f8;
  --hp-accent: #ffb285;
  --hp-border: #3e4042;
  --hp-media: #303236;
  --hp-shadow: 0 1px 3px rgb(0 0 0 / 20%);
  --hp-shadow-hover: 0 8px 24px rgb(0 0 0 / 35%);
}
.home-page .home-wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding: 24px 20px 0; }
.home-page .top-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.home-page .featured-section, .home-page .hot-section, .home-page .hot-item, .home-page .lg-card { min-width: 0; }
.home-page .section-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 12px; }
.home-page .sh-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.1rem; line-height: 1.4; font-weight: 700; color: var(--hp-text); }
.home-page .sh-title::before { content: ''; flex: 0 0 4px; height: 18px; border-radius: 2px; background: var(--hp-primary); }
.home-page .sh-more { font-size: .85rem; color: var(--hp-muted); text-decoration: none; }
.home-page .sh-more:hover { color: var(--hp-primary); }

/* The image frame owns its ratio; surrounding cards never determine its height. */
.home-page .feat-card { position: relative; border-radius: var(--hp-radius-lg); overflow: hidden; background: var(--hp-card); box-shadow: var(--hp-shadow); }
.home-page .fc-link { display: block; color: var(--hp-text); text-decoration: none; }
.home-page .fc-media { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; background: var(--hp-media); }
.home-page .fc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.home-page .fc-placeholder { position: absolute; inset: 0; display: grid; place-content: center; visibility: hidden; color: var(--hp-muted); font-size: 1.6rem; }
.home-page .fc-media.image-failed .fc-placeholder { visibility: visible; }
.home-page .fc-caption { padding: 12px 16px; }
.home-page .fc-title { margin: 0; min-height: 2.8em; font-size: 1.1rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-page .fc-link:hover .fc-title { color: var(--hp-primary); }
.home-page .feat-empty { min-height: 0; aspect-ratio: 2 / 1; display: grid; place-content: center; padding: 24px; text-align: center; color: var(--hp-muted); }
.home-page .feature-tools { display: flex; gap: 6px; align-items: center; max-width: 100%; }
.home-page .feat-carousel .carousel-indicators { position: static; display: flex; margin: 0; padding: 0; }
.home-page .feat-carousel .carousel-indicators button { display: grid; place-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; opacity: 1; text-indent: 0; background: transparent; }
.home-page .feat-carousel .carousel-indicators button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hp-muted); opacity: .5; }
.home-page .feat-carousel .carousel-indicators button.active::before { width: 16px; border-radius: 8px; background: var(--hp-primary); opacity: 1; }
.home-page .carousel-autoplay { min-height: 32px; padding: 4px 8px; border: 1px solid var(--hp-border); border-radius: 7px; color: var(--hp-text); background: var(--hp-card); font-size: .75rem; white-space: nowrap; }
.home-page .feat-navigation { position: absolute; top: 0; inset-inline: 0; width: 100%; aspect-ratio: 2 / 1; display: flex; align-items: center; justify-content: space-between; padding: 10px; pointer-events: none; }
.home-page .feat-navigation button { position: static; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid rgb(255 255 255 / 25%); border-radius: 50%; background: rgb(0 0 0 / 45%); opacity: 1; pointer-events: auto; }
.home-page .feat-navigation button:hover { background: rgb(0 0 0 / 65%); }
.home-page .feat-navigation .carousel-control-prev-icon, .home-page .feat-navigation .carousel-control-next-icon { width: 20px; height: 20px; }

.home-page .hot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-page .hot-item, .home-page .lg-card { display: flex; flex-direction: column; overflow: hidden; background: var(--hp-card); border-radius: var(--hp-radius); box-shadow: var(--hp-shadow); text-decoration: none; color: var(--hp-text); transition: box-shadow .2s ease; }
.home-page .hi-thumb, .home-page .lg-thumb { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hp-media); }
.home-page .hi-thumb img, .home-page .lg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-page .hi-info, .home-page .lg-info { padding: 8px 10px 10px; }
.home-page .hi-title, .home-page .lg-title { font-size: .9rem; line-height: 1.4; font-weight: 600; color: var(--hp-text); min-height: 2.8em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-page .hi-meta, .home-page .lg-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; color: var(--hp-muted); font-size: .76rem; line-height: 1.4; white-space: nowrap; }
.home-page .hi-author, .home-page .lg-author { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-page .hi-meta > :last-child, .home-page .lg-meta > :last-child { flex-shrink: 0; }
.home-page .hi-stats, .home-page .lg-stats { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: rgb(0 0 0 / 70%); color: #fff; font-size: .72rem; line-height: 1; }
.home-page .hot-empty { grid-column: 1 / -1; padding: 36px 16px; border: 1px dashed var(--hp-border); border-radius: var(--hp-radius); text-align: center; color: var(--hp-muted); }
.home-page .latest-section { margin-top: 28px; }
.home-page .latest-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.home-page .latest-grid a.lg-card { display: flex; }
.home-page .ad-banner { margin-top: 20px; position: relative; border-radius: var(--hp-radius); overflow: hidden; background: var(--hp-card); box-shadow: var(--hp-shadow); }
.home-page .ad-fullwidth { display: block; }
.home-page .ad-fullwidth img { display: block; width: 100%; height: auto; }
.home-page .ad-tag { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 4px; background: rgb(0 0 0 / 65%); color: #fff; font-size: .7rem; pointer-events: none; }
.home-page .load-observer { height: 1px; width: 100%; }
/* Reserve the existing group button's bottom-right position below this control. */
.home-page .home-back-to-top { position: fixed; right: max(20px, calc(env(safe-area-inset-right) + 12px)); bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 1030; display: grid; place-content: center; gap: 4px; width: 52px; min-height: 56px; padding: 8px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius); background: var(--hp-card); color: var(--hp-text); box-shadow: var(--hp-shadow-hover); font-size: .75rem; line-height: 1.2; }
.home-page .home-back-to-top[hidden] { display: none; }
.home-page .home-back-to-top:hover { color: var(--hp-primary); }
.home-page .home-back-to-top:focus-visible { outline: 3px solid var(--hp-primary); outline-offset: 3px; }
.home-page :is(.hot-item, .lg-card, .sh-more, .carousel-autoplay, .carousel-indicators button, .feat-navigation button):focus-visible { outline: 3px solid var(--hp-primary); outline-offset: 3px; }
.home-page .fc-link:focus-visible { outline: 3px solid var(--hp-primary); outline-offset: -3px; }
@media (hover: hover) {
  .home-page .hot-item:hover, .home-page .lg-card:hover { box-shadow: var(--hp-shadow-hover); }
  .home-page .hot-item:hover .hi-title, .home-page .lg-card:hover .lg-title { color: var(--hp-primary); }
}
@media (max-width: 1199.98px) {
  .home-page .top-row { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .home-page .latest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 991.98px) {
  .home-page .home-wrap { padding: 18px 16px 0; }
  .home-page .latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .home-page .home-wrap { padding: 16px 12px 0; }
  .home-page .top-row { gap: 20px; }
  .home-page .hot-grid, .home-page .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-page .fc-title { font-size: 1rem; }
  .home-page .fc-caption { padding: 10px 12px; }
  .home-page .hi-title, .home-page .lg-title { font-size: .875rem; }
  .home-page .latest-section { margin-top: 24px; }
  .home-page .ad-banner { margin-top: 16px; }
}
@media (max-width: 339.98px) {
  .home-page .feat-carousel .carousel-indicators button { width: 26px; }
  .home-page .section-head { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .carousel-item, .home-page .hot-item, .home-page .lg-card { transition: none !important; }
}
