/* publicShare.css - 公开文件分享页面样式（完整版） */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: #333;
    min-height: 100vh;
    padding-top: 100px;
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
}

/* 隐藏空div，修复移动端大空白 */
div:empty {
    display: none !important;
}

/* ============================================================
   悬浮导航栏 - 所有链接（排除xsx图片、operate、users）
   ============================================================ */
body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    display: inline-block;
    position: fixed;
    top: 0;
    z-index: 1000;
    text-decoration: none;
    padding: 10px 6px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    background-color: rgba(52, 73, 94, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 导航链接悬停效果 */
body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    background-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ----- 各链接定位（桌面端） ----- */
body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 0;
    width: 7%;
    min-width: 50px;
}
body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 7%;
    width: 11%;
    min-width: 80px;
    background-color: #2ecc71;
}
body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 18%;
    width: 7%;
    min-width: 55px;
}
body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    display: none !important;
}
body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 25%;
    width: 9%;
    min-width: 65px;
}
body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 34%;
    width: 7%;
    min-width: 55px;
}
body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 41%;
    width: 7%;
    min-width: 55px;
}

/* 登录 - 桌面端放在悬浮窗和边界中间，字体大一倍 */
body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 72%;
    right: auto;
    width: 100px;
    min-width: 100px;
    background-color: transparent;
    color: #2c3e50;
    border-right: none;
    backdrop-filter: none;
    box-shadow: none;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 4px;
    text-decoration: underline;
    text-underline-offset: 10px;
    text-decoration-thickness: 4px;
    text-decoration-color: #2ecc71;
    height: 45px;
    line-height: 25px;
}
body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    background-color: transparent;
    transform: none;
    box-shadow: none;
    color: #2ecc71;
    text-decoration-color: #2c3e50;
}

/* 注册 - 紧挨登录右侧，字体大一倍 */
body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: calc(72% + 105px);
    right: auto;
    width: 100px;
    min-width: 100px;
    background-color: transparent;
    color: #2c3e50;
    border-right: none;
    backdrop-filter: none;
    box-shadow: none;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 4px;
    text-decoration: underline;
    text-underline-offset: 10px;
    text-decoration-thickness: 4px;
    text-decoration-color: #2ecc71;
    height: 45px;
    line-height: 25px;
}
body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    background-color: transparent;
    transform: none;
    box-shadow: none;
    color: #2ecc71;
    text-decoration-color: #2c3e50;
}

body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    left: 48%;
    width: 11%;
    min-width: 80px;
}

/* xsx图片链接单独处理，固定在右上角 */
body > a[href='/xsx'] {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: 55px;
    height: 45px;
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
}
body > a[href='/xsx'] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
}
body > a[href='/xsx'] img:hover {
    transform: none;
    animation: none;
}

/* ============================================================
   主标题
   ============================================================ */
h1 {
    margin: 30px auto 40px;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2ecc71;
    max-width: 90%;
    text-align: center;
    position: relative;
}


/* ============================================================
   上传表单美化
   ============================================================ */
form[action='/shareUpload'] {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: fit-content;
    max-width: 90%;
    margin: 20px auto 30px;
    padding: 18px 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(8px);
    border-radius: 60px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(46, 204, 113, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
form[action='/shareUpload']:hover {
    box-shadow: 0 12px 28px rgba(46, 204, 113, 0.2), 0 0 0 2px rgba(46, 204, 113, 0.4);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}
form[action='/shareUpload'] {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.3px;
}
form[action='/shareUpload'] input[type="file"] {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    width: auto;
    min-width: 220px;
}
form[action='/shareUpload'] input[type="file"]:hover {
    background: #ffffff;
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}
form[action='/shareUpload'] input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
    color: white;
    padding: 6px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
}
form[action='/shareUpload'] input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: scale(0.96);
}
form[action='/shareUpload'] input[type="submit"] {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
    padding: 10px 32px;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: inherit;
}
form[action='/shareUpload'] input[type="submit"]:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}
form[action='/shareUpload'] input[type="submit"]:active {
    transform: translateY(1px);
}
form[action='/shareUpload'] input[type="file"]:focus,
form[action='/shareUpload'] input[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.4);
}
form[action='/shareUpload'] input[type="file"]:valid {
    border-color: #2ecc71;
    background-color: #f0fff4;
}

