/* =========================
   AdPanel Black-Gray Theme
   ========================= */
/* 纯黑白灰配色，已去除所有紫色元素 */

:root {
    --primary-100: #4e4e4e;         /* 主灰 */
    --primary-200: #6a6a6a;         /* 次主灰 */
    --primary-300: #bdbdbd;         /* 淡灰 */
    --accent-100: #909090;          /* 点缀灰 */
    --accent-200: #3a3a3a;          /* 深灰 */
    --text-100: #f5f5f5;            /* 主文本白 */
    --text-200: #d6d6d6;            /* 次文本灰 */
    --text-300: #b5b5b5;            /* 更淡文本灰 */
    --bg-100: #141414;              /* 主背景黑 */
    --bg-200: #1b1b1b;              /* 次级背景黑 */
    --bg-300: #252525;              /* 再次级背景黑 */
    --bg-400: #1a1a1a;              /* 分割/边界黑 */
    --header-bg-100: #171717;       /* 头部渐变起点 */
    --header-bg-200: #232323;       /* 头部渐变终点 */
    --color-bg-card: #1b1b1b;       /* 卡片背景 */
    --color-bg-alt: #222222;        /* 备用卡片背景 */
    --color-text-primary: #ededed;  /* 主文本 */
    --color-text-secondary: #b5b5b5;/* 次文本 */
    --color-accent: #909090;        /* 点缀（灰） */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: .15s cubic-bezier(.42,.6,.55,1.0);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.15);
    --shadow-hover: 0 6px 22px rgba(0,0,0,.3);
    font-size: 15px;
    --backtop-size: 50px;
    --backtop-bg: rgba(64,64,64,0.67);
    --backtop-bg-hover: rgba(48,48,48,0.93);
    --backtop-color: #fff;
    --backtop-shadow: 0 4px 16px -2px rgba(0,0,0,.35),0 2px 6px rgba(0,0,0,.25);
    --backtop-radius: 13px;
    --backtop-z: 999;
    --backtop-fade-duration: .32s;
    --backtop-offset-bottom: 200px;
    --backtop-offset-right: 16px;
    --bs-modal-bg: #f3f3f5;
    --tab-active-bg: #ff8a00;  /* 橙色背景 */
    --tab-active-fg: #ffffff;  /* 白色文字 */

}
html {
    overflow-x: hidden;
}
html, body {
    /*overscroll-behavior: none;           !* 禁止向上/向下/左右的边缘越界联动 *!*/
}

body {
    font-family: 'Segoe UI', 'Nunito', 'Avenir', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-100);
    max-width: 768px;
    margin: 0 auto;
    display: block;
    color: var(--text-200);
    letter-spacing: .01em;
    /*-webkit-font-smoothing: antialiased;*/
}

a {
    color: var(--primary-200);
    text-decoration: none;
    transition: color .18s;
}
a:hover { color: var(--accent-100); }

img, video {
    height: auto;
    max-width: 100%;
    border-radius: var(--radius-sm);
    background: var(--bg-200);
}

button, input, select {
    margin: 0;
    font-family: inherit;
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--bg-300);
    color: var(--text-100);
    border: 1px solid var(--bg-400);
}

.hidden{
    display: none !important;
}
.container{
    padding-right: 2px;
    padding-left:  2px;
    overflow-x: hidden;
}

.yt-header {
    background: linear-gradient(90deg, var(--header-bg-100) 0%, var(--header-bg-200) 100%);
    border-bottom: 1.5px solid var(--primary-200);
    color: var(--primary-200);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    padding: 8px 0;
}

.yt-header .logo-mark {
    width: 30px; height: 30px;
    color: var(--primary-100);
    background: #1a1a1a;
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-md);
}
.yt-header .logo-text { letter-spacing: .5px; font-weight: 700; color: var(--primary-300);}
.yt-header .badge-free {
    font-size: 11px; line-height: 1;
    color: var(--accent-100);
    background: #1a1a1a;
    border: 1px solid var(--primary-200);
    border-radius: 6px; padding: 3px 6px;
}

.btn-reset {
    background: none; border: none; padding: 0; color: inherit;
}
.yt-link {
    color: var(--text-200);
    opacity: .98;
    transition: color .18s, opacity .18s;
}
.yt-link:hover, .yt-link:focus {
    color: var(--accent-100);
    opacity: 1;
    text-decoration: underline;
}
.yt-link:focus-visible {
    outline: 2px solid var(--accent-100);
    outline-offset: 2px;
    border-radius: 8px;
}

.badge-dot {
    position: absolute;
    top: -2px; right: -6px;
    width: 9px; height: 9px;
    background: red;
    border: 2px solid var(--bg-100);
    border-radius: 50%;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.col-tight {
    padding-left: 4px;
    padding-right: 4px;
}

.category-block {
    position: relative;
    /*background: var(--color-bg-alt);*/
    /*border-radius: var(--radius-md);*/
    /*box-shadow: var(--shadow-sm);*/
    /*margin-bottom: 20px;*/
    padding: 5px 8px 8px 8px;
}
.category-block-nav {
    position: relative;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 10px;
    padding: 5px 4px 4px 4px;
}
.breadcrumb-item.active {
    color: var(--text-100);
}

.type-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffc107;
    letter-spacing: .02em;
    margin-bottom: 4px;
}

/* =========================
   Social Links
   ========================= */
.social-links a:hover {
    color: var(--primary-200) !important;
    transition: color 0.3s;
}

/* =========================
   Loading Spinner
   ========================= */
.loading {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #232323;
    border-top: 3px solid var(--primary-200);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================
   Video Card Grid
   ========================= */
.video-card {
    border-radius: var(--radius-md);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}
.video-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px) scale(1.03);
    background: var(--color-bg-alt);
}
.video-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.video-figure {
    position: relative;
    margin: 0;
}
.video-thumb {
    width: 100%;
    height: auto;
    max-height: 220px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-200);
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: transform .13s, filter .13s;
}
.video-card:hover .video-thumb {
    transform: scale(1.04);
    filter: brightness(1.11);
}
.video-meta {
    padding: 2px 6px 6px;
}
.video-title {
    margin: 2px 0 4px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.28;
    max-height: 2.6em;
    color: var(--text-200);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    letter-spacing: .01em;
}
.video-title a {
    color: var(--text-200);
}
.video-title-link {
    color: var(--text-200);
    text-decoration: none;
    font-weight: 500;
}
.video-title-link:hover {
    color: var(--primary-100);
    text-decoration: underline;
}

/* 时长角标 */
.duration-badge {
    position: absolute;
    bottom: 7px;
    right: 10px;
    background: var(--accent-100);
    color: var(--text-200);
    font-size: 12px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(2px);
    font-weight: 600;
}

/* =========================
   Load More
   ========================= */
/* css */
.loytpanel-more-card {
    /* 保持居中显示，移除固定小高度以便按钮决定高度 */
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    width: 100%;
    height: auto;
}
/* css */
.loytpanel-more-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 16px);   /* 留出卡片内边距 */
    max-width: 720px;           /* 最大宽度，防止超出窄屏容器 */
    height: 44px;               /* 长条高度，可按需调整 */
    padding: 0 18px;
    gap: 8px;
    background: linear-gradient(90deg, rgba(255,138,0,0.10), rgba(255,138,0,0.06));
    border: 1px solid rgba(255,138,0,0.16);
    color: var(--tab-active-fg);
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;       /* 完整圆角，形成长条 */
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
    position: relative;
    text-align: center;
}

/* 悬停/激活/键盘聚焦效果 */
.loytpanel-more-btn:hover {
    background: linear-gradient(90deg, var(--tab-active-bg), rgba(255,138,0,0.18));
    color: var(--tab-active-fg);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,.28);
    border: none;
}
.loytpanel-more-btn:active {
    transform: translateY(0);
}
.loytpanel-more-btn:focus-visible {
    outline: 3px solid rgba(255,138,0,0.22);
    outline-offset: 4px;
    border-radius: 999px;
}

/* 让按钮内部两行文字变为一行居中（如果需要保留纵向两行可删掉） */
.loytpanel-more-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 1;
    white-space: nowrap;
}

/* 小屏幕微调，确保不至于过大 */
@media (max-width: 420px) {
    .loytpanel-more-btn {
        height: 40px;
        font-size: 14px;
        width: calc(100% - 12px);
        max-width: none;
    }
}

/* =========================
   Back to Top
   ========================= */
.global-backtop {
    position: fixed;
    right: var(--backtop-offset-right);
    bottom: var(--backtop-offset-bottom);
    width: var(--backtop-size);
    height: var(--backtop-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--backtop-bg);
    color: var(--backtop-color);
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: var(--backtop-radius);
    box-shadow: var(--backtop-shadow);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity var(--backtop-fade-duration) ease, transform .25s ease;
    opacity: 0;
    transform: translateY(12px) scale(.91);
    pointer-events: none;
    font: inherit;
}
.global-backtop:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-100), var(--backtop-shadow);
}
.global-backtop:hover {
    background: var(--backtop-bg-hover);
    transform: translateY(0) scale(1.07);
    color: var(--primary-300);
}
.global-backtop.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1.07);
    pointer-events: auto;
}
/* 分类导航 Tabs 与二级分类样式（橙底白字激活），Tabs 等宽自适应铺满 */


/* 一级分类：Bootstrap 5 Tabs */
.category-tabs .nav-tabs {
    border-bottom: 1px solid var(--bg-400, #1a1a1a);
    display: flex;            /* 兜底：确保 flex 布局可用 */
    width: 100%;
}

/* 等宽铺满：Bootstrap 的 nav-justified 已实现，以下为兜底与细节 */
.category-tabs .nav-tabs .nav-item {
    flex: 1 1 0;              /* 等分剩余空间 */
}
.category-tabs .nav-tabs .nav-link {
    width: 100%;              /* 铺满各自网格 */
    text-align: center;
    color: var(--text-200, #d6d6d6);
    background: transparent;
    border: 0;
    border-radius: .5rem .5rem 0 0;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
    overflow: hidden;         /* 过长名称省略 */
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 16px;
}

.category-tabs .nav-tabs .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 138, 0, .12);
}

/* 选中态：橙底白字 */
.category-tabs .nav-tabs .nav-link.active,
.category-tabs .nav-tabs .nav-item.show .nav-link {
    color: var(--tab-active-fg);
    background: var(--tab-active-bg);
    border: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,.18);
}

.category-tabs .nav-tabs .nav-link:focus-visible {
    outline: 2px solid var(--tab-active-bg);
    outline-offset: 2px;
}

/* 面板文本颜色沿用主题 */
.category-tabs .tab-content {
    color: var(--text-200, #d6d6d6);
    width: 100%;
}

/* 二级分类区域 */
.nav_s { display: inline-block; font-size: 15px;width: 100%; }

/* 仅定义一次 nav_flex，布局与 HTML 内联 gap 保持兼容 */
.nav_s .nav_flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 25px;
    width: 100%;
}

/* 二级分类按钮（灰阶基调） */
.nav_s .nav_flex a {
    flex: 0 0 calc(25% - 2px);
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-100, #f5f5f5);
    background: var(--primary-200, #252525);
    border: 1px solid var(--bg-400, #1a1a1a);
    border-radius: 3px;
    padding: 5px 9px;
    font-size: 15px;
    font-weight: 500;
    transition: background .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.nav_s .nav_flex a:hover {
    background: #2f2f2f;
    color: #ffffff;
    border-color: #3a3a3a;
}

/* 二级分类选中态（沿用橙底白字） */
.nav_s .nav_flex .active-tit {
    background: var(--tab-active-bg);
    color: var(--tab-active-fg);
    border-color: var(--tab-active-bg);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* 可选：当一级分类很多时，极窄屏保持等宽但允许文字省略，无需横向滚动 */
@media (max-width: 375px) {
    .category-tabs .nav-tabs .nav-link { font-size: 13px; padding-left: .5rem; padding-right: .5rem; }
}
@media (hover: none) {
    .global-backtop:hover {
        transform: translateY(0) scale(1.01);
    }
}
@media (prefers-reduced-motion: reduce) {
    .global-backtop {
        transition: none;
    }
}
@media (max-width: 640px) {
    :root {
        --backtop-size: 50px;
        --backtop-radius: 50%;
        --backtop-offset-right: 10px;
        --backtop-offset-bottom: 200px;
    }
    body { font-size: 15px; }
}

/* =========================
   Responsive
   ========================= */
@media (min-width: 576px) {
    .video-thumb {
        height: 170px;
    }

}
@media (min-width: 900px) {
    .video-thumb {
        height: 220px;
    }

    .video-title {
        font-size: 17px;
    }
}
@media (hover: none) {
    .video-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    .video-card:hover .video-thumb {
        transform: none;
        filter: none;
    }
}