/* xsx.css - 响应式美化样式（适配9个导航链接） */

/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
    background-image: url('/static/img/gcd.jpg');
    background-repeat: repeat;
    background-attachment: fixed;
}

/* 悬浮导航栏 - 9个链接样式 */
body > a:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    display: inline-block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    text-decoration: none;
    color: #fff;
    background-color: rgba(52, 73, 94, 0.95);
    padding: 10px 6px;
    margin: 0;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: none;
    text-align: center;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* 为每个导航链接定位 - 8个左侧导航链接 */
body > a[href='/']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 0;
    width: 8%;
    min-width: 55px;
}

body > a[href='/publicShare']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 8%;
    width: 12%;
    min-width: 85px;
}

body > a[href='/article']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 20%;
    width: 8%;
    min-width: 60px;
}

body > a[href='/chat']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 28%;
    width: 10%;
    min-width: 70px;
}

body > a[href='/tools']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 38%;
    width: 8%;
    min-width: 60px;
}

body > a[href='/login']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 46%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/signUp']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 53%;
    width: 7%;
    min-width: 55px;
}

body > a[href='/comment']:not([href$='.jpg']):not([href$='.png']):not([href$='.gif']):not([href='/xsx']) {
    left: 60%;
    width: 12%;
    min-width: 85px;
}

/* 图片链接（xsx）单独处理，固定在右上角 */
body > a[href='/xsx'] {
    position: fixed;
    top: 0;
    right: 0;
    left: auto !important;
    z-index: 1001;
    width: 55px;
    height: 45px;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    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;
}

/* 标题样式 */
h2 {
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a6fa5;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

/* 图片容器样式 */
body > div {
    min-height: 20px;
    margin: 15px 0;
    position: relative;
}

/* 在空div前添加装饰线 */
body > div:empty::before {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 20px 0;
}

/* 图片统一样式 */
img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    object-fit: cover;
}

/* 特定图片尺寸设置 */
img[alt^="xjp"] {
    width: 100%;
    max-width: 600px;
    height: auto;
    min-height: 400px;
    object-fit: cover;
}

/* 图片悬停效果 */
img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 图片alt文本美化（注意：CSS伪元素对img无效，此样式仅供参考） */
img[alt] {
    position: relative;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-top: 100px;
    }
    
    /* 导航栏移动端垂直堆叠 */
    body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
        position: fixed;
        display: block;
        width: 100% !important;
        left: 0 !important;
        top: auto;
        padding: 8px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.8rem;
        height: 36px;
        text-align: left;
        padding-left: 20px;
        border-radius: 0;
    }
    
    /* 为每个导航链接设置垂直位置 - 8个链接 */
    body > a[href='/']:not([href='/xsx']) {
        top: 0;
    }
    
    body > a[href='/publicShare']:not([href='/xsx']) {
        top: 36px;
    }
    
    body > a[href='/article']:not([href='/xsx']) {
        top: 72px;
    }
    
    body > a[href='/chat']:not([href='/xsx']) {
        top: 108px;
    }
    
    body > a[href='/tools']:not([href='/xsx']) {
        top: 144px;
    }
    
    body > a[href='/login']:not([href='/xsx']) {
        top: 180px;
    }
    
    body > a[href='/signUp']:not([href='/xsx']) {
        top: 216px;
    }
    
    body > a[href='/comment']:not([href='/xsx']) {
        top: 252px;
    }
    
    /* xsx图片链接在移动端调整位置 */
    body > a[href='/xsx'] {
        position: fixed;
        top: 0;
        right: 0;
        width: 45px;
        height: 36px;
    }
    
    h2 {
        font-size: 24px;
        margin: 20px 0 15px 0;
    }
    
    /* 移动端图片尺寸调整 */
    img[alt^="xjp"] {
        height: auto;
        max-width: 100%;
    }
    
    /* 减少移动端图片间距 */
    body > div:empty::before {
        margin: 15px 0;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-top: 100px;
    }
    
    body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
        font-size: 0.7rem;
        padding: 6px 10px;
        height: 32px;
    }
    
    body > a[href='/']:not([href='/xsx']) {
        top: 0;
    }
    
    body > a[href='/publicShare']:not([href='/xsx']) {
        top: 32px;
    }
    
    body > a[href='/article']:not([href='/xsx']) {
        top: 64px;
    }
    
    body > a[href='/chat']:not([href='/xsx']) {
        top: 96px;
    }
    
    body > a[href='/tools']:not([href='/xsx']) {
        top: 128px;
    }
    
    body > a[href='/login']:not([href='/xsx']) {
        top: 160px;
    }
    
    body > a[href='/signUp']:not([href='/xsx']) {
        top: 192px;
    }
    
    body > a[href='/comment']:not([href='/xsx']) {
        top: 224px;
    }
    
    body > a[href='/xsx'] {
        width: 40px;
        height: 32px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    /* 更小屏幕的图片尺寸调整 */
    img[alt^="xjp"] {
        height: auto;
        min-height: 300px;
    }
    
    img {
        margin: 15px auto;
    }
}

/* 平板设备适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 20px;
        padding-top: 70px;
    }
    
    body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
        font-size: 0.7rem;
        padding: 10px 4px;
        height: 42px;
    }
    
    img[alt^="xjp"] {
        height: auto;
        max-width: 700px;
    }
}

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

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

img {
    animation: fadeIn 0.5s ease-out;
}

body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
    animation: slideInFromTop 0.5s ease-out;
}

/* 添加顶部装饰线 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, #4a6fa5, #3498db, #2ecc71, #f39c12);
    z-index: 1002;
}

/* 为不同图片添加细微区别 */
img[alt="xjpzqsy"] {
    border-left: 4px solid #3498db;
}

img[alt="xjpzzd"] {
    border-left: 4px solid #2ecc71;
}

img[alt="xjpzxm"] {
    border-left: 4px solid #e74c3c;
}

img[alt="xjpznd"] {
    border-left: 4px solid #f39c12;
}

img[alt="xjpfpgs"] {
    border-left: 4px solid #9b59b6;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 打印样式 */
@media print {
    body > a:not([href='/xsx']) {
        display: none;
    }
    
    img {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body::before {
        display: none;
    }
}

/* 移动端导航栏图标 */
@media (max-width: 768px) {
    body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif'])::before {
        margin-right: 8px;
        font-size: 0.9rem;
    }
}

/* ========= 移动端折叠/展开按钮样式 ========= */
.nav-toggle-btn {
    display: none;
    position: fixed;
    top: 5px;
    left: 10px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    background: #4a6fa5;
    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: #3a5a8a;
    transform: scale(1.02);
}

/* 移动端显示按钮 */
@media (max-width: 768px) {
    .nav-toggle-btn {
        display: block;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .nav-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 24px;
        top: 3px;
        left: 8px;
    }
}

/* ========= 移动端折叠/展开功能（默认展开，可收缩） ========= */
@media (max-width: 768px) {
    /* 导航栏默认展开状态 */
    body > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }
    
    /* 收缩状态：点击按钮后隐藏 */
    body.nav-collapsed > a:not([href='/xsx']):not([href$='.jpg']):not([href$='.png']):not([href$='.gif']) {
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
    }
}

