/* ============================================================
   topButton.css - 顶部导航悬浮按钮样式
   ============================================================ */

body {
    background-image: url("/static/img/background.jpg");
}

/* ----- 桌面端默认隐藏折叠按钮 ----- */
.nav-toggle-btn {
    display: none;
}

/* 悬浮导航栏 - 基础样式 */
body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    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']):not([href='/rss']):hover {
    background-color: #3498db;
    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']):not([href='/rss']) {
    left: 0;
    width: 7%;
    min-width: 50px;
    background-color: #3498db;
}

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

body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    left: 18%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    display: none !important;
}

body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    left: 25%;
    width: 9%;
    min-width: 65px;
}

body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    left: 34%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
    left: 41%;
    width: 7%;
    min-width: 55px;
}

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

/* 登录 & 注册 - 特殊样式 */
body > a[href='/login']:not([href^='/article/']) {
    left: 72% !important;
    right: auto !important;
    width: 100px !important;
    min-width: 100px !important;
    background-color: transparent !important;
    color: #2c3e50 !important;
    border-right: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    padding: 10px 4px !important;
    text-decoration: underline !important;
    text-underline-offset: 10px !important;
    text-decoration-thickness: 4px !important;
    text-decoration-color: #3498db !important;
    height: 45px !important;
    line-height: 25px !important;
}

body > a[href='/signUp']:not([href^='/article/']) {
    left: calc(72% + 105px) !important;
    right: auto !important;
    width: 100px !important;
    min-width: 100px !important;
    background-color: transparent !important;
    color: #2c3e50 !important;
    border-right: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    padding: 10px 4px !important;
    text-decoration: underline !important;
    text-underline-offset: 10px !important;
    text-decoration-thickness: 4px !important;
    text-decoration-color: #3498db !important;
    height: 45px !important;
    line-height: 25px !important;
}

/* RSS & 小红图 - 右侧固定 */
body > a[href='/rss'] {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: 55px;
    height: 45px;
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
    display: block;
}

body > a[href='/rss'] img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    border: none;
    margin: 0;
    padding: 2px;
}

body > a[href='/rss'] img:hover {
    opacity: 0.8;
}

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

/* 文章悬停显示随笔（桌面） */
@media (min-width: 769px) {
    body > a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        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']):not([href='/rss']):hover ~ a[href='/essay']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        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']):not([href='/rss']):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']):not([href='/rss']):hover {
        background-color: #e67e22;
    }

    /* 桌面端再次确保折叠按钮隐藏 */
    .nav-toggle-btn {
        display: none !important;
    }
}

/* 移动端折叠导航 */
@media (max-width: 768px) {
    .nav-toggle-btn {
        display: block !important;
        position: fixed;
        top: 5px;
        left: 10px;
        z-index: 1002;
        width: 44px;
        height: 44px;
        background: #3498db;
        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);
    }

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

    body.nav-collapsed > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 0 !important; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 36px !important; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 72px !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 108px !important; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 144px !important; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 180px !important; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 216px !important; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 252px !important; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 288px !important; }

    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']):hover,
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']):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='/rss'] {
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 45px !important;
        height: 36px !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        z-index: 1001 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        pointer-events: auto !important;
        display: block !important;
        font-size: 0 !important;
        line-height: 0 !important;
        min-width: unset !important;
        border-right: none !important;
    }

    body > a[href='/rss'] img {
        max-height: 36px !important;
        max-width: 45px !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        display: block !important;
        background: transparent !important;
        border: none !important;
        margin: 0 !important;
        padding: 2px !important;
    }

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

/* 超小屏导航调整 */
@media (max-width: 480px) {
    .nav-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 24px;
        top: 3px;
        left: 8px;
    }

    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        font-size: 0.7rem !important;
        padding: 6px 10px !important;
        height: 32px !important;
        line-height: 20px !important;
    }

    body > a[href='/']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 0 !important; }
    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 32px !important; }
    body > a[href='/article']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 64px !important; }
    body > a[href='/chat']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 96px !important; }
    body > a[href='/tools']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 128px !important; }
    body > a[href='/games']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 160px !important; }
    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 192px !important; }
    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 224px !important; }
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) { top: 256px !important; }

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

    body > a[href='/rss'] img {
        max-height: 32px !important;
        max-width: 40px !important;
    }

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

/* 平板设备导航微调 */
@media (min-width: 769px) and (max-width: 1024px) {
    body > a:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        font-size: 0.65rem;
        padding: 10px 4px;
        height: 42px;
    }

    body > a[href='/publicShare']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']),
    body > a[href='/comment']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        font-size: 0.6rem;
    }

    body > a[href='/login']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        left: 72%;
        font-size: 1.15rem;
        width: 70px;
        min-width: 70px;
        text-underline-offset: 8px;
        text-decoration-thickness: 3px;
    }

    body > a[href='/signUp']:not([href='/xsx']):not([href='/operate']):not([href='/users']):not([href='/rss']) {
        left: calc(72% + 75px);
        font-size: 1.15rem;
        width: 70px;
        min-width: 70px;
        text-underline-offset: 8px;
        text-decoration-thickness: 3px;
    }
}

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

/* ============================================================
   语言按钮美化 + 悬停效果
   ============================================================ */

#language {
    position: fixed;
    top: 0;
    left: 63%;                 /* 登录按钮左侧，可微调 */
    z-index: 1000;
    height: 45px;              /* 与导航栏高度一致 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    pointer-events: auto;
}

#language button {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-weight: 700;          /* 黑体 */
    border: 2px solid #000;    /* 黑边 */
    background-color: #fff;    /* 白底 */
    color: #000;               /* 黑色文字 */
    border-radius: 50px;       /* 椭圆形 */
    padding: 6px 22px;
    font-size: 0.8rem;
    cursor: pointer;           /* 手型指针，表示可点击 */
    outline: none;
    white-space: nowrap;
    line-height: 1.4;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);  /* 轻微阴影 */
    transition: all 0.3s ease; /* 平滑过渡 */
    letter-spacing: 1px;
}

/* 悬停效果：上浮 + 阴影加深 + 背景轻微变化 */
#language button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background-color: #f5f5f5;
}

/* 移动端适配（≤768px） */
@media (max-width: 768px) {
    #language {
        top: 5px;
        left: 60px;            /* 折叠按钮右侧 */
        height: 44px;
        width: 44px;
    }
    #language button {
        width: 44px;
        height: 44px;
        border-radius: 50% !important;   /* 移动端变为圆形 */
        padding: 0 !important;
        font-size: 0 !important;         /* 隐藏文字 */
        color: transparent !important;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #000;
        background-color: #fff;
        position: relative;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }
    /* 用伪元素显示地球图标 */
    #language button::before {
        content: '🌐';
        font-size: 22px;
        color: #000;
        font-weight: normal;
    }
    /* 移动端悬停效果：轻微放大 */
    #language button:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
        background-color: #f5f5f5;
    }
}

/* 超小屏（≤480px）微调 */
@media (max-width: 480px) {
    #language {
        top: 3px;
        left: 52px;
        height: 38px;
        width: 38px;
    }
    #language button {
        width: 38px;
        height: 38px;
    }
    #language button::before {
        font-size: 18px;
    }
}

/* 平板（769~1024px）微调位置 */
@media (min-width: 769px) and (max-width: 1024px) {
    #language {
        left: 61%;
    }
    #language button {
        font-size: 0.7rem;
        padding: 4px 16px;
    }
}

