* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f1115;
    color: #ffffff;
}

header {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #292d35;
    background: #15181e;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 28px;
}

nav a {
    color: #b8bdc7;
    text-decoration: none;
}

nav a:hover {
    color: #ffffff;
}

.hero {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    margin: 0;
    font-size: 48px;
}

.hero p {
    margin-top: 14px;
    color: #8d94a1;
    font-size: 16px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0f1115;
}

.login-box {
    width: 100%;
    max-width: 380px;
    padding: 36px 32px;
    background: #171a20;
    border: 1px solid #2b3038;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.login-box h1 {
    margin: 0;
    text-align: center;
    font-size: 30px;
}

.login-box p {
    margin: 8px 0 28px;
    text-align: center;
    color: #8f96a3;
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #343a45;
    border-radius: 8px;
    outline: none;
    background: #0f1115;
    color: #ffffff;
    font-size: 14px;
}

.login-box input:focus {
    border-color: #6f7785;
}

.login-box button {
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #111318;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-box button:hover {
    opacity: 0.9;
}

.login-error {
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(255, 90, 90, 0.08);
    color: #ff9292;
    font-size: 13px;
    text-align: center;
}

.login-box form p {
    margin: 0;
    text-align: left;
    color: #c9ced6;
}

.login-box form p label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.login-box form p input {
    margin: 0;
}

.user-name {
    color: #ffffff;
    font-size: 14px;
}

.logout-form {
    margin: 0;
}

.nav-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #b8bdc7;
    font: inherit;
    cursor: pointer;
}

.nav-button:hover {
    color: #ffffff;
}

.content {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0;
}

.page-title {
    margin-bottom: 28px;
}

.page-title h1 {
    margin: 0;
    font-size: 28px;
}

.page-title p {
    margin: 8px 0 0;
    color: #8d94a1;
}

.logo a {
    color: #ffffff;
    text-decoration: none;
}

.bj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.bj-card {
    display: block;
    padding: 22px;
    border: 1px solid #292d35;
    border-radius: 10px;
    background: #15181e;
    color: #ffffff;
    text-decoration: none;
}

.bj-card:hover {
    border-color: #4b525e;
    background: #191d24;
}

.bj-name {
    font-size: 18px;
    font-weight: 700;
}

.bj-count {
    margin-top: 8px;
    color: #8d94a1;
    font-size: 13px;
}

.broadcast-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.broadcast-item {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 20px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid #292d35;
    border-radius: 8px;
    background: #15181e;
}

.broadcast-date {
    color: #9aa1ad;
    font-size: 14px;
}

.broadcast-title {
    font-size: 15px;
    font-weight: 600;
}

.empty-box {
    padding: 30px;
    border: 1px solid #292d35;
    border-radius: 8px;
    color: #8d94a1;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #9aa1ad;
    text-decoration: none;
}

.back-link:hover {
    color: #ffffff;
}

.broadcast-item {
    color: #ffffff;
    text-decoration: none;
}

.broadcast-item:hover {
    border-color: #4b525e;
    background: #191d24;
}

.viewer-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 20px;
}

.video-panel,
.chat-panel {
    min-width: 0;
}

.video-panel h2,
.chat-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.placeholder-box {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #292d35;
    border-radius: 8px;
    background: #15181e;
    color: #8d94a1;
}

@media (max-width: 800px) {
    .viewer-layout {
        grid-template-columns: 1fr;
    }
}

.video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

#youtube-player,
#youtube-player iframe {
    width: 100%;
    height: 100%;
}

