/* ===== 全局 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #f4f1ea;
    color: #2b2b2b;
}

/* ===== 前台首页：导览图（铺满首屏）===== */
.campus-page {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #4a4a4a;
}
.map-wrap {
    position: relative;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 14px;
    touch-action: none;
}
/* 舞台与底图实际显示盒子一致 → 锚点百分比定位以此为基准 */
.map-stage {
    position: relative;
    display: block;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
}
.map-img {
    display: block;
    width: auto; height: auto;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    user-select: none;
}
/* 与后台 .map-marker 保持同一基准尺寸(44px)，再乘以后台保存的缩放 --z */
.marker {
    position: absolute;
    height: 44px; width: auto;
    padding: 0; border: 0; background: transparent; line-height: 0;
    transform: translate(-50%, -100%) scale(var(--z, 1));
    transform-origin: 50% 100%;
    cursor: pointer;
    transition: transform .08s ease;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
.marker img { height: 100%; width: auto; display: block; }
.marker:hover { transform: translate(-50%, -100%) scale(calc(var(--z, 1) * 1.12)); z-index: 5; }
.marker .marker-label {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    line-height: 1.5;
    background: rgba(255,255,255,.92); color: #b23b2e; font-size: 12px; font-weight: 600;
    padding: 1px 6px; border-radius: 8px; white-space: nowrap; pointer-events: none;
}

/* ===== 全屏按钮 ===== */
.fs-toggle {
    position: fixed; top: 14px; right: 14px; z-index: 1200;
    width: 42px; height: 42px; border-radius: 50%;
    background: #928686; color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    transition: transform .15s, background .15s;
}
.fs-toggle:hover { background: #a39595; transform: scale(1.06); }
.fs-ico { display: block; width: 21px; height: 21px; }
.fs-ico-exit { display: none; }
body.fs-on .fs-ico-enter { display: none; }
body.fs-on .fs-ico-exit { display: block; }

/* ===== 导览图加载遮罩（流体粒子动画 + 提示）===== */
/* 加载完成前先隐藏底图与锚点，避免“半截地图”闪现（遮罩先显示，就绪后再淡入） */
#mapStage { opacity: 0; transition: opacity .45s ease; }
body.map-loaded #mapStage { opacity: 1; }

.map-loading {
    position: fixed;
    inset: 0;
    z-index: 1300;                 /* 高于全屏按钮，加载期间完全覆盖 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 42%, #2c2c2c 0%, #161616 68%, #0d0d0d 100%);
    transition: opacity .5s ease;
}
.map-loading.hide {
    opacity: 0;
    pointer-events: none;
}
.ml-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.ml-canvas {
    display: block;
    width: 220px;
    height: 220px;
}
.ml-text {
    color: #f2f2f2;
    font-size: 16px;
    letter-spacing: 3px;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    text-shadow: 0 1px 6px rgba(0,0,0,.55);
    animation: ml-pulse 1.4s ease-in-out infinite;
}
@keyframes ml-pulse {
    0%, 100% { opacity: .5; }
    50%      { opacity: 1; }
}

/* ===== 锚点位置弹窗（前台）===== */
.ap-dialog { max-width: 720px; }
/* 关闭 Bootstrap 自带的位移过渡，便于播放点击位放大动画 */
#anchorPopup .modal-dialog, #contentModal .modal-dialog, #previewModal .modal-dialog { transition: none; }
.ap-modal {
    border: 0; border-radius: 14px; overflow: hidden;
    box-shadow: 0 26px 80px rgba(12,22,44,.38);
    background: #fff;
}
.ap-header {
    background: linear-gradient(100deg, #4a72b5 0%, #2b4a7d 100%);
    border: 0; padding: 13px 18px; align-items: center; gap: 12px;
}
.ap-ico { width: 26px; height: 26px; color: #fff; flex: none; }
.ap-header .modal-title { color: #fff; font-size: 24px; font-weight: 700; margin: 0; }
.ap-close {
    margin-left: auto; width: 34px; height: 34px; border: 0; background: transparent;
    color: rgba(255,255,255,.85); font-size: 28px; line-height: 1; cursor: pointer; border-radius: 8px; padding: 0;
}
.ap-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.ap-body { padding: 14px; display: flex; gap: 16px; background: #fff; }
.ap-thumb { flex: 0 0 36%; max-width: 36%; }
.ap-thumb img {
    width: 100%; border-radius: 12px; object-fit: cover;
    aspect-ratio: 2 / 3; background: #eef0f3; display: block;
}
.ap-tree { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.ap-empty { color: #9aa3b2; font-size: 14px; padding: 8px 4px; }

/* 二级导航：默认浅灰、选中深蓝 */
.ap-tree #apTree { display: flex; flex-direction: column; gap: 12px; }
.tree-row {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-radius: 12px;
    cursor: pointer; color: #3c4a63; font-weight: 600; font-size: 17px;
    background: #e3e3e1;
    transition: background .15s, color .15s;
}
.tree-row:hover { background: #d6d6d2; }
.tree-row .dot { width: 9px; height: 9px; border-radius: 50%; background: #2f4f80; flex: none; }
.tree-row .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.active {
    background: linear-gradient(100deg, #3d63a8 0%, #2b4a7d 100%);
    color: #fff;
}
.tree-row.active .dot { background: #fff; }

/* ===== 二级栏目内容弹窗 ===== */
.cm-dialog { max-width: 1100px; }
.cm-modal {
    border: 0; border-radius: 14px; overflow: hidden;
    background: #0d0f12;
    box-shadow: 0 26px 80px rgba(8,16,32,.48);
}
.cm-header {
    background: linear-gradient(100deg, #4a72b5 0%, #2b4a7d 100%);
    border: 0; padding: 11px 18px; display: flex; align-items: center; gap: 12px; position: relative;
}
.cm-ico { width: 23px; height: 23px; color: #fff; flex: none; }
.cm-header .modal-title { color: #fff; font-size: 18px; font-weight: 600; margin: 0; }
.cm-count {
    position: absolute; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.95); font-size: 16px; letter-spacing: 1px; font-weight: 600;
}
.cm-close {
    margin-left: auto; width: 34px; height: 34px; border: 0; background: transparent;
    color: rgba(255,255,255,.85); font-size: 28px; line-height: 1; cursor: pointer; border-radius: 8px; padding: 0;
}
.cm-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.cm-body { padding: 0; height: 72vh; max-height: none; overflow: hidden; display: flex; }
.cm-loading { width: 100%; text-align: center; color: #cfd4dc; font-size: 14px; padding: 28px; }
.cm-body-richtext { background: #f7f1e3; }
.cm-body-image, .cm-body-video { background: #000; }
.cm-body-audio { background: #0d0f12; }

/* ===== 前台内容四类形态 ===== */
.fv-root { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; }
/* 图文：米色底，内容由后台录入（秀米样式保留），内部滚动 */
.fv-richtext {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 24px 28px; line-height: 1.9; background: #f7f1e3;
}
.fv-richtext img, .fv-richtext video { max-width: 100% !important; height: auto !important; display: block; margin: 10px auto; }
/* audio 设显式高度：height:auto 会让 <audio> 在多数浏览器塌陷为 0 高度而不可见 */
.fv-richtext audio { width: 100% !important; height: 40px !important; display: block; margin: 10px auto; }
.fv-richtext p { margin: 0 0 12px; }
/* 秀米等外部编辑器内容：块级元素不撑破弹窗，超宽时容器横向滚动而非挤压版式 */
.fv-richtext section, .fv-richtext article, .fv-richtext > div, .fv-richtext table { max-width: 100%; }
.fv-richtext { overflow-x: auto; }
/* 图片 / 视频：黑底自适应 + 底部导航条 */
.fv-stage {
    flex: 1 1 auto; min-height: 0; background: #000; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.fv-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; }
.fv-video { max-width: 100%; max-height: 100%; width: auto; height: auto; background: #000; }
.fv-nav {
    flex: none; display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; background: #fff; border-top: 1px solid #e7e7e7;
}
.fv-arrow {
    width: 52px; height: 52px; flex: none; border-radius: 50%;
    border: 2px solid #cbb994; background: #fff; color: #a8915c;
    cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.fv-arrow img { width: 50px; height: 50px; display: block; object-fit: contain; }
.fv-arrow:hover { background: #f7f2e4; }
.fv-nav-text {
    flex: 1; min-width: 0; text-align: center; color: #555; font-size: 15px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 音频：深色列表，整条可点播放/停止 */
.fv-audiolist {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; background: #0d0f12;
    padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.fv-audioitem {
    display: flex; align-items: center; gap: 14px;
    background: #26292f; border-radius: 8px; padding: 12px 14px; cursor: pointer;
    transition: background .15s;
}
.fv-audioitem:hover { background: #32363d; }
.fv-acover {
    width: 56px; height: 56px; flex: none; border-radius: 6px;
    background: #767b84; color: #e9ecef;
    display: flex; align-items: center; justify-content: center; padding: 8px;
}
.fv-audioitem.active .fv-acover { background: #3b82f6; color: #fff; }
.fv-wave { width: 100%; height: 100%; display: block; }
.fv-ameta { flex: 1; min-width: 0; }
.fv-atitle { color: #fff; font-size: 19px; font-weight: 600; line-height: 1.4; }
.fv-adesc { color: #9aa0a6; font-size: 14px; margin-top: 4px; }
.fv-aplay {
    width: 38px; height: 38px; flex: none; border-radius: 50%;
    border: 2px solid #9aa0a6; background: transparent; color: #e9ecef;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.fv-audioitem.active .fv-aplay { border-radius: 8px; background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ===== 内容展示页（整页 /Intro/Show）===== */
.intro-page { max-width: 900px; margin: 0 auto; padding: 16px; }
.intro-page .intro-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
/* 内容区：固定高度 + 内部自适应，不产生整页上下滚动 */
.intro-view { display: flex; flex-direction: column; height: 60vh; min-height: 340px; }
.intro-view .intro-title { flex: none; font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #3a3326; }
.intro-richtext { line-height: 1.8; flex: 1; min-height: 0; overflow-y: auto; }
/* 富文本里的图片/视频按容器宽度自适应，不撑破弹窗 */
.intro-richtext img, .intro-richtext video { max-width: 100% !important; height: auto !important; display: block; margin: 8px auto; }
.intro-richtext audio { width: 100% !important; height: 40px !important; display: block; margin: 8px auto; }
.intro-richtext table { max-width: 100%; }
/* 秀米等外部编辑器内容：块级元素不撑破预览框 */
.intro-richtext section, .intro-richtext article, .intro-richtext > div { max-width: 100%; }
.intro-richtext { overflow-x: auto; }
.intro-richtext img, .media-stage img.stage-media, .intro-gallery .gallery-img { cursor: zoom-in; }
.intro-gallery { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.intro-gallery .gallery-img { width: 100%; height: auto; border-radius: 10px; }
.media-stage {
    position: relative; flex: 1; min-height: 0;
    background: #000; border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.media-stage .stage-media { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-stage audio.stage-media { width: 100%; height: 44px; }
.media-nav { display: flex; justify-content: space-between; margin-top: 10px; flex: none; align-items: center; }
.media-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; flex: none; }

/* ===== 图片全屏查看 ===== */
.xy-lightbox {
    position: fixed; inset: 0; z-index: 3000; background: rgba(12,16,14,.92);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.xy-lightbox img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.xy-lightbox .lb-close {
    position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; border: 0; font-size: 22px; line-height: 1; cursor: pointer;
}
.xy-lightbox .lb-close:hover { background: rgba(255,255,255,.26); }

/* ===== 通用 ===== */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.text-muted-2 { color: #9a917f; font-size: 12px; }
