/* ========== 视频播放页 ========== */
#videoPage { position:relative; width:100%; height:100%; overflow:hidden; }
.video-list { height:100%; transition:transform .3s cubic-bezier(0.2,0,0,1); will-change:transform; }
.video-item { 
    width:100%; 
    height:100vh; 
    position:absolute; 
    left:0; 
    background:#000; 
    display:flex; 
    align-items:center; 
    justify-content:center; 
}
.video-player { 
    width:100%; 
    height:100%; 
    object-fit:contain;
    background:#000; 
}
.video-overlay { position:absolute; top:0; left:0; right:0; bottom:0; background:transparent; z-index:5; }
.loading { position:absolute; top:50%; left:50%; width:40px; height:40px; border-radius:50%; border:3px solid rgba(255,255,255,.3); border-top-color:#fff; animation:spin .8s infinite; transform:translate(-50%,-50%); display:none; z-index:9; }
.loading.show { display:block; }
@keyframes spin { to { transform:translate(-50%,-50%) rotate(360deg); } }

.heart { position:absolute; top:50%; left:50%; font-size:80px; color:#ff3355; opacity:0; transform:translate(-50%,-50%) scale(0.5); pointer-events:none; transition:all .25s; z-index:20; }
.heart.show { opacity:1; transform:translate(-50%,-50%) scale(1.2); }

/* ========== 进度条 ========== */
.progress-wrap { 
    position:absolute; 
    left:0; 
    right:0; 
    bottom:64px; 
    height:3px; 
    background:rgba(255,255,255,.15); 
    margin:0 20px; 
    z-index:10; 
    border-radius:10px; 
    overflow:hidden; 
}
.buffer-bar { position:absolute; left:0; top:0; height:100%; background:rgba(255,255,255,.4); width:0; border-radius:10px; }
.play-bar { position:absolute; left:0; top:0; height:100%; background:#ff3355; width:0; border-radius:10px; z-index:2; }

/* ========== 信息区域 ========== */
.info-box {
    position: absolute;
    left: 16px;
    bottom: 90px;
    color: #fff;
    z-index: 10;
    width: 70%;
    text-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    position: relative;
}

.at-text {
    font-size: 16px;
    flex-shrink: 0;
}

.at-text a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.inline-fullscreen-btn {
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.inline-fullscreen-btn:hover {
    background: rgba(20, 20, 20, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
}

.inline-fullscreen-btn:active {
    transform: scale(0.95);
}

.inline-fullscreen-btn .fullscreen-icon {
    font-size: 15px;
    line-height: 1;
}

.inline-fullscreen-btn .fullscreen-text {
    font-size: 13px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tags span {
    background: rgba(20,20,20,.3);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ========== 视频描述 ========== */
.video-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: none;
    max-width: 100%;
    word-break: break-word;
    font-weight: 400;
}

/* ========== 在线人数和观看次数 ========== */
.video-views {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ========== 工具栏 ========== */
.toolbar { 
    position:absolute; 
    right:16px; 
    bottom:70px; 
    z-index:10; 
    display:flex; 
    flex-direction:column; 
    gap:12px; 
}
.tool { 
    width:52px; 
    min-height:52px; 
    border-radius:30px; 
    background:rgba(20,20,20,.45); 
    backdrop-filter:blur(4px); 
    display:flex; 
    flex-direction:column; 
    align-items:center; 
    justify-content:center; 
    color:#fff; 
    border:none; 
    box-shadow:0 4px 8px rgba(0,0,0,.2); 
    transition:transform .1s, background .2s; 
    cursor:pointer; 
    padding:6px 0; 
}
.tool:active { transform:scale(0.92); }

.user-avatar-tool {
    width: 52px;
    min-height: 52px;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible;
    border: 2px solid rgba(255,255,255,0.3) !important;
    margin-bottom: 8px;
    position: relative;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.like-tool .tool-icon, .collect-tool .tool-icon { font-size:22px; line-height:1; }
.tool-count { font-size:11px; font-weight:600; margin-top:2px; color:#ddd; }
#likeBtn.active .tool-icon { color:#ff3355; }
#collectBtn.active .tool-icon { color:#ffcc00; }
#commentBtn { font-size:20px; }
#commentBtn .tool-count { margin-top: 0; line-height: 1; }
#shareBtn { font-size:22px; }
#soundBtn, #playSettingsBtn { font-size:20px; }

.user-video-thumb:hover {
    opacity: 0.8;
    transform: scale(1.02);
    transition: all 0.2s;
}

/* ========== 关注加号按钮（居中底部） ========== */
.follow-plus {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    background: #ff3355;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    border: 2px solid #000;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}
.follow-plus.show {
    opacity: 1;
    pointer-events: auto;
}
.follow-plus.followed {
    background: #22c55e;
}
.follow-plus.animating {
    transform: translateX(-50%) scale(1.4);
}

/* ========== 全屏时UI调整 ========== */
#videoPage:fullscreen .info-box { display: none !important; }
#videoPage:fullscreen .nav,
#videoPage:fullscreen .toolbar .tool:not(#playSettingsBtn):not(#soundBtn) { display: none !important; }
#videoPage:fullscreen .play-settings-panel { z-index: 250 !important; }
#videoPage:fullscreen .progress-wrap { bottom: 20px; }
#videoPage:fullscreen .toolbar { bottom: 30px; right: 16px; }

#videoPage:-webkit-full-screen .info-box { display: none !important; }
#videoPage:-webkit-full-screen .nav,
#videoPage:-webkit-full-screen .toolbar .tool:not(#playSettingsBtn):not(#soundBtn) { display: none !important; }
#videoPage:-webkit-full-screen .play-settings-panel { z-index: 250 !important; }
#videoPage:-webkit-full-screen .progress-wrap { bottom: 20px; }
#videoPage:-webkit-full-screen .toolbar { bottom: 30px; }

/* ========== 底部导航栏 ========== */
.nav { 
    position:fixed; 
    bottom:0; 
    left:0; 
    right:0; 
    height:56px; 
    background:#0f0f0f; 
    display:flex; 
    align-items:center; 
    justify-content:space-around; 
    color:#aaa; 
    z-index:30; 
    border-top:1px solid #222; 
}
.nav .item { flex:1; text-align:center; font-size:15px; padding:8px 0; cursor:pointer; transition:color .2s; display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; }
.nav .item.active { color:#fff; font-weight:500; }
.nav .item i { display:block; font-size:20px; margin-bottom:2px; }
.nav .item span { font-size:12px; white-space:nowrap; }
.nav .item.item-plus i { font-size:26px; margin-bottom:0; }

/* ========== 响应式调整 ========== */
@media (max-width: 480px) {
    .tool { width: 48px; min-height: 48px; }
    .tool-count { font-size: 10px; }
    .toolbar { right: 12px; bottom: 62px; }
    .info-box { left: 12px; bottom: 78px; }
    .progress-wrap { bottom: 58px; }
    .inline-fullscreen-btn {
        padding: 3px 10px;
    }
    .inline-fullscreen-btn .fullscreen-icon {
        font-size: 14px;
    }
    .inline-fullscreen-btn .fullscreen-text {
        font-size: 12px;
    }
    .video-desc {
        font-size: 13px;
        margin-top: 6px;
    }
    .user-avatar-tool {
        width: 48px;
        min-height: 48px;
    }
    .video-views {
        font-size: 11px;
        gap: 12px;
    }
    .follow-plus {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* ==================== 左上角接口按钮 ==================== */
.api-menu-btn {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 16px;
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 25;
    padding: 4px 3px;
    border-radius: 8px;
    transition: background 0.2s;
}
.api-menu-btn:active { background: rgba(255,255,255,0.12); }
.api-menu-btn span {
    display: block;
    height: 3px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    transition: all 0.25s;
}
.api-menu-btn span:nth-child(1) { width: 20px; }
.api-menu-btn span:nth-child(2) { width: 28px; }
.api-menu-btn span:nth-child(3) { width: 20px; }
.api-menu-btn:hover span { background: #ff3355; }

/* ==================== 接口列表面板 ==================== */
.api-list-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: none;
}
.api-list-panel.show { display: block; }

.api-panel-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    animation: apiFadeIn 0.2s ease;
}
@keyframes apiFadeIn { from { opacity: 0; } to { opacity: 1; } }

.api-panel-body {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 82%;
    max-width: 360px;
    background: #15151f;
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    animation: apiSlideIn 0.25s ease;
}
@keyframes apiSlideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.api-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #2a2a3e;
    flex-shrink: 0;
}
.api-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.api-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.api-panel-close:hover { color: #ff3355; }

.api-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.api-loading, .api-empty {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 14px;
}

.api-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.api-item:active { background: rgba(255,255,255,0.04); }

.api-item-index {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(79,70,229,0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.api-item-info {
    flex: 1;
    min-width: 0;
}
.api-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.api-item-url {
    font-size: 11px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.api-item-url .api-url-hidden {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-style: normal;
    line-height: 1.6;
}

.api-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}
.api-priority-badge {
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(79,70,229,0.2);
    border: 1px solid rgba(79,70,229,0.35);
    color: #a5b4fc;
    border-radius: 8px;
    font-weight: 700;
}
.api-last-check {
    font-size: 10px;
    color: #6b7280;
}

.api-item-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.api-item-status.online { color: #22c55e; }
.api-item-status.offline { color: #ef4444; }

.api-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-online  { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.6); }
.dot-offline { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.6); }

.api-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #2a2a3e;
    font-size: 12px;
    color: #6b7280;
    flex-shrink: 0;
    text-align: center;
}
.api-panel-tip::before { content: 'ⓘ '; }

/* 浅色模式 */
body.light-mode .api-menu-btn span { background: #333; }
body.light-mode .api-menu-btn:hover span { background: #ff3355; }
body.light-mode .api-panel-body {
    background: #ffffff;
    color: #333;
}
body.light-mode .api-panel-header { border-bottom-color: #e5e7eb; }
body.light-mode .api-panel-title { color: #111; }
body.light-mode .api-panel-close { color: #999; }
body.light-mode .api-item { border-bottom-color: #f0f0f0; }
body.light-mode .api-item-name { color: #222; }
body.light-mode .api-item-url { color: #9ca3af; }
body.light-mode .api-item-url .api-url-hidden {
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
}
body.light-mode .api-priority-badge {
    background: rgba(79,70,229,0.1);
    border-color: rgba(79,70,229,0.25);
    color: #4f46e5;
}
body.light-mode .api-last-check { color: #9ca3af; }
body.light-mode .api-item-status.online { color: #16a34a; }
body.light-mode .api-item-status.offline { color: #dc2626; }
body.light-mode .api-panel-footer {
    border-top-color: #e5e7eb;
    color: #9ca3af;
}
body.light-mode .api-loading, body.light-mode .api-empty { color: #999; }