/* ==========================================================
   南京奶龙大学门户网站首页样式表
   配色：奶龙黄主题
   ========================================================== */

/* ---------- 变量与基础 ---------- */
:root {
    --nl-yellow: #FFD826;       /* 奶龙主黄 */
    --nl-yellow-deep: #FFC91E;  /* 深一档的黄 */
    --nl-orange: #F59E0B;       /* 强调橙黄（悬停色） */
    --nl-cream: #FFF8E1;        /* 米黄底色 */
    --nl-cream-soft: #FFFBEA;   /* 更浅的米黄 */
    --nl-brown: #4A3608;        /* 深棕文字 */
    --nl-brown-dark: #3B2B06;   /* 页脚深棕 */
    --nl-line: #F0E3B8;         /* 浅色分隔线 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--nl-brown);
    background: var(--nl-cream);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 课程作业声明条（醒目标注） */
.hw-notice {
    background: #D97706;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    padding: 7px 12px;
}

/* ---------- 一、顶部横幅 ---------- */
.top-bar {
    background: var(--nl-brown-dark);
    color: #E8D9A0;
    font-size: 12px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 34px;
}

.top-links a {
    margin-right: 18px;
    transition: color .2s;
}

.top-links a:hover {
    color: var(--nl-yellow);
}

/* 实时时钟（原生 JS 驱动） */
.top-time {
    letter-spacing: .5px;
}

/* 校名区 */
.masthead {
    background: linear-gradient(180deg, #FFFDF4 0%, var(--nl-cream) 100%);
    border-bottom: 1px solid var(--nl-line);
}

.masthead-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    gap: 20px;
}

.school-id {
    display: flex;
    align-items: center;
    gap: 14px;
}

.school-badge {
    width: 64px;
    height: 64px;
}

.school-name h1 {
    font-size: 30px;
    letter-spacing: 4px;
    color: var(--nl-brown);
}

.school-name p {
    font-size: 12px;
    letter-spacing: 3.5px;
    color: #A98F45;
    margin-top: 4px;
}

/* 站内搜索 */
.search-box {
    display: flex;
}

.search-box input {
    width: 240px;
    height: 38px;
    border: 2px solid var(--nl-yellow);
    border-right: none;
    border-radius: 19px 0 0 19px;
    padding: 0 16px;
    font-size: 13px;
    outline: none;
    background: #fff;
}

.search-box input:focus {
    border-color: var(--nl-orange);
}

.search-box button {
    height: 38px;
    padding: 0 22px;
    border: none;
    border-radius: 0 19px 19px 0;
    background: var(--nl-yellow);
    color: var(--nl-brown);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background .2s;
}

.search-box button:hover {
    background: var(--nl-orange);
    color: #fff;
}

/* ---------- 二、导航菜单（无序列表 + 悬停下拉） ---------- */
.main-nav {
    background: linear-gradient(180deg, var(--nl-yellow) 0%, var(--nl-yellow-deep) 100%);
    border-bottom: 3px solid var(--nl-orange);
    position: relative;
    z-index: 100;
}

.nav-toggle {
    display: none;
    width: 100%;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--nl-brown);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.nav-list {
    display: flex;
}

.nav-list > li {
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-list > li > a {
    display: block;
    line-height: 48px;
    font-size: 16px;
    font-weight: bold;
    color: var(--nl-brown);
    white-space: nowrap;
    transition: background .25s, color .25s;
}

.nav-list > li:hover > a,
.nav-list > li > a:hover {
    background: var(--nl-orange);
    color: #fff;
}

/* 子菜单：绝对定位 + 悬停过渡显示 */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 10px);
    min-width: 150px;
    background: #fff;
    border-top: 3px solid var(--nl-orange);
    box-shadow: 0 6px 16px rgba(74, 54, 8, .18);
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    z-index: 99;
}

.nav-list > li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.submenu li a {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    color: #6B5A25;
    border-bottom: 1px solid var(--nl-line);
    transition: background .2s, color .2s;
}

.submenu li:last-child a {
    border-bottom: none;
}

.submenu li a:hover {
    background: var(--nl-yellow);
    color: var(--nl-brown);
}

/* ---------- 三、南京美景横幅 ---------- */
.banner {
    position: relative;
    overflow: hidden;
}

.banner img {
    display: block;
    width: 100%;
    height: 420px;
    object-fit: cover;          /* 铺满横幅区域 */
    object-position: 50% 72%;   /* 取秦淮河灯火主体 */
}

