.container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
}
@media (min-width: 640px) { .container { padding: 0 var(--sp-6); } }
@media (min-width: 1024px) { .container { padding: 0 var(--sp-8); } }

.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    background: var(--chrome);
    border-bottom: 1px solid var(--hairline);
box-shadow: inset 0 -2px 0 var(--brand);
}
.header-inner {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
    height: var(--header-h);
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-4);
 min-width: 0;
}
.header-left { display: flex; align-items: center; gap: var(--sp-6); min-width: 0; }
.header-center { min-width: 0; display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: var(--sp-2); }

.logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
.logo-img {
    display: block;
    height: 38px;
    width: auto;
    max-width: min(220px, 52vw);
    object-fit: contain;
}
[data-theme="light"] .logo-img {
    filter: invert(1) hue-rotate(180deg);
}
.footer-logo .logo-img {
    height: 42px;
    max-width: min(240px, 70vw);
    margin: 0 auto;
}

.nav-desktop { display: none; }
@media (min-width: 1024px) {
    .nav-desktop { display: flex; align-items: center; gap: 2px; }
}
.nav-link {
    padding: 0.45rem 0.85rem;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.nav-link:hover { color: var(--text-primary); background: var(--surface-3); }
.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--brand);
    background: transparent;
    font-weight: 700;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 560px;
    display: none;
}
@media (min-width: 900px) { .search-form { display: flex; } }
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    outline: none;
}
.search-input:focus { border-color: var(--brand); }

.mobile-only { display: flex; }
.desktop-only { display: none !important; }
@media (min-width: 900px) {
    .mobile-only { display: none !important; }
    .desktop-only { display: flex !important; }
    .desktop-only[hidden] { display: none !important; }
}

.mobile-search-overlay {
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--surface-0) 88%, transparent);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    z-index: 2000;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    animation: sheet-fade 0.22s var(--ease-out);
}
.mobile-search-overlay.hidden { display: none; }
.mobile-search-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.9rem;
    font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em;
}
.mobile-search-form { position: relative; }
.mobile-search-form i {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
}
.mobile-search-form input {
    width: 100%;
    min-height: 48px;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border-radius: 14px;
    border: 1px solid var(--hairline);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}
.mobile-search-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-subtle); }
#mobile-search-results {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.75rem;
    padding-bottom: 0.5rem;
}

.mobile-menu-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2050;
    opacity: 1;
    transition: opacity 0.28s var(--ease-out);
}
.mobile-menu-overlay.hidden { display: none; }
.mobile-menu {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(320px, 88vw);
    background: color-mix(in srgb, var(--surface-1) 92%, transparent);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-right: 1px solid var(--hairline);
    z-index: 2100;
    transform: translateX(-100%);
    transition: transform 0.34s var(--ease-spring);
    padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 0.85rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.45);
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 0.55rem 0.95rem 0.85rem;
    margin: 0 0.15rem 0.85rem;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    font-weight: 700;
}
.mobile-menu-user > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mobile-menu-close { margin-left: auto; width: 40px; height: 40px; }
.mobile-nav-link {
    display: flex; align-items: center; gap: 0.9rem;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.mobile-nav-link[hidden] { display: none !important; }
.mobile-nav-link:hover,
.mobile-nav-link[aria-current="page"],
.mobile-nav-link.active {
    color: var(--text-primary);
    background: var(--surface-3);
}
.mobile-nav-link.active i { color: var(--brand); }
.mobile-nav-link i { width: 1.4rem; text-align: center; color: var(--text-muted); }
.mobile-nav-link.logout { color: var(--danger); }

.main-content {
    flex-grow: 1;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + var(--sp-4));
    padding-bottom: var(--sp-8);
}
@media (max-width: 899px) {
    .header {
        background: var(--chrome-glass);
        backdrop-filter: var(--glass);
        -webkit-backdrop-filter: var(--glass);
        border-bottom-width: 1.5px;
    }
    .main-content {
        display: block;
        overflow: visible;
        height: auto;
        min-height: 0;
        padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 0.55rem);
        padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
    }
    #site-chrome {
        display: block;
        overflow: visible;
        height: auto;
        min-height: 0;
        flex: none;
    }
    body.watch-mode .mobile-tabbar { display: none; }
    body.watch-mode .main-content {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
    html.kb-open .mobile-tabbar {
        transform: translateY(110%);
        pointer-events: none;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    body.watch-mode .header,
    body.watch-mode .mobile-tabbar,
    body.watch-mode .footer { display: none !important; }
    body.watch-mode .main-content {
        padding: 0;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }
    body.watch-mode .watch-section,
    body.watch-mode .container { padding: 0; max-width: none; }
    body.watch-mode .watch-layout { gap: 0; }
    body.watch-mode .player-wrapper {
        margin: 0;
        width: 100%;
        border-radius: 0;
        aspect-ratio: auto;
        height: 100dvh;
        max-height: 100dvh;
    }
    body.watch-mode .video-info,
    body.watch-mode .related-area { display: none; }
}

.mobile-tabbar {
    display: none;
}
@media (max-width: 899px) {
    .mobile-tabbar {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1200;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--chrome-glass);
        backdrop-filter: var(--glass);
        -webkit-backdrop-filter: var(--glass);
        border-top: 1px solid var(--hairline);
        transition: transform 0.28s var(--ease-out);
        user-select: none;
        -webkit-user-select: none;
    }
    .tabbar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-muted);
        font-size: 0.62rem;
 font-weight: 700;
 letter-spacing: 0;
 min-height: var(--tabbar-h);
 min-width: 0;
 padding: 0 1px;
 position: relative;
 overflow: visible;
 }
 .tabbar-item span { display: block; max-width: 100%; line-height: 1.1; }
 .tabbar-item i { font-size: 1.12rem; transition: transform 0.22s var(--ease-spring); }
    .tabbar-item.active { color: var(--brand); }
    .tabbar-item.active i { transform: translateY(-1px) scale(1.08); }
    .tabbar-item.active::before {
        content: "";
        position: absolute;
        top: 6px;
        width: 18px;
        height: 3px;
        border-radius: 99px;
        background: var(--brand);
    }
    .tabbar-item:active i { transform: scale(0.9); }
}

