/* ================================================================
   ZY 工作室 · 学习资源（文件空间）专属样式
   ---------------------------------------------------------------
   目标：提升高级感与层次感，解决"看着乱、不大气"的问题。
   手法：
     1) 三层背景（校园水印 / 柔光 / 内容卡）拉开纵深
     2) 侧栏与主区用不同明度区分，形成清晰的视觉分区
     3) 内容卡片统一圆角、描边、投影，节奏一致
     4) 数字与状态用彩色点缀，避免死板的纯蓝
   ================================================================ */

/* ---------------------------------------------------------------
   1. 页面底：柔光 + 校园水印
   --------------------------------------------------------------- */
body.fs-body {
    background:
        radial-gradient(900px 460px at 8% 0%, rgba(29, 78, 216, 0.07), transparent 62%),
        radial-gradient(820px 420px at 94% 12%, rgba(13, 148, 136, 0.07), transparent 64%),
        radial-gradient(700px 380px at 50% 100%, rgba(249, 115, 22, 0.05), transparent 66%),
        #f7f8fa;
}

/* ---------------------------------------------------------------
   2. 顶部工具条：层次感的锚点
   --------------------------------------------------------------- */
.fs-toolbar {
    position: relative;
    border-radius: var(--radius-lg) !important;
    background: linear-gradient(112deg, #ffffff 0%, #fbfdff 52%, #f1fbfa 100%) !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06) !important;
    padding: 14px 22px !important;
    overflow: hidden;
}

/* 工具条顶部的双色细线 */
.fs-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f97316 0%, #e8734a 16%, #3b6ef5 52%, #0d9488 100%);
}

.fs-crumb {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--color-dark) !important;
}

/* 面包屑的层级分隔 */
.fs-crumb + .fs-crumb::before {
    content: '/';
    margin-right: 8px;
    color: #c3cbd8;
    font-weight: 400;
}

/* ---------------------------------------------------------------
   3. 侧栏：浅色卡片（保留 v4 原本的浅色调，只做层次优化）
   --------------------------------------------------------------- */
.fs-layout {
    gap: 22px !important;
    align-items: flex-start;
}

.fs-sidebar {
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.05) !important;
    color: var(--color-dark);
    overflow: hidden;
}

.fs-sidebar-head {
    border-bottom: 1px solid rgba(29, 78, 216, 0.10) !important;
    padding: 15px 18px !important;
    background: linear-gradient(100deg, #f7f9fc, #f2fbfa) !important;
}

.fs-sidebar-head h3 {
    color: var(--color-dark) !important;
    font-size: 0.9rem !important;
    letter-spacing: 1.2px;
    font-weight: 650;
}

.fs-sidebar-head h3::after {
    content: '';
    display: inline-block;
    width: 22px;
    height: 2px;
    margin-left: 9px;
    vertical-align: middle;
    border-radius: 1px;
    background: linear-gradient(90deg, #f97316, #0d9488);
}

.fs-add-folder {
    background: rgba(29, 78, 216, 0.08) !important;
    color: var(--color-primary) !important;
    border: 1px solid rgba(29, 78, 216, 0.16) !important;
    transition: background .2s ease, transform .2s ease, color .2s ease;
}

.fs-add-folder:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
    transform: rotate(90deg);
}

/* 文件夹树 */
.fs-tree {
    padding: 8px !important;
}

.fs-tree li a,
.fs-tree-item {
    color: var(--color-dark-2) !important;
    border-radius: 9px !important;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.fs-tree li a:hover,
.fs-tree-item:hover {
    background: rgba(29, 78, 216, 0.06) !important;
    color: var(--color-primary) !important;
    transform: translateX(2px);
}

.fs-tree .is-active,
.fs-tree-item.is-active {
    background: linear-gradient(90deg, rgba(29, 78, 216, 0.12), rgba(29, 78, 216, 0.03)) !important;
    color: var(--color-primary) !important;
    box-shadow: inset 2px 0 0 var(--color-primary);
}

/* 侧栏底部统计 */
.fs-sidebar-foot {
    border-top: 1px solid rgba(29, 78, 216, 0.10) !important;
    color: var(--color-gray) !important;
    padding: 13px 18px !important;
    font-size: 0.8rem;
    background: #fbfcfd;
}

.fs-sidebar-foot strong {
    color: var(--color-primary) !important;
}

 主区：内容卡片
   --------------------------------------------------------------- */
.fs-main {
    min-width: 0;
}

/* 上传区 */
.fs-upload {
    border-radius: var(--radius-lg) !important;
    background: linear-gradient(120deg, #ffffff 0%, #fbfdff 60%, #f2fbfa 100%) !important;
    border: 1px dashed rgba(29, 78, 216, 0.24) !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04) !important;
    padding: 16px 20px !important;
}

.fs-upload strong {
    color: var(--color-dark) !important;
}

.fs-upload-hint {
    color: var(--color-gray) !important;
    font-size: 0.82rem;
}

/* 上传区标题前的小图标块 */
.fs-upload-info strong::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    margin-right: 9px;
    vertical-align: -2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #f97316, #0d9488);
}

/* 文件列表 */
.fs-files {
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.045) !important;
    overflow: hidden;
}