/* ============================================================
   文件列表容器
   ============================================================ */
#fileList {
    width: 85%;
    max-width: 800px;
    margin: 30px auto 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 30px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#fileList:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ========== 文件项 - 图片+链接作为一个整体按钮 ========== */
#fileList > div {
    margin-bottom: clamp(12px, 2vw, 16px);
    padding: clamp(12px, 2vw, 16px);
    background-color: rgba(46, 204, 113, 0.1);
    border-radius: 10px;
    border-left: 4px solid #2ecc71;
    transition: all 0.3s ease;
    /* 用 flex 让图片和链接并排，且图片固定大小 */
    display: flex;
    align-items: center;
    gap: 12px;          /* 图片和文字间距 */
    position: relative;
    overflow: hidden;
    /* 让整个 div 可点击 —— 把链接设为 block 并撑满 */
}
#fileList > div:hover {
    transform: translateX(5px);
    background-color: rgba(46, 204, 113, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* ---------- 图片样式：统一大小 ---------- */
#fileList > div img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: cover;      /* 保证所有图片填满且不变形 */
    border-radius: 6px;
    display: block;
    flex-shrink: 0;         /* 防止图片被压缩 */
    background: #f0f0f0;    /* 图片加载前的占位背景 */
}

/* ---------- 链接样式：占满剩余空间，且点击区域包含图片 ---------- */
#fileList > div a {
    text-decoration: none;
    color: #2c3e50;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 500;
    /* 让链接撑满父容器剩余宽度，同时不覆盖图片区域 */
    flex: 1;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    /* 去掉原有的伪元素，因为图片已经单独存在 */
}
#fileList > div a:hover {
    color: #2ecc71;
}

/* 移除伪元素，因为我们用真实的 img 展示图标 */
#fileList > div a::before {
    display: none;
}
#fileList > div a::after {
    content: attr(data-extension);
    margin-left: auto;
    background-color: rgba(52, 73, 94, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #7f8c8d;
    font-weight: 600;
    flex-shrink: 0;
}
/* 鼠标悬停时，链接内文字变化，但不影响图片 */
#fileList > div a:hover::after {
    background-color: rgba(46, 204, 113, 0.2);
}
/* 鼠标悬停时，整个 div 内的图片不受影响，但保留统一效果 */
#fileList > div:hover a::before {
    display: none !important;  /* 覆盖之前的 hover 伪元素 */
}
/* 移除 hover 时的箭头变化，因为图片已经存在 */
#fileList > div a:hover::before {
    content: none !important;
}

/* ---------- 文件类型颜色指示（保留原样式） ---------- */
#fileList > div a[href$=".jpg"]::after,
#fileList > div a[href$=".jpeg"]::after,
#fileList > div a[href$=".png"]::after,
#fileList > div a[href$=".gif"]::after,
#fileList > div a[href$=".webp"]::after {
    background-color: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}
#fileList > div a[href$=".pdf"]::after {
    background-color: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}
#fileList > div a[href$=".zip"]::after,
#fileList > div a[href$=".rar"]::after,
#fileList > div a[href$=".7z"]::after {
    background-color: rgba(155, 89, 182, 0.15);
    color: #8e44ad;
}
#fileList > div a[href$=".txt"]::after,
#fileList > div a[href$=".doc"]::after,
#fileList > div a[href$=".docx"]::after {
    background-color: rgba(52, 73, 94, 0.15);
    color: #2c3e50;
}

/* ---------- 空状态和加载状态 ---------- */
#fileList:empty::before {
    content: "📁 暂无公开文件";
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 1.2rem;
    font-style: italic;
}
#fileList::after {
    content: attr(data-file-count);
    display: block;
    text-align: center;
    padding-top: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}