.content-section { padding: var(--sp-4) 0; overflow: visible; }
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-6);
}
.section-header.sticky-filters {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 40;
    overflow: visible;
    background: color-mix(in srgb, var(--surface-0) 94%, transparent);
    backdrop-filter: blur(10px);
    margin-left: calc(var(--sp-4) * -1);
    margin-right: calc(var(--sp-4) * -1);
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
}
.section-title-area { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.section-title {
    font-size: var(--fs-xl);
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    letter-spacing: -0.03em;
}
.section-title i { color: var(--brand); font-size: 1.05rem; }

.video-grid,
.video-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px 16px;
}
.video-grid.is-loading,
.video-masonry.is-loading,
.gallery-grid.is-loading,
.gallery-masonry.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
@media (max-width: 640px) {
    .video-grid,
    .video-masonry { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
}

.gallery-grid,
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
@media (max-width: 640px) {
    .gallery-grid,
    .gallery-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.feed-shell {
    display: grid;
    grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
    gap: var(--sp-8);
    align-items: start;
}
.feed-rail {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 14px);
}
.rail-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.68rem;
    color: var(--brand);
    font-weight: 800;
    margin-bottom: 0.45rem;
}
.rail-block .section-title { margin-bottom: 0.7rem; }
.rail-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.rail-filters { flex-direction: column; align-items: stretch; }
.rail-filters .filter-btn { width: 100%; justify-content: space-between; }
.rail-filters .dropdown { width: 100%; }
.rail-filters .dropdown-menu { left: 0; right: 0; min-width: 0; }
.search-hero {
    padding: 0.4rem 0 1.4rem;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--border);
}
.search-hero .section-title { font-size: var(--fs-2xl); margin-bottom: 0.55rem; }
.search-jump { display: flex; gap: 0.45rem; margin-top: 0.85rem; }
.search-split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
    gap: var(--sp-8);
    align-items: start;
}
.search-col .section-header {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    z-index: 20;
    background: color-mix(in srgb, var(--surface-0) 92%, transparent);
    backdrop-filter: blur(10px);
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
}
.search-col.photos .gallery-masonry {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 6px;
}
.search-col .pagination { margin-top: 1.05rem; }
.search-col.photos .pagination { margin-top: 0.8rem; }
@media (max-width: 980px) {
    .feed-shell,
    .search-split { grid-template-columns: 1fr; }
    .feed-rail { position: static; }
    .rail-filters { flex-direction: row; }
    .rail-filters .filter-btn { width: auto; }
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-4);
}

.watch-section { padding: 0.5rem 0 var(--sp-8); }
.watch-layout { display: flex; flex-direction: column; gap: var(--sp-6); }
.player-area { min-width: 0; }
.related-area { width: 100%; min-width: 0; }

.footer {
    border-top: 1px solid var(--border);
    padding: var(--sp-8) 0 var(--sp-6);
    margin-top: auto;
}
@media (max-width: 899px) {
    .footer { padding-bottom: calc(var(--sp-6) + 8px); }
}
.footer-inner {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-4);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-xs);
}
.footer-logo { display: inline-flex; line-height: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.1rem; font-size: 0.8rem; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--brand); }

