/* 基础变量 */
:root {
    --primary: #1a5490;
    --primary-dark: #123a63;
    --secondary: #2c7ac9;
    --accent: #ff6b35;
    --bg: #f5f7fa;
    --text: #1f2d3d;
    --light-text: #6b7b8c;
    --border: #e3e8ef;
    --shadow: 0 10px 30px rgba(18, 58, 99, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Han Sans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }

ul { list-style: none; }

a { text-decoration: none; color: inherit; }

.wl {
    width: min(1200px, 96vw);
    margin: 0 auto;
}

.clearfix::after { content: ""; display: block; clear: both; }
.fl { float: left; }
.fr { float: right; }

main { padding-bottom: 60px; }

/* 头部 */
.site-header {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar { border-bottom: 1px solid var(--border); }

.logo {
    display: flex;
    align-items: center;
    height: 70px;
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 3px;
}

.logo-text {
    font-size: 20px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 420px;
}

.logo-line {
    display: block;
    white-space: nowrap;
}

.logo-r {

    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    background: #f0f4fa;
    border-radius: 999px;
    padding: 6px 16px;
}

.search-box form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input[type="text"] {
    border: none;
    background: transparent;
    padding: 6px;
    min-width: 260px;
    font-size: 14px;
    color: var(--text);
}

.search-box input[type="text"]:focus { outline: none; }

.search-box input[type="submit"] {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}

.logout-form {
    display: inline;
    margin: 0;
}

.logout-form button {
    font: inherit;
}

.login, .regis {

    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 14px;
    transition: all 0.3s;
}

.regis {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.login:hover, .regis:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 导航 */
.nav { background: var(--primary); }

/* 默认隐藏汉堡按钮，仅在手机端（并且启用 JS）时显示 */
.nav-toggle { display: none; }

.nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.nav-list > li {
    position: relative;
    flex: 1;
    text-align: center;
}

.navs {
    display: block;
    padding: 16px 0;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s;
}

.navs:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-sec, .nav-mega {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 14px 20px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 10;
}

.nav-has-children:hover .nav-sec,
.nav-has-children:focus-within .nav-sec,
.nav-has-children:hover .nav-mega,
.nav-has-children:focus-within .nav-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-sec li + li { border-top: 1px solid var(--border); }

.nav-sec a, .nav-mega a {
    display: block;
    padding: 8px 4px;
    color: var(--text);
    font-size: 14px;
}

.nav-sec a:hover, .nav-mega a:hover { color: var(--primary); }

.nav-mega { width: 520px; }

.nav-mega ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 6px 18px;
}

/* 横幅轮播 */
.banner { margin-top: 20px; }

.slider {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: 24px;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.slide.active { opacity: 1; }

.slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(18,58,99,0.78), rgba(18,58,99,0.12));
    z-index: 1;
    pointer-events: none;
}

.slide-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.slide-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 80px;
    color: #fff;
    max-width: 600px;
}

.slide-content h2 {
    font-size: 42px;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.slide-content p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}


.slider-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    cursor: pointer;
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

/* 新闻模块 */
.news {
    margin-top: 40px;
    padding: 30px 0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-radius: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(26, 84, 144, 0.08);
}

.news::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.news::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -200px;
    top: -220px;
    background: radial-gradient(circle, rgba(44, 122, 201, 0.18) 0%, transparent 65%);
    pointer-events: none;
}

.news::before,
.news::after {
    z-index: 0;
}

.news > * {
    position: relative;
    z-index: 1;
}

.news .title { text-align: center; margin-bottom: 24px; }


.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.section-title::before,
.section-title::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: translateY(-50%);
}

.section-title::before { left: -50px; }
.section-title::after { right: -50px; }

.title {
    display: flex;
    justify-content: center;
    align-items: center;
}


.new-l {
    width: 58%;
    padding: 0 30px;
    border-right: 1px solid var(--border);
}

