body:has(> .footer-box) { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
body:has(> .footer-box) > * { flex-shrink:0; }
body > .footer-box { margin-top:auto; width:100%; box-sizing:border-box; }
body > .footer-friends { margin-top:auto; }
body > .footer-friends ~ .footer-box { margin-top:0; }

/* Shared friend-link directory */
.footer-friends { width: 100%; color: #fff; }
.footer-friends-inner {
  display: flex; flex-wrap: wrap; gap: 22px;
  width: 1552px; max-width: calc(100% - 64px); margin: 0 auto; padding: 24px 0 32px;
  box-sizing: border-box;
}
.home-page .section-title, .footer-friends h2 {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 24px; line-height: 32px; font-weight: 600;
}
.home-page .section-title::before, .footer-friends h2::before {
  content: ''; width: 4px; height: 24px; flex-shrink: 0; border-radius: 2px; background: var(--home-accent, #ff4b02);
}
.footer-friends h2 { flex-basis: 100%; color: inherit; }
.friend-section {
  flex: 1 1 0; min-width: 0; padding: 22px; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.06); border-radius: 15px; background: #1f1f1f;
}
.friend-section--drama { flex-basis: 100%; }
.friend-section h3 { display: flex; align-items: center; gap: 11px; margin: 0; color: inherit; font-size: 16px; line-height: 22px; font-weight: 600; }
.friend-section h3 img { width: 30px; height: 30px; padding: 4px; box-sizing: border-box; border-radius: 7px; background: rgba(255,75,2,.1); }
.friend-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 18px 0 0; padding: 0; list-style: none; }
.friend-list li { min-width: 0; }
.friend-list a {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 11px 0 15px; box-sizing: border-box;
  color: rgba(255,255,255,.8); background: rgba(255,255,255,.05); border-radius: 8px; text-decoration: none;
  font-size: 13px; line-height: 18px;
}
.friend-list a::after { content: ''; width: 12px; height: 12px; margin-left: auto; flex: none; background: url('/static/images/footer/friend-chevron.svg') center / contain no-repeat; }
.friend-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-icon { display: block; flex: none; width: 20px; height: 20px; overflow: hidden; border-radius: 4px; background: #282828; }
.friend-icon img { position: static; display: block; width: 100%; height: 100%; object-fit: cover; }
.friend-section--drama .friend-list { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 18px; }
.friend-section--drama a { flex-direction: column; justify-content: center; gap: 7px; min-height: 102px; padding: 4px; background: transparent; }
.friend-section--drama a::after { display: none; }
.friend-section--drama .friend-icon { display: block; width: 66px; max-width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; }
.friend-list a:hover { color: var(--home-accent, #ff4b02); background: rgba(255,255,255,.08); }
.friend-list a:focus-visible { outline: 2px solid #ff4b02; outline-offset: 3px; }

@media (min-width: 861px) and (max-width: 1919px) {
  html body .footer-friends-inner { max-width: none; zoom: var(--site-pc-scale-1552); }
}
@media (max-width: 860px) {
  .footer-friends-inner { width: 100%; max-width: 100%; padding: 8px 16px 16px; gap: 16px; }
  .friend-section { flex-basis: 100%; padding: 16px; border-radius: 12px; }
  .friend-section h3 { gap: 8px; font-size: 14px; line-height: 20px; }
  .friend-section h3 img { width: 28px; height: 28px; }
  .friend-list, .friend-section--drama .friend-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; margin-top: 12px; }
  .friend-list a { min-height: 44px; gap: 4px; padding: 0 6px; font-size: 12px; }
  .friend-section--drama a { min-height: 78px; gap: 8px; padding: 4px 0; }
  .friend-section--drama .friend-icon { width: 44px; }
  .friend-section:not(.friend-section--drama) .friend-icon { width: 14px; height: 14px; }
  .friend-list a::after { display: none; }
}

@media (max-width: 767px) {
  .home-page .section-title, .footer-friends h2 { font-size: 18px; line-height: 24px; gap: 6px; }
  .home-page .section-title::before, .footer-friends h2::before { width: 3px; height: 18px; }
}

/* Personal-center pages omit the shared footer on H5. */
@media (max-width: 767px) {
  body:is(.is-user-center-page, .deposit-layout, .is-collect-page,
    .is-history-page, .is-setting-page, .is-edit-profile-page,
    .is-edit-password-page) > :is(.footer-friends, .footer-box, .download-fab, .floating-action) {
    display: none;
  }
}

/* Account status is shared by the header, personal center and wallet. */
.account-status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #482b27; color: #ffc1b5; font-size: 12px; line-height: 18px; white-space: nowrap; }
.account-ban-notice { padding: 16px; margin-bottom: 24px; border: 1px solid #75433a; border-radius: 12px; background: #2d201e; color: #ffc1b5; }
.account-ban-notice strong { font-size: 16px; line-height: 24px; }
.account-ban-notice p { margin: 6px 0 0; font-size: 14px; line-height: 22px; }
[data-account-banned][hidden] { display: none !important; }
@media (max-width: 767px) {
  .account-ban-notice { padding: 12px; margin-bottom: 20px; }
  .account-ban-notice p { font-size: 13px; line-height: 21px; }
  .header-account .account-status-badge { display: none; }
}