#fileList.loading::before {
    content: "⏳ 加载中...";
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #3498db;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ============================================================
   移动端折叠菜单（文字居中）
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-left: 15px;
        padding-right: 15px;
    }

    body > a[href='/essay'] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* 移除动画，防止闪现 */
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        animation: none !important;
    }

    /* 导航栏垂直堆叠 - 默认隐藏 */
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        position: fixed !important;
        display: block !important;
        width: 100% !important;
        left: 0 !important;
        right: auto !important;
        top: auto !important;
        padding: 8px 12px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        font-size: 0.9rem !important;
        height: 36px !important;
        text-align: center !important;
        padding-left: 12px !important;
        background-color: rgba(52, 73, 94, 0.95) !important;
        color: #fff !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        min-width: auto !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: none !important;
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s !important;
        line-height: 20px !important;
    }

    /* 展开状态 - 当body有nav-collapsed类时显示 */
    body.nav-collapsed > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* 设置垂直位置（按顺序） */
    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 0 !important; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 36px !important; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 72px !important; }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { display: none !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 108px !important; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 144px !important; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 180px !important; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 216px !important; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 252px !important; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 288px !important; }

    /* 移动端登录/注册悬停恢复（覆盖桌面透明背景） */
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover,
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        background-color: rgba(52, 73, 94, 0.95) !important;
        color: #fff !important;
        transform: none !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body > a[href='/xsx'] {
        position: fixed;
        top: 0;
        right: 0;
        width: 45px;
        height: 36px;
        z-index: 1001;
    }

    .nav-toggle-btn {
        display: block !important;
    }

    h1 {
        margin-top: 60px;
        font-size: 2rem;
    }

    form[action='/shareUpload'] {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px;
        border-radius: 32px;
        width: 90%;
        margin: 15px auto 25px;
        gap: 12px;
    }
    form[action='/shareUpload'] {
        font-size: 0.9rem;
        text-align: center;
    }
    form[action='/shareUpload'] input[type="file"] {
        width: 100%;
        min-width: unset;
        padding: 10px 15px;
        text-align: center;
    }
    form[action='/shareUpload'] input[type="file"]::file-selector-button {
        padding: 6px 16px;
        margin-right: 10px;
    }
    form[action='/shareUpload'] input[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    #fileList {
        width: 95%;
        padding: 20px;
    }

    /* 移动端：文件项垂直排列改为水平（图片在左，文字在右） */
    #fileList > div {
        flex-direction: row !important;   /* 保持水平排列 */
        align-items: center !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }

    /* 移动端图片适当缩小，但仍然统一大小 */
    #fileList > div img {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    /* 移动端链接去掉伪元素中的自动边距，保持文字完整 */
    #fileList > div a {
        font-size: 0.95rem !important;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }
    #fileList > div a::after {
        margin-left: auto;
        margin-top: 0;
        font-size: 0.7rem;
        padding: 2px 8px;
    }
}

/* 超小屏幕（≤480px） */
@media (max-width: 480px) {
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        font-size: 0.8rem !important;
        height: 32px !important;
        line-height: 20px !important;
    }
    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 0 !important; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 32px !important; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 64px !important; }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { display: none !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 96px !important; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 128px !important; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 160px !important; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 192px !important; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 224px !important; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) { top: 256px !important; }

    body > a[href='/xsx'] {
        width: 40px;
        height: 32px;
    }

    .nav-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 24px;
        top: 3px;
        left: 8px;
        display: block !important;
    }

    h1 {
        font-size: 1.8rem;
        margin-top: 50px;
    }

    form[action='/shareUpload'] {
        padding: 16px 18px;
        width: 95%;
    }
    form[action='/shareUpload'] input[type="file"] {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    form[action='/shareUpload'] input[type="file"]::file-selector-button {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    form[action='/shareUpload'] input[type="submit"] {
        padding: 10px;
        font-size: 0.9rem;
    }

    #fileList {
        padding: 14px;
    }
    #fileList > div {
        padding: 10px 12px !important;
        gap: 8px !important;
    }
    #fileList > div img {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }
    #fileList > div a {
        font-size: 0.85rem !important;
    }
    #fileList > div a::after {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        font-size: 0.65rem;
        padding: 10px 4px;
        height: 42px;
    }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']),
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        font-size: 0.6rem;
    }
    h1 {
        font-size: 2.8rem;
    }
    form[action='/shareUpload'] {
        gap: 12px;
        padding: 15px 25px;
    }
    form[action='/shareUpload'] input[type="file"] {
        min-width: 200px;
    }
    /* 平板端登录注册 - 保持大字体比例 */
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        left: 72%;
        font-size: 1.3rem;
        width: 90px;
        min-width: 90px;
        text-underline-offset: 8px;
        text-decoration-thickness: 3px;
    }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        left: calc(72% + 95px);
        font-size: 1.3rem;
        width: 90px;
        min-width: 90px;
        text-underline-offset: 8px;
        text-decoration-thickness: 3px;
    }

    /* 平板端图片保持统一大小 */
    #fileList > div img {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
        max-height: 44px;
    }
}

/* 桌面端优化 */
@media (min-width: 1025px) {
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}

/* ============================================================
   折叠按钮 (移动端)
   ============================================================ */
.nav-toggle-btn {
    display: none;
    position: fixed;
    top: 5px;
    left: 10px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.nav-toggle-btn:hover {
    background: #27ae60;
    transform: scale(1.02);
}

/* ============================================================
   桌面端：文章悬停显示随笔
   ============================================================ */
@media (min-width: 769px) {
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        position: fixed;
        top: 45px;
        left: 18%;
        width: 7%;
        min-width: 55px;
        z-index: 999;
        background-color: rgba(52, 73, 94, 0.98);
        backdrop-filter: blur(12px);
        border-radius: 0 0 8px 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        height: 40px;
        line-height: 40px;
        padding: 0 6px;
        font-size: 0.75rem;
        text-align: center;
        transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        transform: translateY(-10px);
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover ~ a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        background-color: #e67e22 !important;
    }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        background-color: #e67e22;
    }
}

/* ============================================================
   动画效果
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    animation: none !important;
}
h1 {
    animation: fadeIn 0.8s ease-out;
}
#fileList {
    animation: fadeIn 0.8s ease-out 0.2s both;
}
#fileList > div {
    animation: slideIn 0.5s ease-out;
}
#fileList > div:nth-child(odd) {
    animation-delay: 0.1s;
}
#fileList > div:nth-child(even) {
    animation-delay: 0.2s;
}

/* ============================================================
   装饰元素
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #2ecc71, #3498db, #9b59b6, #f39c12);
    z-index: 1002;
}
body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users'])::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px 3px 0 0;
}
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(46, 204, 113, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 30%, rgba(52, 152, 219, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 50% 80%, rgba(155, 89, 182, 0.05) 0%, transparent 20%);
    z-index: -1;
    pointer-events: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* ============================================================
   夜间模式（终极覆盖，桌面 + 移动端全生效）
   ============================================================ */

/* 1. body 背景变黑（覆盖渐变） */
body.dark-mode {
    background: #121212 !important;
    color: #e0e0e0 !important;
}

/* 2. 所有普通元素背景透明，继承文字颜色 */
body.dark-mode div:not(.visitor-stats):not(.about),
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode p, body.dark-mode span {
    background: transparent !important;
    color: inherit !important;
}

/* 3. 导航栏（桌面 + 移动端统一深色） */
body.dark-mode body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    background-color: rgba(20, 20, 35, 0.95) !important;
    color: #ccc !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}
body.dark-mode body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    background-color: #1a4a2a !important;
}

/* 4. 登录注册（桌面）下划线颜色调亮 */
body.dark-mode body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']),
body.dark-mode body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
    color: #81c784 !important;
    background-color: transparent !important;
    text-decoration-color: #81c784 !important;
}
body.dark-mode body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    color: #66bb6a !important;
}
body.dark-mode body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
    color: #81c784 !important;
}

/* 5. 移动端导航栏夜间模式 */
@media (max-width: 768px) {
    body.dark-mode body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        background-color: rgba(20, 20, 35, 0.98) !important;
        color: #ccc !important;
        border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    }
    body.dark-mode body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']),
    body.dark-mode body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        background-color: rgba(20, 20, 35, 0.98) !important;
        color: #ccc !important;
        text-decoration: none !important;
    }
    body.dark-mode body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover,
    body.dark-mode body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):hover {
        background-color: rgba(20, 20, 35, 0.98) !important;
        color: #ccc !important;
    }
    body.dark-mode.nav-collapsed > a:not([href='/xsx']):not([href='/operate']):not([href='/users']) {
        background-color: rgba(20, 20, 35, 0.98) !important;
        color: #ccc !important;
    }
}

/* 6. 主标题（夜间） */
body.dark-mode h1 {
    color: #e0e0e0 !important;
    border-bottom-color: #1a4a2a !important;
}

/* 7. 上传表单（夜间） */
body.dark-mode form[action='/shareUpload'] {
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.95), rgba(20, 20, 35, 0.9)) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(46, 204, 113, 0.2) !important;
    color: #ddd !important;
}
body.dark-mode form[action='/shareUpload']:hover {
    box-shadow: 0 12px 28px rgba(46, 204, 113, 0.1), 0 0 0 2px rgba(46, 204, 113, 0.3) !important;
}
body.dark-mode form[action='/shareUpload'] input[type="file"] {
    background: #2a2a3e !important;
    border-color: #3d3d5e !important;
    color: #ddd !important;
}
body.dark-mode form[action='/shareUpload'] input[type="file"]:hover {
    border-color: #2ecc71 !important;
    background: #333 !important;
}
body.dark-mode form[action='/shareUpload'] input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #1a4a2a, #0d3a1a) !important;
}
body.dark-mode form[action='/shareUpload'] input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #0d3a1a, #1a4a2a) !important;
}
body.dark-mode form[action='/shareUpload'] input[type="submit"] {
    background: linear-gradient(135deg, #1a4a2a, #0d3a1a) !important;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15) !important;
}
body.dark-mode form[action='/shareUpload'] input[type="submit"]:hover {
    background: linear-gradient(135deg, #0d3a1a, #1a4a2a) !important;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.2) !important;
}

/* 8. 文件列表（夜间） */
body.dark-mode #fileList {
    background-color: rgba(30, 30, 45, 0.95) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode #fileList:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4) !important;
}
body.dark-mode #fileList > div {
    background-color: rgba(46, 204, 113, 0.08) !important;
}
body.dark-mode #fileList > div:hover {
    background-color: rgba(46, 204, 113, 0.15) !important;
}
body.dark-mode #fileList > div a {
    color: #ddd !important;
}
body.dark-mode #fileList > div a:hover {
    color: #66bb6a !important;
}
body.dark-mode #fileList:empty::before {
    color: #666 !important;
}
body.dark-mode #fileList::after {
    color: #666 !important;
    border-top-color: rgba(255, 255, 255, 0.05) !important;
}
body.dark-mode #fileList.loading::before {
    color: #42a5f5 !important;
}

/* 9. 文件类型标签（夜间） */
body.dark-mode #fileList > div a::after {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #999 !important;
}
body.dark-mode #fileList > div a[href$=".jpg"]::after,
body.dark-mode #fileList > div a[href$=".jpeg"]::after,
body.dark-mode #fileList > div a[href$=".png"]::after,
body.dark-mode #fileList > div a[href$=".gif"]::after,
body.dark-mode #fileList > div a[href$=".webp"]::after {
    background-color: rgba(52, 152, 219, 0.15) !important;
    color: #42a5f5 !important;
}
body.dark-mode #fileList > div a[href$=".pdf"]::after {
    background-color: rgba(231, 76, 60, 0.15) !important;
    color: #ef5350 !important;
}
body.dark-mode #fileList > div a[href$=".zip"]::after,
body.dark-mode #fileList > div a[href$=".rar"]::after,
body.dark-mode #fileList > div a[href$=".7z"]::after {
    background-color: rgba(155, 89, 182, 0.15) !important;
    color: #ab47bc !important;
}
body.dark-mode #fileList > div a[href$=".txt"]::after,
body.dark-mode #fileList > div a[href$=".doc"]::after,
body.dark-mode #fileList > div a[href$=".docx"]::after {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #999 !important;
}