.chat-panel {
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-header h2 {
    margin: 0;
}

.chat-header button,
.chat-search button,
.chat-search select,
.chat-search input {
    height: 34px;
    border: 1px solid #343943;
    border-radius: 6px;
    background: #15181e;
    color: #ffffff;
}

.chat-header button,
.chat-search button {
    padding: 0 12px;
    cursor: pointer;
}

.chat-search {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    gap: 6px;
    margin: 12px 0 8px;
}

.chat-search input {
    width: 100%;
    padding: 0 10px;
}

.chat-status {
    min-height: 26px;
    color: #8d94a1;
    font-size: 12px;
}

.chat-list {
    height: 560px;
    overflow-y: auto;
    border: 1px solid #292d35;
    border-radius: 8px;
    background: #11141a;
}

.chat-row {
    padding: 9px 10px;
    border-bottom: 1px solid #22262d;
}

.chat-row:last-child {
    border-bottom: 0;
}

.chat-seekable {
    cursor: pointer;
}

.chat-seekable:hover {
    background: #1a1f27;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
    font-size: 12px;
}

.chat-time {
    color: #747c89;
}

.chat-nickname {
    color: #d8dce3;
    font-weight: 700;
}

.chat-message {
    color: #e4e7eb;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.chat-donation {
    background: #1a1710;
}

.chat-donation-label {
    color: #e7c572;
}

.chat-current {
    outline: 1px solid #8f98a8;
    outline-offset: -1px;
    background: #202630;
}

@media (max-width: 800px) {
    .chat-list {
        height: 460px;
    }
}

.video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

#youtube-player,
#youtube-player iframe {
    width: 100%;
    height: 100%;
}

