/* Ported from mobile-v2. Only the homepage opts into these styles. */
body.home-v2 {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  height: auto;
  margin: 0 auto;
  background: #f4f7fd;
  color: #1a1a1a;
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  word-break: normal;
  overflow-wrap: break-word;
}
body.home-v2 *, body.home-v2 *::before, body.home-v2 *::after { box-sizing: border-box; }
body.home-v2 [hidden] { display: none !important; }
body.home-v2 a { text-decoration: none; color: inherit; }
body.home-v2 button { font: inherit; cursor: pointer; }
body.home-v2 img { display: block; }
body.home-v2 > footer { display: none; }
.home-v2 .home-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0 1rem calc(var(--home-tabbar-space, 132px) + env(safe-area-inset-bottom, 0px));
  background: #f4f7fd url('../images/v2/home-bg.png') no-repeat center top / 100% auto;
}
.home-v2 .home-sticky-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1rem;
  padding: 0 1rem;
  background: #f4f7fd url('../images/v2/home-bg.png') no-repeat center top / 100% auto;
}
.home-v2 .home-head { position: static; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 0 0; background: none; }
.home-v2 .home-head__row { display: flex; align-items: center; justify-content: space-between; }
.home-v2 .home-head h1 { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: #111; }
.home-v2 .home-head__user { flex-shrink: 0; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; background: none; }
.home-v2 .home-head__user img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.home-v2 .home-search { display: flex; align-items: center; gap: .5rem; height: 2.75rem; margin-top: 1rem; padding: 0 1rem; border-radius: .5rem; background: #fff; box-shadow: 0 0 .25rem rgba(172,170,255,.25); color: #8a8a8a; font-size: .875rem; }
.home-v2 .home-search img { flex-shrink: 0; width: 1.125rem; height: 1.125rem; object-fit: contain; }
.home-v2 .home-search span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.home-v2 .home-tabs { display: flex; align-items: flex-end; gap: 1.25rem; margin: .5rem -1rem 0; padding: .75rem 1rem .5rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.home-v2 .home-tabs::-webkit-scrollbar { display: none; }
.home-v2 .home-tabs ul { display: flex; align-items: flex-end; gap: 1.25rem; margin: 0; padding: 0; }
.home-v2 .home-tabs li { display: block; float: none; width: auto; margin: 0; padding: 0; }
.home-v2 .home-tabs a { position: relative; display: block; flex-shrink: 0; padding: 0 0 .5rem; color: #8b8b8b; font-size: 1rem; line-height: 1.2; white-space: nowrap; background: none; }
.home-v2 .home-tabs .home-tabs__active { color: #3b5bff; font-weight: 700; }
.home-v2 .home-tabs__active::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 1rem; height: .1875rem; border-radius: .125rem; background: #3b5bff; transform: translateX(-50%); }
.home-v2 .home-tabs img { display: none; }
.home-v2 .home-feed, .home-v2 .home-list, .home-v2 .home-feature { display: flex; flex-direction: column; gap: .75rem; }
.home-v2 .home-feed { padding: .5rem 0 1rem; }
.home-v2 .home-list:empty { display: none; }
.home-label-page .home-shell { padding-top: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.home-label-page .home-feed { padding-top: 0; }
.home-label-page .home-label-heading { position: -webkit-sticky; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: center; min-height: calc(3.25rem + env(safe-area-inset-top, 0px)); margin: 0 -1rem; padding: calc(.25rem + env(safe-area-inset-top, 0px)) 1rem .25rem; background: #f4f7fd url('../images/v2/home-bg.png') no-repeat center top / 100% auto; }
.home-label-page .home-label-heading h2 { max-width: calc(100% - 6rem); margin: 0; font-size: 1.125rem; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.home-label-page .home-label-heading button { position: absolute; left: 1rem; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; background: none; color: #000; }
.home-label-page .home-label-heading svg { width: 1.25rem; height: 1.25rem; }
.home-label-page .home-label-heading button:focus-visible { outline: 2px solid #3078f5; outline-offset: 2px; }
.home-label-page .home-label-profile { margin: 0; padding: .75rem; list-style: none; border-radius: 1rem; background: #fff; }
.home-label-page .home-label-profile a { display: flex; align-items: flex-start; gap: .75rem; }
.home-label-page .home-label-profile img { flex-shrink: 0; width: 3rem; height: 3rem; object-fit: contain; border-radius: .5rem; }
.home-label-page .detail-expert-info { flex: 1; min-width: 0; font-size: .8125rem; line-height: 1.5; }
.home-label-page .detail-expert-info p { margin: 0; }
.home-label-page .detail-expert-info p + p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-top: .25rem; color: #666; }
.home-v2 .home-card { display: block; overflow: hidden; border-radius: 1rem; background: #fff; }
.home-v2 .home-article { padding: 1rem; }
.home-v2 .home-card:not(.home-card--banner) .home-article { padding: .75rem; }
.home-v2 .home-article--row { display: flex; align-items: flex-start; gap: .75rem; }
.home-v2 .home-article__main { flex: 1; min-width: 0; }
.home-v2 .home-article h3 { display: -webkit-box; margin: 0; overflow: hidden; color: #222; font-size: .875rem; font-weight: 700; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-v2 .home-article__thumb { flex-shrink: 0; width: 4.5rem; height: 4.5rem; border-radius: .5rem; object-fit: contain; background: #f7f7f7; }
.home-v2 .home-article__meta { display: flex; flex-wrap: wrap; gap: .625rem; margin: .75rem 0 0; color: #c2c2c2; font-size: .6875rem; line-height: 1.2; }
.home-v2 .home-banner { display: block; width: 100%; height: auto; aspect-ratio: 358 / 160; object-fit: cover; border-radius: 0; }
.home-v2 .home-card--banner .home-article { padding-top: .875rem; }
.home-v2 .home-carousel { width: 100%; min-width: 0; height: auto; overflow: hidden; border-radius: 1rem; background: #fff; }
.home-v2 .home-carousel .swiper-slide { height: auto; }
.home-v2 .home-carousel .home-card { height: 100%; border-radius: 0; }
.home-v2 .home-carousel .swiper-pagination { position: static; bottom: auto !important; display: flex; justify-content: center; gap: .375rem; margin-top: 0; padding: 0 0 .75rem; text-align: center !important; line-height: 1; }
.home-v2 .home-carousel .swiper-pagination-bullet { width: .5rem; height: .5rem; margin: 0; background: #c1ccdf; opacity: 1; border-radius: 999px; }
.home-v2 .home-carousel .swiper-pagination-bullet-active { width: 1.125rem; background: #3078f5; }
.home-v2 .home-feature__heading { display: flex; align-items: center; justify-content: space-between; padding: .5rem .25rem 0; }
.home-v2 .home-feature__heading h2 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.home-v2 .home-feature__heading a { color: #888; font-size: .75rem; }
.home-v2 .home-flash { display: flex; flex-direction: column; gap: .75rem; }
.home-v2 .home-flash a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; row-gap: .625rem; align-items: center; padding: .875rem 1rem; border-radius: 1rem; background: #fff; color: #333; font-size: .875rem; line-height: 1.5; }
.home-v2 .home-flash__badge { display: inline-flex; align-items: center; justify-self: start; gap: .25rem; padding: .0625rem .5rem; border-radius: 999px; background: #ffe9e7; color: #ff6258; font-size: .6875rem; font-weight: 700; line-height: 1.4; }
.home-v2 .home-flash__heading { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.home-v2 .home-flash__badge { flex-shrink: 0; }
.home-v2 .home-flash__time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #999; font-size: .6875rem; }
.home-v2 .home-flash__badge svg { width: .625rem; height: .75rem; }
.home-v2 .home-flash__title { grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.home-v2 .home-flash__view { grid-column: 2; grid-row: 1 / 3; color: #2f78f6; font-size: .8125rem; white-space: nowrap; }
.home-v2 .home-ad { position: relative; width: calc(100% + 2rem); margin-left: -1rem; background: url('../images/v2/ad-bg.png') no-repeat center / cover; }
.home-v2 .home-ad__content { width: 100%; overflow: hidden; }
.home-v2 .home-ad__content > a { display: block; }
.home-v2 .home-ad__content img { display: block; width: 100%; height: auto; }
.home-v2 .home-ad__close { position: absolute; top: .5rem; right: 1rem; z-index: 2; display: flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 0; line-height: 1; }
.home-v2 .home-ad__close::before,
.home-v2 .home-ad__close::after { content: ''; position: absolute; top: 50%; left: 50%; width: .625rem; height: 2px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.home-v2 .home-ad__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.home-v2 .home-ad__tag { position: absolute; top: .5rem; left: 1rem; z-index: 1; padding: .125rem .5rem; border-radius: .625rem; background: rgba(70,90,110,.45); color: #fff; font-size: .625rem; line-height: 1.4; }
.home-v2 .home-ad .home-ad__cta { position: absolute; top: calc(1.625rem + 10px); right: 1rem; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; height: 1.75rem; padding: 0 .625rem 0 .75rem; border-radius: 999px; background: linear-gradient(90deg,#ff8a65,#ff6b4a); color: #fff; font-size: .75rem; font-weight: 600; line-height: 1; }
.home-v2 .home-load-more { display: block; width: 100%; padding: 1rem 0; background: none; color: #888; text-align: center; font-size: .8125rem; }
.home-v2 .home-load-more[aria-busy="true"]::before { content: ''; display: inline-block; width: .875rem; height: .875rem; margin-right: .5rem; border: 2px solid #dce3ef; border-top-color: #3078f5; border-radius: 50%; vertical-align: -.125rem; animation: home-loading-spin .8s linear infinite; }
@keyframes home-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .home-v2 .home-load-more[aria-busy="true"]::before { animation: none; } }
.home-v2 .home-tabbar-retry { position: fixed; bottom: calc(25px + env(safe-area-inset-bottom,0px)); left: 50%; transform: translateX(-50%); z-index: 100; padding: 16px 32px; border-radius: 999px; background: #fff; color: #3078f5; box-shadow: 0 4px 8px #dbe0e8; font-size: 14px; }
@media (min-width: 768px) { body.home-v2 { max-width: 430px; } }

/* These three sections retain the original mobile layout and stylesheet rules. */
.home-v2 .home-legacy-block {
  width: calc(100% + 2rem);
  margin-left: -1rem;
  padding: 0 0 .5rem;
  background: #fff;
}
.home-v2 .home-legacy-block .listtpl h2,
.home-v2 .home-legacy-block .index-courses .swiper-container p { box-sizing: content-box; }
.home-v2 .home-legacy-block .zb_appTitle { display: flex; align-items: center; justify-content: space-between; }
.home-v2 .home-legacy-block .zb_appTitle a { display: inline-flex; align-items: center; flex-shrink: 0; gap: .125rem; float: none; height: auto; padding-top: 0; line-height: 1.5; text-indent: 0; color: #aaa; }
.home-v2 .home-legacy-block .zb_appTitle .home-more-icon { display: block; flex-shrink: 0; width: .8125rem; height: .6875rem; margin: 0; object-fit: contain; }
.home-v2 .home-legacy-block .index-courses .swiper-slide > a > img { width: 100%; height: auto; }

/* Live and topic sections share the same card layout. */
.home-v2 #home-live,
.home-v2 #home-topic {
  width: calc(100% + 2rem);
  min-width: 0;
  margin-left: -1rem;
  border-radius: 0;
  overflow: hidden;
}
.home-v2 #home-live .listtpl > a,
.home-v2 #home-topic .listtpl > a {
  display: block;
  border: 0;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.home-v2 #home-live .listtpl h2,
.home-v2 #home-topic .listtpl h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  height: 44px;
  margin: 10px 0;
  padding: 0;
  border: 0;
  font-size: .9375rem;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.home-v2 .home-carousel .home-article h3 {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}

.home-v2 .home-ad__caption { margin: 0; padding: .5rem 1rem; background: #fff; color: #333; font-size: .875rem; line-height: 1.5; text-align: center; }