.new-pic li {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(26, 84, 144, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.new-pic li:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(18, 58, 99, 0.12);
    border-color: rgba(26, 84, 144, 0.18);
}


.new-tu {
    width: 180px;
    height: 120px;
    overflow: hidden;
    border-radius: 16px;
    margin-right: 20px;
    position: relative;
}

.new-tu::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    pointer-events: none;
}


.new-tu img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.new-pic li:hover .new-tu img {
    transform: scale(1.04);
}


.new-c { width: calc(100% - 200px); }

.new-c h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary);
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-link:hover h3 {
    color: #0a2540;
}

.news-inline-link {
    color: inherit;
    text-decoration: none;
    margin-right: 8px;
}

.news-inline-link:hover {
    color: var(--primary);
}

.new-c p {

    color: var(--light-text);
    font-size: 14px;
    margin-bottom: 10px;
}

.new-c span { font-size: 12px; color: #9aa7b8; }

.new-r { width: 42%; padding: 0 30px; }

.news-slide {
    position: relative;
    overflow: hidden;
}

.news-con {
    display: flex;
    width: 100%;
    transition: transform 0.6s ease;
}

.news-list {
    width: 100%;
    flex: 0 0 100%;
}


.news-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.news-list h3 {
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--primary);
}

.news-list span { font-size: 12px; color: #94a3b8; }

.news-list p {
    font-size: 14px;
    color: var(--light-text);
    margin-top: 6px;
}

.flex-control-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.flex-control-nav li { list-style: none; }

.flex-dot {
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--light-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    transition: all 0.2s ease;
}

.flex-dot.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* 研究会介绍 */
.main { margin-top: 40px; }

.main-list {
    display: grid;
    grid-template-columns: 320px 1fr 140px;
    gap: 30px;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 32px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(26, 84, 144, 0.08);
}

.main-list::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    left: -240px;
    bottom: -240px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.14) 0%, transparent 65%);
    pointer-events: none;
}

.main-list::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--secondary), var(--primary));
}

.main-list::before,
.main-list::after {
    z-index: 0;
}

.main-list > * {
    position: relative;
    z-index: 1;
}

.main-list:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(18, 58, 99, 0.15);
}



.main-list .pic img {
    border-radius: 16px;
    height: 220px;
    object-fit: cover;
}

.mian-wenzi h3 { font-size: 26px; color: var(--primary); margin-bottom: 16px; }
.mian-wenzi p { color: var(--light-text); }

.gengduo {
    text-align: center;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 2px;
}

/* 理事风采 */
.director-in { margin-top: 40px; }

.director-slider {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(26, 84, 144, 0.08);
}

.director-slider::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
}

.director-slider::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    right: -260px;
    bottom: -260px;
    background: radial-gradient(circle, rgba(26, 84, 144, 0.16) 0%, transparent 66%);
    pointer-events: none;
}

.director-slider::before,
.director-slider::after {
    z-index: 0;
}

.director-slider > * {
    position: relative;
    z-index: 1;
}

/* 自适应显示数量：根据容器宽度自动换行，且整行居中对齐 */

.dir-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, 140px);
    justify-content: center;
    gap: 22px 28px;
}

.dir-list li {
    text-align: center;
    padding: 10px 8px;
    border-radius: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dir-list li:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(18, 58, 99, 0.12);
    background: rgba(255, 255, 255, 0.65);
}


.dir-tu {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    position: relative;
    box-shadow: 0 10px 24px rgba(18, 58, 99, 0.12);
}

.dir-tu::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.65),
        0 0 0 6px rgba(26, 84, 144, 0.08);
    pointer-events: none;
}


.dir-tu img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.dir-list h3 { font-size: 16px; color: var(--primary); }
.dir-list p { color: var(--light-text); font-size: 13px; }


#directorDetails {
    margin-top: 24px;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.cut-con { display: none; }
.cut-con.active { display: block; }

