/* 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;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
#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 a {
    text-decoration: none;
    color: #2c3e50;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 500;
    display: flex;
    align-items: center;
    width: 100%;
    transition: color 0.3s ease;
}
#fileList a:hover {
    color: #2ecc71;
}
#fileList a::before {
    content: "📄";
    margin-right: 12px;
    font-size: 1.2em;
}
#fileList 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;
}
#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;
}

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

/* ============================================================
   移动端折叠菜单（文字居中）
   ============================================================ */
@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: column;
        align-items: flex-start;
    }
    #fileList a::after {
        margin-left: 0;
        margin-top: 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 a {
        font-size: 0.95rem;
    }
}

/* 平板设备 */
@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;
    }
}

/* 桌面端优化 */
@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 a {
    color: #ddd !important;
}
body.dark-mode #fileList 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 a::after {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #999 !important;
}
body.dark-mode #fileList a[href$=".jpg"]::after,
body.dark-mode #fileList a[href$=".jpeg"]::after,
body.dark-mode #fileList a[href$=".png"]::after,
body.dark-mode #fileList a[href$=".gif"]::after,
body.dark-mode #fileList a[href$=".webp"]::after {
    background-color: rgba(52, 152, 219, 0.15) !important;
    color: #42a5f5 !important;
}
body.dark-mode #fileList a[href$=".pdf"]::after {
    background-color: rgba(231, 76, 60, 0.15) !important;
    color: #ef5350 !important;
}
body.dark-mode #fileList a[href$=".zip"]::after,
body.dark-mode #fileList a[href$=".rar"]::after,
body.dark-mode #fileList a[href$=".7z"]::after {
    background-color: rgba(155, 89, 182, 0.15) !important;
    color: #ab47bc !important;
}
body.dark-mode #fileList a[href$=".txt"]::after,
body.dark-mode #fileList a[href$=".doc"]::after,
body.dark-mode #fileList 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;
    }
}