
*{box-sizing:border-box}
html,body{margin:0;background:#111;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",Arial,sans-serif;color:#fff}
body{display:flex;justify-content:center}
a{color:inherit;text-decoration:none}
button,input,textarea{font:inherit}
.app{position:relative;width:375px;height:812px;overflow:hidden;background:#000}
.gradient{background:linear-gradient(166.36deg,#160007 .26%,#670425 13.02%,#380516 25.17%,#000 94.96%)}
.bottom{position:absolute;left:0;bottom:0;width:375px;height:67px;background:#1d1d1d;display:flex;align-items:flex-start;padding:22px 47px;gap:98px;z-index:50}
.nav{text-decoration:none!important;font-size:14px;line-height:14px;color:#8a8585;white-space:nowrap}
.nav:hover,.nav:visited,.nav:focus{text-decoration:none!important}
.nav.active{color:#ff2a70;font-weight:600;position:relative}
.nav.active:after{content:"";position:absolute;top:21px;left:7px;width:14px;height:2px;border-radius:6px;background:#ff2a70}
.search-head{position:absolute;left:16px;top:48px;width:343px;height:32px;z-index:30}
.back-btn{position:absolute;left:0;top:0;width:28px;height:32px;display:flex;align-items:center;justify-content:flex-start;z-index:4}
.back-btn img,.back{width:18px;height:18px;display:block}
.search-box{position:absolute;left:26px;top:0;width:317px;height:32px;border-radius:30px;background:rgba(255,255,255,.1);display:flex;align-items:center;padding:0 10px;gap:10px}
.search-box img{width:14px;height:14px}
.search-box span{font-size:14px;line-height:14px}
.search-box .muted{color:rgba(255,255,255,.2)}
.close{margin-left:auto;width:16px!important;height:16px!important}
.catbar{position:absolute;left:0;top:96px;width:375px;height:25px;border-bottom:1px solid rgba(255,255,255,.05);padding-left:16px;display:flex;gap:16px;align-items:flex-start;z-index:25;background:transparent;backdrop-filter:none}
.cat{font-size:14px;line-height:14px;color:rgba(255,255,255,.25);height:24px;cursor:pointer;white-space:nowrap}
.cat.active{color:#ff2a70;font-weight:600;position:relative}
.cat.active:after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;border-radius:4px 4px 0 0;background:#ff2a70}
.content-scroll{position:absolute;left:0;right:0;top:121px;bottom:67px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.content-scroll.no-bottom{bottom:0}
.content-scroll::-webkit-scrollbar{display:none}
.grid2{width:343px;margin:16px auto 30px;display:grid;grid-template-columns:166px 166px;gap:10px}
.card2{min-height:267px;position:relative}
.card2 img{display:block;width:166px;height:221px;object-fit:cover;border-radius:16px}
.card2 .txt{padding:8px 4px 0;font-size:14px;line-height:18px;color:#686868}
.card2 .txt b{color:#fff;font-weight:400}
.grid3{width:343px;margin:16px auto 30px;display:grid;grid-template-columns:107px 107px 107px;gap:10px}
.card3{height:188px;position:relative}
.card3 img{display:block;width:107px;height:142px;object-fit:cover;border-radius:16px}
.card3 .txt{padding:8px 4px 0;font-size:14px;line-height:18px;color:#686868;height:46px;overflow:hidden}
.cover-badge{position:absolute;right:6px;top:6px;width:24px;height:24px;border-radius:50%;background:rgba(0,0,0,.58);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;font-size:14px;line-height:1;color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.28)}
.cover-badge.star{color:#ffd55c}
.cover-badge.heart{color:#ff477e}
.section-panel{position:absolute;left:0;top:238px;width:375px;height:574px;background:rgba(255,255,255,.05);border-radius:32px 32px 0 0;overflow:hidden}
.profile-tabs{position:absolute;left:126px;top:20px;height:20px;display:flex;gap:20px;align-items:flex-start;z-index:3}
.profile-tabs .t{font-size:14px;line-height:14px;cursor:pointer}
.profile-tabs .active{color:#ff2a70;font-weight:600;position:relative}
.profile-tabs .active:after{content:"";position:absolute;left:7px;top:18px;width:14px;height:2px;background:#ff2a70;border-radius:6px}
.profile-tabs .search-mini{position:absolute;left:217px;top:1px;width:12px;height:12px}
.profile-scroll{position:absolute;left:0;right:0;top:54px;bottom:0;overflow-y:auto;scrollbar-width:none}
.profile-scroll::-webkit-scrollbar{display:none}
.profile-grid{margin-top:6px}
.settings-wrap,.subpage{background:#0a0a0c}
.settings-header,.sub-header{height:80px;border-bottom:1px solid rgba(255,255,255,.03);background:rgba(10,10,12,.94);position:relative;z-index:10}
.settings-header .back-btn,.sub-header .back-btn{left:16px;top:24px}
.settings-header h1,.sub-header h1{margin:0;position:absolute;top:25px;width:100%;text-align:center;font-size:18px;line-height:28px;font-weight:400;pointer-events:none}
.settings-main,.sub-main{padding:16px;display:flex;flex-direction:column;gap:16px;overflow-y:auto;height:732px;scrollbar-width:none}
.settings-main::-webkit-scrollbar,.sub-main::-webkit-scrollbar{display:none}
.group{background:#16161a;border:1px solid rgba(255,255,255,.05);border-radius:16px;overflow:hidden}
.row{min-height:50px;padding:13px 16px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid rgba(255,255,255,.04);font-size:15px;color:#f3f4f6;gap:10px}
.row:first-child{border-top:0}
.row.column{display:block}
.row .desc{font-size:12px;color:#777;margin-top:5px;line-height:18px}
.meta{font-size:12px;color:#9ca3af;display:flex;align-items:center;gap:4px}
.chev{width:16px;height:16px;opacity:.7}
.switch{width:44px;height:22px;border-radius:999px;background:#36363b;position:relative;flex:none}
.switch i{position:absolute;width:22px;height:22px;border-radius:50%;background:#fff;left:0;top:0;transition:.2s}
.switch.on{background:#000}
.switch.on i{left:22px;background:#ff2e7e}
.logout{justify-content:center;color:#ff2e7e}
.form-input,.form-textarea{width:100%;border:1px solid rgba(255,255,255,.06);background:#16161a;color:#fff;border-radius:14px;outline:none;padding:12px 14px}
.form-input{height:46px}
.form-textarea{height:150px;resize:none;line-height:20px}
.primary-btn{height:46px;border:0;border-radius:14px;background:#ff2a70;color:#fff;font-weight:600;cursor:pointer}
.secondary-btn{height:46px;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:#16161a;color:#fff;cursor:pointer}
.info-card{padding:20px;background:#16161a;border:1px solid rgba(255,255,255,.05);border-radius:18px}
.info-card h2{font-size:20px;margin:0 0 10px}.info-card p{font-size:13px;line-height:22px;color:#9ca3af;margin:0}
.version-logo{width:72px;height:72px;border-radius:20px;margin:15px auto;background:linear-gradient(145deg,#ff2a70,#80143a);display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:700;box-shadow:0 14px 35px rgba(255,42,112,.2)}


/* Unified back button */
.back-btn{
  width:28px!important;
  height:32px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  overflow:visible!important;
}
.back-btn img,
.back-btn .back{
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  object-fit:contain!important;
  transform:none!important;
}

/* V10 secondary pages */
.avatar-wrap{position:relative;display:inline-block;cursor:pointer}
.avatar-edit-tip{position:absolute;right:-2px;bottom:-2px;width:22px;height:22px;border-radius:50%;background:#FF2A70;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;border:2px solid #12050b}
.avatar-modal-preview{width:88px;height:88px;border-radius:50%;object-fit:cover;margin:4px auto 18px;display:block;border:2px solid rgba(255,255,255,.18)}
.action-btn{height:44px;border-radius:12px;border:none;background:#FF2A70;color:#fff;font-size:15px;font-weight:600;width:100%;cursor:pointer}
.action-btn.secondary{background:#2b2328}
.text-input{width:100%;height:44px;border:1px solid rgba(255,255,255,.1);background:#21161c;color:#fff;border-radius:10px;padding:0 12px;outline:none;box-sizing:border-box}
.textarea{width:100%;min-height:140px;resize:none;border:1px solid rgba(255,255,255,.1);background:#21161c;color:#fff;border-radius:10px;padding:12px;outline:none;box-sizing:border-box}
.page-note{font-size:12px;color:#8f858b;line-height:1.6;margin:10px 4px 0}
.device-card{padding:14px 16px;border-radius:12px;background:#1d151a;margin-bottom:10px}
.device-title{font-size:15px;font-weight:600}
.device-meta{font-size:12px;color:#8f858b;margin-top:5px;line-height:1.5}
.status-ok{color:#45d483;font-size:12px}
.danger{color:#ff5c79}
.faq-item{padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.05)}
.faq-q{font-size:14px;font-weight:600}
.faq-a{font-size:12px;color:#958b90;line-height:1.6;margin-top:7px}
.minor-hero{text-align:center;padding:26px 18px 18px}
.minor-icon{width:72px;height:72px;border-radius:22px;background:linear-gradient(135deg,#FF2A70,#ff6d9d);display:flex;align-items:center;justify-content:center;margin:0 auto 14px;font-size:34px}
.minor-title{font-size:20px;font-weight:700}
.minor-desc{font-size:13px;color:#968c91;line-height:1.7;margin-top:8px}

/* V11: all secondary-page titles are geometrically centered */
.sub-header,
.settings-header{
  position:absolute!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.sub-header .sub-title,
.settings-header .settings-title,
.sub-title,
.settings-title{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  width:auto!important;
  max-width:250px!important;
  margin:0!important;
  text-align:center!important;
  white-space:nowrap!important;
  pointer-events:none!important;
}
.sub-header .back-btn,
.settings-header .back-btn{
  position:absolute!important;
  left:16px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  z-index:2!important;
}

/* Avatar picker */
.avatar-picker-card{padding:20px 18px 16px!important}
.avatar-picker-label{font-size:13px;color:#9d9298;margin:12px 0 10px}
.default-avatar-list{display:flex;justify-content:space-between;gap:10px}
.default-avatar{width:48px;height:48px;padding:0;border:2px solid transparent;border-radius:50%;background:linear-gradient(135deg,#FF2A70,#40101f);color:#fff;cursor:pointer;overflow:hidden;display:flex;align-items:center;justify-content:center}
.default-avatar:nth-child(2){background:linear-gradient(135deg,#ff6a3d,#661828)}
.default-avatar:nth-child(3){background:linear-gradient(135deg,#8c55ff,#28125c)}
.default-avatar:nth-child(4){background:linear-gradient(135deg,#2aa8ff,#133d67)}
.default-avatar:nth-child(5){background:linear-gradient(135deg,#ff78ae,#7a2148)}
.default-avatar span{font-size:18px;font-weight:700}
.default-avatar:active{transform:scale(.94)}

/* V12 exact standalone header alignment */
.settings-header,.sub-header{
  position:absolute!important;
  left:0!important;
  top:0!important;
  width:100%!important;
  height:80px!important;
  box-sizing:border-box!important;
}
.settings-header h1,.sub-header h1{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:24px!important;
  width:100%!important;
  height:32px!important;
  margin:0!important;
  padding:0 56px!important;
  box-sizing:border-box!important;
  text-align:center!important;
  font-size:18px!important;
  line-height:32px!important;
  font-weight:400!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  pointer-events:none!important;
}
.settings-header .back-btn,.sub-header .back-btn{
  position:absolute!important;
  left:16px!important;
  top:24px!important;
  width:28px!important;
  height:32px!important;
  transform:none!important;
  z-index:5!important;
}

/* V13 avatar popup: NEVER visible until the center avatar is clicked */
#avatarModal{
  display:none!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
#avatarModal.show{
  display:flex!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}

/* V14: profile avatar modal centered in the viewport */
#avatarModal{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 20px!important;
  box-sizing:border-box!important;
  background:rgba(0,0,0,.58)!important;
  z-index:999!important;
}
#avatarModal.show{
  display:flex!important;
}
#avatarModal .modal-card,
#avatarModal .avatar-picker-card{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:100%!important;
  max-width:320px!important;
  margin:0!important;
  border-radius:18px!important;
  box-sizing:border-box!important;
}

/* V15: solid background for avatar modal card */
#avatarModal .modal-card,
#avatarModal .avatar-picker-card{
  background:#1A1116!important;
  border:1px solid rgba(255,255,255,.08)!important;
  box-shadow:0 18px 50px rgba(0,0,0,.45)!important;
  overflow:hidden!important;
}

/* V16: fix settings/sub pages content being covered by fixed header */
.settings-main,
.sub-main{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:80px!important;
  bottom:0!important;
  height:auto!important;
  box-sizing:border-box!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  padding:16px!important;
}

/* Keep the header above the scrolling content */
.settings-header,
.sub-header{
  z-index:100!important;
}

/* Give first content block a clean gap below the header */
.settings-main > :first-child,
.sub-main > :first-child{
  margin-top:0!important;
}

/* V17 interactive checkbox switches */
.switch input{
  position:absolute!important;
  opacity:0!important;
  pointer-events:none!important;
}
.switch.on{background:#000!important}
.switch.on i{left:22px!important;background:#ff2e7e!important}

/* V18 auth + customer service */
.cs-link{
  width:24px;height:24px;display:flex;align-items:center;justify-content:center;
  text-decoration:none;flex:none;transform-origin:50% 50%;
  animation:csWiggle 1.8s ease-in-out infinite;
}
.cs-link svg{width:22px;height:22px;display:block}
@keyframes csWiggle{
  0%,100%{transform:rotate(0deg)}
  20%{transform:rotate(-10deg)}
  40%{transform:rotate(10deg)}
  60%{transform:rotate(-6deg)}
  80%{transform:rotate(6deg)}
}
.profile-cs{
  position:absolute;right:48px;top:45px;width:24px;height:24px;z-index:12;
  display:flex;align-items:center;justify-content:center;
}
.profile-cs svg{width:22px!important;height:22px!important;display:block!important}
.auth-page{
  position:absolute;inset:0;padding:88px 24px 24px;box-sizing:border-box;
  overflow-y:auto;background:linear-gradient(180deg,#12080d 0%,#090609 100%);
}
.auth-logo{
  width:58px;height:58px;border-radius:18px;margin:0 auto 18px;
  background:linear-gradient(135deg,#FF2A70,#6b1738);
  display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:800;color:#fff;
}
.auth-title{text-align:center;font-size:24px;font-weight:700;margin-bottom:8px}
.auth-subtitle{text-align:center;color:#8f858b;font-size:13px;margin-bottom:28px}
.auth-form{display:flex;flex-direction:column;gap:12px}
.auth-input{
  width:100%;height:48px;border-radius:12px;border:1px solid rgba(255,255,255,.08);
  background:#1b1318;color:#fff;padding:0 14px;box-sizing:border-box;outline:none;font-size:14px;
}
.auth-input:focus{border-color:#FF2A70}
.auth-btn{
  width:100%;height:48px;border:0;border-radius:12px;background:#FF2A70;color:#fff;
  font-size:15px;font-weight:700;margin-top:4px;cursor:pointer;
}
.auth-switch{text-align:center;margin-top:18px;color:#91878c;font-size:13px}
.auth-switch a{color:#FF2A70;text-decoration:none;margin-left:4px}
.auth-agree{font-size:12px;color:#777;line-height:1.5;margin-top:4px}
.pause-indicator{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:58px;height:58px;border-radius:50%;background:rgba(0,0,0,.48);
  display:none;align-items:center;justify-content:center;z-index:45;pointer-events:none;
}
.pause-indicator.show{display:flex}
.pause-indicator:before,.pause-indicator:after{
  content:"";width:6px;height:22px;border-radius:2px;background:#fff;margin:0 3px;
}

/* V19: customer service icon on the right of every titled subpage header */
.settings-header .header-cs,
.sub-header .header-cs{
  position:absolute!important;
  right:16px!important;
  top:29px!important;
  width:22px!important;
  height:22px!important;
  z-index:12!important;
}
.settings-header .header-cs svg,
.sub-header .header-cs svg{
  width:22px!important;
  height:22px!important;
}

/* =========================================================
   V20 Responsive Mobile Layout
   Base design remains 375×812, but all pages now adapt
   to different phone widths/heights and safe areas.
   ========================================================= */

/* Global */
html, body{
  width:100%;
  min-height:100%;
  margin:0;
  padding:0;
  background:#000;
  overflow:hidden;
}
*{box-sizing:border-box}
body{
  min-height:100dvh;
  min-height:100vh;
}

/* App shell: no longer hard-locked to 375×812 */
.app{
  position:relative!important;
  width:100%!important;
  max-width:480px!important;
  height:100dvh!important;
  min-height:100vh!important;
  margin:0 auto!important;
  overflow:hidden!important;
  background:#000;
}

/* iOS safe areas */
.app{
  padding-left:env(safe-area-inset-left);
  padding-right:env(safe-area-inset-right);
}

/* Shared top headers */
.topbar,
.search-head,
.settings-header,
.sub-header{
  width:100%!important;
  left:0!important;
  right:0!important;
  padding-left:max(16px, env(safe-area-inset-left))!important;
  padding-right:max(16px, env(safe-area-inset-right))!important;
}

/* Keep title centered even on wider/narrower phones */
.settings-header h1,
.sub-header h1{
  width:100%!important;
  left:0!important;
  right:0!important;
  padding-left:64px!important;
  padding-right:64px!important;
  text-align:center!important;
}

/* Main scrolling areas */
.settings-main,
.sub-main{
  left:0!important;
  right:0!important;
  width:100%!important;
  bottom:0!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  padding-left:max(16px, env(safe-area-inset-left))!important;
  padding-right:max(16px, env(safe-area-inset-right))!important;
  padding-bottom:max(20px, env(safe-area-inset-bottom))!important;
}

/* Bottom navigation */
.bottom{
  left:0!important;
  right:0!important;
  width:100%!important;
  bottom:0!important;
  padding-bottom:env(safe-area-inset-bottom)!important;
  height:calc(67px + env(safe-area-inset-bottom))!important;
}

/* Homepage/video full-screen feeds */
.home-feed,
.video-feed{
  width:100%!important;
  height:100dvh!important;
  min-height:100vh!important;
  overflow-y:auto!important;
  scroll-snap-type:y mandatory;
  overscroll-behavior-y:contain;
}
.home-slide,
.video-slide{
  width:100%!important;
  height:100dvh!important;
  min-height:100vh!important;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  position:relative!important;
}
.home-slide video,
.video-slide video,
.home-slide .bg,
.video-slide .bg{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}

/* Homepage fixed layers */
.topbar{
  top:0!important;
  padding-top:env(safe-area-inset-top)!important;
  height:calc(48px + env(safe-area-inset-top))!important;
}
.home-slide .video-actions{
  right:max(12px, env(safe-area-inset-right))!important;
}
.home-slide .info,
.video-slide .info{
  left:max(16px, env(safe-area-inset-left))!important;
  right:max(72px, env(safe-area-inset-right))!important;
  bottom:calc(78px + env(safe-area-inset-bottom))!important;
  width:auto!important;
  max-width:none!important;
}

/* Search and category content */
.content-scroll{
  left:0!important;
  right:0!important;
  width:100%!important;
  bottom:calc(67px + env(safe-area-inset-bottom))!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  padding-left:max(12px, env(safe-area-inset-left))!important;
  padding-right:max(12px, env(safe-area-inset-right))!important;
}

/* Responsive card grids */
.grid2{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
.grid3{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
}
.grid2 > *,
.grid3 > *{
  min-width:0!important;
  width:100%!important;
}

/* Images/cards should not overflow */
.card,
.card2,
.card3,
.cover,
.profile-card{
  max-width:100%!important;
}
.card img,
.card2 img,
.card3 img,
.cover img,
.profile-card img{
  width:100%!important;
  height:auto;
  object-fit:cover;
}

/* Profile page */
.profile-page,
.profile-main{
  width:100%!important;
}
.profile-cs{
  right:52px!important;
}
#avatarModal{
  width:100%!important;
  height:100%!important;
  padding-left:max(20px, env(safe-area-inset-left))!important;
  padding-right:max(20px, env(safe-area-inset-right))!important;
}
#avatarModal .modal-card,
#avatarModal .avatar-picker-card{
  width:min(320px, calc(100vw - 40px))!important;
  max-height:calc(100dvh - 80px)!important;
  overflow-y:auto!important;
}

/* Auth pages */
.auth-page{
  left:0!important;
  right:0!important;
  width:100%!important;
  padding-left:max(24px, env(safe-area-inset-left))!important;
  padding-right:max(24px, env(safe-area-inset-right))!important;
  padding-bottom:max(24px, env(safe-area-inset-bottom))!important;
}

/* Modals / sheets */
.modal-mask,
.share-mask{
  width:100%!important;
  height:100%!important;
}
.modal-card,
.share-sheet{
  max-width:100%!important;
}
.share-sheet{
  padding-bottom:max(16px, env(safe-area-inset-bottom))!important;
}

/* Smaller phones */
@media (max-width:359px){
  .topbar .tabs{gap:14px!important}
  .topbar .tab{font-size:13px!important}
  .grid3{gap:4px!important}
  .settings-main,.sub-main{padding-left:12px!important;padding-right:12px!important}
  .home-slide .info,.video-slide .info{right:64px!important}
}

/* Larger phones */
@media (min-width:430px){
  .app{
    max-width:520px!important;
  }
  .settings-main,
  .sub-main,
  .content-scroll{
    padding-left:20px!important;
    padding-right:20px!important;
  }
}

/* Landscape phones: keep usable instead of clipping */
@media (orientation:landscape) and (max-height:600px){
  .app{
    max-width:none!important;
    width:100vw!important;
    height:100dvh!important;
  }
  .settings-main,.sub-main{
    top:64px!important;
  }
  .settings-header,.sub-header{
    height:64px!important;
  }
  .settings-header h1,.sub-header h1{
    top:16px!important;
  }
  .settings-header .back-btn,.sub-header .back-btn{
    top:16px!important;
  }
  .settings-header .header-cs,.sub-header .header-cs{
    top:21px!important;
  }
}

/* =========================================================
   V21 Responsive polish: Home / Explore / Profile
   ========================================================= */

/* ---------- Global app spacing ---------- */
:root{
  --page-gutter: clamp(16px, 4.5vw, 24px);
  --top-safe-gap: clamp(10px, 2.5vw, 16px);
  --bottom-nav-h: 68px;
}

/* ---------- Home top bar ---------- */
.topbar{
  top:0!important;
  height:calc(56px + env(safe-area-inset-top))!important;
  padding-top:calc(env(safe-area-inset-top) + var(--top-safe-gap))!important;
  padding-left:max(var(--page-gutter), env(safe-area-inset-left))!important;
  padding-right:max(var(--page-gutter), env(safe-area-inset-right))!important;
  align-items:flex-start!important;
  gap:12px!important;
}
.topbar .cs-link{
  margin-left:0!important;
  margin-top:0!important;
  flex:0 0 24px!important;
}
.topbar .tabs-viewport{
  min-width:0!important;
  flex:1 1 auto!important;
  margin-left:4px!important;
}
.topbar .search{
  flex:0 0 24px!important;
  margin-right:0!important;
}

/* Give home content breathing room under top bar */
.home-slide .info{
  left:max(var(--page-gutter), env(safe-area-inset-left))!important;
}
.home-slide .video-actions{
  right:max(14px, env(safe-area-inset-right))!important;
}

/* ---------- Bottom nav: equal distribution ---------- */
.bottom{
  display:grid!important;
  grid-template-columns:repeat(3, minmax(0, 1fr))!important;
  align-items:start!important;
  justify-items:stretch!important;
  column-gap:0!important;
  width:100%!important;
  left:0!important;
  right:0!important;
  height:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom))!important;
  padding:8px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left))!important;
}
.bottom .nav{
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:4px!important;
  margin:0!important;
  padding:0!important;
  text-align:center!important;
}
.bottom .nav img{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px!important;
}
.bottom .nav span{
  width:100%!important;
  text-align:center!important;
  white-space:nowrap!important;
  font-size:11px!important;
}

/* ---------- Explore: fluid grid ---------- */
.content-scroll{
  padding-left:max(var(--page-gutter), env(safe-area-inset-left))!important;
  padding-right:max(var(--page-gutter), env(safe-area-inset-right))!important;
}
.grid3{
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(104px, 1fr))!important;
  gap:10px!important;
  align-items:start!important;
}
.grid3 .card3,
.grid3 > a,
.grid3 > div{
  width:100%!important;
  min-width:0!important;
}
.grid3 .card3 img,
.grid3 .cover,
.grid3 .cover img{
  width:100%!important;
}

/* Wider screens can show more columns */
@media (min-width:430px){
  .grid3{
    grid-template-columns:repeat(auto-fit, minmax(118px, 1fr))!important;
    gap:12px!important;
  }
}
@media (min-width:520px){
  .grid3{
    grid-template-columns:repeat(auto-fit, minmax(128px, 1fr))!important;
  }
}

/* ---------- Profile page ---------- */
.profile-page,
.profile-main{
  width:100%!important;
  padding-left:max(var(--page-gutter), env(safe-area-inset-left))!important;
  padding-right:max(var(--page-gutter), env(safe-area-inset-right))!important;
}
.profile-page .user-info,
.profile-main .user-info{
  width:min(100%, 340px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.profile-tabs{
  display:grid!important;
  grid-template-columns:repeat(3, 1fr)!important;
  width:100%!important;
}
.profile-tabs > *{
  width:100%!important;
  text-align:center!important;
  min-width:0!important;
}
.profile-grid,
.profile-page .grid3,
.profile-main .grid3{
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(104px, 1fr))!important;
  gap:10px!important;
  width:100%!important;
}
@media (min-width:430px){
  .profile-grid,
  .profile-page .grid3,
  .profile-main .grid3{
    grid-template-columns:repeat(auto-fit, minmax(118px, 1fr))!important;
    gap:12px!important;
  }
}

/* Profile header icons keep comfortable edge distance */
.profile-cs{
  right:54px!important;
  top:calc(46px + env(safe-area-inset-top))!important;
}
.profile-page .settings,
.profile-main .settings,
a[href="settings.html"]{
  right:max(var(--page-gutter), env(safe-area-inset-right))!important;
}

/* Small screens */
@media (max-width:359px){
  :root{ --page-gutter:14px; }
  .topbar{gap:8px!important}
  .topbar .tabs-viewport{margin-left:0!important}
  .grid3,
  .profile-grid,
  .profile-page .grid3,
  .profile-main .grid3{
    grid-template-columns:repeat(3, minmax(0,1fr))!important;
    gap:6px!important;
  }
}

/* Large phones / small tablets */
@media (min-width:600px){
  .app{
    max-width:720px!important;
  }
  :root{ --page-gutter:28px; }
  .grid3,
  .profile-grid,
  .profile-page .grid3,
  .profile-main .grid3{
    grid-template-columns:repeat(auto-fit, minmax(140px,1fr))!important;
    gap:14px!important;
  }
}

/* =========================================================
   V22 — true responsive fix
   Important: active underlines/indicators are decorative only.
   They are absolutely positioned and NEVER participate in layout.
   ========================================================= */

:root{
  --gutter: clamp(16px, 4.2vw, 24px);
  --nav-h: 64px;
}

/* No canvas scaling. Use the actual viewport. */
html,body{
  width:100%;
  min-width:0;
  min-height:100%;
  overflow:hidden;
}
.app{
  width:100%!important;
  max-width:none!important;
  height:100dvh!important;
  min-height:100vh!important;
  margin:0!important;
  transform:none!important;
}

/* ---------------- Decorative underlines: excluded from layout ---------------- */
.tabs-indicator,
.nav.active::after,
.cat.active::after,
.profile-tabs .active::after{
  position:absolute!important;
  pointer-events:none!important;
  flex:none!important;
  margin:0!important;
}

/* ---------------- Home ---------------- */
.topbar{
  left:0!important;
  right:0!important;
  width:100%!important;
  height:auto!important;
  min-height:58px!important;
  padding:
    calc(env(safe-area-inset-top) + 14px)
    max(var(--gutter), env(safe-area-inset-right))
    8px
    max(var(--gutter), env(safe-area-inset-left))!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
}
.topbar .cs-link{
  flex:0 0 24px!important;
  width:24px!important;
  height:24px!important;
  margin:0!important;
}
.topbar .tabs-viewport{
  flex:1 1 0!important;
  min-width:0!important;
  width:auto!important;
  margin:0!important;
}
.topbar .tabs{
  display:flex!important;
  width:max-content!important;
  min-width:max-content!important;
  gap:clamp(14px, 4vw, 20px)!important;
  padding-bottom:7px!important;
}
.topbar .search{
  position:static!important;
  flex:0 0 24px!important;
  width:24px!important;
  height:24px!important;
  margin:0!important;
}

/* ---------------- Bottom navigation ---------------- */
.bottom{
  left:0!important;
  right:0!important;
  bottom:0!important;
  width:100%!important;
  height:calc(var(--nav-h) + env(safe-area-inset-bottom))!important;
  padding:0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left))!important;
  display:grid!important;
  grid-template-columns:repeat(3, 1fr)!important;
  gap:0!important;
  align-items:stretch!important;
}
.bottom .nav{
  position:relative!important;
  width:auto!important;
  min-width:0!important;
  height:var(--nav-h)!important;
  margin:0!important;
  padding:20px 0 0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  line-height:14px!important;
  text-align:center!important;
}
/* underline is overlay only; it does not use a grid cell or affect equal thirds */
.bottom .nav.active::after{
  content:""!important;
  left:50%!important;
  top:40px!important;
  width:14px!important;
  height:2px!important;
  transform:translateX(-50%)!important;
}

/* ---------------- Explore / Search header ---------------- */
.search-head{
  left:0!important;
  right:0!important;
  top:0!important;
  width:100%!important;
  height:auto!important;
  padding:
    calc(env(safe-area-inset-top) + 14px)
    max(var(--gutter), env(safe-area-inset-right))
    8px
    max(var(--gutter), env(safe-area-inset-left))!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.search-head .back-btn{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  flex:0 0 28px!important;
}
.search-head .search-box{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:auto!important;
  flex:1 1 auto!important;
  min-width:0!important;
}

/* Category bar uses real viewport width */
.catbar{
  left:0!important;
  right:0!important;
  width:100%!important;
  top:calc(env(safe-area-inset-top) + 66px)!important;
  height:38px!important;
  padding:7px max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left))!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
}
.catbar::-webkit-scrollbar{display:none!important}
.cat{
  position:relative!important;
  flex:0 0 auto!important;
  height:26px!important;
  line-height:18px!important;
}
.cat.active::after{
  left:50%!important;
  right:auto!important;
  bottom:0!important;
  width:14px!important;
  height:2px!important;
  transform:translateX(-50%)!important;
}

/* Explore content */
.content-scroll{
  top:calc(env(safe-area-inset-top) + 104px)!important;
  bottom:calc(var(--nav-h) + env(safe-area-inset-bottom))!important;
  padding:0 max(var(--gutter), env(safe-area-inset-right)) 24px max(var(--gutter), env(safe-area-inset-left))!important;
}
.grid3{
  width:100%!important;
  margin:16px 0 30px!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fill, minmax(104px, 1fr))!important;
  gap:12px 10px!important;
}
.card3{
  width:100%!important;
  height:auto!important;
  min-width:0!important;
}
.card3 img{
  width:100%!important;
  height:auto!important;
  aspect-ratio:107 / 142!important;
  object-fit:cover!important;
  border-radius:16px!important;
}
.card3 .txt{
  width:100%!important;
  height:auto!important;
  min-height:44px!important;
}

/* A wider screen naturally gets more cards per row. */
@media (min-width:420px){
  .grid3{grid-template-columns:repeat(auto-fill, minmax(112px, 1fr))!important}
}
@media (min-width:520px){
  .grid3{grid-template-columns:repeat(auto-fill, minmax(124px, 1fr))!important}
}
@media (min-width:700px){
  .grid3{grid-template-columns:repeat(auto-fill, minmax(138px, 1fr))!important}
}

/* ---------------- Profile ---------------- */
.section-panel{
  left:0!important;
  right:0!important;
  width:100%!important;
  top:238px!important;
  height:calc(100dvh - 238px)!important;
  padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom))!important;
}
.profile-tabs{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:18px!important;
  width:100%!important;
  height:28px!important;
  padding:0 max(22px, var(--gutter))!important;
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:0!important;
  align-items:start!important;
}
.profile-tabs .t{
  position:relative!important;
  width:100%!important;
  text-align:center!important;
}
.profile-tabs .active::after{
  left:50%!important;
  top:20px!important;
  width:14px!important;
  transform:translateX(-50%)!important;
}
.profile-scroll{
  left:0!important;
  right:0!important;
  top:54px!important;
  bottom:0!important;
  padding:0 max(var(--gutter), env(safe-area-inset-right)) 24px max(var(--gutter), env(safe-area-inset-left))!important;
}
.profile-grid{
  width:100%!important;
  margin:6px 0 24px!important;
  grid-template-columns:repeat(auto-fill, minmax(104px, 1fr))!important;
  gap:12px 10px!important;
}

/* Keep profile top controls away from screen edges */
.profile-cs{
  right:54px!important;
  top:calc(env(safe-area-inset-top) + 48px)!important;
}
a[href="settings.html"]{
  right:max(var(--gutter), env(safe-area-inset-right))!important;
  top:calc(env(safe-area-inset-top) + 48px)!important;
}

/* On very narrow phones keep exactly 3 compact columns, without scaling the page. */
@media (max-width:359px){
  :root{--gutter:12px}
  .grid3,
  .profile-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .topbar{gap:8px!important}
}

/* =========================================================
   V23 FINAL STRUCTURAL RESPONSIVE FIX
   Fix actual positioning conflicts from legacy absolute CSS.
   ========================================================= */
:root{
  --mobile-gutter: clamp(16px, 4.266vw, 24px);
  --header-y: clamp(34px, 5.9vh, 48px);
  --bottom-h: 67px;
}

/* ---------- HOME TOP ---------- */
.topbar{
  position:absolute!important;
  top:var(--header-y)!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  padding:0 max(var(--mobile-gutter), env(safe-area-inset-right))
           0 max(var(--mobile-gutter), env(safe-area-inset-left))!important;
  display:flex!important;
  align-items:flex-start!important;
  gap:0!important;
  z-index:80!important;
}
.topbar .cs-link{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:24px!important;
  height:24px!important;
  flex:0 0 24px!important;
  margin:0!important;
}
.topbar .tabs-viewport{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:auto!important;
  height:30px!important;
  flex:1 1 auto!important;
  min-width:0!important;
  margin:0 14px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
.topbar .tabs{
  position:relative!important;
  height:30px!important;
  display:flex!important;
  width:max-content!important;
  min-width:max-content!important;
  gap:20px!important;
  padding:0 0 6px!important;
}
.topbar .search{
  position:relative!important;
  right:auto!important;
  top:4px!important;
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  margin:0!important;
}

/* ---------- BOTTOM NAV: EXACT 3 EQUAL AREAS ---------- */
.bottom{
  position:absolute!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  width:100%!important;
  height:calc(var(--bottom-h) + env(safe-area-inset-bottom))!important;
  padding:0 0 env(safe-area-inset-bottom)!important;
  margin:0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:stretch!important;
  gap:0!important;
  background:#1d1d1d!important;
  z-index:50!important;
}
.bottom .nav{
  position:relative!important;
  flex:1 1 33.333333%!important;
  width:33.333333%!important;
  max-width:33.333333%!important;
  min-width:0!important;
  height:67px!important;
  margin:0!important;
  padding:22px 0 0!important;
  display:block!important;
  text-align:center!important;
  font-size:14px!important;
  line-height:14px!important;
  white-space:nowrap!important;
}
.bottom .nav.active::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:43px!important;
  bottom:auto!important;
  width:14px!important;
  height:2px!important;
  margin:0!important;
  transform:translateX(-50%)!important;
  border-radius:6px!important;
}

/* ---------- EXPLORE / SEARCH HEADER ---------- */
.search-head{
  position:absolute!important;
  top:var(--header-y)!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  height:32px!important;
  padding:0 max(var(--mobile-gutter), env(safe-area-inset-right))
           0 max(var(--mobile-gutter), env(safe-area-inset-left))!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.search-head .back-btn{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:28px!important;
  height:32px!important;
  flex:0 0 28px!important;
}
.search-head .search-box{
  position:relative!important;
  left:auto!important;
  top:auto!important;
  width:auto!important;
  height:32px!important;
  flex:1 1 auto!important;
  min-width:0!important;
}
.catbar{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:calc(var(--header-y) + 48px)!important;
  width:100%!important;
  height:25px!important;
  padding-left:max(var(--mobile-gutter), env(safe-area-inset-left))!important;
  padding-right:max(var(--mobile-gutter), env(safe-area-inset-right))!important;
  display:flex!important;
  gap:16px!important;
  align-items:flex-start!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
.content-scroll{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:calc(var(--header-y) + 73px)!important;
  bottom:calc(var(--bottom-h) + env(safe-area-inset-bottom))!important;
  padding:0 max(var(--mobile-gutter), env(safe-area-inset-right))
           24px max(var(--mobile-gutter), env(safe-area-inset-left))!important;
}

/* Explore cards: responsive columns based only on card width */
.grid3{
  width:100%!important;
  margin:16px 0 30px!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(107px, 1fr))!important;
  gap:10px!important;
}
.card3{
  width:100%!important;
  height:auto!important;
}
.card3 img{
  width:100%!important;
  height:auto!important;
  aspect-ratio:107/142!important;
}

/* ---------- PROFILE ---------- */
/* Top icons follow the same header baseline as other pages */
.profile-cs{
  top:var(--header-y)!important;
  right:calc(max(var(--mobile-gutter), env(safe-area-inset-right)) + 34px)!important;
}
a[href="settings.html"]{
  top:var(--header-y)!important;
  right:max(var(--mobile-gutter), env(safe-area-inset-right))!important;
}

/* Center profile information with fluid width */
#avatarTrigger{
  flex:none!important;
}
.app.gradient > div[style*="left:50%"][style*="top:82px"]{
  top:calc(var(--header-y) + 34px)!important;
  width:min(260px, calc(100% - 80px))!important;
}

/* Profile lower panel uses full viewport width */
.section-panel{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:238px!important;
  width:100%!important;
  height:auto!important;
  bottom:0!important;
  padding:0!important;
}
.profile-tabs{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:20px!important;
  width:100%!important;
  height:22px!important;
  padding:0 18%!important;
  margin:0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:0!important;
}
.profile-tabs .t{
  position:relative!important;
  width:auto!important;
  flex:0 0 auto!important;
  text-align:center!important;
}
.profile-scroll{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:54px!important;
  bottom:calc(var(--bottom-h) + env(safe-area-inset-bottom))!important;
  padding:0 max(var(--mobile-gutter), env(safe-area-inset-right))
           24px max(var(--mobile-gutter), env(safe-area-inset-left))!important;
}
.profile-grid{
  width:100%!important;
  margin:6px 0 24px!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit, minmax(107px, 1fr))!important;
  gap:10px!important;
}

/* Make wide phones actually gain columns without stretching cards too much */
@media (min-width:430px){
  .grid3,
  .profile-grid{
    grid-template-columns:repeat(auto-fit, minmax(112px, 1fr))!important;
  }
}
@media (min-width:520px){
  .grid3,
  .profile-grid{
    grid-template-columns:repeat(auto-fit, minmax(120px, 1fr))!important;
  }
}

/* Keep compact phones clean */
@media (max-width:350px){
  :root{
    --mobile-gutter:12px;
    --header-y:32px;
  }
  .topbar .tabs-viewport{margin:0 9px!important}
  .topbar .tabs{gap:16px!important}
  .grid3,
  .profile-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr))!important;
    gap:8px!important;
  }
}

/* V24 Search page: same 3-column responsive layout as Explore */
.search-grid{
  width:100%!important;
  margin:16px 0 30px!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(107px,1fr))!important;
  gap:10px!important;
}
.search-grid .card3{
  width:100%!important;
  height:auto!important;
  min-width:0!important;
}
.search-grid .card3 img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:107/142!important;
  object-fit:cover!important;
  border-radius:16px!important;
}
.search-grid .card3 .txt{
  width:100%!important;
  height:46px!important;
  padding:8px 4px 0!important;
  overflow:hidden!important;
  font-size:14px!important;
  line-height:18px!important;
}
@media (min-width:430px){
  .search-grid{
    grid-template-columns:repeat(auto-fit,minmax(112px,1fr))!important;
  }
}
@media (min-width:520px){
  .search-grid{
    grid-template-columns:repeat(auto-fit,minmax(120px,1fr))!important;
  }
}
@media (max-width:350px){
  .search-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
}

/* V4 homepage video advertisement */
.ad-slide{cursor:pointer}
.ad-label{
  position:absolute;
  left:max(16px,env(safe-area-inset-left));
  top:calc(var(--header-y,48px) + 46px);
  z-index:24;
  height:24px;
  padding:0 9px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  background:rgba(0,0,0,.58);
  border:1px solid rgba(255,255,255,.32);
  color:#fff;
  font-size:12px;
  line-height:1;
  pointer-events:none;
}
.two-column-mode .grid3{grid-template-columns:repeat(2,minmax(0,1fr))!important}

/* V6 unified back button: login/register now match all secondary pages */
.sub-header .back-btn,.settings-header .back-btn{width:40px!important;height:40px!important;left:12px!important;top:50%!important;transform:translateY(-50%)!important;align-items:center!important;justify-content:center!important;}
.sub-header .back-btn img,.settings-header .back-btn img,.sub-header .back-btn .back,.settings-header .back-btn .back{width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;}

/* V7 unified back button: all second/third/fourth-level pages use the same 44px hit area and 22px chevron. */
.sub-header .back-btn,
.settings-header .back-btn,
.search-head .back-btn,
a.back-btn,
.video-back{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  z-index:90!important;
}
.sub-header .back-btn,
.settings-header .back-btn{left:8px!important;top:50%!important;transform:translateY(-50%)!important;}
a.back-btn img,.video-back img{display:none!important;}
a.back-btn::before,.video-back::before{
  content:"";
  width:14px;
  height:14px;
  border-left:2.2px solid #fff;
  border-bottom:2.2px solid #fff;
  transform:rotate(45deg);
  display:block;
  margin-left:5px;
}
.video-back{left:8px!important;top:36px!important;justify-content:center!important;}

/* V7 avatar modal */
.avatar-modal{position:fixed!important;inset:0!important;display:none!important;align-items:center!important;justify-content:center!important;padding:20px!important;background:rgba(0,0,0,.72)!important;backdrop-filter:blur(8px)!important;z-index:300!important;box-sizing:border-box!important;}
.avatar-modal.show{display:flex!important;}
.avatar-card{width:min(320px,calc(100vw - 40px))!important;background:#17171c!important;border:1px solid rgba(255,255,255,.1)!important;border-radius:22px!important;padding:22px 18px 18px!important;box-shadow:0 20px 70px rgba(0,0,0,.55)!important;box-sizing:border-box!important;}
.avatar-title{text-align:center;font-size:18px;font-weight:600;margin-bottom:20px;color:#fff;}
.avatar-list{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-bottom:20px;}
.avatar-list .default-avatar{width:48px;height:48px;border-radius:50%;border:2px solid transparent;color:#fff;font-size:20px;font-weight:700;cursor:pointer;}
.avatar-upload,.avatar-cancel{width:100%;height:44px;border-radius:12px;border:0;font-size:15px;cursor:pointer;}
.avatar-upload{background:#ff2a70;color:#fff;font-weight:600;margin-bottom:10px;}
.avatar-cancel{background:#26262d;color:#fff;}

/* V8: 全站返回按钮统一。所有 back-btn 本体保持空内容，只由一个伪元素绘制箭头，避免重复图标。 */
a.back-btn{
  width:44px!important;height:44px!important;display:flex!important;align-items:center!important;justify-content:center!important;
  text-decoration:none!important;font-size:0!important;line-height:0!important;overflow:visible!important;
}
a.back-btn::before{
  content:""!important;display:block!important;width:12px!important;height:12px!important;
  border-left:2px solid #fff!important;border-bottom:2px solid #fff!important;
  transform:rotate(45deg)!important;box-sizing:border-box!important;
}
a.back-btn img,a.back-btn svg,a.back-btn .back{display:none!important;}
.sub-header a.back-btn,.settings-header a.back-btn{left:8px!important;top:50%!important;transform:translateY(-50%)!important;}
.search-head a.back-btn{display:flex!important;align-items:center!important;justify-content:center!important;}


/* V8.3: unified customer-service icon on every page that has a back button */
.sub-header,.settings-header,.search-head{position:relative}
.sub-header .header-cs,.settings-header .header-cs,.search-head .header-cs{
  position:absolute!important;right:10px!important;left:auto!important;top:50%!important;
  transform:translateY(-50%)!important;width:44px!important;height:44px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  z-index:90!important;border:0!important;background:transparent!important;
}
.sub-header .header-cs svg,.settings-header .header-cs svg,.search-head .header-cs svg{
  width:24px!important;height:24px!important;display:block!important;
}
.video-cs{
  position:absolute!important;right:12px!important;top:42px!important;width:44px!important;height:44px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;z-index:90!important;
  background:rgba(0,0,0,.18)!important;border-radius:22px!important;backdrop-filter:blur(5px);
}
.video-cs svg{width:24px!important;height:24px!important;display:block!important}

/* V8.6 mobile viewport / iOS safe-area final override */
html,body{width:100%;height:100%;min-height:100%;overflow:hidden;background:#000!important}
body{display:block!important}
.app{position:fixed!important;inset:0!important;width:100%!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-width:none!important;margin:0!important;overflow:hidden!important;background:#000!important}
.home-feed{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior-y:none}
.home-slide{width:100%!important;height:100%!important;min-height:100%!important;max-height:none!important}
.home-slide>.bg{inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important}
/* top controls live inside the video, directly below the real safe area */
.topbar{top:calc(env(safe-area-inset-top) + 10px)!important;height:34px!important;padding-top:0!important;background:transparent!important}
/* make bottom navigation comfortably tappable while preserving the home indicator */
.bottom{bottom:0!important;height:calc(78px + env(safe-area-inset-bottom))!important;min-height:78px!important;padding:0 0 env(safe-area-inset-bottom)!important;align-items:stretch!important}
.bottom .nav{height:78px!important;min-height:78px!important;padding:24px 0 0!important;font-size:15px!important;line-height:18px!important;display:block!important;touch-action:manipulation}
.bottom .nav.active::after{top:49px!important}
.info{bottom:calc(92px + env(safe-area-inset-bottom))!important}
.video-actions{top:50%!important;transform:translateY(-32%)!important}
.sound-hint{top:50%!important}
@supports (-webkit-touch-callout:none){
  .app{height:100svh!important}
  @supports (height:100dvh){.app{height:100dvh!important}}
}

/* V8.8 bottom content safe spacing
   Keep video metadata clearly above the bottom navigation / home indicator. */
.home-slide .info{
  bottom:calc(126px + env(safe-area-inset-bottom))!important;
  max-height:calc(46vh - env(safe-area-inset-bottom))!important;
  overflow:visible!important;
}
/* Detail video pages do not have the home bottom nav, but still need room above
   the iPhone home indicator and browser chrome. */
.video-slide .info{
  bottom:calc(48px + env(safe-area-inset-bottom))!important;
  max-height:46vh!important;
  overflow:visible!important;
}
@media (max-height:700px){
  .home-slide .info{bottom:calc(112px + env(safe-area-inset-bottom))!important}
  .video-slide .info{bottom:calc(36px + env(safe-area-inset-bottom))!important}
}

/* V8.9 auth + explore/search spacing final override */
/* Login / register use a pure black canvas, including the iOS safe area. */
.auth-page{
  background:#000!important;
  padding-top:calc(env(safe-area-inset-top) + 132px)!important;
}
.auth-logo{margin-top:0!important;}
/* Give the category row more breathing room below the search box and
   keep its active underline away from the label. */
.search-head + .catbar,
.catbar{
  top:calc(var(--header-y) + 58px)!important;
  height:38px!important;
  padding-top:6px!important;
  align-items:flex-start!important;
}
.cat{
  height:30px!important;
  line-height:20px!important;
  padding-bottom:10px!important;
  box-sizing:border-box!important;
}
.cat.active::after{bottom:1px!important;}
.content-scroll{
  top:calc(var(--header-y) + 96px)!important;
}

/* V8.10 — glamorous dark glow background for Login / Register / Profile */
.auth-page,
.app.gradient{
  background:
    radial-gradient(72% 46% at 14% 14%, rgba(255,42,112,.22) 0%, rgba(255,42,112,.08) 34%, rgba(255,42,112,0) 72%),
    radial-gradient(62% 48% at 88% 24%, rgba(155,61,255,.18) 0%, rgba(111,36,135,.08) 38%, rgba(78,24,103,0) 72%),
    radial-gradient(72% 54% at 70% 88%, rgba(255,72,142,.14) 0%, rgba(255,72,142,.05) 40%, rgba(255,72,142,0) 74%),
    linear-gradient(180deg,#09080a 0%,#050506 48%,#000 100%) !important;
}

/* Keep the glow soft and elegant rather than turning the whole page pink */
.auth-page{
  isolation:isolate;
}
.auth-page::before,
.auth-page::after{
  content:"";
  position:absolute;
  pointer-events:none;
  z-index:-1;
  border-radius:50%;
  filter:blur(34px);
  opacity:.55;
}
.auth-page::before{
  width:210px;
  height:210px;
  left:-105px;
  top:18%;
  background:rgba(255,42,112,.22);
}
.auth-page::after{
  width:220px;
  height:220px;
  right:-125px;
  top:44%;
  background:rgba(132,59,255,.16);
}

/* Profile keeps readable content surfaces while exposing the new backdrop */
.app.gradient .section-panel{
  background:linear-gradient(180deg,rgba(25,22,26,.82),rgba(13,12,14,.94));
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-top:1px solid rgba(255,255,255,.055);
}

@media (min-height: 840px){
  .auth-page::before{top:20%;}
  .auth-page::after{top:48%;}
}

/* V8.11 — auth glow overflow fix
   The decorative glow circles intentionally extend beyond the viewport.
   When auth-page only had overflow-y:auto, browsers could promote overflow-x
   to auto as well, creating an unwanted horizontal scrollbar / blank strip. */
.auth-page{
  overflow-x:hidden!important;
  overflow-y:auto!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overscroll-behavior-x:none;
  -webkit-overflow-scrolling:touch;
}
.auth-page::before,
.auth-page::after{
  max-width:none!important;
}
html,body{
  overflow-x:hidden!important;
  max-width:100%;
}


/* V8.21 home feed polish */
.home-slide .info{bottom:calc(100px + env(safe-area-inset-bottom))!important;}
.home-slide .episode,.video-slide .episode{font-size:11px!important;line-height:16px!important;}
.creator-link{color:inherit!important;text-decoration:none!important;display:inline-block;position:relative;z-index:30;}
.creator-link:active{opacity:.72;}
.boundary-loader{position:fixed;left:50%;z-index:120;transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:18px;background:rgba(0,0,0,.68);backdrop-filter:blur(8px);color:#fff;font-size:11px;opacity:0;pointer-events:none;transition:opacity .18s ease;}
.boundary-loader.top{top:calc(env(safe-area-inset-top) + 58px);}
.boundary-loader.bottom{bottom:calc(env(safe-area-inset-bottom) + 92px);}
.boundary-loader.show{opacity:1;}
.boundary-loader span{width:13px;height:13px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:v821spin .7s linear infinite;}
@keyframes v821spin{to{transform:rotate(360deg)}}
@media (max-height:700px){.home-slide .info{bottom:calc(100px + env(safe-area-inset-bottom))!important;}}


/* V8.22 — typography + native-feeling pull-to-refresh */
.home-slide .tag,.video-slide .tag{font-size:14px!important;line-height:20px!important;height:auto!important;min-height:20px!important;padding:0 5px!important;}
.home-slide .episode,.video-slide .episode{font-size:14px!important;line-height:20px!important;}
.home-feed{will-change:transform;}
.boundary-loader{transition:opacity .12s ease,transform .12s ease!important;}
.boundary-loader.top{top:calc(env(safe-area-inset-top) + 8px)!important;}
.boundary-loader.bottom{bottom:calc(env(safe-area-inset-bottom) + 86px)!important;}
.boundary-loader.pulling{opacity:.25;}
.boundary-loader.ready{opacity:1!important;}
.boundary-loader.pulling span{animation:none!important;transform:rotate(calc(var(--pull-progress,0) * 300deg));border-top-color:#ff2a70;}
.boundary-loader.loading span,.boundary-loader.show span{animation:v821spin .7s linear infinite!important;border-top-color:#fff;}

/* V8.28 */
.tag-link{color:#fff;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.video-slide .info{bottom:calc(72px + env(safe-area-inset-bottom))!important;}
@supports(height:100dvh){.video-slide{height:100dvh!important}}

/* V8.29 video detail viewport/safe-area final overrides */
.video-feed{height:var(--vvh,100dvh)!important;min-height:0!important}
.video-slide{height:var(--vvh,100dvh)!important;min-height:var(--vvh,100dvh)!important}
.video-slide .info{bottom:max(calc(24px + env(safe-area-inset-bottom)),var(--detail-safe-bottom,24px))!important}

/* V8.51 — unified iPhone/PWA fullscreen geometry
   One viewport model for Home, Explore playback and My/History video detail. */
:root{
  --v851-nav-content-h:67px;
  --v851-player-top:calc(env(safe-area-inset-top) + 18px);
  --v851-player-bottom:calc(env(safe-area-inset-bottom) + 24px);
}
html,body{width:100%!important;height:100%!important;min-height:0!important;margin:0!important;background:#000!important;overflow:hidden!important}
.app{
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100vh!important;
  min-height:0!important;
  margin:0!important;
  background:#000!important;
  overflow:hidden!important;
}
@supports(height:100dvh){.app{height:100dvh!important}}
/* iOS PWA: let the canvas fill the standalone viewport. */
@supports (-webkit-touch-callout:none){
  html,body{height:-webkit-fill-available!important;min-height:-webkit-fill-available!important}
  .app{height:-webkit-fill-available!important}
  @supports(height:100dvh){.app{height:100dvh!important}}
}
.home-feed,.feed-track,.home-slide,.video-feed,.video-slide{max-height:none!important}
/* Bottom nav owns the home-indicator area exactly once (no duplicated spacer). */
.bottom{
  left:0!important;right:0!important;bottom:0!important;width:100%!important;
  height:calc(var(--v851-nav-content-h) + env(safe-area-inset-bottom))!important;
  min-height:0!important;
  padding:0 0 env(safe-area-inset-bottom)!important;
  background:#1d1d1d!important;
  align-items:stretch!important;
}
.bottom .nav{
  height:var(--v851-nav-content-h)!important;min-height:0!important;
  padding:18px 0 0!important;line-height:18px!important;
}
.bottom .nav.active::after{top:45px!important}
/* Home metadata clears only the real nav + safe area. */
.home-slide .info{bottom:calc(var(--v851-nav-content-h) + env(safe-area-inset-bottom) + 24px)!important}
.boundary-loader.bottom{bottom:calc(var(--v851-nav-content-h) + env(safe-area-inset-bottom) + 8px)!important}
/* All detail-style players use exactly the same controls and metadata anchors. */
.video-back,.explore-play-back{
  position:fixed!important;top:var(--v851-player-top)!important;left:max(16px,env(safe-area-inset-left))!important;
  width:44px!important;height:44px!important;z-index:2147483000!important;
}
.video-cs,.explore-play-cs{
  position:fixed!important;top:var(--v851-player-top)!important;right:max(16px,env(safe-area-inset-right))!important;
  width:44px!important;height:44px!important;z-index:2147483000!important;
}
.video-slide .info,body.explore-play-mode .home-slide .info{
  left:max(16px,env(safe-area-inset-left))!important;
  bottom:var(--v851-player-bottom)!important;
  width:min(304px,calc(100% - 72px))!important;
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 112px)!important;
  overflow:hidden!important;
}
.video-slide .video-actions,body.explore-play-mode .home-slide .video-actions{
  right:max(16px,env(safe-area-inset-right))!important;top:50%!important;transform:translateY(-32%)!important;
}
