/**
 * ==========================================
 * style.css - 核心样式文件（升级版 v5）
 * 左侧导航 + 连续滚动 + 视频导航 + Monaco Editor
 * Style 0: 经典图标网格
 * Style 2: 缤纷模式（列表详情 + 用户自定义背景色）
 * ==========================================
 */

/* ==================== CSS 变量定义 ==================== */
:root {
    /* 毛玻璃效果颜色 */
    --glass: rgba(255, 255, 255, 0.15);
    --glass-hover: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* 文字颜色 */
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.85);

    /* 主题色 */
    --primary: #399dff;

    /* 圆角与尺寸 */
    --radius: 15px;
    --card-w: 85px;
    --card-h: 85px;

    /* 背景遮罩透明度 */
    --bg-overlay-opacity: 0.4;

    /* 网站卡片图标尺寸 */
    --icon-size: 32px;
    --emoji-size: 32px;

    /* 侧边栏尺寸 */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
}

/* ==================== 亮色模式 ==================== */
body.light-theme {
    --glass: rgba(255, 255, 255, 0.55);
    --glass-hover: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.07);
    --text: #2c3e50;
    --text-dim: rgba(44, 62, 80, 0.7);
    --bg-overlay-opacity: 0.25;
}

body.light-theme {
    background-color: #eef1f5;
}

body.light-theme::before {
    background: rgba(240, 243, 248, var(--bg-overlay-opacity));
}

body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .sidebar-nav-item {
    color: #5a6a7a;
}

body.light-theme .sidebar-nav-item.active {
    background: var(--primary);
    color: white;
}

body.light-theme .sidebar-nav-item:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .tab-btn {
    color: #3d4f5f;
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.5);
}

body.light-theme .tab-btn.active {
    background: var(--primary);
    color: white;
}

body.light-theme .card {
    background: rgba(255, 255, 255, 0.55);
}