/* 文件列表表头 */
.fs-files-head {
    background: linear-gradient(90deg, #f7f9fc, #f2fbfa) !important;
    border-bottom: 1px solid rgba(29, 78, 216, 0.10) !important;
    color: var(--color-gray) !important;
    font-size: 0.78rem;
    letter-spacing: .8px;
    font-weight: 600;
    padding: 11px 18px !important;
}

/* 单个文件行 */
.fs-file-row {
    border-bottom: 1px solid rgba(16, 24, 40, 0.055) !important;
    transition: background .2s ease;
}

.fs-file-row:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.045), transparent 60%) !important;
}

.fs-file-row:last-child {
    border-bottom: none !important;
}

.fs-file-name {
    color: var(--color-dark) !important;
    font-weight: 600;
}

/* 文件类型图标：给一点色彩 */
.fs-file-icon {
    border-radius: 9px !important;
    background: rgba(29, 78, 216, 0.09) !important;
    color: var(--color-primary) !important;
    transition: background .2s ease, transform .2s ease;
}

.fs-file-row:hover .fs-file-icon {
    background: rgba(249, 115, 22, 0.14) !important;
    color: var(--color-daily) !important;
    transform: scale(1.06);
}

.fs-file-meta {
    color: #98a2b3 !important;
    font-size: 0.78rem;
}

/* 文件操作按钮 */
.fs-file-btn {
    border-radius: 8px !important;
    border: 1px solid rgba(29, 78, 216, 0.16) !important;
    background: #fff !important;
    color: var(--color-primary) !important;
    transition: all .2s ease;
}

.fs-file-btn:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(29, 78, 216, 0.22);
}

/* 预览态 */
.fs-file-btn.is-preview {
    background: rgba(29, 78, 216, 0.08) !important;
    color: var(--color-primary) !important;
}

.fs-file-btn.is-preview:hover {
    background: #dbeafe !important;
    color: var(--color-primary) !important;
}

/* 删除按钮 */
.fs-file-del {
    color: #d92d20 !important;
    border-radius: 8px !important;
    transition: all .2s ease;
}

.fs-file-del:hover {
    background: rgba(217, 45, 32, 0.10) !important;
}

/* 子文件夹网格 */
.fs-subfolders {
    gap: 12px !important;
}

.fs-subfolders .fs-item,
.fs-subfolders > div {
    border-radius: var(--radius-md, 12px) !important;
    background: #fff !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04) !important;
    transition: all .24s cubic-bezier(.4, 0, .2, 1);
}

.fs-subfolders .fs-item:hover,
.fs-subfolders > div:hover {
    border-color: rgba(249, 115, 22, 0.34) !important;
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.10) !important;
    transform: translateY(-3px);
}

/* ---------------------------------------------------------------
   5. 留言板 / 成员管理
   --------------------------------------------------------------- */
.fs-board {
    border-radius: var(--radius-lg) !important;
    background: #fff !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.045) !important;
    overflow: hidden;
}