@media (max-width: 899px) {
    .header-inner {
 padding: 0 0.4rem 0 0.65rem;
 gap: 0.2rem;
 grid-template-columns: minmax(0, 1fr) auto;
 }
 .header-center { display: none; }
 .logo { min-width: 0; }
 .header-right { gap: 2px; flex-shrink: 0; }
 .header-right .icon-btn,
 .header-right .mobile-only { width: 44px; height: 44px; display: flex !important; }
    .logo-img { height: 30px; max-width: min(148px, 42vw); }
    .content-section { padding: 0.35rem 0; }
    .section-header {
        gap: 0.55rem;
        padding-bottom: 0.7rem;
        margin-bottom: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }
    .section-header.sticky-filters {
        margin-left: calc(-0.75rem - env(safe-area-inset-left, 0px));
        margin-right: calc(-0.75rem - env(safe-area-inset-right, 0px));
        padding: 0.55rem 0.75rem 0.65rem;
        background: var(--chrome);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom-color: var(--hairline);
    }
    .section-title { font-size: 1.15rem; }
    .video-grid, .video-masonry { grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
    .gallery-grid, .gallery-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .models-grid { grid-template-columns: 1fr; gap: 0.55rem; }
    .related-title { font-size: 0.92rem; margin: 0.2rem 0 0.7rem; padding-bottom: 0.5rem; }
    .related-scroller {
        margin: 0 -0.75rem;
        padding: 0 0.75rem 0.4rem;
        scrollbar-width: none;
        touch-action: pan-x pan-y;
    }
    .related-scroller::-webkit-scrollbar { display: none; }
    .related-list { gap: 0.65rem; }
    .related-card {
        flex: 0 0 68vw;
        width: 68vw;
        min-width: 68vw;
        max-width: none;
        gap: 0.4rem;
    }
    .related-thumb { border-radius: 10px; }
    .watch-section { padding: 0 0 0.5rem; }
    .watch-layout { gap: 0.85rem; }
    .player-wrapper {
        border-radius: 0;
        margin-left: calc(-0.75rem - env(safe-area-inset-left, 0px));
        margin-right: calc(-0.75rem - env(safe-area-inset-right, 0px));
        width: calc(100% + 1.5rem + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
    }
    .container { padding: 0 0.75rem; }
    .footer { display: none; }
    .video-info { padding: 0.85rem 0 0.4rem; }
    .video-title { font-size: 1.05rem; margin-bottom: 0.45rem; }
    .video-meta { gap: 0.65rem; }
}

body.shorts-mode {
    overflow: hidden;
    height: 100dvh;
    overscroll-behavior: none;
}
body.shorts-mode .bg-glow { display: none; }
html:has(body.shorts-mode) {
    overflow: hidden;
    height: 100dvh;
    overscroll-behavior: none;
}
body.shorts-mode {
    display: flex;
    flex-direction: column;
}
body.shorts-mode #site-chrome {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    overflow: hidden;
    flex: 1;
}
body.shorts-mode .header {
    background: #000;
    border-bottom-color: transparent;
}
body.shorts-mode .footer { display: none !important; }
body.shorts-mode .main-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}
@media (max-width: 899px) {
    body.shorts-mode .header { display: none !important; }
    body.shorts-mode .main-content {
        padding-top: 0;
        padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    }
    body.shorts-mode .mobile-tabbar {
        background: #000;
        border-top-color: rgba(255, 255, 255, 0.08);
    }
}
body.shorts-sheet-on { overflow: hidden; }
@media (max-width: 899px) {
    body.shorts-sheet-on .mobile-tabbar {
        transform: translateY(110%);
        pointer-events: none;
    }
}

.shorts-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
    width: 100%;
    background: #000;
    display: flex;
    justify-content: center;
}
.shorts-top {
    display: none;
}
@media (max-width: 899px) {
    .shorts-top {
        display: block;
        position: absolute;
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: 14px;
        z-index: 4;
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: #fff;
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
        pointer-events: none;
    }
}
.shorts-feed {
    height: 100%;
    min-height: 0;
    width: 100%;
    max-width: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #000;
    touch-action: pan-y;
}
.shorts-feed::-webkit-scrollbar { display: none; }
.short-slide {
    position: relative;
    height: 100%;
    min-height: 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #000;
    overflow: hidden;
}
@media (max-width: 899px) {
    .shorts-feed,
    .short-slide {
        height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom, 0px));
        min-height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom, 0px));
    }
}
.short-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}
.short-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 18%, transparent 58%, rgba(0, 0, 0, 0.78) 100%);
}
.short-meta {
    position: absolute;
    left: 14px;
    right: 72px;
    bottom: 18px;
    z-index: 2;
    pointer-events: none;
}
.short-chan {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.short-title {
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.short-rail {
    position: absolute;
    right: 8px;
    bottom: 72px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.short-act {
    width: 48px;
    min-height: 48px;
    border: 0;
    background: transparent;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    font: inherit;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.short-act i { font-size: 1.35rem; }
.short-act span {
    font-size: 0.68rem;
    font-weight: 700;
    min-height: 0.9em;
}
.short-loading {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.6rem;
    font-size: 0.92rem;
}
@media (min-width: 900px) {
    .shorts-stage { padding: 12px 0; }
    .shorts-feed,
    .short-slide {
        max-width: 420px;
        height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px) - 24px);
        min-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px) - 24px);
        border-radius: 18px;
    }
    .shorts-feed { box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45); }
}