body.light-theme .card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 12px rgba(57, 157, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-theme .card h3 {
    color: #3d4f5f;
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme input,
body.light-theme select {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: #3d4f5f;
}

body.light-theme .admin-actions {
    background: rgba(255, 255, 255, 0.85);
}

body.light-theme .batch-actions-bar {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .batch-btn.delete {
    background: rgba(231, 76, 60, 0.85);
}

body.light-theme .batch-btn.move {
    background: rgba(57, 157, 255, 0.85);
}

body.light-theme .sidebar-header {
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .sidebar-footer {
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .category-section-title {
    color: #3d4f5f;
}

body.light-theme .sidebar-toggle {
    background: rgba(255, 255, 255, 0.8);
    color: #3d4f5f;
}

body.light-theme .video-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .video-card .video-card-title {
    color: #3d4f5f;
}

body.light-theme .video-card .video-card-desc {
    color: #8a9aaa;
}

body.light-theme .video-modal-content {
    background: rgba(245, 247, 250, 0.98);
}

body.light-theme .video-info h3 {
    color: #3d4f5f;
}

body.light-theme .video-info p {
    color: #8a9aaa;
}

body.light-theme .monaco-modal-content {
    background: rgba(245, 247, 250, 0.98);
}

body.light-theme .monaco-header {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .monaco-header h4 {
    color: #3d4f5f;
}

/* ==================== 简约模式 ==================== */
body.no-blur::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0, 0, 0, var(--bg-overlay-opacity));
}

body.no-blur.light-theme::before {
    background: rgba(255, 255, 255, var(--bg-overlay-opacity));
}

body.no-blur .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.no-blur .modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.no-blur .card.has-bg,
body.no-blur body.view-style-2 .card.has-bg {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 移动端减少阴影 */
@media (max-width: 768px) {
    .card:hover {
        box-shadow: 0 0 10px rgba(57, 157, 255, 0.3), 0 0 20px rgba(57, 157, 255, 0.1);
    }

    body.view-style-2 .card.has-bg:hover {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 10px var(--card-bg-color, rgba(255,255,255,0.15));
    }
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ==================== 页面主体样式 ==================== */
body {
    background-color: #111;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    transition: background-image 0.8s ease-in-out;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: -1;
}

/* ==================== 应用布局（左侧边栏 + 主内容） ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==================== 左侧导航栏 ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 24px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    margin-bottom: 3px;
    user-select: none;
}

.sidebar-nav-item .nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.sidebar-nav-item .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item.active {
    background: var(--primary);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(57, 157, 255, 0.35);
}

.sidebar-nav-item.hidden-item {
    opacity: 0.4;
    text-decoration: line-through;
}

.sidebar-footer {
    padding: 10px 8px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.sidebar-footer .manage-cat-btn {
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    font-size: 13px;
}

/* 移动端侧边栏切换按钮 */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 150;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.visible {
    display: block;
}

/* ==================== 主内容区域 ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 20px 20px 80px;
}

.grid-container {
    max-width: 62rem;
    margin: 0 auto;
}

/* ==================== 分类区块（连续滚动） ==================== */
.category-section {
    margin-bottom: 16px;
    scroll-margin-top: 10px;
}

.category-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    padding: 8px 4px 10px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: inherit;
}

.category-section-title .cat-icon {
    font-size: 20px;
}

/* ==================== 分类按钮样式（保留用于管理弹窗内） ==================== */
.tab-btn {
    white-space: nowrap;
    padding: 8px 22px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

.tab-btn.hidden-item {
    opacity: 0.4;
    text-decoration: line-through;
}

/* ==================== 分类管理按钮 ==================== */
.manage-cat-btn {
    background: transparent;
    border: 1px dashed var(--glass-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
}

/* ==================== 导航网格布局（Style 0 默认） ==================== */
.nav-grid {
    display: grid;
    gap: 15px;
    margin: 0 auto;
    width: 100%;
    grid-template-columns: repeat(6, 1fr);
    animation: fadeInUp 0.4s ease-out;
}

@media (max-width: 1200px) {
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 900px) {
    .nav-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 淡入上浮动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 卡片样式（Style 0 默认） ==================== */
.card {
    background: var(--glass);
    border: none;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    min-height: var(--card-h, 85px);
    height: var(--card-h, 85px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(57, 157, 255, 0.5), 0 0 30px rgba(57, 157, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card.sortable-ghost {
    opacity: 0.4;
    background: var(--primary);
}

.card.hidden-item {
    opacity: 0.3;
    filter: grayscale(1);
}

.card a {
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    gap: 6px;
}

/* ==================== 卡片提示框 ==================== */
.card[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(8px);
    color: #eee;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: pre-wrap;
    z-index: 1000;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
    width: max-content;
    max-width: 200px;
    text-align: center;
    line-height: 1.5;
}

.card[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: rgba(25, 25, 25, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    pointer-events: none;
}

.card[data-tooltip]:hover::after,
.card[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 卡片图标与标题（Style 0） ==================== */
.icon-wrapper {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 6px auto;
}

.card img {
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 4px;
    object-fit: contain;
}

.card .emoji-icon {
    font-size: var(--emoji-size);
}

.card h3 {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
    color: #fff;
    line-height: 1.2;
    min-height: 1.5em;
}

/* ==================== 管理操作按钮 ==================== */
.admin-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 3px;
    z-index: 20;
    opacity: 1;
}

.action-mini {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 22px;
    height: 22px;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 侧边栏样式切换器 ==================== */
.sidebar-style-switcher {
    display: flex;
    gap: 4px;
    padding: 0 4px;
    margin-bottom: 6px;
}

.sidebar-style-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-style-btn i {
    font-size: 14px;
}

.sidebar-style-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.sidebar-style-btn.active {
    background: var(--primary);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(57, 157, 255, 0.3);
}

.sidebar-admin-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 亮色模式 - 侧边栏样式切换器 */
body.light-theme .sidebar-style-btn {
    color: #666;
}

body.light-theme .sidebar-style-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

body.light-theme .sidebar-style-btn.active {
    background: var(--primary);
    color: white;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    width: 90%;
    max-width: 450px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    backdrop-filter: blur(15px);
}

/* ==================== 表单元素 ==================== */
.form-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.form-row label {
    width: 70px;
    text-align: left;
    font-size: 13px;
    color: #ccc;
    flex-shrink: 0;
    font-weight: bold;
}

input,
select {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    font-size: 14px;
    width: 100%;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== 复选框和单选框 ==================== */
input[type="checkbox"],
input[type="radio"] {
    margin: 0;
    padding: 10px;
    flex-shrink: 0;
    width: auto !important;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
}

/* ==================== 图标预览容器 ==================== */
.preview-container {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    border-radius: 8px;
    margin-left: 8px;
}

.preview-container img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* ==================== Toast 提示 ==================== */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: #27ae60;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    z-index: 3000;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
}

#toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 加载动画 ==================== */
.global-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#global-loading-overlay {
    display: none;
    flex-direction: column;
}

/* ==================== 骨架屏 ==================== */
#skeleton-screen {
    display: none;
    width: 100%;
    max-width: 62rem;
    margin: 0 auto;
    padding-top: 10px;
}

.skel-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    width: 120px;
}

.skel-tab {
    width: 100%;
    height: 35px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.skel-grid {
    display: grid;
    gap: 15px;
    margin: 0 auto;
    width: 100%;
    grid-template-columns: repeat(6, 1fr);
}

.skel-card {
    height: var(--card-h, 85px);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.skel-anim::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ==================== 页脚信息 ==================== */
.footer-info {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    pointer-events: none;
    z-index: 50;
}

/* ==================== 拖拽排序相关 ==================== */
.card.sortable-ghost {
    opacity: 0.4;
    background: var(--primary);
}

.card.sortable-drag {
    opacity: 0.9;
    transform: rotate(3deg) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(57, 157, 255, 0.4);
    z-index: 1000;
}

.card.drag-over {
    transform: translateY(5px);
    border-color: var(--primary);
}

/* 视频卡片拖拽排序样式 */
.video-card.sortable-ghost {
    opacity: 0.4;
    background: var(--primary);
}

.video-card.sortable-drag {
    opacity: 0.9;
    transform: rotate(2deg) scale(1.03);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(57, 157, 255, 0.4);
    z-index: 1000;
}

.video-card.drag-over {
    transform: translateY(5px);
    border-color: var(--primary);
}

.cat-item-row.sortable-ghost {
    background: var(--primary) !important;
    opacity: 0.5;
}

.drag-handle {
    cursor: grab;
    color: #666;
    margin-right: 5px;
    font-size: 18px;
}

/* ==================== 批量选择样式 ==================== */
.card.selected {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: rgba(57, 157, 255, 0.2);
}

.card.selected::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.batch-actions-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 10px 20px;
    display: none;
    gap: 10px;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.batch-actions-bar.visible {
    display: flex;
}

.batch-actions-bar span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-right: 5px;
}

.batch-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.batch-btn.delete {
    background: rgba(231, 76, 60, 0.8);
    color: white;
}

.batch-btn.move {
    background: rgba(57, 157, 255, 0.8);
    color: white;
}

.batch-btn:hover {
    transform: scale(1.05);
}

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

/* ==================== Emoji 推荐选中状态 ==================== */
.emoji-suggestion {
    cursor: pointer;
    padding: 4px 8px;
    font-size: 20px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.emoji-suggestion.selected {
    background: rgba(57, 157, 255, 0.4);
    box-shadow: 0 0 8px rgba(57, 157, 255, 0.5);
}

body.light-theme .emoji-suggestion {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .emoji-suggestion.selected {
    background: rgba(57, 157, 255, 0.3);
}

/* ==================== 缤纷模式 ==================== */
body.view-style-2 .nav-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

@media (max-width: 1200px) {
    body.view-style-2 .nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 900px) {
    body.view-style-2 .nav-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    body.view-style-2 .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

body.view-style-2 .card {
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    justify-content: flex-start;
    transition: all 0.25s ease;
}

body.view-style-2 .card.has-bg {
    background: var(--card-bg-color, rgba(255,255,255,0.15));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.view-style-2 .card.has-bg:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3), 
        0 0 15px var(--card-bg-color, rgba(255,255,255,0.2)),
        0 0 30px rgba(255, 255, 255, 0.1);
}

body.view-style-2 .card:not(.has-bg):hover {
    background: rgba(110, 115, 135, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

body.view-style-2 .card a {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
    gap: 10px;
}

body.view-style-2 .icon-wrapper {
    width: calc(var(--icon-size) + 10px);
    height: calc(var(--icon-size) + 10px);
    min-width: calc(var(--icon-size) + 10px);
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    flex-shrink: 0;
}

body.view-style-2 .card img {
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 5px;
    object-fit: contain;
}

body.view-style-2 .card .emoji-icon {
    font-size: calc(var(--emoji-size) + 4px);
}

body.view-style-2 .card-text-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

body.view-style-2 .card h3 {
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    margin-left: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    color: #fff;
    line-height: 1.2;
    min-height: unset;
}

body.view-style-2 .card[data-tooltip]::after {
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

body.view-style-2 .card[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(0);
}

body.view-style-2 .card[data-tooltip]::before {
    display: none;
}

/* ==================== 视频卡片网格 ==================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0 auto;
    width: 100%;
}

.video-card {
    background: var(--glass);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    position: relative;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(57, 157, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.video-card-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.video-card-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-card-cover img {
    transform: scale(1.05);
}

.video-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.video-card-badge.bilibili {
    background: rgba(251, 114, 153, 0.9);
    color: white;
}

.video-card-badge.youtube {
    background: rgba(255, 0, 0, 0.9);
    color: white;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s;
    z-index: 1;
}

.video-card:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.video-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.75);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-play-btn i {
    font-size: 24px;
    color: #333;
    margin-left: 2px;
}

.video-card:hover .video-play-btn {
    opacity: 1;
    transform: scale(1);
}

.video-card-body {
    padding: 10px 12px;
}

.video-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.video-card-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 视频封面加载失败占位 */
.video-card-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(57, 157, 255, 0.2), rgba(139, 92, 246, 0.2));
}

.video-card-cover-fallback i {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.5);
}

/* 视频封面异步加载插槽 */
.video-cover-slot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-cover-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-cover-slot img {
    transform: scale(1.05);
}

/* ==================== 视频播放弹窗 ==================== */
.video-modal-content {
    background: rgba(20, 20, 20, 0.98);
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.video-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.video-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}

.video-player-wrapper {
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    position: relative;
    background: #000;
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 16px 20px;
}

.video-info h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.video-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 10px;
}

.video-ext-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.video-ext-link:hover {
    opacity: 0.8;
}

/* ==================== Monaco Editor 弹窗 ==================== */
.monaco-modal-content {
    background: rgba(20, 20, 20, 0.98);
    width: 92%;
    max-width: 1000px;
    height: 80vh;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.monaco-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.monaco-header h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.monaco-actions {
    display: flex;
    gap: 8px;
}

.monaco-action-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.monaco-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.monaco-action-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.monaco-action-btn.primary:hover {
    opacity: 0.9;
}

.monaco-action-btn.close:hover {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.8);
    color: white;
}

.monaco-container {
    flex: 1;
    min-height: 0;
}

/* ==================== 跟随系统偏好 ==================== */
@media (prefers-color-scheme: light) {
    body:not(.light-theme):not(.dark-theme) {
        --glass: rgba(255, 255, 255, 0.55);
        --glass-hover: rgba(255, 255, 255, 0.75);
        --glass-border: rgba(0, 0, 0, 0.07);
        --text: #2c3e50;
        --text-dim: rgba(44, 62, 80, 0.7);
        --bg-overlay-opacity: 0.25;
    }

    body:not(.light-theme):not(.dark-theme) {
        background-color: #eef1f5;
    }

    body:not(.light-theme):not(.dark-theme)::before {
        background: rgba(240, 243, 248, var(--bg-overlay-opacity));
    }

    body:not(.light-theme):not(.dark-theme) .sidebar {
        background: rgba(255, 255, 255, 0.72);
        border-color: rgba(0, 0, 0, 0.06);
    }

    body:not(.light-theme):not(.dark-theme) .sidebar-nav-item {
        color: #5a6a7a;
    }

    body:not(.light-theme):not(.dark-theme) .sidebar-nav-item.active {
        background: var(--primary);
        color: white;
    }

    body:not(.light-theme):not(.dark-theme) .sidebar-nav-item:hover:not(.active) {
        background: rgba(0, 0, 0, 0.05);
    }

    body:not(.light-theme):not(.dark-theme) .card {
        background: rgba(255, 255, 255, 0.55);
    }

    body:not(.light-theme):not(.dark-theme) .card h3 {
        color: #3d4f5f;
    }

    body:not(.light-theme):not(.dark-theme) .modal-content {
        background: rgba(255, 255, 255, 0.92);
        border-color: rgba(0, 0, 0, 0.08);
    }

    body:not(.light-theme):not(.dark-theme) input,
    body:not(.light-theme):not(.dark-theme) select {
        background: rgba(255, 255, 255, 0.7);
        border-color: rgba(0, 0, 0, 0.1);
        color: #3d4f5f;
    }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    :root {
        --card-w: 80px;
        --card-h: 80px;
    }

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

@media (max-width: 768px) {
    :root {
        --card-w: 75px;
        --card-h: 75px;
        --sidebar-width: 250px;
    }

    /* 移动端：侧边栏变为滑出式 */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 60px 12px 80px;
    }

    body.view-style-2 .nav-grid {
        gap: 12px;
    }

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

    .video-modal-content {
        width: 96%;
        max-width: none;
    }

    .monaco-modal-content {
        width: 98%;
        height: 90vh;
    }

    .category-section-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-w: 70px;
        --card-h: 70px;
    }

    .main-content {
        padding: 60px 10px 80px;
    }

    .batch-actions-bar {
        bottom: 60px;
        padding: 8px 14px;
    }

    .batch-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