.fs-board-head {
    background: linear-gradient(90deg, #f7f9fc, #fdf6f2) !important;
    border-bottom: 1px solid rgba(29, 78, 216, 0.09) !important;
    padding: 14px 20px !important;
}

.fs-board-head h3 {
    color: var(--color-dark) !important;
    font-size: 1rem !important;
    font-weight: 650;
}

.fs-board-form {
    background: linear-gradient(180deg, #fbfcfe, #fff) !important;
    padding: 18px 20px !important;
    border-bottom: 1px solid rgba(16, 24, 40, 0.055);
}

.fs-board-field label {
    color: var(--color-dark-2) !important;
    font-weight: 600;
    font-size: 0.85rem;
}

.fs-board-field textarea,
.fs-board-field input,
.fs-admin-reply {
    border-radius: 10px !important;
    border: 1px solid rgba(29, 78, 216, 0.18) !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.fs-board-field textarea:focus,
.fs-board-field input:focus,
.fs-admin-reply:focus {
    border-color: rgba(249, 115, 22, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12) !important;
}

/* 实名提问标记 */
.fs-board-as {
    color: var(--color-daily) !important;
    font-weight: 600;
    font-size: 0.82rem;
}

/* 留言条目 */
.fs-board-row {
    border-bottom: 1px solid rgba(16, 24, 40, 0.055) !important;
    padding: 14px 20px !important;
    transition: background .2s ease;
}

.fs-board-row:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.04), transparent 55%) !important;
}

.fs-board-msg {
    color: var(--color-dark-2) !important;
    line-height: 1.8;
}

/* 空状态 */
.fs-board-empty,
.fs-empty {
    color: var(--color-gray) !important;
    padding: 34px 20px !important;
}

.fs-empty-icon {
    opacity: .5;
}

/* ---------------------------------------------------------------
   6. 成员管理
   --------------------------------------------------------------- */
.fs-member-row {
    border-radius: var(--radius-md, 12px) !important;
    border: 1px solid rgba(13, 148, 136, 0.20) !important;
    background: linear-gradient(100deg, #f4fdfc 0%, #ffffff 60%) !important;
    transition: all .2s ease;
}

.fs-member-row:hover {
    border-color: rgba(13, 148, 136, 0.42) !important;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12) !important;
}

.fs-avatar {
    background: linear-gradient(135deg, #0d9488, #2dd4bf) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.26);
}

.fs-member-name {
    color: var(--color-dark) !important;
    font-weight: 600;
}

.fs-member-id {
    color: #98a2b3 !important;
}

.fs-member-off {
    color: #b25b00 !important;
    background: #fff3e6 !important;
    border-radius: 999px;
}

/* ---------------------------------------------------------------
   7. 按钮与账号区
   --------------------------------------------------------------- */
.fs-btn {
    border-radius: 9px !important;
    transition: all .2s ease;
}

.fs-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.24) !important;
}

.fs-btn-primary:hover {
    background: linear-gradient(135deg, #f97316, #e05a2b) !important;
    box-shadow: 0 8px 20px rgba(217, 72, 15, 0.30) !important;
    transform: translateY(-1px);
}

/* 头像与用户名 */
.fs-user-btn {
    border-radius: 999px !important;
    border: 1px solid rgba(29, 78, 216, 0.14) !important;
    background: #fff !important;
    transition: all .2s ease;
}

.fs-user-btn:hover {
    border-color: rgba(29, 78, 216, 0.30) !important;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.12);
}

.fs-account-menu {
    border-radius: var(--radius-md, 12px) !important;
    border: 1px solid rgba(29, 78, 216, 0.12) !important;
    box-shadow: 0 18px 44px rgba(16, 24, 40, 0.16) !important;
    overflow: hidden;
}

.fs-account-head {
    background: linear-gradient(120deg, #f7f9fc, #f2fbfa) !important;
    border-bottom: 1px solid rgba(29, 78, 216, 0.09) !important;
    padding: 13px 15px !important;
}

.fs-menu-item {
    transition: background .18s ease, color .18s ease, padding-left .18s ease;
}

.fs-menu-item:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.08), transparent) !important;
    padding-left: 18px;
}