.cut-con h3 { font-size: 20px; color: var(--primary); margin-bottom: 12px; }
.cut-con span { font-size: 14px; color: var(--light-text); margin-left: 8px; }

/* 友情链接 */
.friend-links {
    margin-top: 40px;
}

.friend-links .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.friend-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(26, 84, 144, 0.10);
    position: relative;
    overflow: hidden;
}

.friend-link-item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.friend-link-item::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -120px;
    top: -120px;
    background: radial-gradient(circle, rgba(26, 84, 144, 0.14) 0%, transparent 65%);
    pointer-events: none;
}

.friend-link-item::before,
.friend-link-item::after {
    z-index: 0;
}

.friend-link-item > * {
    position: relative;
    z-index: 1;
}

.friend-link-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px rgba(26, 84, 144, 0.2);
    border-color: rgba(26, 84, 144, 0.28);
}



.link-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    background: rgba(26, 84, 144, 0.08);
    flex-shrink: 0;
}


.link-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    font-size: 18px;
    color: var(--secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.friend-link-item:hover .link-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

.friend-links .empty-state {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: var(--light-text);
}

/* 页脚 */
.site-footer {
    margin-top: 60px;
    background: #0f1c2e;
    color: #94a3b8;
    padding: 30px 0;
}

.site-footer a {
    color: #cbd5f5;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.site-footer a:hover {
    color: #ffffff;
}

.site-footer a:focus-visible {
    outline: 2px solid rgba(203, 213, 245, 0.7);
    outline-offset: 2px;
    border-radius: 4px;
}

.foot-r span { margin: 0 8px; color: #3b4a61; }

/* 响应式 */
@media (max-width: 1024px) {
    .top-bar .wl,
    .nav .wl,
    .news .wl,
    .main .wl,
    .director-in .wl,
    .display .wl { width: 94vw; }

    .news .fl { float: none; width: 100%; border-right: none; }
    .main-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .logo-r { flex-wrap: wrap; justify-content: flex-end; }
    .search-box input[type="text"] { min-width: 160px; }

    /* 手机端隐藏后台入口（需要的话可在桌面端使用） */
    .top-bar .logo-r .login,
    .top-bar .logo-r .logout-form {
        display: none !important;
    }

    /* 手机端导航：汉堡按钮 + 折叠菜单（避免菜单换行挤压） */
    .nav .wl {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 0;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: none;
        width: 44px;
        height: 44px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.10);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle:focus-visible {
        outline: 3px solid rgba(255, 255, 255, 0.45);
        outline-offset: 2px;
    }

    .nav-toggle-icon {
        position: relative;
        display: block;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 999px;
    }

    .nav-toggle-icon::before,
    .nav-toggle-icon::after {
        content: "";
        position: absolute;
        left: 0;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 999px;
        transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
    }

    .nav-toggle-icon::before { top: -6px; }
    .nav-toggle-icon::after { top: 6px; }

    /* 仅在启用 JS 时折叠菜单（无 JS 时保持原样可用） */
    .js .nav-toggle { display: inline-flex; }

    .js .nav-list {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin-top: 8px;
        padding: 8px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.16);
        gap: 2px;
    }

    .js .nav.is-open .nav-list { display: flex; }

    .js .nav.is-open .nav-toggle-icon { background: transparent; }

    .js .nav.is-open .nav-toggle-icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    .js .nav.is-open .nav-toggle-icon::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .nav-list > li {
        flex: none;
        text-align: left;
    }

    .navs {
        padding: 12px 14px;
        border-radius: 12px;
        font-weight: 600;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .navs:hover { background: rgba(255, 255, 255, 0.12); }

    .slider { height: 320px; }
    .slide-content { padding: 0 30px; }
    .new-pic li { display: flex; flex-direction: column; }
    .new-tu, .new-c { width: 100%; }
    .dir-tu { width: 120px; height: 120px; }
    .dir-list { grid-template-columns: repeat(auto-fit, 120px); gap: 18px 22px; }
    .book-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