/* 10. 折叠按钮（夜间） */
body.dark-mode .nav-toggle-btn {
    background: #1a4a2a !important;
}
body.dark-mode .nav-toggle-btn:hover {
    background: #0d3a1a !important;
}

/* 11. 顶部装饰条（夜间） */
body.dark-mode::before {
    background: linear-gradient(to right, #1a4a2a, #1a3a5a, #3a1a5a, #5a3a1a) !important;
}

/* ============================================================
   夜间模式切换按钮 - 固定右中侧
   ============================================================ */
#toggleTheme {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    padding: 10px 14px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background 0.3s, box-shadow 0.3s;
    line-height: 1;
}
#toggleTheme:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
body.dark-mode #toggleTheme {
    background: rgba(40, 40, 60, 0.85);
    color: #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
body.dark-mode #toggleTheme:hover {
    background: rgba(60, 60, 80, 1);
}

/* 移动端切换按钮 */
@media (max-width: 768px) {
    #toggleTheme {
        right: 12px;
        padding: 8px 12px;
        font-size: 1.1rem;
        top: 50%;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.9);
    }
    body.dark-mode #toggleTheme {
        background: rgba(40, 40, 60, 0.9);
    }
}
@media (max-width: 480px) {
    #toggleTheme {
        right: 8px;
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
        padding: 0;
    }
}

/* ============================================================
   文件列表中的更新日期样式 - 新增
   ============================================================ */

/* 更新日期文本样式 - 字体小一点，灰色，靠右对齐 */
#fileList > div p {
    font-size: 0.7rem;
    color: #999;
    margin: 0;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* 文件项内部布局调整 - 图片 + 链接 + 日期，保持在一行 */
#fileList > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 链接自动占据剩余空间，日期固定在右侧 */
#fileList > div a {
    flex: 1;
    min-width: 0; /* 防止文字溢出 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移动端日期样式调整 */
@media (max-width: 768px) {
    #fileList > div {
        flex-wrap: nowrap;
        gap: 8px;
    }
    #fileList > div p {
        font-size: 0.6rem;
        color: #999;
        margin-left: auto;
        flex-shrink: 0;
        white-space: nowrap;
    }
    /* 移动端链接文字缩小，给日期腾空间 */
    #fileList > div a {
        font-size: 0.85rem !important;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 超小屏幕日期更小 */
@media (max-width: 480px) {
    #fileList > div p {
        font-size: 0.5rem;
        color: #aaa;
    }
    #fileList > div a {
        font-size: 0.75rem !important;
    }
    #fileList > div {
        gap: 5px;
    }
}

/* 平板设备日期调整 */
@media (min-width: 769px) and (max-width: 1024px) {
    #fileList > div p {
        font-size: 0.65rem;
    }
}

/* ============================================================
   夜间模式 - 日期颜色适配
   ============================================================ */
body.dark-mode #fileList > div p {
    color: #777;
}

/* 桌面端 - 日期悬停无变化，保持低调 */
#fileList > div p:hover {
    color: #999;
}
body.dark-mode #fileList > div p:hover {
    color: #777;
}

/* ============================================================
   文件列表卡片样式 - 增大尺寸，图片在左，日期在右下
   ============================================================ */

/* 文件列表容器 - 稍微加宽 */
#fileList {
    width: 90%;
    max-width: 900px;
    padding: clamp(25px, 4vw, 40px);
}

