::-webkit-scrollbar{
    width: 5px;
}

::-webkit-scrollbar-track{
    background-color: transparent;
}

::-webkit-scrollbar-thumb{
    background-color: rgb(207, 192, 175);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover{
    background-color: rgb(187, 152, 109);
}

html{
    scroll-behavior: smooth;
}

body{
    background-color: #F0EFEA;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.rhine-lab{
    position: fixed;
    width: 15vw;
    height: 6.5vw;
    margin: 40px 60px;
    color: rgb(0, 0, 0,0.9);
    border-left: 2px solid black;
}

.line1{
    font-size: 2vw;
    font-weight: 700;
    padding: 3px 5px;
    margin: 0%;
}

.line2{
    font-size: 0.8vw;
    padding: 2px 5px;
    margin: 0%;
}

.line3{
    font-size: 1.5vw;
    padding: 1px 10px;
    margin: 0%;
}

.bottom{
    position: fixed;
    bottom: 0;
    right: 20px;
    color: rgb(0, 0, 0,0.8);
}

.logo-black{
    position: fixed;
    width: 5.5vw;
    bottom: 50px;
    right: 80px;
}

/* ---------- 主标题 ---------- */

.title{
    position: fixed;
    width: 13vw;
    top: 19vh;
    left: 60px;
    margin: 0;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 2.7vw;
    font-weight: 700;
    border-bottom: 3px solid black;
}

.subtitle{
    position: fixed;
    top: 28vh;
    left: 62px;
    margin: 0;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 1.2vw;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgb(0, 0, 0, 0.85);
}

.subtitle span{
    display: block;
    font-size: 0.75vw;
    font-weight: 500;
    letter-spacing: 0.25em;
    opacity: 0.55;
    margin-top: 3px;
}

/* ---------- 连接列表 ---------- */

.links{
    position: fixed;
    top: 36vh;
    left: 80px;
    width: 72vw;
    max-height: 57vh;
    display: grid;
    /* 自适应列数: 宽屏自动排到 3~5 列, 窄屏退化为 1~2 列 */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.6vh 2vw;
    overflow-y: auto;
    padding-right: 1vw;
}

.card{
    position: relative;
    display: block;
    padding: 1.1vw 1.2vw 1.1vw 1.3vw;
    border-left: 2px solid black;
    border-bottom: 1px solid rgba(0, 0, 0, 0.45);
    color: rgb(0, 0, 0, 0.9);
    text-decoration: none;
    transition: transform 0.5s ease-out, color 0.3s ease-in-out,
                background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.card:hover{
    color: rgb(187, 152, 109);
    background-color: rgba(255, 255, 255, 0.4);
    border-left-color: rgb(187, 152, 109);
    transform: translateX(-15px);
}

.card .code{
    position: absolute;
    top: 1.1vw;
    right: 1.2vw;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 0.7vw;
    font-weight: 600;
    letter-spacing: 0.2em;
    opacity: 0.45;
}

.card .name{
    margin: 0 0 0.5vw 0;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 1.35vw;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.card .name span{
    display: inline-block;
    margin-left: 0.6vw;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 0.85vw;
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.75;
    transition: opacity 0.3s ease-in-out;
}

.card .desc{
    margin: 0 0 0.7vw 0;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 0.92vw;
    line-height: 1.65;
    text-align: justify;
}

.card .url{
    margin: 0;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 0.78vw;
    letter-spacing: 0.02em;
    opacity: 0.55;
    word-break: break-all;
}

.card .url::before{
    content: "▸ ";
    opacity: 0.7;
}

/* ---------- 右侧导航 ---------- */

.content{
    position: fixed;
    display: flex;
    gap: 0;
    flex-direction: column;
    width: 13vw;
    height: 24vw;
    gap: 20px;
    right: 5vw;
    bottom: 43vh;
}

.content button{
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    height: 5vw;
    width: 13vw;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 1.5vw;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: transform 0.5s ease-out, color 0.3s ease-in-out;
}

.content button:hover{
    color: rgb(187, 152, 109);
    transform: translateX(-15px);
}

.index{
    border: none;
    border-bottom: 1px solid black;
}

.overview{
    border: none;
    border-bottom: 1px solid black;
}

.history{
    border: none;
    border-bottom: 1px solid black;
}

.department{
    border: none;
    border-bottom: 1px solid black;
}

.section{
    border: none;
    border-bottom: 1px solid black;
}

.external{
    border: none;
    border-bottom: 1px solid black;
    color: rgb(187, 152, 109);
}

a{
    padding: 0;
    margin: 0;
    text-decoration: none;
    color: black;
}

/* ---------- 窄屏降级 ---------- */

@media (max-width: 900px){
    html{
        -webkit-text-size-adjust: 100%;
    }

    body{
        display: flex;
        flex-direction: column;
        /* svh = 浏览器地址栏展开时的可视高度; 100vh 在手机上偏大会导致必须下滑 */
        min-height: 100vh;
        min-height: 100svh;
        background-attachment: scroll;
    }

    /* 背景: 桌面端是 fixed + cover (以视口为基准缩放)。
       移动端若保持 scroll, cover 会按整页高度放大图片, 所以改成固定定位层来复刻桌面端效果 */
    html body{
        background-image: none;
    }

    body::before{
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: url("../image/background.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        pointer-events: none;
        z-index: -1;
    }

    /* 页眉 */
    .rhine-lab{
        position: relative;
        width: auto;
        height: auto;
        margin: 20px 20px 0;
        order: -3;
    }

    .line1{
        font-size: 26px;
        padding: 2px 4px;
    }

    .line2{
        font-size: 10px;
        padding: 2px 4px;
    }

    .line3{
        font-size: 19px;
        padding: 2px 8px;
    }

    /* 右侧竖排导航 -> 顶部两列 */
    .content{
        position: relative;
        right: auto;
        bottom: auto;
        width: auto;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0;
        margin: 18px 20px 0;
        order: -2;
    }

    .content a{
        flex: 0 0 46%;
        padding: 0;
        margin: 0;
    }

    .content button{
        width: 100%;
        height: 44px;
        font-size: 16px;
        text-align: left;
    }

    .content button:hover{
        transform: none;
    }

    /* 标题 */
    .title{
        position: relative;
        top: auto;
        left: auto;
        width: fit-content;
        margin: 26px 20px 0;
        font-size: 34px;
        order: 0;
    }

    .subtitle{
        position: relative;
        top: auto;
        left: auto;
        margin: 10px 20px 0;
        font-size: 17px;
    }

    .subtitle span{
        font-size: 11px;
    }

    /* 链接卡片: 单列，铺满宽度 */
    .links{
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        max-height: none;
        grid-template-columns: 1fr;
        gap: 18px;
        margin: 24px 20px 0;
        padding-right: 0;
        overflow: visible;
        order: 1;
    }

    .card{
        padding: 16px 16px 16px 16px;
    }

    .card:hover{
        transform: none;
    }

    .card .code{
        top: 16px;
        right: 16px;
        font-size: 11px;
    }

    .card .name{
        font-size: 20px;
        margin-bottom: 8px;
    }

    .card .name span{
        font-size: 14px;
        margin-left: 8px;
    }

    .card .desc{
        font-size: 15px;
        margin-bottom: 10px;
    }

    .card .url{
        font-size: 13px;
    }

    /* 页脚 */
    .foot{
        order: 5;
        margin-top: auto;
        padding-top: 32px;
        text-align: right;
    }

    .bottom{
        position: relative;
        right: auto;
        bottom: auto;
        margin: 0 20px 8px;
        font-size: 12px;
    }

    .logo-black{
        position: relative;
        right: auto;
        bottom: auto;
        width: 64px;
        margin: 0 20px 18px 0;
    }
}
