/* ui.css — 界面外框与浮层：图片放大灯箱、顶部进度条、右上工具栏与页码、二维码浮窗、
   左右翻页热区、移动端翻页导航条。均为演示外壳，不随内容变化。 */

  /* 图片放大灯箱 */
  .img-zoomable {
    cursor: zoom-in;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
  }
  .img-zoomable:hover { opacity: 0.92; }
  .img-lightbox {
    position: fixed; inset: 0; z-index: 10050;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(16px, 3vw, 40px);
    background: rgba(10, 10, 12, 0.88);
    backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  .img-lightbox.open {
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .img-lightbox-inner {
    position: relative; max-width: min(96vw, 1600px); max-height: 92vh;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
  }
  .img-lightbox-img {
    display: block; max-width: 100%; max-height: min(82vh, 900px);
    width: auto; height: auto; object-fit: contain;
    border-radius: 10px; background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
  .img-lightbox-caption {
    color: rgba(255, 255, 255, 0.88); font-size: 0.9em;
    text-align: center; line-height: 1.5; max-width: 720px;
  }
  .img-lightbox-close {
    position: fixed; top: clamp(12px, 2vh, 24px); right: clamp(12px, 2vw, 24px);
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.14); color: #fff;
    font-size: 1.35em; line-height: 1; cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
  }
  .img-lightbox-close:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.05); }
  .img-lightbox-hint {
    position: fixed; bottom: clamp(12px, 2vh, 24px); left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55); font-size: 0.78em;
    pointer-events: none; white-space: nowrap;
  }

  /* HTML 演示放大灯箱 */
  .iframe-lightbox {
    position: fixed; inset: 0; z-index: 10060;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(12px, 2vw, 28px);
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  .iframe-lightbox.open {
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .iframe-lightbox-inner {
    width: min(96vw, 1200px);
    height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
  .iframe-lightbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #ececec;
    border-bottom: 1px solid #d8d8d8;
    flex-shrink: 0;
  }
  .iframe-lightbox-title {
    margin: 0;
    font-size: 0.92em;
    font-weight: 700;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .iframe-lightbox-close {
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: rgba(126, 24, 28, 0.1); color: var(--pku-red-dark);
    font-size: 1.2em; line-height: 1; cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
  }
  .iframe-lightbox-close:hover { background: rgba(126, 24, 28, 0.18); transform: scale(1.05); }
  .iframe-lightbox iframe {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    border: 0;
    display: block;
    background: #fff;
  }
  .iframe-lightbox-hint {
    position: fixed; bottom: clamp(12px, 2vh, 24px); left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55); font-size: 0.78em;
    pointer-events: none; white-space: nowrap;
  }

  /* 顶部进度条 + 右上工具栏 + 页码 */
  .progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: rgba(140,21,21,0.1); z-index: 1000; }
  .progress-bar { height: 100%; background: linear-gradient(90deg, var(--pku-red-dark), var(--pku-red)); width: 0%; transition: width 0.35s ease; }
  /* 页码与全屏按钮放左下角，避免遮挡内容页右上角的北大 Logo */
  .top-bar {
    position: fixed; bottom: 16px; left: 16px; z-index: 1001;
    display: flex; align-items: center; gap: 8px;
  }
  .top-btn {
    width: 42px; height: 42px; background: rgba(255,255,255,0.92);
    border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1em; color: var(--primary); box-shadow: var(--shadow);
    transition: all 0.2s;
  }
  .top-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
  .slide-counter {
    background: rgba(255,255,255,0.92); border: 1.5px solid var(--border);
    border-radius: 12px; padding: 0 14px; height: 42px;
    display: flex; align-items: center; font-size: 0.88em; font-weight: 700;
    color: var(--primary-dark); box-shadow: var(--shadow); min-width: 72px; justify-content: center;
  }

  /* 底部页面跳转 */
  .slide-jump-bar {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(520px, calc(100vw - 200px));
    padding: 0 4px;
  }
  .slide-jump-label {
    flex-shrink: 0;
    font-size: 0.82em;
    font-weight: 700;
    color: var(--primary-dark);
    background: rgba(255,255,255,0.92);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
  }
  .slide-jump-select {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    font-size: 0.82em;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: rgba(255,255,255,0.96);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
  }
  .slide-jump-select:hover,
  .slide-jump-select:focus {
    border-color: var(--primary);
    outline: none;
  }

  /* 二维码浮窗 */
  .qr-float { position: fixed; right: 20px; bottom: 20px; z-index: 999; }
  .qr-float-body { transition: transform 0.3s, opacity 0.24s; }
  .qr-float-body.qr-hidden { transform: scale(0.6); opacity: 0; pointer-events: none; }
  .qr-float-card { background: #fff; border: 2px solid rgba(140,21,21,0.18); border-radius: 16px; padding: 14px; text-align: center; width: 200px; }
  .qr-toggle-btn {
    width: 56px; height: 56px; border-radius: 28px; margin-top: 8px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--pku-red-dark), var(--pku-red)); color: #fff;
    display: flex; align-items: center; justify-content: center; padding: 0;
    box-shadow: 0 4px 14px rgba(126,24,28,0.28);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .qr-toggle-btn:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(126,24,28,0.34); }
  .qr-toggle-btn .qr-toggle-icon { display: block; width: 24px; height: 24px; flex-shrink: 0; }
  .qr-toggle-btn .qr-toggle-icon-close { display: none; }
  .qr-toggle-btn.qr-open .qr-toggle-icon-qr { display: none; }
  .qr-toggle-btn.qr-open .qr-toggle-icon-close { display: block; }

  /* 点击区域翻页 */
  .click-zone {
    position: fixed; top: 0; bottom: 0; width: 18%; z-index: 5; cursor: pointer;
  }
  .click-zone-left { left: 0; }
  .click-zone-right { right: 0; }

  /* 移动端翻页按钮（桌面端隐藏） */
  .mobile-nav {
    display: none;
  }
  .mobile-nav-btn {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s;
  }
  .mobile-nav-prev {
    background: #f1f5f9;
    color: var(--text);
  }
  .mobile-nav-next {
    background: linear-gradient(135deg, var(--pku-red-dark), var(--pku-red));
    color: #fff;
  }
  .mobile-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }
