/* ======================== 基础重置 ======================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
    --bg:#0a0a12;
    --surface:#16162a;
    --surface2:#1e1e38;
    --border:#2a2a4a;
    --accent:#6c5ce7;
    --accent-h:#5a4bd1;
    --text:#f0f0f5;
    --muted:#8888aa;
    --radius:10px;
    --shadow:0 4px 20px rgba(0,0,0,.35);
}

html,body{height:100%}
body{
    background:var(--bg);
    color:var(--text);
    font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans CJK SC",sans-serif;
    line-height:1.6;
    -webkit-font-smoothing:antialiased;
}

/* 滚动条 */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--muted)}

/* ======================== 顶部标签栏 ======================== */
.app{max-width:1200px;margin:0 auto;padding:0 16px 60px}

.tab-bar{
    display:flex;
    gap:4px;
    padding:16px 0;
    position:sticky;
    top:0;
    z-index:100;
    background:linear-gradient(to bottom,var(--bg) 70%,rgba(10,10,18,0));
    margin-bottom:8px;
}

.tab-btn{
    flex:1;
    max-width:200px;
    padding:12px 28px;
    border:none;
    border-radius:var(--radius) var(--radius) 0 0;
    background:var(--surface);
    color:var(--muted);
    font-size:16px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s;
    border-bottom:3px solid transparent;
}
.tab-btn:hover{color:var(--text);background:var(--surface2)}
.tab-btn.active{
    color:var(--text);
    background:var(--surface);
    border-bottom-color:var(--accent);
}

/* ======================= 标签内容区 ======================= */
.tab-content{display:none;animation:fadeIn .3s ease}
.tab-content.active{display:block}

@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* 标签顶部介绍内容 */
.tab-description{
    padding:16px 20px;
    margin-bottom:20px;
    background:var(--surface);
    border-left:4px solid var(--accent);
    border-radius:0 var(--radius) var(--radius) 0;
    font-size:15px;
    line-height:1.7;
    color:var(--text);
    white-space:pre-wrap;
    word-break:break-word;
}

/* ======================== 空状态 ======================== */
.empty-state{
    text-align:center;
    padding:80px 20px;
    color:var(--muted);
}
.empty-state p{font-size:20px;margin-bottom:8px}
.empty-state small{font-size:14px}
.empty-state code{
    background:var(--surface2);
    padding:2px 8px;
    border-radius:4px;
    color:var(--accent);
    font-size:13px;
}

/* ======================== 标签A：视频画廊 ======================== */
.video-player-wrap{
    background:#000;
    border-radius:var(--radius);
    overflow:hidden;
    margin-bottom:24px;
    box-shadow:var(--shadow);
}
.main-player,.split-player{
    display:block;
    width:100%;
    max-height:65vh;
    background:#000;
}
.main-player{aspect-ratio:16/9}

.section-title{
    font-size:18px;
    font-weight:600;
    margin-bottom:16px;
    padding-left:4px;
    color:var(--muted);
}

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

.video-card{
    background:var(--surface);
    border-radius:var(--radius);
    overflow:hidden;
    cursor:pointer;
    transition:transform .2s,box-shadow .2s;
    border:2px solid transparent;
}
.video-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.video-card.playing{border-color:var(--accent)}

.thumb-wrap{
    position:relative;
    aspect-ratio:16/9;
    background:var(--surface2);
    overflow:hidden;
}
.thumb-wrap img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.thumb-placeholder{
    width:100%;
    height:100%;
    background:linear-gradient(135deg,var(--surface2),var(--surface));
}

.play-overlay{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,.25);
    opacity:0;
    transition:opacity .2s;
}
.video-card:hover .play-overlay{opacity:1}
.play-overlay span{
    width:0;height:0;
    border-left:20px solid var(--accent);
    border-top:14px solid transparent;
    border-bottom:14px solid transparent;
    margin-left:6px;
    filter:drop-shadow(0 2px 6px rgba(0,0,0,.5));
}

.video-card-title{
    padding:10px 12px;
    font-size:14px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* ======================== 标签B：左右分栏 ======================== */
.split-layout{
    display:flex;
    gap:24px;
    align-items:flex-start;
}

.split-left{
    flex:1 1 60%;
    min-width:0;
}
.split-left .split-player{
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    aspect-ratio:16/9;
}

.split-playlist{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:16px;
    max-height:300px;
    overflow-y:auto;
}
.playlist-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px;
    border-radius:8px;
    background:var(--surface);
    cursor:pointer;
    transition:background .2s;
}
.playlist-item:hover{background:var(--surface2)}
.playlist-item.active{background:var(--surface2);border-left:3px solid var(--accent)}
.playlist-item img{
    width:80px;
    height:45px;
    object-fit:cover;
    border-radius:4px;
    flex-shrink:0;
}
.playlist-item span{
    font-size:14px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.split-right{
    flex:0 1 35%;
    display:flex;
    flex-direction:column;
    gap:24px;
    padding:24px;
    background:var(--surface);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.text-content{
    font-size:16px;
    line-height:1.8;
    color:var(--text);
    white-space:pre-wrap;
    word-break:break-word;
}

.download-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:14px 32px;
    background:var(--accent);
    color:#fff;
    text-decoration:none;
    border-radius:var(--radius);
    font-size:16px;
    font-weight:600;
    transition:background .2s,transform .15s;
}
.download-btn:hover{background:var(--accent-h);transform:translateY(-2px)}
.download-btn:active{transform:translateY(0)}

/* ======================== 标签C：图片画廊 ======================== */
.image-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
    gap:14px;
}

.image-card{
    aspect-ratio:1;
    border-radius:var(--radius);
    overflow:hidden;
    cursor:pointer;
    background:var(--surface);
    box-shadow:0 2px 10px rgba(0,0,0,.2);
    transition:transform .2s,box-shadow .2s;
}
.image-card:hover{transform:scale(1.04);box-shadow:var(--shadow)}
.image-card img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

/* ======================== 灯箱 ======================== */
.lightbox{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.92);
    z-index:9999;
    align-items:center;
    justify-content:center;
    padding:40px;
    cursor:pointer;
}
.lightbox.open{display:flex;animation:fadeIn .2s}
.lightbox img{
    max-width:90vw;
    max-height:90vh;
    object-fit:contain;
    border-radius:8px;
    box-shadow:0 8px 40px rgba(0,0,0,.6);
}
.lightbox-close{
    position:fixed;
    top:20px;
    right:30px;
    font-size:40px;
    color:#fff;
    cursor:pointer;
    line-height:1;
    user-select:none;
    opacity:.7;
    transition:opacity .2s;
}
.lightbox-close:hover{opacity:1}

/* ======================== 响应式 ======================== */
@media(max-width:768px){
    .split-layout{flex-direction:column}
    .split-right{flex:1}
    .video-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
    .image-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
    .tab-btn{padding:10px 16px;font-size:15px;max-width:none}
}