.banner-caption {
    position: absolute;
    left: 0;
    bottom: 48px;
    padding: 14px 38px 14px max(38px, calc((100% - 1200px) / 2 + 15px));
    background: linear-gradient(90deg, rgba(255, 216, 38, .96) 0%, rgba(255, 216, 38, .82) 60%, rgba(255, 216, 38, 0) 100%);
    color: var(--nl-brown);
}

.banner-caption strong {
    display: block;
    font-size: 26px;
    letter-spacing: 6px;
}

.banner-caption span {
    display: block;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 6px;
    color: #7A6420;
}

/* ---------- 四、滚动新闻 + 校园风光 ---------- */
.main-content {
    display: flex;
    gap: 20px;
    margin-top: 26px;
    margin-bottom: 34px;
}

.news-panel {
    flex: 2;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--nl-line);
    border-radius: 8px;
    padding: 0 20px 12px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--nl-yellow);
    padding: 14px 0 10px;
}

.panel-head h2 {
    font-size: 20px;
    color: var(--nl-brown);
    border-left: 6px solid var(--nl-orange);
    padding-left: 12px;
    letter-spacing: 2px;
}

.panel-head a {
    font-size: 13px;
    color: #A98F45;
}

.panel-head a:hover {
    color: var(--nl-orange);
}

/* 纵向无缝滚动：外层裁剪，内层 @keyframes 上移 50% */
.news-viewport {
    height: 350px;
    overflow: hidden;
}

.news-track {
    animation: newsRoll 20s linear infinite;
}

/* 鼠标悬停暂停 */
.news-viewport:hover .news-track {
    animation-play-state: paused;
}

@keyframes newsRoll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.news-list li {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px dashed var(--nl-line);
}

.news-date {
    flex-shrink: 0;
    width: 56px;
    font-size: 13px;
    color: var(--nl-orange);
}

.news-list li a {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}

.news-list li a:hover {
    color: var(--nl-orange);
}

.news-tip {
    text-align: right;
    font-size: 12px;
    color: #C0B078;
    padding-top: 8px;
}

/* 校园风光侧栏 */
.scenery-panel {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--nl-line);
    border-radius: 8px;
    padding: 0 16px 6px;
}

.scenery-item {
    margin: 14px 0;
}

.scenery-item img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform .3s;
}

.scenery-item img:hover {
    transform: scale(1.02);
}

.scenery-item figcaption {
    text-align: center;
    font-size: 13px;
    color: #A98F45;
    padding-top: 7px;
}

/* ---------- 五、页脚版权信息 ---------- */
.footer {
    background: var(--nl-brown-dark);
    color: #D8C68C;
    text-align: center;
    padding: 30px 0 24px;
    font-size: 13px;
    line-height: 2;
}

.footer-name {
    font-size: 20px;
    color: var(--nl-yellow);
    letter-spacing: 4px;
}

.footer-name span {
    font-size: 11px;
    letter-spacing: 3px;
    color: #A98F45;
    margin-left: 10px;
}

.footer-note {
    max-width: 860px;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.9;
    color: #C9B880;
}

.footer-tel {
    color: var(--nl-yellow);
    font-weight: bold;
    letter-spacing: 2px;
}

.footer-copy {
    color: #8F7C46;
}

/* ---------- 奶龙宇宙图鉴 ---------- */
.universe {
    margin-bottom: 34px;
}

.universe-panel {
    background: #fff;
    border: 1px solid var(--nl-line);
    border-radius: 8px;
    padding: 0 20px 18px;
}

.uni-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding-top: 16px;
}

.uni-card {
    display: block;
    background: var(--nl-cream-soft);
    border: 1px solid var(--nl-line);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.uni-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(74, 54, 8, .15);
    border-color: var(--nl-yellow);
}

.uni-avatar {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--nl-yellow);
    overflow: hidden;
}

.uni-avatar svg {
    display: block;
    width: 100%;
    height: 100%;
}

.uni-card strong {
    display: block;
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--nl-brown);
}

.uni-card em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: var(--nl-orange);
    margin: 4px 0 6px;
}

.uni-card p {
    font-size: 12px;
    line-height: 1.6;
    color: #8A7A45;
}

/* ---------- 搜索结果高亮与暂停 ---------- */
.news-viewport.paused .news-track {
    animation-play-state: paused;
}

.news-list a mark {
    background: var(--nl-yellow);
    color: inherit;
    padding: 1px 2px;
    border-radius: 3px;
}

