@media (max-width: 680px) {
  .topnav,
  .home-body .topnav {
    box-sizing: border-box;
    column-gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding-right: 16px;
    padding-left: 16px;
  }

  .nav-actions,
  .nav-actions.is-open {
    display: flex !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    grid-column: 3 !important;
    justify-self: end !important;
    align-items: center;
    gap: 2px;
    width: auto !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    transform: none !important;
  }

  .topnav > .logo,
  .home-body .topnav > .logo {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    grid-column: 2 !important;
    justify-self: center !important;
    margin: 0 !important;
    transform: none !important;
  }

  .icon-search,
  .avatar-btn,
  .menu-btn {
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    padding: 0;
  }

  .avatar-btn .account-avatar-todo-dot,
  .fyg-dashboard-avatar-link .account-avatar-todo-dot {
    top: -6px;
    right: -7px;
    width: 16px;
    min-width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 9px !important;
  }

  .icon-search::before {
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .icon-search::after {
    top: 18px;
    left: 17px;
    width: 8px;
    height: 2px;
  }

  .avatar-btn::before {
    top: 3px;
    left: 7px;
    width: 10px;
    height: 10px;
    border-width: 1.8px;
  }

  .avatar-btn::after {
    right: 4px;
    bottom: 3px;
    left: 4px;
    height: 9px;
    border-width: 1.8px;
  }

  .menu-btn {
    position: relative;
    top: auto;
    left: auto;
    grid-column: 1;
    justify-self: start;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    transform: none;
  }

  .menu-btn span {
    width: 19px;
    height: 2px;
    margin: 0;
  }

  .mobile-tabbar__item span {
    width: 24px !important;
    height: 24px !important;
  }

  .mobile-tabbar__item.is-active {
    color: var(--pink);
  }

  .mobile-tabbar__item small {
    position: relative;
    display: inline-block;
    padding-bottom: 7px;
  }

  .mobile-tabbar__item.is-active small::after {
    position: absolute;
    right: 0;
    bottom: 1px;
    left: 0;
    height: 2px;
    background: var(--pink);
    content: "";
  }

  .site-hero {
    height: auto;
    min-height: 246px;
    padding-bottom: 18px;
  }

  .hero-collage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(61.5px, 1fr));
  }

  .hero-collage-item,
  .hero-collage-item:nth-child(1),
  .hero-collage-item:nth-child(2),
  .hero-collage-item:nth-child(3),
  .hero-collage-item:nth-child(6),
  .hero-collage-item:nth-child(8) {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-collage-item:nth-child(1) {
    grid-row: span 2;
  }

  .hero-collage-item:nth-child(2) {
    grid-column: span 2;
  }

  .hero-collage.is-detail-fit {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .hero-collage.is-detail-fit > .hero-collage-item,
  .hero-collage.is-detail-fit > .hero-collage-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-center {
    margin-top: 57px;
  }

  .hero-center p {
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .hero-center h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hot-cities span {
    font-size: 13px;
  }

  .hot-cities a {
    font-size: 12px;
  }

  .dashboard-body .profile-panel {
    padding: 26px 14px 34px !important;
  }

  .dashboard-body .fyg-dashboard-topbar {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) auto auto !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .dashboard-body .fyg-dashboard-menu-btn,
  .dashboard-body .fyg-dashboard-toplinks,
  .dashboard-body .fyg-dashboard-toplinks a,
  .dashboard-body .fyg-dashboard-home-link,
  .dashboard-body .fyg-dashboard-user-popover {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    box-sizing: border-box !important;
  }

  .dashboard-body .fyg-dashboard-menu-btn {
    grid-column: 1 !important;
    width: 54px !important;
    min-width: 54px !important;
    font-size: 20px !important;
    line-height: 50px !important;
  }

  .dashboard-body .fyg-dashboard-toplinks {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .dashboard-body .fyg-dashboard-toplinks a {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 14px !important;
    gap: 7px !important;
    font-size: 14px !important;
    line-height: 50px !important;
  }

  .dashboard-body .fyg-dashboard-toplinks a span {
    flex: 0 0 12px !important;
  }

  .dashboard-body .fyg-dashboard-topfill {
    display: none !important;
  }

  .dashboard-body .fyg-dashboard-home-link {
    grid-column: 3 !important;
    margin: 0 !important;
    padding: 0 12px !important;
    line-height: 50px !important;
  }

  .dashboard-body .fyg-dashboard-user-popover {
    grid-column: 4 !important;
    width: 54px !important;
    min-width: 54px !important;
    margin: 0 !important;
  }

  .dashboard-body .fyg-dashboard-avatar-link {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
  }

  .dashboard-body .fyg-dashboard-content {
    padding: 12px !important;
    background: #eef3f6 !important;
  }

  .dashboard-body .fyg-dashboard-content > section,
  .dashboard-body .fyg-dashboard-content > .records-panel,
  .dashboard-body .fyg-dashboard-content > .recharge-panel,
  .dashboard-body .fyg-dashboard-content > .vip-panel,
  .dashboard-body .fyg-dashboard-content > .agency-panel,
  .dashboard-body .fyg-dashboard-content > .profile-panel,
  .dashboard-body .fyg-dashboard-content > .withdraw-panel,
  .dashboard-body .fyg-dashboard-content > .tickets-panel,
  .dashboard-body .fyg-dashboard-content > .ticket-panel,
  .dashboard-body .fyg-dashboard-content > .favorites-panel {
    border: 1px solid #edf1f6 !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .dashboard-body .fyg-dashboard-shell .records-panel-table,
  .dashboard-body .fyg-dashboard-shell .favorites-panel,
  .dashboard-body .fyg-dashboard-shell .withdraw-panel,
  .dashboard-body .fyg-dashboard-shell .agency-panel,
  .dashboard-body .fyg-dashboard-shell .profile-panel,
  .dashboard-body .fyg-dashboard-shell .tickets-panel,
  .dashboard-body .fyg-dashboard-shell .ticket-panel,
  .dashboard-body .fyg-dashboard-shell .recharge-panel {
    padding: 24px 14px 28px !important;
  }

  .dashboard-body .fyg-dashboard-shell .records-title-row,
  .dashboard-body .fyg-dashboard-shell .favorites-title-row,
  .dashboard-body .fyg-dashboard-shell .user-comments-head,
  .dashboard-body .fyg-dashboard-shell .submission-comments-header,
  .dashboard-body .fyg-dashboard-shell .member-admin-head {
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 0 0 16px !important;
  }

  .dashboard-body .fyg-dashboard-shell .records-title-row h1,
  .dashboard-body .fyg-dashboard-shell .favorites-title-row h1,
  .dashboard-body .fyg-dashboard-shell .user-comments-head h1,
  .dashboard-body .fyg-dashboard-shell .submission-comments-header h1,
  .dashboard-body .fyg-dashboard-shell .member-admin-head h1,
  .dashboard-body .fyg-dashboard-shell .withdraw-page-title {
    margin: 0 !important;
    color: #111 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .dashboard-body .fyg-dashboard-shell .submission-tabs,
  .dashboard-body .fyg-dashboard-shell .fyg-admin-tabs,
  .dashboard-body .fyg-dashboard-shell .member-admin-tabs,
  .dashboard-body .fyg-dashboard-shell .fyg-ticket-tabs,
  .dashboard-body .fyg-dashboard-shell .user-comments-tabs {
    flex-wrap: nowrap !important;
    gap: 8px !important;
    min-height: 0 !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: transparent !important;
    scrollbar-width: none !important;
  }

  .dashboard-body .fyg-dashboard-shell .submission-tabs::-webkit-scrollbar,
  .dashboard-body .fyg-dashboard-shell .fyg-admin-tabs::-webkit-scrollbar,
  .dashboard-body .fyg-dashboard-shell .member-admin-tabs::-webkit-scrollbar,
  .dashboard-body .fyg-dashboard-shell .fyg-ticket-tabs::-webkit-scrollbar,
  .dashboard-body .fyg-dashboard-shell .user-comments-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .dashboard-body .fyg-dashboard-shell .submission-tabs a,
  .dashboard-body .fyg-dashboard-shell .submission-tabs button,
  .dashboard-body .fyg-dashboard-shell .fyg-admin-tabs a,
  .dashboard-body .fyg-dashboard-shell .member-admin-tabs a,
  .dashboard-body .fyg-dashboard-shell .fyg-ticket-tabs a,
  .dashboard-body .fyg-dashboard-shell .user-comments-tabs a {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    background: #f5f6fa !important;
    color: #5e6875 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .dashboard-body .fyg-dashboard-shell .submission-tabs a.is-active,
  .dashboard-body .fyg-dashboard-shell .submission-tabs button.is-active,
  .dashboard-body .fyg-dashboard-shell .fyg-admin-tabs a.is-active,
  .dashboard-body .fyg-dashboard-shell .member-admin-tabs a.is-active,
  .dashboard-body .fyg-dashboard-shell .fyg-ticket-tabs a.is-active,
  .dashboard-body .fyg-dashboard-shell .user-comments-tabs a.is-active {
    background: var(--brand-primary-soft-strong) !important;
    color: var(--pink) !important;
  }

  .dashboard-body .withdraw-page-title {
    margin: 0 0 16px !important;
    color: #111 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .dashboard-body .profile-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: min(100%, 500px) !important;
    margin: 0 auto !important;
    gap: 18px !important;
  }

  .dashboard-body .profile-line {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    column-gap: 10px !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .dashboard-body .profile-line span {
    min-width: 0 !important;
    color: #233041;
    font-size: 14px;
    line-height: 38px !important;
    text-align: right !important;
    white-space: nowrap;
  }

  .dashboard-body .profile-readonly p {
    margin: 0 !important;
    color: #7f8da3;
    font-size: 14px;
    line-height: 38px !important;
  }

  .dashboard-body .profile-line input {
    width: 100% !important;
    max-width: 380px;
    box-sizing: border-box;
  }

  .dashboard-body .profile-line textarea {
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
  }

  .dashboard-body .profile-line textarea {
    height: 80px;
  }

  .dashboard-body .profile-line > button,
  .dashboard-body .profile-form > .profile-line > button:not(.code-btn) {
    grid-column: 2;
    justify-self: start;
    width: 110px;
  }

  .dashboard-body .profile-result {
    margin: -6px 0 0 82px !important;
  }
}

/* Mobile auth fields: lock icon boxes and text to the same 14px line box. */
@media (max-width: 680px) {
  .auth-modal,
  .login-shell {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .auth-modal .login-field input,
  .login-shell .login-field input {
    box-sizing: border-box;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 14px !important;
  }

  .auth-modal .login-field input {
    height: 36px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .login-shell .login-field input {
    height: 45px !important;
    padding-top: 14.5px !important;
    padding-bottom: 14.5px !important;
  }

  .auth-modal .registration-email-field.is-email-hint-visible:not(:focus-within) input,
  .login-shell .registration-email-field.is-email-hint-visible:not(:focus-within) input {
    height: 62px !important;
    padding-top: 7px !important;
    padding-bottom: 31px !important;
  }

  .auth-modal .login-field > span,
  .login-shell .login-field > span {
    top: 50% !important;
    width: 14px !important;
    height: 14px !important;
    font-size: 14px !important;
    line-height: 14px !important;
    transform: translateY(-50%) !important;
  }

  .auth-modal .registration-email-field.is-email-hint-visible:not(:focus-within) > span,
  .login-shell .registration-email-field.is-email-hint-visible:not(:focus-within) > span,
  .auth-modal .registration-email-field.is-email-hint-visible.is-valid:not(:focus-within)::after,
  .login-shell .registration-email-field.is-email-hint-visible.is-valid:not(:focus-within)::after {
    top: 20px !important;
  }

  /* 登录、注册、找回密码弹窗在手机视口内与 PC 一样上下左右居中。 */
  .auth-modal {
    box-sizing: border-box;
    place-items: center !important;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .auth-modal__card {
    align-self: center !important;
    width: min(400px, 100%) !important;
    max-height: 100% !important;
    border-radius: 12px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24) !important;
  }

  #authModal .auth-modal__card,
  #registerModal .auth-modal__card,
  #forgotPasswordModal .auth-modal__card {
    min-height: 0 !important;
  }

}

/* Daily check-in: phone layout keeps four bottom tabs and uses the account sheet. */
@media (max-width: 680px) {
  .topnav:has(.nav-checkin-popover),
  .home-body .topnav:has(.nav-checkin-popover) {
    grid-template-columns: 24px minmax(54px, 1fr) auto !important;
  }

  .nav-checkin-popover {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }

  .nav-actions .nav-daily-checkin {
    display: inline-flex !important;
    flex: 0 0 auto;
    gap: 5px;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 3px 7px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  .nav-daily-checkin::before {
    display: inline-flex !important;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .nav-daily-checkin__copy {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    max-width: none;
    color: inherit;
    font-size: var(--fyg-font-medium, 14px) !important;
    font-weight: 800;
    line-height: var(--fyg-line-medium, 1.55) !important;
    text-align: left;
    white-space: nowrap !important;
  }

  .nav-daily-checkin__copy > span {
    display: inline;
    line-height: inherit;
    white-space: nowrap;
  }

  .nav-checkin-calendar {
    top: calc(100% + 18px);
    right: -30px;
    width: min(324px, calc(100vw - 24px));
    max-height: calc(100dvh - 86px);
    padding: 12px;
    border-radius: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .nav-checkin-calendar::before {
    right: 51px;
  }

  .nav-checkin-calendar__header {
    gap: 8px;
    padding-bottom: 6px;
  }

  .nav-checkin-calendar__header strong {
    font-size: 14px;
  }

  .nav-checkin-calendar .checkin-period-calendar__toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .nav-checkin-calendar .checkin-period-calendar__navigation {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav-actions .nav-checkin-calendar .checkin-period-calendar__tabs button,
  .nav-actions .nav-checkin-calendar .checkin-period-calendar__navigation button,
  .nav-actions .nav-checkin-calendar .checkin-period-calendar__current {
    min-height: 30px;
  }

  .nav-checkin-calendar .checkin-period-calendar__weekdays,
  .nav-checkin-calendar .checkin-period-calendar__days {
    gap: 3px;
  }

  .nav-checkin-calendar .checkin-period-calendar__day {
    height: 30px;
    border-radius: 8px;
  }

  .nav-checkin-calendar .checkin-period-calendar__year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-checkin-calendar__table {
    margin-bottom: 6px;
    border-spacing: 3px;
  }

  .nav-checkin-calendar__day,
  .nav-checkin-calendar__day time {
    height: 30px;
  }

  .nav-checkin-calendar__day time {
    width: 30px;
    border-radius: 9px;
  }

  .nav-checkin-calendar__summary {
    padding-top: 8px;
    padding-bottom: 7px;
  }

  .nav-actions .nav-checkin-calendar__action {
    min-height: 44px;
    font-size: var(--fyg-font-medium, 14px);
  }

  .home-checkin-card {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: calc(100% - 24px) !important;
    margin-bottom: 18px !important;
    padding: 14px !important;
    border-radius: 9px !important;
  }

  .home-checkin-card__coin {
    flex-basis: 42px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
  }

  .home-checkin-card__intro h2,
  .home-checkin-card__stats strong,
  .home-checkin-card__action,
  .home-checkin-card__login {
    font-size: 14px !important;
  }

  .home-checkin-card__stats {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px !important;
    padding: 8px 0;
    border-top: 1px solid rgba(125, 135, 147, .16);
    border-bottom: 1px solid rgba(125, 135, 147, .16);
  }

  .home-checkin-card__stats span {
    min-width: 0;
    white-space: normal !important;
  }

  .home-checkin-card__action,
  .home-checkin-card__login {
    grid-column: 1 !important;
    width: 100% !important;
    min-height: 46px !important;
    box-sizing: border-box;
  }

  .home-checkin-card__recommendation {
    grid-column: 1 !important;
    margin-top: 0 !important;
  }

  .mobile-account-card .nav-user-balance {
    min-height: 35px !important;
    line-height: 1.45 !important;
  }

  .mobile-account-card .nav-user-balance strong,
  .mobile-account-card .nav-user-balance-breakdown strong {
    color: inherit !important;
    font: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
  }

  .mobile-account-checkin {
    width: 100% !important;
    min-height: 50px !important;
    margin-top: 12px !important;
    padding: 7px 12px !important;
    font-size: 14px !important;
  }

  .mobile-tabbar__checkin-dot {
    top: 2px !important;
    left: calc(50% + 7px) !important;
  }

  .account-vip-checkin-note {
    max-width: 100% !important;
    margin-top: 13px !important;
    padding: 9px 10px !important;
    background: #fff !important;
    color: #738094 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* On narrow detail pages the notice wraps to several lines. Keep the warning
 * symbol anchored to the first line, immediately before “提示”, instead of
 * vertically centering it beside the whole paragraph. */
@media (max-width: 680px) {
  .safe-note {
    align-items: flex-start;
  }

  .safe-note__icon {
    align-self: flex-start;
  }
}

/* VIP-only private fields: keep the desktop sentence intact, but present a
 * compact two-line action block on phones. */
@media (max-width: 680px) {
  .private-access-tip--vip {
    min-height: 0;
    justify-content: center;
    padding: 10px 8px;
    text-align: center;
  }

  .private-access-tip--vip .private-access-content {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .private-access-tip--vip .private-access-desktop-copy {
    display: none;
  }

  .private-access-tip--vip .private-access-actions {
    --fyg-current-line: 30px;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }

  .private-access-tip--vip .private-access-actions--multiple {
    white-space: normal;
  }

  .private-access-tip--vip .private-access-action {
    --fyg-current-font: 13px;
    --fyg-current-line: 1;
    padding-right: 10px;
    padding-left: 10px;
  }
}

@media (max-width: 340px) {
  .private-access-tip--vip {
    padding-right: 6px;
    padding-left: 6px;
  }

  .private-access-tip--vip .private-access-action {
    --fyg-current-font: 12px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .nav-actions,
  .nav-actions.is-open {
    gap: 1px !important;
  }

  .nav-actions > .icon-search {
    width: 20px !important;
    min-width: 20px !important;
    transform: scale(.88) !important;
  }
}