.chat-panel {
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-header h2 {
    margin: 0;
}

.chat-header button,
.chat-search button,
.chat-search select,
.chat-search input {
    height: 34px;
    border: 1px solid #343943;
    border-radius: 6px;
    background: #15181e;
    color: #ffffff;
}

.chat-header button,
.chat-search button {
    padding: 0 12px;
    cursor: pointer;
}

.chat-search {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    gap: 6px;
    margin: 12px 0 8px;
}

.chat-search input {
    width: 100%;
    padding: 0 10px;
}

.chat-status {
    min-height: 26px;
    color: #8d94a1;
    font-size: 12px;
}

.chat-list {
    height: 560px;
    overflow-y: auto;
    border: 1px solid #292d35;
    border-radius: 8px;
    background: #11141a;
}

.chat-row {
    padding: 9px 10px;
    border-bottom: 1px solid #22262d;
}

.chat-row:last-child {
    border-bottom: 0;
}

.chat-seekable {
    cursor: pointer;
}

.chat-seekable:hover {
    background: #1a1f27;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
    font-size: 12px;
}

.chat-time {
    color: #747c89;
}

.chat-nickname {
    color: #d8dce3;
    font-weight: 700;
}

.chat-message {
    color: #e4e7eb;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.chat-donation {
    background: #1a1710;
}

.chat-donation-label {
    color: #e7c572;
}

.chat-current {
    outline: 1px solid #8f98a8;
    outline-offset: -1px;
    background: #202630;
}

@media (max-width: 800px) {
    .chat-list {
        height: 460px;
    }
}

:root {
    --chat-font-size: 14px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.chat-toolbar button,
.chat-toolbar .download-btn {
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid #343943;
    border-radius: 5px;
    background: #15181e;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.chat-toolbar button:hover,
.chat-toolbar .download-btn:hover {
    background: #20252d;
}

.chat-message {
    font-size: var(--chat-font-size);
}

.chat-nickname {
    font-size: calc(
        var(--chat-font-size) - 1px
    );
}

.chat-donation {
    background: #211b0f;
}

.chat-donation-label {
    color: #f0c95d;
    font-weight: 700;
}

.bookmark-panel[hidden] {
    display: none;
}

.bookmark-panel {
    margin: 8px 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #292d35;
    border-radius: 6px;
    background: #11141a;
}

.bookmark-row {
    display: grid;
    grid-template-columns: 72px 1fr 45px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #252931;
}

.bookmark-row:last-child {
    border-bottom: 0;
}

.bookmark-seek,
.bookmark-delete {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.bookmark-seek {
    color: #fff;
    text-align: left;
    font-weight: 700;
}

.bookmark-delete {
    color: #8d94a1;
}

.bookmark-memo {
    font-size: 12px;
    word-break: break-word;
}

.bookmark-empty {
    padding: 14px;
    color: #8d94a1;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 800px) {

    .chat-toolbar {
        justify-content: flex-start;
    }

    .chat-toolbar button,
    .chat-toolbar .download-btn {
        min-height: 34px;
    }
}

:root {
    --chat-font-size: 14px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: wrap;
}

.chat-toolbar button,
.chat-toolbar .download-btn {
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid #343943;
    border-radius: 5px;
    background: #15181e;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.chat-toolbar button:hover,
.chat-toolbar .download-btn:hover {
    background: #20252d;
}

.chat-message {
    font-size: var(--chat-font-size);
}

.chat-nickname {
    font-size: calc(
        var(--chat-font-size) - 1px
    );
}

.chat-donation {
    background: #211b0f;
}

.chat-donation-label {
    color: #f0c95d;
    font-weight: 700;
}

.bookmark-panel[hidden] {
    display: none;
}

.bookmark-panel {
    margin: 8px 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #292d35;
    border-radius: 6px;
    background: #11141a;
}

.bookmark-row {
    display: grid;
    grid-template-columns: 72px 1fr 45px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #252931;
}

.bookmark-row:last-child {
    border-bottom: 0;
}

.bookmark-seek,
.bookmark-delete {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.bookmark-seek {
    color: #fff;
    text-align: left;
    font-weight: 700;
}

.bookmark-delete {
    color: #8d94a1;
}

.bookmark-memo {
    font-size: 12px;
    word-break: break-word;
}

.bookmark-empty {
    padding: 14px;
    color: #8d94a1;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 800px) {

    .chat-toolbar {
        justify-content: flex-start;
    }

    .chat-toolbar button,
    .chat-toolbar .download-btn {
        min-height: 34px;
    }
}

.chat-message {
    white-space: pre-wrap;
}

/* ===== 재생화면 자동 맞춤 보정 ===== */

.content {
    width: calc(100vw - 48px);
    max-width: none;
    margin: 0 auto;
    padding: 32px 0;
}

.viewer-layout {
    width: 100%;
    grid-template-columns: minmax(0, 3fr) minmax(340px, 1fr);
    gap: 16px;
    align-items: stretch;
}

.video-panel,
.chat-panel {
    min-width: 0;
}

.video-wrap {
    width: 100%;
}

.chat-panel {
    height: auto;
}

.chat-list {
    flex: 1;
    height: auto;
    min-height: 0;
}

/* 일반 채팅에는 강제 줄바꿈 규칙 사용 안 함 */
.chat-message {
    white-space: normal;
    line-height: 1.45;
}

/* 후원랭크에만 줄바꿈 유지 */
.chat-rank .chat-message {
    white-space: pre-line;
    line-height: 1.65;
}

/* 후원랭크 구분 */
.chat-rank {
    background: #171b22;
}

.chat-rank .chat-nickname {
    font-weight: 700;
}

/* 큰 모니터에서 채팅창도 영상 높이에 자연스럽게 맞춤 */
@media (min-width: 801px) {
    .viewer-layout {
        min-height: 0;
    }

    .chat-panel {
        display: flex;
        flex-direction: column;
    }
}

/* 모바일은 기존처럼 세로 배치 */
@media (max-width: 800px) {
    .content {
        width: calc(100vw - 20px);
        padding: 18px 0;
    }

    .viewer-layout {
        grid-template-columns: 1fr;
    }

    .chat-list {
        height: 460px;
    }
}

/* ===== PC 재생화면: 채팅 높이를 영상에 맞춤 ===== */

@media (min-width: 801px) {

    .viewer-layout {
        align-items: start;
    }

    .video-panel,
    .chat-panel {
        min-height: 0;
    }

    .chat-panel {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .chat-list {
        height: auto;
        min-height: 0;
        overflow-y: auto;
    }
}


/* ==================================================
   방송 상세 화면 기능 레이아웃 최종 보정
   ================================================== */

.broadcast-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    color: #a6adba;
    font-size: 14px;
}

.broadcast-meta > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.meta-label {
    width: 68px;
    flex: 0 0 68px;
    color: #737c8b;
    font-size: 12px;
}


/* 영상 아래 도구 */

.video-tools {
    display: flex;
    gap: 7px;
    margin-top: 10px;
}

.video-tools button {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #343943;
    border-radius: 5px;
    background: #15181e;
    color: #fff;
    cursor: pointer;
}

.video-tools button:hover {
    background: #20252d;
}

.video-bookmark-panel {
    margin-top: 7px;
}


/* PC : 영상과 채팅 높이 고정 */

@media (min-width: 801px) {

    .viewer-layout {
        align-items: start !important;
    }

    .chat-panel {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .chat-header,
    .chat-search,
    .chat-status {
        flex: 0 0 auto;
    }

    .chat-list {
        flex: 1 1 auto !important;
        width: 100%;
        height: 0 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
}


/* 모바일은 자체 높이 */

@media (max-width: 800px) {

    .chat-panel {
        height: auto !important;
    }

    .chat-list {
        height: 460px !important;
        min-height: 460px !important;
        overflow-y: auto !important;
    }

    .broadcast-meta > div {
        align-items: flex-start;
    }
}


/* =========================================================
   메인 방송목록 - 모바일 전용 압축
   ========================================================= */

@media (max-width: 800px) {

    /* 상단 헤더 */
    header {
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 12px !important;
        gap: 8px !important;
    }

    /* PH Labs */
    header .logo {
        flex: 0 0 auto !important;
        font-size: 15px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    /* 우측 사용자 메뉴 */
    header nav {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 9px !important;
    }

    /* 아이디 */
    header .user-name {
        min-width: 0 !important;
        max-width: 105px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 11px !important;
        line-height: 1 !important;
    }

    /* 비밀번호 변경 */
    header nav > a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    /* 로그아웃 form */
    header .logout-form {
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* 로그아웃 */
    header .nav-button {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }


    /* 메인 영역 */
    .content {
        width: 100% !important;
        padding: 20px 14px !important;
    }

    /* 방송 기록 */
    .page-title {
        margin-bottom: 22px !important;
    }

    .page-title h1 {
        margin: 0 0 8px !important;
        font-size: 25px !important;
        line-height: 1.15 !important;
    }

    .page-title p {
        margin: 0 !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }


    /* BJ 목록 */
    .bj-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .bj-card {
        min-height: auto !important;
        padding: 18px !important;
        border-radius: 10px !important;
    }

    .bj-name {
        margin-bottom: 8px !important;
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    .bj-count {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
}

/* 모바일 헤더 최종 정렬 */
@media (max-width: 800px) {

    header {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }

    header .logo {
        flex: 0 0 auto !important;
    }

    .mobile-user-area {
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    .mobile-user-name {
        flex: 0 1 auto !important;
        max-width: 150px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    .mobile-my {
        flex: 0 0 auto !important;
    }
}


/* =========================================================
   Home My 메뉴
   ========================================================= */

.mobile-user-area {
    display: none;
}

@media (max-width: 800px) {

    /* PC용 메뉴 숨김 */
    .desktop-user-nav {
        display: none !important;
    }

    header {
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 12px !important;

        display: flex !important;
        align-items: center !important;
    }

    header .logo {
        flex: 0 0 auto !important;
        font-size: 15px !important;
        white-space: nowrap !important;
    }

    /* 닉네임 + My를 오른쪽 끝으로 */
    .mobile-user-area {
        margin-left: auto !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;

        gap: 9px !important;
        min-width: 0 !important;
    }

    .mobile-user-name {
        max-width: 145px !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;

        color: #e5e7eb;
        font-size: 11px !important;
        text-align: right;
    }

    .mobile-my {
        display: block !important;
        position: relative;
        flex: 0 0 auto;
    }

    .my-menu-button {
        height: 29px;
        padding: 0 10px;

        border: 1px solid #3a3f47;
        border-radius: 6px;

        background: #20242a;
        color: #fff;

        font-size: 11px;
        font-weight: 700;

        cursor: pointer;
    }

    .my-menu {
        position: absolute;
        top: calc(100% + 7px);
        right: 0;
        z-index: 9999;

        width: 150px;

        border: 1px solid #343940;
        border-radius: 7px;

        background: #181b20;

        box-shadow: 0 8px 25px rgba(0,0,0,.4);

        overflow: hidden;
    }

    .my-menu[hidden] {
        display: none !important;
    }

    .my-menu a,
    .my-menu form button {
        display: block;
        width: 100%;

        padding: 10px 12px;

        border: 0;
        border-bottom: 1px solid #30343a;

        background: transparent;

        color: #e5e7eb;

        text-align: left;
        text-decoration: none;

        font-size: 12px;

        cursor: pointer;
    }

    .my-menu form {
        margin: 0;
    }

    .my-menu form button {
        border-bottom: 0;
    }
}


/* =========================================================
   PH Labs video-library layout
   PC: fixed BJ sidebar + YouTube-like video cards
   Tablet/Mobile: horizontal BJ chips + responsive cards
   ========================================================= */

.library-page {
    background: #0f1115;
}

.library-page header {
    position: sticky;
    top: 0;
    z-index: 50;
}

.library-shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

.bj-sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 18px 12px 28px;
    border-right: 1px solid #292d35;
    background: #11141a;
}

.sidebar-heading {
    padding: 8px 12px 12px;
    color: #8d94a1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.sidebar-item {
    min-height: 46px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 9px;
    color: #d7dbe2;
    text-decoration: none;
}

.sidebar-item:hover {
    background: #1b1f27;
    color: #fff;
}

.sidebar-item.active {
    background: #242932;
    color: #fff;
    font-weight: 700;
}

.sidebar-icon,
.sidebar-avatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2a303a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-icon {
    background: transparent;
    font-size: 19px;
}

.sidebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.sidebar-count {
    color: #777f8d;
    font-size: 11px;
}

.sidebar-divider {
    height: 1px;
    margin: 10px 8px;
    background: #292d35;
}

.sidebar-empty {
    padding: 12px;
    color: #777f8d;
    font-size: 13px;
}

.video-library {
    min-width: 0;
    padding: 34px 34px 60px;
}

.library-title-row {
    margin-bottom: 24px;
}

.library-title-row h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
}

.library-title-row p {
    margin: 7px 0 0;
    color: #8d94a1;
    font-size: 13px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 18px;
}

.video-card {
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 11px;
    background: #191d24;
}

.video-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.015);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f7785;
    font-size: 18px;
    font-weight: 700;
}

.video-card-info {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding-top: 11px;
}

.video-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #252b35;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.video-meta {
    min-width: 0;
}

.video-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 39px;
    color: #f2f4f7;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.video-bj,
.video-date {
    margin-top: 5px;
    color: #8d94a1;
    font-size: 12px;
    line-height: 1.25;
}

.video-date {
    margin-top: 3px;
}

.video-grid-empty {
    grid-column: 1 / -1;
}

.mobile-bj-strip {
    display: none;
}

@media (max-width: 1500px) {
    .video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1120px) {
    .library-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .video-library {
        padding-left: 24px;
        padding-right: 24px;
    }

    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .library-shell {
        display: block;
    }

    .bj-sidebar {
        display: none;
    }

    .video-library {
        padding: 18px 16px 44px;
    }

    .mobile-bj-strip {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin: 0 -16px 22px;
        padding: 0 16px 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-bj-strip::-webkit-scrollbar {
        display: none;
    }

    .mobile-bj-chip {
        flex: 0 0 auto;
        padding: 8px 13px;
        border: 1px solid #303641;
        border-radius: 9px;
        background: #191d24;
        color: #d5d9e0;
        font-size: 13px;
        text-decoration: none;
        white-space: nowrap;
    }

    .mobile-bj-chip.active {
        border-color: #e6e8ec;
        background: #e6e8ec;
        color: #111318;
        font-weight: 700;
    }

    .library-title-row {
        margin-bottom: 18px;
    }

    .library-title-row h1 {
        font-size: 22px;
    }

    .video-grid {
        gap: 24px 14px;
    }
}

@media (max-width: 580px) {
    .video-library {
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-bj-strip {
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .video-thumb {
        border-radius: 9px;
    }

    .video-card-info {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
    }

    .video-avatar {
        width: 34px;
        height: 34px;
    }

    .video-title {
        min-height: 0;
        font-size: 15px;
    }
}