/* ---------- 轻提示（代替 alert） ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translate(-50%, 12px);
    max-width: 86vw;
    padding: 11px 22px;
    background: var(--nl-brown-dark);
    color: var(--nl-yellow);
    font-size: 14px;
    border-radius: 22px;
    box-shadow: 0 6px 16px rgba(59, 43, 6, .35);
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    z-index: 300;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---------- 详情页 ---------- */
.motto {
    font-size: 14px;
    letter-spacing: 2px;
    color: #A98F45;
    font-weight: bold;
}

a.school-id {
    display: flex;
    align-items: center;
    gap: 14px;
}

.detail-main {
    margin-top: 24px;
    margin-bottom: 34px;
}

.crumb {
    font-size: 13px;
    color: #A98F45;
    margin-bottom: 14px;
}

.crumb a:hover {
    color: var(--nl-orange);
}

.detail-card {
    background: #fff;
    border: 1px solid var(--nl-line);
    border-radius: 8px;
    padding: 34px 38px 30px;
    min-height: 380px;
}

.detail-card h1 {
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--nl-brown);
    border-left: 6px solid var(--nl-orange);
    padding-left: 14px;
}

.detail-meta {
    font-size: 13px;
    color: #C0B078;
    border-bottom: 1px dashed var(--nl-line);
    padding: 12px 0 14px;
    margin-bottom: 6px;
}

.detail-body p {
    font-size: 15px;
    line-height: 2;
    color: #6B5A25;
    margin: 14px 0;
}

.detail-tips {
    background: var(--nl-cream-soft);
    border: 1px dashed var(--nl-yellow);
    border-radius: 8px;
    padding: 16px 22px;
    margin: 18px 0;
}

.detail-tips li {
    font-size: 14px;
    line-height: 2.1;
    color: #6B5A25;
    list-style: square;
    margin-left: 18px;
}

.detail-tips a {
    color: var(--nl-orange);
}

.detail-tips a:hover {
    text-decoration: underline;
}

.detail-back {
    display: inline-block;
    margin-top: 10px;
    padding: 9px 26px;
    background: var(--nl-yellow);
    color: var(--nl-brown);
    font-weight: bold;
    font-size: 14px;
    border-radius: 19px;
    transition: background .2s, color .2s;
}

.detail-back:hover {
    background: var(--nl-orange);
    color: #fff;
}

/* ---------- 回到顶部（原生 JS 控制） ---------- */
.back-top {
    position: fixed;
    right: 28px;
    bottom: 64px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #E8A800;
    background: var(--nl-yellow);
    color: var(--nl-brown);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    z-index: 200;
}

.back-top.show {
    opacity: 1;
    visibility: visible;
}

.back-top:hover {
    background: var(--nl-orange);
    color: #fff;
}

/* ---------- 响应式：平板 ≤992px ---------- */
@media (max-width: 992px) {
    .school-name h1 {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .search-box input {
        width: 170px;
    }

    .nav-list > li > a {
        padding: 0 6px;
        font-size: 15px;
    }

    .banner img {
        height: 320px;
    }

    .banner-caption strong {
        font-size: 20px;
    }

    .uni-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- 响应式：手机 ≤768px ---------- */
@media (max-width: 768px) {
    .top-links {
        display: none;
    }

    .top-bar-inner {
        justify-content: center;
    }

    .masthead-inner {
        flex-direction: column;
        gap: 14px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
        width: auto;
    }

    /* 移动端导航折叠为汉堡菜单 */
    .nav-toggle {
        display: block;
    }

    .nav-list {
        display: none;
        padding-bottom: 10px;
    }

    .nav-list.open {
        display: block;
    }

    .nav-list > li {
        flex: none;
        border-top: 1px solid rgba(232, 168, 0, .35);
    }

    /* 子菜单在移动端平铺展示（无悬停） */
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        background: var(--nl-cream-soft);
        border-top: none;
        box-shadow: none;
    }

    .nav-list > li > a {
        text-align: left;
        padding-left: 14px;
    }

    .submenu li a {
        text-align: left;
        padding-left: 38px;
        background: transparent;
    }

    .submenu li a:hover {
        background: var(--nl-cream);
    }

    .banner img {
        height: 210px;
    }

    .banner-caption {
        bottom: 20px;
        padding: 10px 22px 10px 22px;
    }

    .banner-caption strong {
        font-size: 17px;
        letter-spacing: 3px;
    }

    .banner-caption span {
        font-size: 12px;
    }

    /* 主内容区改为单列 */
    .main-content {
        flex-direction: column;
    }

    .news-viewport {
        height: 280px;
    }

    .back-top {
        right: 16px;
        bottom: 40px;
    }

    .uni-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-card {
        padding: 24px 20px;
    }

    .detail-card h1 {
        font-size: 21px;
    }
}