/* 每个卡片 - 增大内边距和间距 */
#fileList > div {
    padding: clamp(16px, 2.5vw, 24px) !important;
    margin-bottom: clamp(16px, 2.5vw, 20px) !important;
    border-left-width: 5px !important;
    border-radius: 12px !important;
    gap: 16px !important;
    min-height: 80px; /* 保证卡片高度 */
}

/* 图片 - 增大尺寸 */
#fileList > div img {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 8px !important;
}

/* 链接文字 - 增大字体 */
#fileList > div a {
    font-size: clamp(1.1rem, 2.2vw, 1.3rem) !important;
    font-weight: 600 !important;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 日期 - 放在右下角 */
#fileList > div p {
    font-size: 0.65rem;
    color: #999;
    margin: 0;
    padding: 0;
    /* 让日期固定在右下角 */
    align-self: flex-end;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0.3px;
    /* 添加一点上边距，让它靠在底部 */
    margin-top: auto;
    padding-top: 4px;
}

/* 卡片内部布局 - 让内容垂直居中，日期在底部 */
#fileList > div {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    position: relative;
    /* 使用grid布局更好控制 */
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 16px;
    align-items: center;
}

/* 图片 - 占据第一行第一列，跨两行 */
#fileList > div img {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}

/* 链接 - 第一行第二列 */
#fileList > div a {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
    align-self: center;
}

/* 日期 - 第二行第二列，靠右 */
#fileList > div p {
    grid-row: 2 / 3;
    grid-column: 2 / 3;
    justify-self: end;
    align-self: start;
    margin: 0;
    padding-top: 2px;
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 768px) {
    #fileList {
        width: 98%;
        padding: 16px;
    }

    /* 移动端卡片 - 使用grid布局 */
    #fileList > div {
        padding: 14px 16px !important;
        gap: 8px 12px !important;
        min-height: 70px !important;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }

    /* 移动端图片 - 适中大小 */
    #fileList > div img {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 50px !important;
        max-height: 50px !important;
        grid-row: 1 / 3;
        grid-column: 1 / 2;
    }

    /* 移动端链接 */
    #fileList > div a {
        font-size: 0.95rem !important;
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 移动端日期 - 右下角 */
    #fileList > div p {
        font-size: 0.55rem;
        grid-row: 2 / 3;
        grid-column: 2 / 3;
        justify-self: end;
        align-self: start;
        color: #aaa;
        padding-top: 2px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    #fileList {
        padding: 12px;
    }

    #fileList > div {
        padding: 12px 14px !important;
        gap: 6px 10px !important;
        min-height: 60px !important;
    }

    #fileList > div img {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        max-width: 42px !important;
        max-height: 42px !important;
    }

    #fileList > div a {
        font-size: 0.85rem !important;
    }

    #fileList > div p {
        font-size: 0.5rem;
        color: #bbb;
    }
}

/* ============================================================
   平板适配
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    #fileList > div img {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
    }

    #fileList > div a {
        font-size: 1.1rem !important;
    }

    #fileList > div p {
        font-size: 0.6rem;
    }
}

/* ============================================================
   夜间模式适配
   ============================================================ */
body.dark-mode #fileList > div p {
    color: #888;
}

body.dark-mode #fileList > div:hover p {
    color: #999;
}

/* 移动端夜间模式 */
@media (max-width: 768px) {
    body.dark-mode #fileList > div p {
        color: #777;
    }
}

@media (max-width: 480px) {
    body.dark-mode #fileList > div p {
        color: #666;
    }
}

/* 隔离 #bottom 不受全局样式影响 */
#bottom,
#bottom * {
    all: initial;
    display: revert;
}

/* 重新定义 #bottom 内部需要的样式 */
#bottom {
    display: block;
    padding: 0;
    margin: 0;
}

#bottom h5 {
    display: block;
    font-size: 0.83em;
    font-weight: bold;
    margin: 1.5em 0;
    text-align: center;
}

#bottom a {
    text-decoration: underline;
    cursor: pointer;
}


#bottom center {
    display: block;
    text-align: center;
}