/* ---------------------------------------------------------------
   8. 底部状态条
   --------------------------------------------------------------- */
.fs-foot-bar {
    background: linear-gradient(100deg, #f7f9fc, #f2fbfa) !important;
    border-radius: var(--radius-md, 12px) !important;
    border: 1px solid rgba(29, 78, 216, 0.10) !important;
    color: var(--color-dark-2) !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.045) !important;
}

.fs-foot-bar strong {
    color: var(--color-primary) !important;
}

/* ---------------------------------------------------------------
   9. 学习资源介绍区（进入文件空间前的引导页）
   --------------------------------------------------------------- */
.lr-intro-section {
    background:
        radial-gradient(760px 380px at 8% 0%, rgba(29, 78, 216, 0.07), transparent 62%),
        radial-gradient(700px 340px at 92% 18%, rgba(13, 148, 136, 0.07), transparent 64%),
        linear-gradient(180deg, #fbfcfe 0%, #f7f8fa 100%);
}

.lr-intro-head {
    text-align: center;
    margin-bottom: 40px;
}

.lr-intro-head .section-title {
    margin-bottom: 6px;
}

.lr-intro-head .section-lead {
    max-width: 620px;
    margin: 14px auto 0;
}

/* 三张入口卡片 */
.lr-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.lr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 30px 28px 26px;
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, #ffffff 0%, #fbfcfe 58%, #f4fbfa 100%);
    border: 1px solid rgba(29, 78, 216, 0.10);
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.05);
    text-decoration: none;
    overflow: hidden;
    transition: transform .32s cubic-bezier(.4, 0, .2, 1),
                box-shadow .32s, border-color .32s;
}

.lr-card:hover {
    transform: translateY(-5px);
    border-color: rgba(29, 78, 216, 0.22);
    box-shadow: 0 20px 44px rgba(16, 24, 40, 0.13);
}

/* 卡片右上角的校园水印 */
.lr-card::before {
    content: '';
    position: absolute;
    top: -22%;
    right: -14%;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: url('../images/wm-04-hall.jpg') center/cover;
    opacity: 0.07;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 74%);
    mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 74%);
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.lr-card:hover::before {
    transform: scale(1.1) rotate(6deg);
}

/* 图标块：三种色 */
.lr-card-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.lr-card:hover .lr-card-icon {
    transform: scale(1.06) rotate(-3deg);
}

.lr-icon-1 {
    color: #1d4ed8;
    background: #eef3ff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.14);
}

.lr-icon-2 {
    color: #0d9488;
    background: #e6fbf7;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.14);
}

.lr-icon-3 {
    color: #b45309;
    background: #fef3c7;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.14);
}

.lr-card-body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
}

.lr-card-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--color-dark);
    margin-bottom: 8px;
    letter-spacing: .3px;
}

.lr-card-desc {
    display: block;
    font-size: 0.86rem;
    line-height: 1.8;
    color: var(--color-gray);
}

.lr-card-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #d9261c;
    letter-spacing: .3px;
    transition: gap .24s ease, color .24s ease;
}

.lr-card-link i {
    font-style: normal;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform .24s ease;
}

.lr-card:hover .lr-card-link {
    gap: 7px;
    color: #b91c1c;
}

.lr-card:hover .lr-card-link i {
    transform: translateX(2px);
}

/* 底部提示 */
.lr-intro-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 13px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(29, 78, 216, 0.22);
    font-size: 0.86rem;
    color: var(--color-gray);
    text-align: center;
}

.lr-intro-note svg {
    flex: 0 0 auto;
    color: var(--color-primary);
}

@media (max-width: 900px) {
    .lr-cards {
        grid-template-columns: 1fr;
    }

    .lr-card {
        padding: 24px 22px 22px;
    }

    .lr-intro-note {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------------------------------------------------------------
   10. 学习资源方向卡片 —— 华为式横排（图标+标题+箭头）
   --------------------------------------------------------------- */
.lr-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.lr-card-row {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: #fff;
}

.lr-card-row .lr-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex: 0 0 auto;
}

.lr-card-row .lr-card-title {
    font-size: 1.02rem;
    margin-bottom: 4px;
}

.lr-card-row .lr-card-desc {
    font-size: 0.8rem;
    line-height: 1.7;
}

/* 右侧箭头 */
.lr-card-arrow {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--color-primary);
    background: rgba(29, 78, 216, 0.06);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1), background .26s ease, color .26s ease;
}

.lr-card-row:hover .lr-card-arrow {
    background: var(--color-primary);
    color: #fff;
    transform: translateX(4px);
}

/* 六种图标配色 */
.lr-icon-1 { color: #1d4ed8; background: #eef3ff; box-shadow: 0 4px 12px rgba(29, 78, 216, .13); }
.lr-icon-2 { color: #6d28d9; background: #f3eeff; box-shadow: 0 4px 12px rgba(109, 40, 217, .13); }
.lr-icon-3 { color: #0d9488; background: #e6fbf7; box-shadow: 0 4px 12px rgba(13, 148, 136, .13); }
.lr-icon-4 { color: #be185d; background: #fdf2f8; box-shadow: 0 4px 12px rgba(190, 24, 93, .13); }
.lr-icon-5 { color: #b45309; background: #fef3c7; box-shadow: 0 4px 12px rgba(180, 83, 9, .13); }
.lr-icon-6 { color: #0f766e; background: #ecfdf5; box-shadow: 0 4px 12px rgba(15, 118, 110, .13); }

@media (max-width: 1000px) {
    .lr-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .lr-cards-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------
   11. 学习资源介绍页 —— 闸门显示控制
   ---------------------------------------------------------------
   未登录时先展示「学习资源」方向介绍页，用户点任意方向后才弹出登录闸门。
   JS 负责切换 hidden 属性，这里用 body 上的状态类做一层 CSS 兜底，
   避免任何一处 JS 把闸门打开后无法再隐藏。
   --------------------------------------------------------------- */
body:not(.lr-gate-open) #gateSection {
    display: none !important;
}

body.lr-gate-open #gateSection {
    display: block !important;
}

/* 未进入闸门时，页头保持显示（不隐藏大图页头） */
body:not(.lr-gate-open) .page-header {
    display: block !important;
}

/* ---------------------------------------------------------------
   12. 学习资源树形流程图
   ---------------------------------------------------------------
   根节点：学习资源（板块标题）
   一级：6 个技术方向（卡片）
   二级：每个方向下的 4 个学期/分类（点击卡片弹出的浮层）
   --------------------------------------------------------------- */

/* 树容器 */
.lr-tree {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 连接线：从上方主干分出到每个节点 */
.lr-tree::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(29, 78, 216, 0) 0%,
        rgba(29, 78, 216, .28) 12%,
        rgba(29, 78, 216, .28) 88%,
        rgba(29, 78, 216, 0) 100%);
    border-radius: 1px;
}

/* 每个节点：卡片 + 弹层 */
.lr-node {
    position: relative;
}

/* 节点卡片 */
.lr-node .lr-card {
    width: 100%;
    cursor: pointer;
}

/* 卡片内部：标题与描述单行显示，避免换行拥挤 */
.lr-node .lr-card-title {
    font-size: 1rem;
    margin-bottom: 3px;
}

.lr-node .lr-card-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 图标里的 emoji */
.lr-card-emoji {
    font-size: 24px;
    line-height: 1;
}

/* 展开状态：卡片高亮 + 箭头旋转 */
.lr-node.is-open .lr-card {
    border-color: rgba(29, 78, 216, 0.36);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.13);
}

.lr-node.is-open .lr-card-arrow {
    transform: rotate(90deg);
    background: var(--color-primary);
    color: #fff;
}

.lr-node.is-open .lr-card-arrow svg {
    transform: rotate(0deg);
}

.lr-card-arrow svg {
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

/* 子目录浮层 */
.lr-pop {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 30;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(29, 78, 216, 0.14);
    box-shadow: 0 18px 44px rgba(16, 24, 40, 0.16);
    animation: lrPop .22s cubic-bezier(.2, .9, .3, 1.1) both;
}

.lr-pop[hidden] {
    display: none !important;
}

@keyframes lrPop {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 浮层与卡片之间的连接小三角 */
.lr-pop::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 26px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid rgba(29, 78, 216, 0.14);
    border-top: 1px solid rgba(29, 78, 216, 0.14);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

.lr-pop-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(29, 78, 216, 0.10);
}

.lr-pop-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: .3px;
}

.lr-pop-sub {
    font-size: 0.72rem;
    color: var(--color-gray);
}

/* 子目录列表 */
.lr-pop-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 单个子目录 */
.lr-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.lr-sub:hover {
    background: linear-gradient(90deg, rgba(29, 78, 216, 0.07), rgba(29, 78, 216, 0.02));
    transform: translateX(3px);
}

.lr-sub-icon {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1;
}

.lr-sub-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--color-dark-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-sub:hover .lr-sub-name {
    color: var(--color-primary);
}

.lr-sub-arrow {
    flex: 0 0 auto;
    font-size: 1rem;
    color: #c3cbd8;
    transition: transform .2s ease, color .2s ease;
}

.lr-sub:hover .lr-sub-arrow {
    transform: translateX(2px);
    color: var(--color-primary);
}

/* 弹层被裁剪的问题：节点加 overflow 可见 */
.lr-node {
    overflow: visible;
}

@media (max-width: 1000px) {
    .lr-tree {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .lr-tree {
        grid-template-columns: 1fr;
    }

    .lr-tree::before {
        display: none;
    }
}

/* ---------------------------------------------------------------
   13. 学习资源树形结构 · 7 个方向的适配
   ---------------------------------------------------------------
   目录实为 7 个顶层方向（AI/Python、Java·C#/Web前端/移动端/网络安全/
   公共资料/团建活动），用 auto-fit 自适应列数，避免出现孤行。
   --------------------------------------------------------------- */
.lr-tree {
    grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
    gap: 16px;
}

/* 第 7 个图标配色（团建活动） */
.lr-icon-7 {
    color: #be185d;
    background: #fdf2f8;
    box-shadow: 0 4px 12px rgba(190, 24, 93, .13);
}

/* 无子目录的方向：直接进入 */
.lr-sub-direct .lr-sub-name {
    font-weight: 600;
    color: var(--color-dark);
}

.lr-sub-direct {
    background: linear-gradient(90deg, rgba(29, 78, 216, .06), rgba(29, 78, 216, .01));
}

@media (max-width: 640px) {
    .lr-tree {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------
   14. 文件空间侧栏等高对齐
   ---------------------------------------------------------------
   之前 .fs-layout 用了 align-items:flex-start，侧栏只按自身内容高度收缩，
   右边（文件列表 + 内部留言 + 成员管理）却很长，于是左栏提前"落地"，
   底部大段留白。
   现在改为：
     1. 栅格 align-items: stretch —— 侧栏与右列等高
     2. 侧栏自身为纵向 flex 容器
     3. 目录树 flex:1 自动占满剩余高度，超出时在树内独立滚动
     4. 底部统计条固定在侧栏底部
   --------------------------------------------------------------- */
.fs-layout {
    align-items: stretch !important;
}

.fs-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.fs-sidebar-head {
    flex: 0 0 auto;
}

.fs-tree {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* 细滚动条，避免打断视觉 */
    scrollbar-width: thin;
    scrollbar-color: rgba(29, 78, 216, .28) transparent;
}

.fs-tree::-webkit-scrollbar {
    width: 6px;
}

.fs-tree::-webkit-scrollbar-track {
    background: transparent;
}

.fs-tree::-webkit-scrollbar-thumb {
    background: rgba(29, 78, 216, .24);
    border-radius: 3px;
}

.fs-tree::-webkit-scrollbar-thumb:hover {
    background: rgba(29, 78, 216, .42);
}

.fs-sidebar-foot {
    flex: 0 0 auto;
}

/* 树顶部的「学习资源」根节点在滚动时保持可见 */
.fs-tree-item.fs-tree-root {
    position: sticky;
    top: -8px;
    z-index: 2;
    background: #fff;
    box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .18);
}

/* ---------------------------------------------------------------
   15. 修复账号下拉菜单被裁切
   ---------------------------------------------------------------
   .fs-toolbar 为了让顶部双色渐变线贴合圆角，加了 overflow:hidden，
   结果把挂在工具条下方的「账号菜单」（修改密码 / 退出登录）整块裁掉，
   表现为点「工作室管理员」没反应。
   现在：
     1. 工具条本身改为 overflow:visible
     2. 渐变线自己带圆角，不再依赖父级裁剪
     3. 账号区提升层级，确保菜单浮在其它内容之上
   --------------------------------------------------------------- */
.fs-toolbar {
    overflow: visible !important;
}

.fs-toolbar::before {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* 账号区与菜单层级 */
.fs-account {
    position: relative;
    z-index: 45;
}

.fs-account-menu {
    z-index: 60 !important;
}

/* 工具条内部其它内容不被菜单遮挡 */
.fs-toolbar-right {
    position: relative;
    z-index: 46;
}

/* ---------------------------------------------------------------
   16. 撤销侧栏内滚动，改为整页自然滚动
   ---------------------------------------------------------------
   第 14 节让侧栏 stretch 到与右列等高，结果出现两个问题：
     1. 目录树内部多出一条滚动条，7 个方向要单独滚，很别扭
     2. 侧栏卡片被拉得很高，目录列表下面留出一大块空白色块
   现在改为：
     1. 侧栏高度 = 内容高度，不再被拉伸，也就没有空白色块
     2. 目录树不设内部滚动，7 个方向全部平铺展开
     3. 整个页面像普通网页一样自然上下滚动
   --------------------------------------------------------------- */
.fs-layout {
    align-items: flex-start !important;
}

.fs-sidebar {
    display: block;
    height: auto;
    max-height: none;
}

.fs-tree {
    flex: none;
    overflow: visible !important;
}

/* 去掉上一版加的粘性根节点（不再需要内滚动） */
.fs-tree-item.fs-tree-root {
    position: static;
    box-shadow: none;
}

/* ---------------------------------------------------------------
   17. 侧栏最终方案：整页自然滚动 + 内容全部铺开 + 与右列齐平
   ---------------------------------------------------------------
   问题根源（v4.css:3625）：
       .fs-tree { max-height: 460px; overflow-y: auto; }
   目录树盒子被压到 460px，但 7 个方向 + 24 个学期目录实际需要约 1000px，
   内容溢出后就压在底部统计条上、还溢出白色卡片之外。

   最终规则：
     1. .fs-tree 解除 max-height，7 个方向全部平铺展开
     2. 侧栏高度由内容决定，并随右列一起 stretch 到"成员管理"那一行
     3. 不设任何内部滚动条，整页像普通网页一样自然上下滚动
   --------------------------------------------------------------- */
.fs-layout {
    align-items: stretch !important;
}

.fs-tree {
    max-height: none !important;
    overflow: visible !important;
    flex: none;
    height: auto;
}

.fs-sidebar {
    display: block;
    height: auto;
    max-height: none;
    overflow: hidden;
}

/* 底部统计条固定在目录树之后（不再被树的内容压住） */
.fs-sidebar-foot {
    position: relative;
    z-index: 2;
    background: #fbfcfd;
}

/* ---------------------------------------------------------------
   18. 目录树删除按钮
   ---------------------------------------------------------------
   后端本来就有 DELETE /api/folders/:id（仅管理员，且会保护
   「有子目录」或「有文件」的目录），这里补上前端入口：
   管理员登录时，鼠标悬停在任意目录上，右侧浮出一个垃圾桶图标。
   --------------------------------------------------------------- */
.fs-tree-del {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #b3bdcb;
    cursor: pointer;
    opacity: 0;
    transition: opacity .16s ease, background .16s ease, color .16s ease;
}

.fs-tree-item:hover .fs-tree-del {
    opacity: 1;
}

.fs-tree-del:hover {
    background: rgba(220, 38, 38, .10);
    color: #dc2626;
}

.fs-tree-del:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    opacity: 1;
}

.fs-tree-del:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* 触屏设备没有 hover，直接常驻显示 */
@media (hover: none) {
    .fs-tree-del {
        opacity: .55;
    }
}
