/* 配置本地极细字体引用（替代之前的网络镜像） */
@font-face {
    font-family: 'Noto Sans SC Local';
    src: url('./fonts/NotoSansSC-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
/* CSS Reset & Base Fallbacks */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    user-select: none;
    -webkit-user-select: none;
    min-width: 482px; /* 明确全站最小渲染宽度为 482px，防止大屏窗口缩过窄或小屏下容器变形 */
}
/* 3D Flip Card Animation Styles */
.perspective-1000 {
    perspective: 1000px;
}
.transform-style-3d {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.rotate-y-180 {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

/* Glassmorphic Effects */
.glass-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-modal {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* Tri-state Checkbox Styling Helper */
input[type="checkbox"]:indeterminate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236366f1'%3E%3Crect x='3' y='7' width='10' height='2' rx='1'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* 锁定 482px 最小宽度，防止控件挤压 */
#vocab-modal,
#schemeDeleteModal,
#filterSettingsModal,
#scheme-mismatch-modal {
    min-width: 482px;
}

/* 最左侧方案块列表容器（解决过多时挤压被切问题，提供独立滚动） */
#scheme-list-container {
    padding-bottom: 10px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 10px), transparent 100%);
}

/* 方案边栏触摸事件 */
.scheme-item-swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    flex-shrink: 0; /* 防止方案卡片在纵向布局中被压缩变形 */
}
.scheme-item-content {
    transition: transform 0.25s ease-out;
    will-change: transform;
    cursor: grab; /* 鼠标悬停提示可抓取拖拽 */
}
.scheme-item-content:active {
    cursor: grabbing; /* 拖拽按下的光标状态 */
}

/* 将侧滑双按钮外层容器的绝对定位与隐藏平移挂载至 .scheme-item-actions */
.scheme-item-actions {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 92px; /* 适配双独立按钮容器宽度 92px */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    cursor: pointer; /* 显示手型点击光标 */
    z-index: 10; /* 提升层级确保滑出后点击事件不受阻挡 */
}

.scheme-item-swipe-container.swiped .scheme-item-content {
    /* 滑动距离由 88px/92px 调整为 96px，适配双独立按钮宽度(92px)及与卡片间 4px 的留白间距 */
    transform: translateX(96px);
}

.scheme-item-swipe-container.swiped .scheme-item-actions {
    transform: translateX(0);
}

/* 方案块删除时的烟气消散与顺次填位动画（时长拉长至 1 秒） */
.scheme-item-swipe-container {
    max-height: 120px; /* 确保 max-height 动画生效 */
    transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1),
                margin 1s cubic-bezier(0.4, 0, 0.2, 1),
                padding 1s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 1s ease-out,
                filter 1s ease-out,
                transform 1s ease-out;
}

.scheme-item-swipe-container.deleting {
    opacity: 0;
    filter: blur(12px); /* 增强烟气模糊效果 */
    transform: scale(0.88);
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

/* 词库列表树及词库搜索部分 */
/* 为大容器补充 padding-bottom，确保内容滚到底部时底边线处于遮罩实色区 */
#vocab-tree-container {
    padding-bottom: 15px; /* 预留 15px 底部留白，垫高最后卡片的底边线 */
    --mask-top-height: 5px; /* 顶部渐隐高度 */
    --mask-bottom-height: 15px; /* 底部渐隐高度 */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--mask-top-height), /* 顶部渐隐过渡点 */
        #000 calc(100% - var(--mask-bottom-height)), /* 使用变量保持底部渐隐 */
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--mask-top-height), /* 新增顶部渐隐过渡点 */
        #000 calc(100% - var(--mask-bottom-height)), /* 使用变量保持底部渐隐 */
        transparent 100%
    );
}

