/**
 * ==========================================
 * style.css - 核心样式文件（升级版 v4）
 * 支持两种展示风格切换
 * 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;

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

    /* 网站卡片图标尺寸（可自定义调整） */
    --icon-size: 32px;
    --emoji-size: 32px;
}

/* ==================== 亮色模式（Light Theme） ==================== */
body.light-theme {
    --glass: rgba(0, 0, 0, 0.08);
    --glass-hover: rgba(0, 0, 0, 0.15);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text: #1a1a1a;
    --text-dim: rgba(0, 0, 0, 0.7);
    --bg-overlay-opacity: 0.15;
}

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

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

body.light-theme .tab-container {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .tab-btn {
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
}

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

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

body.light-theme .card:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px rgba(57, 157, 255, 0.3), 0 0 30px rgba(57, 157, 255, 0.1);
}

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

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

body.light-theme input,
body.light-theme select {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

body.light-theme .style-switcher-panel {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .fab-btn {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

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

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

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

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

/* ==================== 简约模式（无模糊 - 提升低端设备性能） ==================== */
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 .tab-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.no-blur .style-switcher-panel {
    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;
}

/* ==================== 主容器 ==================== */
.container {
    max-width: 65rem;
    margin: 0 auto;
    padding: 150px 15px 100px;
    text-align: center;
    position: relative;
}

/* ==================== 分类标签栏 ==================== */
.tab-container {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 20px;
    scrollbar-width: none;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 35px;
    z-index: 100;
    max-width: 95vw;
}

.tab-container::-webkit-scrollbar {
    display: none;
}

.tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0 auto;
}

/* ==================== 分类按钮样式 ==================== */
.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: none;
    gap: 15px;
    margin: 0 auto;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 85px), 1fr));
    animation: fadeInUp 0.6s ease-out;
}

.nav-grid.active {
    display: grid;
}

/* 淡入上浮动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    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: 85px; /* 确保这里是固定的 85px */
    height: 85px; /* 确保这里是固定的 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);
    /* 使用主题色 var(--primary) 产生光晕效果 */
    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;
}

/* ==================== 右上角固定面板（样式切换 + 管理员工具） ==================== */
.fab {
    position: fixed;
    top: 6rem;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 200;
    align-items: center;
}

.style-switcher-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 12px 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.style-switcher-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.style-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.25s ease;
    font-size: 11px;
    font-weight: 600;
}

.style-btn i {
    font-size: 16px;
    line-height: 1;
}

.style-btn span {
    font-size: 9px;
    line-height: 1;
}

.style-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.style-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(57, 157, 255, 0.5);
}

/* 管理员 FAB 按钮 */
.fab-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    backdrop-filter: blur(10px);
    transition: 0.3s;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fab-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* ==================== 模态框 ==================== */
.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%;
    margin-top: 40px;
}

.skel-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

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

.skel-grid {
    display: grid;
    gap: 15px;
    margin: 0 auto;
    width: 100%;
    max-width: 65rem;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 85px), 1fr));
}

.skel-card {
    height: 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;
}

/* ==================== 拖拽排序相关 ==================== */
.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);
}

.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);
}

/* ==================== 布局容器 ==================== */
#layout-wrapper {
    display: block;
    width: 100%;
}


/* ==================================================================================
   缤纷模式 — 列表详情模式 + 自定义网格背景色
   高宽比与默认样式完全一致（正方形），背景色由用户自定义
   ================================================================================== */

body.view-style-2 .nav-grid.active {
    grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 85px), 1fr));
    gap: 15px;
}

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;
}

/* 缤纷模式 tooltip */
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;
}


/* ==================== 跟随系统偏好（亮色/暗色模式自动切换） ==================== */
@media (prefers-color-scheme: light) {
    body:not(.light-theme):not(.dark-theme) {
        --glass: rgba(0, 0, 0, 0.08);
        --glass-hover: rgba(0, 0, 0, 0.15);
        --glass-border: rgba(0, 0, 0, 0.1);
        --text: #1a1a1a;
        --text-dim: rgba(0, 0, 0, 0.7);
        --bg-overlay-opacity: 0.15;
    }

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

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

    body:not(.light-theme):not(.dark-theme) .tab-container {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    body:not(.light-theme):not(.dark-theme) .tab-btn {
        color: #333;
        border-color: rgba(0, 0, 0, 0.1);
    }

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

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

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

    body:not(.light-theme):not(.dark-theme) input,
    body:not(.light-theme):not(.dark-theme) select {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.15);
        color: #333;
    }

    body:not(.light-theme):not(.dark-theme) .style-switcher-panel {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(0, 0, 0, 0.1);
    }

    body:not(.light-theme):not(.dark-theme) .fab-btn {
        background: rgba(255, 255, 255, 0.7);
        border-color: rgba(0, 0, 0, 0.1);
        color: #333;
    }
}

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

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

    .tab-container {
        top: 1rem;
        padding: 8px 14px;
        gap: 6px;
        max-width: 95vw;
        justify-content: flex-start;
    }

    .tab-btn {
        padding: 6px 14px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .container {
        padding-top: 100px;
    }

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

    .fab {
        right: 10px;
    }

    .style-switcher-panel {
        padding: 8px 6px;
    }

    .style-btn {
        width: 40px;
        height: 40px;
    }

    .fab-btn {
        width: 40px;
        height: 40px;
    }
}

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

    .container {
        padding: 80px 10px 80px;
    }

    .tab-container {
        top: 0.5rem;
        padding: 6px 10px;
        border-radius: 0;
    }

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

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