/* 一级标题吸顶固定类 */
.sticky-file-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: transparent !important;
}
/* 一级标题实体背景层 */
.sticky-file-header::after {
    content: '';
    position: absolute;
    top: -1px;
    bottom: 0;
    left: -1px; /* ⚠️ 保留：左右扩展 1px 压住下层内容块边框 */
    right: -1px;
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    z-index: 2;
}
/* 一级标题遮罩块 */
.sticky-file-header::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -1px; /* ⚠️ 保留：左右扩展 1px 压住边框 */
    right: -1px;
    height: 24px;
    background-color: #0b1227; /* 改为与外层面板一致的背景色，使圆角切口与外层自然融合 */
    box-shadow: 0 -2px 0 0 #0b1227; /* 向上叠加 2px 外衬阴影，强制填补亚像素舍入缝隙 */
    border-radius: 0 !important;
    z-index: 1;
}
/* 一级标题内部文字与图标 */
.sticky-file-header > * {
    position: relative;
    z-index: 3;
}
/* 二级标题吸顶固定类 */
.sticky-src-header {
    position: sticky;
    top: 51px;
    z-index: 20;
    background: transparent !important;
}
/* 二级标题实体背景层（左右扩展 1px 覆盖侧边线） */
.sticky-src-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    right: -1px;
    background-color: #0D1629 !important;
    border-top: 1px solid rgba(21, 32, 56, 0.6); /* 顶部分边线，处于 z-index: 2 层级，强制覆盖在伪元素遮罩（z-index: 1）之上 */
    border-bottom: 1px solid rgba(21, 32, 56, 0.6);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    z-index: 2;
}
/* 二级标题遮罩块 */
.sticky-src-header::before {
    content: '';
    position: absolute;
    top: -12px; /* 设为 -12px，精确填满 12px 卡片间距 */
    left: -1px;
    right: -1px;
    height: calc(50% + 12px); /* 配合 top: -12px */
    background-color: #0d1226;
    box-shadow: 0 -1px 0 0 #0d1226; /* ⚠️ 保留：微量 1px 阴影，吸顶时塞入一级标题下方消除亚像素缝隙，静态时不遮挡上框线 */
    border-radius: 0 !important;
    z-index: 1;
}
/* 二级标题内部文字与图标 */
.sticky-src-header > * {
    position: relative;
    z-index: 3;
}

/* 左侧词条类型多选按钮的 LED 渐亮/渐灭与发光质感（对齐右侧逻辑） */
.search-type-btn {
    color: #94a3b8;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s ease-out;
    text-shadow: none;
}

/* 修复核心痛点：未选中状态下，即使鼠标停留在上面（hover），文字也保持暗沉，确保取消时瞬间变暗 */
.search-type-btn:not(.active):hover {
    color: #94a3b8;
}

/* 选中状态：完美对齐右侧的精致发光与亮边框质感 */
.search-type-btn.active {
    color: #ffffff;
    font-weight: 700;
    background-color: rgba(234, 88, 12, 0.85);
    border: 1px solid rgba(251, 146, 60, 0.7); /* 💡 稍亮一点的暖橘色精致边框，对齐右侧效果 */
    box-shadow: 0 0 6px rgba(234, 88, 12, 0.6);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 16px rgba(251, 146, 60, 0.7);
}

/* 搜索模式控制台 LED 渐亮/渐灭样式与发光质感 */
.search-mode-btn {
    color: #94a3b8;
    text-shadow: none;
}

.search-mode-btn:hover {
    color: #cbd5e1;
}

.search-mode-btn.active {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 16px rgba(165, 180, 252, 0.7);
}

/* 搜索结果卡片悬停与过渡效果 */
.vocab-search-card {
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.vocab-search-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background-color: rgba(30, 41, 59, 0.8);
    transform: translateY(-1px);
}

/* 搜索关键词高亮文本样式 */
.search-highlight {
    color: #818cf8;
    font-weight: 700;
    background-color: rgba(99, 102, 241, 0.18);
    padding: 0 2px;
    border-radius: 2px;
}












/* 通用折叠方式 */

/* 通用折叠容器（基于 CSS Grid 实现高度自适应平滑过渡） */
.collapse-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
/* 折叠容器展开状态 */
.collapse-wrapper.is-expanded {
    grid-template-rows: 1fr;
    overflow: visible;
}
/* 折叠内部包裹层（确保溢出隐藏与透明度渐变） */
.collapse-inner {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
.collapse-wrapper.is-expanded > .collapse-inner {
    opacity: 1;
    overflow: visible;
}
/* 未展开状态下清空内部包裹层的上下 Padding 与 Border，确保 Grid 轨道能彻底塌陷至 0px 消除缝隙 */
.collapse-wrapper:not(.is-expanded) > .collapse-inner {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

/* 通用动画 */

/* 通用弹窗遮罩基础动画状态 */
.modal-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}
/* 遮罩激活显示状态 */
.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
/* 顶部向下弹跃 */
.modal-card {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease-out;
}
.modal-backdrop.is-open .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 窗口平滑缩放与渐隐出场动画（筛选设置弹窗） */
.filter-modal-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.filter-modal-card {
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
}
.filter-modal-backdrop.is-open .filter-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ==========================================================================
   ⚠️ 通用瀑布流阶梯渐显动画 (.cascade-animate)
   可用于：页签内容切换、搜索结果列表展开、下拉菜单内容陈列等
   ========================================================================== */
/* 1. 外层容器整体升起 */
.cascade-animate {
    animation: cascadeContainerFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/* 2. 容器内直属与嵌套子元素默认初始隐藏状态 */
.cascade-animate > *,
.cascade-animate .grid > *,
.cascade-animate .cascade-list > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--cascade-delay, 0s);
    will-change: opacity, transform;
}
/* 3. 元素进入视口状态：由 JS 赋予 is-visible 类展现 */
.cascade-animate > *.is-visible,
.cascade-animate .grid > *.is-visible,
.cascade-animate .cascade-list > *.is-visible {
    opacity: 1;
    transform: translateY(0);
}
/* 微调：来源页签统计徽章基础样式强化 */
.filter-item-card .badge-stats {
  font-variant-numeric: tabular-nums; /* 确保数字等宽对齐 */
  letter-spacing: -0.02em;
}
/* 确保图标垂直对齐 */
.filter-item-card .fa-folder,
.filter-item-card .fa-file-lines {
  line-height: 1;
}
@keyframes cascadeContainerFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 搜索框双击清空引导气泡动画 */
/* 果冻弹出动画 */
@keyframes jellyIn {
    0% {
        transform: scale(0.3) translateY(8px);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) translateY(-3px);
        opacity: 1;
    }
    75% {
        transform: scale(0.95) translateY(1px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
/* 果冻收起/消失动画 */
@keyframes jellyOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) translateY(6px);
        opacity: 0;
    }
}
/* 微微上下浮动动画 */
@keyframes jellyFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}
/* 气泡显示时的复合动画：先果冻出现，0.4s 后开始持续微幅浮动 */
.tooltip-jelly-show {
    animation: jellyIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               jellyFloat 1.8s ease-in-out infinite 0.4s !important;
}
/* 气泡隐藏时的果冻退场动画 */
.tooltip-jelly-hide {
    animation: jellyOut 0.3s ease-in forwards !important;
}


/* 自定义下拉菜单淡入滑出动画 */
.dropdown-anim-enter {
    animation: dropdownSlideDown 0.15s ease-out forwards;
}
/* 自定义下拉菜单淡出滑起动画 */
.dropdown-anim-leave {
    animation: dropdownSlideUp 0.12s ease-in forwards;
}
@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px) scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}
@keyframes dropdownSlideUp {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scaleY(0.95);
    }
}







/* 1. 强制保证文字拥有相对定位与最高层级，强制中文字体启用极细渲染与平滑抗锯齿 */
.quiz-type-text {
    font-family: 'Noto Sans SC Local', -apple-system, "PingFang SC", "Source Han Sans SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    z-index: 10;
}
/* 2. 激活项底部的压扁椭圆阴影 */
.quiz-type-shadow {
    position: absolute;
    left: 50%;
    top: 100%; 
    margin-top: 5px; /* 新增：往下偏移 5px，精确匹配 scale(1.25) 放大后的视觉文字底边 */
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 0; /* 低于 z-index: 10 的文字，但高于背景与倒影 */
    pointer-events: none;
    
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 测验方法的描述文字方向切变动画类 */
.desc-slide-out-down {
    opacity: 0 !important;
    transform: translateY(15px);
}
.desc-slide-in-down {
    transform: translateY(-15px);
}
/* 描述文本容器上下边缘羽化遮罩（解决边缘硬切割问题） */
.quiz-desc-wrapper {
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 75%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 25%,
        black 75%,
        transparent 100%
    );
}