  /* 尊重系统「减少动态」偏好 */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  .skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 20000;
    padding: 9px 14px; border-radius: var(--radius-sm);
    background: var(--ink); color: var(--raised); text-decoration: none;
    transform: translateY(-150%); transition: transform var(--t-fast);
  }
  .skip-link:focus { transform: translateY(0); }

  /* ════════════════════════════════════════════════════════════
     HEADER — logo(左) + 搜索(中) + login(右)
     ════════════════════════════════════════════════════════════ */
  .site-header {
    background: oklch(from var(--surface) l c h / 0.88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; z-index: 100;
    transition: box-shadow 0.2s;
  }
  .site-header.scrolled { box-shadow: 0 1px 8px oklch(0 0 0 / 0.04); }
  .header-inner {
    display: flex; align-items: center; height: var(--header-height); gap: 0;
    padding: 0; max-width: 100%;
  }

  /* ── Header logo（紧贴屏幕最左端）───────────────── */
  .header-logo-area {
    width: 200px; flex-shrink: 0;
    display: flex; align-items: center; gap: 0;
    padding-left: var(--space-md);
    text-decoration: none; line-height: 1;
  }
  .header-logo-area .hl-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-sm); color: white; font-size: 0.75rem; font-weight: 700; font-family: var(--sans);
    flex-shrink: 0; margin-right: var(--space-sm); transition: border-radius 0.2s, transform 0.2s;
  }
  /* 汉堡导航按钮：外观调整选「汉堡菜单」时取代移动端星火图标的位置 */
  .hl-burger {
    display: none; align-items: center; justify-content: center;
    width: 44px; height: var(--header-height); flex-shrink: 0;
    border: 0; background: transparent; color: var(--ink); cursor: pointer;
    touch-action: manipulation;
  }
  .hl-burger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .hl-burger:hover { color: var(--primary); }
  .hl-burger:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
  .header-logo-area:hover .hl-mark { border-radius: var(--radius-md); transform: scale(1.05); }
  .header-logo-area .hl-texts { display: flex; flex-direction: column; }
  .header-logo-area .hl-chinese {
    font-family: var(--serif); font-size: 1rem; font-weight: 700; color: var(--ink);
    letter-spacing: -0.01em; line-height: 1.2;
  }
  .header-logo-area .hl-english {
    font-family: var(--sans); font-size: 0.6rem; font-weight: 600; color: var(--ink-faint);
    letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2;
  }

  /* ── 搜索靠右，紧挨 login 按钮 ────────────────── */
  .search-hero-wrap {
    flex: 1; display: flex; justify-content: flex-end; padding-right: var(--space-sm);
  }
  .search-box {
    display: flex; align-items: center; width: 100%; max-width: 480px;
    background: var(--raised); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 6px 6px 6px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 0.1);
  }
  .search-box input {
    flex: 1; border: none; background: transparent; font-family: inherit;
    font-size: 0.92rem; outline: none; color: var(--ink);
  }
  .search-box input::placeholder { color: var(--ink-faint); }
  .search-box button {
    width: 34px; height: 34px; border: none; background: var(--accent);
    border-radius: 50%; color: white; font-size: 0.85rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background 0.18s, transform 0.18s;
  }
  .search-box button:hover { background: var(--accent-hover); transform: scale(1.08); }

  .mobile-logo-placeholder { display: none; }

  /* ── Login 占位按钮（与 logo 对称）───────────────── */
  .header-login {
    width: 200px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: var(--space-md);
  }
  .header-login .login-btn {
    display: inline-flex; align-items: center; gap: var(--space-xs);
    font-size: 0.85rem; font-weight: 500; color: var(--ink-soft);
    padding: 6px 14px; border-radius: var(--radius-full);
    border: 1px solid var(--border-light); background: transparent;
    cursor: pointer; font-family: inherit;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    text-decoration: none;
  }
  .header-login .login-btn:hover {
    border-color: var(--primary-light); background: var(--primary-surface); color: var(--primary);
  }
  .header-login .login-icon { font-size: 0.9rem; }

  /* ── User Avatar (replaces old bell + dropdown) ── */
  .user-avatar-trigger {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; margin: 0;
    border: none; background: transparent; cursor: pointer;
    border-radius: 50%;
    transition: box-shadow 0.18s;
  }
  .user-avatar-trigger:hover {
    box-shadow: 0 0 0 3px var(--primary-surface);
  }
  .user-avatar-circle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: oklch(0.46 0.04 250); /* v=148：莫兰迪低亮纯色（灰蓝），替代渐变 */
    color: #fff; font-size: 0.85rem; font-weight: 700;
    font-family: inherit; line-height: 1; user-select: none;
    transition: transform 0.15s;
  }
  .user-avatar-trigger:hover .user-avatar-circle {
    transform: scale(1.08);
  }
  .notif-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff; font-size: 0.55rem; font-weight: 700;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1; pointer-events: none;
    box-shadow: 0 1px 3px oklch(0.3 0.01 55 / 0.22);
  }

  /* ════════════════════════════════════════════════════════════
     SIDEBAR — 竖向导航（桌面端）
     ════════════════════════════════════════════════════════════ */
  .page-layout {
    display: flex; min-height: calc(100vh - var(--header-height));
  }

  .side-nav {
    width: 200px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    position: sticky; top: var(--header-height);
    height: calc(100vh - var(--header-height));
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--space-md) var(--space-sm);
    z-index: 50;
  }
  .side-nav a {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 10px 16px;
    font-size: 0.88rem; font-weight: 500; color: var(--ink-soft);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
  }
  .side-nav a:hover { background: var(--primary-surface); color: var(--primary); }
  .side-nav a.active {
    background: var(--primary-surface); color: var(--primary); font-weight: 600;
    border-left-color: var(--primary);
  }
  .side-nav .sn-icon { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
  .side-nav .sn-spacer { margin-top: auto; }

  .main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

  /* ════════════════════════════════════════════════════════════
     HERO — 新版本
     ════════════════════════════════════════════════════════════ */
  .hero {
    padding: 80px 0 60px; text-align: center;
    position: relative; overflow: hidden;
  }
  .hero .container { position: relative; }

  .hero-deco {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
  }
  .hero-deco .shape {
    position: absolute; border-radius: 50%;
    opacity: 0.08; animation: float 20s ease-in-out infinite;
  }
  .hero-deco .shape-1 {
    width: 240px; height: 240px; background: var(--primary);
    top: -60px; right: -40px; animation-delay: 0s;
  }
  .hero-deco .shape-2 {
    width: 160px; height: 160px; background: var(--accent);
    bottom: -30px; left: -20px; animation-delay: -7s;
  }
  .hero-deco .shape-3 {
    width: 80px; height: 80px; background: oklch(0.52 0.10 300);
    top: 40%; left: 10%; animation-delay: -14s;
  }
  @keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(12px, -16px) scale(1.05); }
    66% { transform: translate(-8px, 10px) scale(0.95); }
  }

  .hero .hero-title-zh {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 5.5vw, 3.8rem);
    font-weight: 700; line-height: 1.05; color: var(--ink);
    letter-spacing: 0.02em; margin-bottom: var(--space-xs);
  }
  .hero .hero-title-zh .hl-accent { color: var(--accent); }
  .hero .hero-title-en {
    font-family: var(--sans);
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    font-weight: 600; color: var(--ink-faint);
    letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: var(--space-lg);
  }
  .hero .hero-desc {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--ink-soft); max-width: 520px;
    margin: 0 auto var(--space-md); line-height: 1.4;
    letter-spacing: 0.03em;
  }
  .hero-stats-label {
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em;
    color: var(--ink-faint); margin-bottom: var(--space-xs);
  }
  .hero .stats-row { display: flex; justify-content: center; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); }
  .hero .stat-pill {
    display: inline-flex; align-items: center; gap: var(--space-xs);
    background: var(--raised); border: 1px solid var(--border-light);
    border-radius: var(--radius-full); padding: 7px 18px;
    font-size: 0.82rem; color: var(--ink-soft); font-weight: 500;
    box-shadow: 0 1px 3px oklch(0 0 0 / 0.02);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  }
  .hero .stat-pill:hover {
    border-color: var(--primary-light); transform: translateY(-2px);
    box-shadow: 0 4px 12px oklch(0 0 0 / 0.04);
  }
  .hero .stat-pill strong { font-weight: 700; color: var(--ink); }

  .hero .hero-footer {
    font-size: 0.85rem; color: var(--ink-faint);
    display: flex; justify-content: center; align-items: center; gap: var(--space-sm);
    flex-wrap: wrap;
  }
  .hero .hero-footer .hf-email {
    color: var(--primary); font-weight: 500;
    text-decoration: none; border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
  }
  .hero .hero-footer .hf-email:hover { border-color: var(--primary-light); }
  .hero .hero-footer .hf-dot { color: var(--border); }

  /* ════════════════════════════════════════════════════════════
     CONTENT — 下载最多(左) + 最近上传(右)
     ════════════════════════════════════════════════════════════ */
  .home-content { padding: var(--space-xl) 0 var(--space-2xl); }
  .home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-xl); }

  .hc-panel { background: var(--raised); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
  .hc-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-light);
  }
  .hc-panel-header h3 { font-family: var(--serif); font-size: 0.95rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: var(--space-sm); }
  .hc-more { font-size: 0.8rem; font-weight: 500; color: var(--ink-faint); transition: color 0.15s; }
  .hc-more:hover { color: var(--accent); }

  .hc-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid oklch(from var(--border-light) l c h / 0.6);
    transition: background 0.15s, padding-left 0.15s; cursor: pointer; text-decoration: none;
  }
  .hc-item:last-child { border-bottom: none; }
  .hc-item:hover { background: var(--primary-surface); padding-left: calc(var(--space-lg) + 4px); }
  .hc-item-left { flex: 1; min-width: 0; }
  .hc-item-name { font-size: 0.88rem; font-weight: 500; color: var(--ink); }
  .hc-item-meta { font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px; }
  .hc-item-tag {
    font-size: 0.65rem; font-weight: 600; padding: 2px 10px;
    border-radius: var(--radius-full); flex-shrink: 0;
  }
  .hc-tag-general { background: var(--primary-surface); color: var(--primary); }
  .hc-tag-major { background: var(--accent-light); color: var(--accent-hover); }
  .hc-item-count { font-size: 0.78rem; color: var(--ink-faint); flex-shrink: 0; font-weight: 500; }

  /* ════════════════════════════════════════════════════════════
     FOOTER
     ════════════════════════════════════════════════════════════ */
  .site-footer {
    border-top: 1px solid var(--border-light); padding: var(--space-2xl) 0 var(--space-xl);
    margin-top: auto; /* v=158：sticky footer，内容不足一屏时把备案号栏钉到底部 */
  }
  /* v=160：非首页仅显示备案号一行（compact） */
  .site-footer.compact { padding: var(--space-md) 0; } /* v=163：单行 colophon 上下留 20px，去掉双 32px 叠距 */
  .site-footer.compact .footer-grid { display: none; }
  .site-footer.compact .footer-bottom { border-top: none; padding-top: 0; }
  /* v=163：非首页 footer 只留一行「© 2026 BNU Sparks · 鲁ICP备2026040195号」——
     完整版权行（木铎星火·资料共享）与公安备案仅首页展示 */
  .icp-copy { display: none; }                        /* 首页：版权已在左侧完整行，此处隐藏 */
  .site-footer.compact .icp-copy { display: inline; } /* 非首页：单行版权前缀 */
  .site-footer.compact .footer-bottom > p:first-child { display: none; } /* 完整版权行隐藏 */
  .site-footer.compact .gongan-link { display: none; }                  /* 公安备案隐藏 */
  .site-footer.compact .footer-bottom { justify-content: center; }      /* 单行居中 */
  /* v=163：非首页 footer 再往下沉——内容不足一屏时沉到首屏之下，
     正常浏览不向下翻动就看不到，下滑才出现（给短页面滚动反馈，不遮挡内容）。
     min-height 取 calc(100vh + 48px)：footer 钉在 main-content 底边、
     再向上占据自身高度，这样即使备案号一行换行也能保证其顶边仍在首屏之下 */
  body.footer-pushed .main-content { min-height: calc(100vh + var(--space-xl)); }
  .footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-xl);
    margin-bottom: var(--space-xl);
  }
  .footer-col h4 {
    font-family: var(--serif); font-size: 0.9rem; font-weight: 600;
    color: var(--ink); margin-bottom: var(--space-sm);
  }
    .footer-col p { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.6; }
  .footer-brand .brand-line {
    display: block; width: 28px; height: 2px;
    background: var(--accent); border-radius: 1px;
    margin: 10px 0;
  }
  .footer-brand .brand-name {
    font-family: var(--serif); font-size: 1.1rem; font-weight: 700;
    color: var(--ink); letter-spacing: 0.06em; line-height: 1.3;
  }
  .footer-brand .brand-desc {
    font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7;
  }
  .footer-col a {
    display: block; font-size: 0.82rem; color: var(--ink-soft);
    padding: 3px 0; transition: color 0.15s;
  }
  .footer-col a:hover { color: var(--primary); }
  .footer-bottom {
    border-top: 1px solid var(--border-light); padding-top: var(--space-lg);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-sm);
  }
  .footer-bottom p { font-size: 0.8rem; color: var(--ink-faint); }
  .footer-bottom .icp-info { font-size: 0.75rem; }
  .footer-bottom .icp-info a { color: var(--ink-faint); text-decoration: underline transparent; transition: color 0.15s, text-decoration-color 0.15s; }
  .footer-bottom .icp-info a:hover { color: var(--accent); text-decoration-color: var(--accent); }
  /* 公安联网备案徽章 */
  .footer-bottom .gongan-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
  .footer-bottom .gongan-icon { width: 14px; height: auto; vertical-align: middle; }
  .footer-bottom .footer-social { display: flex; gap: var(--space-sm); }

  /* ════════════════════════════════════════════════════════════
     RESPONSIVE
     ════════════════════════════════════════════════════════════ */

  /* ── Geometric Icon System (replacing emoji) ────────────── */
  .gi { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

  /* Approved course-card and sidebar SVG system */
  .icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .ci-primary {
    fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }
  .ci-solid { fill: currentColor; stroke: none; }
  .ci-soft { fill: currentColor; stroke: none; opacity: 0.11; }
  .sidebar-icon {
    width: 20px; height: 20px; flex: 0 0 20px;
    color: currentColor; overflow: visible;
  }

  /* Nav sidebar icons - small geometric marks */
  .gi-nav-home { width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 1px 1px 3px 3px; position: relative; }
  .gi-nav-home::before { content: ''; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 2px;
    clip-path: polygon(0 100%, 0 45%, 50% 15%, 100% 45%, 100% 100%); background: currentColor; }
  .gi-nav-general { width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; }
  .gi-nav-general::before { content: ''; position: absolute; top: 2px; left: 2px; right: 2px; bottom: 2px;
    background: currentColor; border-radius: 1px; opacity: 0.3; }
  .gi-nav-major { width: 16px; height: 16px; border: 1.5px solid currentColor;
    transform: rotate(45deg); border-radius: 2px; }
  .gi-nav-qa { width: 16px; height: 14px; border: 1.5px solid currentColor; border-radius: 4px; position: relative; }
  .gi-nav-qa::before { content: ''; position: absolute; top: 3px; left: 3px; right: 3px; height: 1.5px;
    background: currentColor; opacity: 0.4; box-shadow: 0 3px 0 0 currentColor; }
  .gi-nav-qa::after { content: ''; position: absolute; left: 4px; bottom: -3px; width: 3px; height: 3px;
    background: currentColor; opacity: 0.8; clip-path: polygon(0 0, 100% 0, 0 100%); }

  /* Login icon - empty circle */
  .gi-login { width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
  .gi-login::before { content: ''; position: absolute; top: 4px; left: 5px; right: 5px; bottom: 6px;
    border-radius: 50%; border: 1.5px solid currentColor; }
  .gi-login::after { content: ''; position: absolute; bottom: 2px; left: 3px; right: 3px; height: 5px;
    border-radius: 3px; border: 1.5px solid currentColor; border-top: none; }

  /* ── Card SVG Icons ─────────────────────────────────────── */
  .fc-icon { position: relative; display: flex; align-items: center; justify-content: center; }
  .folder-card .fc-icon svg { width: 28px; height: 28px; color: var(--primary); opacity: 0.6; }
  /* Section header accent */
  .section-accent { display: inline-flex; align-items: center; gap: 10px; }
  .section-accent::before { content: ''; width: 3px; height: 1.1em; background: var(--accent); border-radius: 2px; }
  @media (max-width: 900px) {
    .header-logo-area { display: none; }
    .mobile-logo-placeholder {
      display: flex; align-items: center; justify-content: center;
      width: 44px; height: var(--header-height); flex-shrink: 0;
    }
    .mobile-logo-mark {
      display: inline-flex; align-items: center; justify-content: center;
      width: 26px; height: 26px; border-radius: var(--radius-sm);
      background: linear-gradient(135deg, var(--accent), var(--accent-hover));
      color: #fff; font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
    }
    /* 汉堡菜单模式：顶部左上入口取代星火图标，底部导航退场 */
    html[data-bnu-nav="burger"] .hl-burger { display: inline-flex; }
    html[data-bnu-nav="burger"] .mobile-logo-placeholder { display: none; }
    html[data-bnu-nav="burger"] .mobile-bottom-nav { display: none; }
    html[data-bnu-nav="burger"] body { padding-bottom: 0; }
    .header-login { width: 44px; padding-right: 0; justify-content: center; }
    .header-login .login-btn { border: none; padding: 6px; background: transparent; }
    .header-login .login-btn:hover { background: transparent; color: var(--primary); }
    .header-login .login-text { display: none; }
    .header-login .user-avatar-trigger { width: 32px; height: 32px; }
    .header-login .user-avatar-circle { width: 30px; height: 30px; font-size: 0.75rem; }
    .side-nav { display: none; }
    .home-grid { grid-template-columns: 1fr; }
    .hero { padding: var(--space-2xl) 0 var(--space-xl); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid .footer-col:first-child { grid-column: 1 / -1; }
  }
  @media (max-width: 640px) {
    .search-box { max-width: none; padding: 5px 5px 5px 16px; }
    .search-box input { font-size: 0.85rem; }
    .search-box button { width: 30px; height: 30px; font-size: 0.8rem; }
    .hero .stats-row { flex-direction: column; align-items: center; }
    .hero .hero-footer { flex-direction: column; gap: var(--space-xs); }
    .hero .hero-footer .hf-dot { display: none; }
    .home-grid { gap: var(--space-md); }
    .container { padding: 0 var(--space-md); }
    .hc-item { padding: var(--space-sm) var(--space-md); }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
  }
  /* ════════════════════════════════════════════════════════════
     EXPLORER — 文件管理器风格课程浏览器
     ════════════════════════════════════════════════════════════ */
  .view-section { display: none; }
  .view-section.active { display: block; }

  /* ── Breadcrumb ─────────────────────────── */
  .breadcrumb {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: var(--space-lg) 0 var(--space-sm); font-size: 0.82rem;
  }
  .breadcrumb a {
    padding: 4px 8px; border-radius: var(--radius-sm);
    color: var(--ink-faint); font-weight: 500;
    transition: background 0.15s, color 0.15s; cursor: pointer;
  }
  .breadcrumb a:hover { background: var(--primary-surface); color: var(--primary); }
  .breadcrumb .bc-sep { color: var(--border); font-size: 0.7rem; user-select: none; }
  .breadcrumb .bc-current { color: var(--ink-soft); font-weight: 500; padding: 4px 6px; }
  /* 窄屏折叠省略号（桌面恒隐，见下方 ≤640px 块）：样式对齐面包屑链接 */
  .breadcrumb .bc-ellipsis {
    display: none;
    border: 0; background: none; font: inherit; font-weight: 700;
    padding: 4px 8px; border-radius: var(--radius-sm);
    color: var(--ink-faint); letter-spacing: 1px;
    cursor: pointer; user-select: none;
    transition: background 0.15s, color 0.15s;
  }
  .breadcrumb .bc-ellipsis:hover { background: var(--primary-surface); color: var(--primary); }

  /* 窄屏面包屑折叠为「首页 / ⋯ / 末项」：中间层级隐藏，点按 ⋯ 临时展开完整路径
     （移动端返回主要靠手势，面包屑只承担定位，不再整段换行“乱飞”） */
  @media (max-width: 640px) {
    .breadcrumb { flex-wrap: nowrap; white-space: nowrap; min-width: 0; overflow: hidden; }
    .breadcrumb .bc-mid { display: none; }
    .breadcrumb .bc-ellipsis { display: inline-flex; align-items: center; }
    .breadcrumb.bc-expanded { flex-wrap: wrap; white-space: normal; }
    .breadcrumb.bc-expanded .bc-mid { display: inline-flex; align-items: center; }
    .breadcrumb.bc-expanded .bc-ellipsis { display: none; }
    /* 末项过长时收缩出省略号，不撑破单行 */
    .breadcrumb > a:last-child,
    .breadcrumb > .bc-current {
      flex: 0 1 auto; min-width: 0;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
  }
  .course-nav-bar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
    padding-top: var(--space-lg);
  }
  /* 全部课程顶部行：面包屑居左（与其他页面一致），根页签/切换分类靠右；管理模式「＋ 新建」独占最右 */
  .explorer-top-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
  .explorer-top-row .course-nav-bar { margin-left: auto; padding-top: 0; }
  .explorer-top-row.has-mgmt-new .course-nav-bar { margin-left: 0; }
  .explorer-top-row .breadcrumb { padding: var(--space-md) 0; }
  /* 课程类型切换：统一采用档案索引式小圆角，不使用胶囊形。 */
  .course-root-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border-light); border-radius: 10px; background: transparent; }
  .course-root-tab {
    border: 0; border-radius: 8px; padding: 6px 14px;
    color: var(--ink-faint); background: transparent; font: inherit; font-size: var(--fs-sm); cursor: pointer;
  }
  .course-root-tab:hover { color: var(--primary); background: var(--primary-surface); }
  .course-root-tab.is-active { color: var(--primary-dark); background: var(--primary-surface); font-weight: 700; }
  .course-switch-btn {
    border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px;
    background: var(--raised); color: var(--ink-soft); font: inherit; font-size: 0.76rem; cursor: pointer;
  }
  .course-switch-btn:hover { border-color: var(--primary-light); color: var(--primary); background: var(--primary-surface); }
  .course-switch-overlay {
    position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: oklch(0.12 0.02 250 / 0.35); backdrop-filter: blur(4px);
  }
  .course-switch-dialog {
    width: min(720px, 100%); max-height: min(760px, 90vh); overflow: auto;
    padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--raised); color: var(--ink); box-shadow: var(--shadow-xl);
  }
  .course-switch-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
  .course-switch-head h3 { margin-top: 4px; font-family: var(--serif); font-size: 1.25rem; }
  .course-switch-close { border: 0; background: transparent; color: var(--ink-faint); font-size: 1.1rem; cursor: pointer; }
  .course-switch-section + .course-switch-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-light); }
  .course-switch-section h4 { margin-bottom: 9px; color: var(--ink-soft); font-size: 0.78rem; }
  .course-nav-current { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .course-nav-current span { color: var(--ink-faint); font-size: 0.7rem; }
  .course-nav-current strong { overflow-wrap: anywhere; color: var(--ink); font-family: var(--serif); font-size: 1.1rem; font-weight: 650; }
  .course-switch-tabs { display: flex; gap: 4px; margin-bottom: 15px; border-bottom: 1px solid var(--border-light); }
  .course-switch-tab { padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-faint); font: inherit; font-size: 0.78rem; cursor: pointer; }
  .course-switch-tab.is-active { border-bottom-color: var(--primary); color: var(--ink); font-weight: 700; }
  .course-switch-current { margin-bottom: 14px; color: var(--ink-faint); font-size: 0.75rem; line-height: 1.5; }
  .course-switch-all { margin-top: 16px; padding: 8px 11px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: transparent; color: var(--primary); font: inherit; font-size: 0.78rem; cursor: pointer; }
  .course-switch-all:hover { background: var(--primary-surface); }
  .course-switch-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .course-switch-grid button {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px;
    background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 0.78rem; cursor: pointer;
  }
  .course-switch-grid button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-surface); }
  @media (min-width: 641px) {
    .course-switch-overlay { align-items: flex-start; justify-content: flex-start; padding: 0; background: transparent; backdrop-filter: none; pointer-events: none; }
    .course-switch-dialog { position: absolute; top: var(--switch-top, 80px); left: min(var(--switch-left, 24px), calc(100vw - 744px)); max-height: min(760px, calc(100vh - 96px)); pointer-events: auto; }
  }

  .mobile-bottom-nav, #otherView { display: none; }

  @media (max-width: 900px) {
    .mobile-bottom-nav {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
      display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
      padding: 3px 8px max(3px, env(safe-area-inset-bottom));
      border-top: 1px solid var(--border-light); background: oklch(from var(--raised) l c h / 0.95);
      backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    }
    .mobile-bottom-nav button {
      position: relative;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
      min-height: 48px; border: 0; border-radius: var(--radius-sm); background: transparent;
      color: var(--ink-faint); font: inherit; font-size: 0.65rem; cursor: pointer;
      transition: color 160ms ease-out, transform 120ms ease-out;
    }
    /* 激活态是伪元素圆角方形软底：胶囊两端弧度过弯，四字标签会视觉上落到圆外 */
    .mobile-bottom-nav button::before {
      content: ''; position: absolute; inset: 3px 10px; z-index: -1;
      border-radius: var(--radius-md); background: transparent;
      transition: background-color 160ms ease-out, box-shadow 160ms ease-out;
    }
    .mobile-bottom-nav button:hover { color: var(--primary); }
    .mobile-bottom-nav button:active { transform: scale(0.97); }
    .mobile-bottom-nav button.is-active { color: var(--primary); }
    .mobile-bottom-nav button.is-active::before { background: var(--primary-surface); }
    .mobile-bottom-nav button:focus-visible { outline: none; }
    .mobile-bottom-nav button:focus-visible::before { box-shadow: inset 0 0 0 1.5px var(--primary); }
    .mobile-bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-bottom-nav button.is-active svg { stroke-width: 1.9; }
    body { padding-bottom: 68px; }
    .course-nav-bar { padding-top: var(--space-md); }
    .course-root-tab { padding-inline: 14px; }
    /* 移动端「其他」聚合页：报头式墨线 + 铜色眉题 + 发丝线行式列表 */
    #otherView.active { display: block; }
    .ov-wrap { max-width: 560px; margin: 0 auto; padding: 22px 20px 48px; }
    .ov-head { padding-top: 14px; border-top: 2px solid var(--ink); }
    .ov-kicker { margin: 0; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
    .ov-head h1 { margin: 6px 0 4px; color: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 650; letter-spacing: -0.5px; }
    .ov-sub { margin: 0; color: var(--ink-soft); font-size: 13px; }
    .ov-list { display: grid; margin-top: 18px; border-top: 1px solid var(--border-light); }
    .ov-list button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
    .ov-list button:active { background: var(--v9-surface); }
    .ov-list button svg { width: 20px; height: 20px; fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
    .ov-list button span { flex: 1; }
    .ov-list button em { color: var(--ink-faint); font-style: normal; font-size: 15px; }
  }
  @media (max-width: 640px) {
    .course-switch-overlay { padding: 12px; }
    .course-switch-overlay { align-items: flex-end; padding: 0; }
    .course-switch-dialog { width: 100%; padding: 18px; border-radius: 16px 16px 0 0; max-height: 88vh; }
    .course-nav-bar { align-items: flex-start; }
    .course-switch-btn { padding-inline: 10px; }
  }
  .explorer-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: var(--space-xs);
  }
  .explorer-header h2 {
    font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink);
  }
  .explorer-header .eh-count { font-size: 0.78rem; color: var(--ink-faint); }

  /* ── Level 1: Square Card Grid ──────────── */
  /* flex-wrap + center：每行都是一个独立的内容组，未满行保持真正的组居中。
     不把短行拉伸成整行分散布局，避免松散模式下卡片看起来漂移。
     （grid 的 auto-fit 折叠不了被前几行占用的轨道，未满行只能左对齐，故改用 flex）
     卡片宽度 clamp 连续渐变：宽屏 5 列 218px（5×218+4×20=1170≤1180，与旧 grid 满行同宽），
     随容器缩小平滑收缩（218→150px），低于 150px 下限时由 flex-wrap 自动降档
     5→4→3→2→1 列（每档卡片恒 150px，无大小突变）；375px 视口 2 列 150px（间距≈20px）、
     360px 视口 2 列 150px、352px 以下 1 列 150px。
     切勿改回固定 px 或用 ≤180px 的窄下限：前者恢复 640px 断点的 218→100 突变，
     后者会让满行变 6 列。 */
  .folder-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0 var(--space-xl);
    max-width: 1180px;
    margin: 0 auto;
  }
  .folder-card {
    flex: 0 0 clamp(150px, calc((100% - 4 * var(--space-md)) / 5), 218px);
    aspect-ratio: 1;
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: var(--space-sm); cursor: pointer;
    padding: var(--space-sm);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative; overflow: hidden;
  }
  .folder-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 60%, oklch(from var(--accent) l c h / 0.03));
    pointer-events: none;
  }
  .folder-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px oklch(0.45 0.01 55 / 0.05);
  }
  .folder-card .fc-icon {
    width: 58px; height: 58px;
    display: flex; align-items: center; justify-content: center;
    background: oklch(from var(--primary-surface) calc(l + 0.018) c h);
    border: 1px solid oklch(from var(--primary-light) l c h / 0.72);
    border-radius: 14px;
    box-shadow: inset 0 0 0 3px oklch(1 0 0 / 0.46);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
  }
  .folder-card:hover .fc-icon {
    background: oklch(from var(--primary-surface) calc(l - 0.01) calc(c + 0.008) h);
    border-color: oklch(from var(--primary-light) l c h / 0.95);
    transform: scale(1.05);
  }
  .folder-card .fc-icon svg { width: 31px; height: 31px; color: var(--primary-dark); opacity: 1; overflow: visible; }
  .folder-card .fc-name {
    font-size: 0.88rem; font-weight: 600; color: var(--ink);
    text-align: center; line-height: 1.3;
  }
  .folder-card .fc-count {
    font-size: 0.7rem; color: var(--ink-faint);
    font-weight: 500;
  }
  /* 松散模式中，数量说明与较长标题共享同一条视觉中线。 */
  html:not([data-bnu-layout="compact"]) .explorer-view .folder-card .fc-copy {
    text-align: center;
  }
  /* 紧凑目录专属装饰在松散方卡中不占布局空间。 */
  .folder-card .fc-spine,
  .folder-card .fc-disclosure { display: none; }

  /* ── 紧凑布局：安静的数字学术索引 ───────────────────────
     只在紧凑布局启用，松散布局继续使用上方的方卡规则。
     固定等宽网格 + 行式信息结构，阅读顺序始终从左到右、从上到下。 */
  .explorer-view .explorer-top-row.has-compact-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 24px;
    row-gap: 2px;
    margin-bottom: 2px;
  }
  .explorer-view .explorer-top-row.has-compact-heading .breadcrumb {
    grid-column: 1 / -1;
    padding: 12px 0 0;
  }
  html[data-bnu-layout="compact"] .explorer-view .explorer-compact-heading {
    grid-column: 1;
    min-width: 0;
    padding: 4px 0 8px;
  }
  html[data-bnu-layout="compact"] .explorer-view .explorer-compact-heading[hidden] { display: none; }
  html[data-bnu-layout="compact"] .explorer-view .ech-title-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
  }
  html[data-bnu-layout="compact"] .explorer-view .ech-title-line h1 {
    min-width: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.015em;
  }
  html[data-bnu-layout="compact"] .explorer-view .ech-count {
    flex: 0 0 auto;
    color: var(--ink-faint);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .explorer-view .explorer-top-row.has-compact-heading .course-nav-bar {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin-left: 0;
    padding: 0 0 8px;
  }
  html[data-bnu-layout="compact"] .explorer-view .explorer-top-row.has-compact-heading.has-mgmt-new .course-nav-bar {
    grid-column: 1;
    justify-self: start;
  }
  html[data-bnu-layout="compact"] .explorer-view .explorer-top-row.has-compact-heading .mgmt-new-btn {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    margin-bottom: 8px;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: minmax(80px, auto);
    align-items: stretch;
    gap: 10px 12px;
    max-width: 1360px;
    padding: 4px 0 var(--space-xl);
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card {
    position: relative;
    display: grid;
    grid-template-columns: 3px 40px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    min-width: 0;
    min-height: 80px;
    padding: 10px 14px 10px 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 11px;
    background: var(--raised);
    box-shadow: none;
    aspect-ratio: auto;
    cursor: pointer;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, transform 120ms ease-out;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card::after { display: none; }
  /* 先抵消松散卡片的 hover 上浮，真正的 hover 反馈只在精确指针设备启用。 */
  html[data-bnu-layout="compact"] .explorer-view .folder-card:hover {
    border-color: var(--border-light);
    background: var(--raised);
    transform: none;
    box-shadow: none;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card:hover .fc-icon {
    border-color: oklch(from var(--primary) l c h / 0.16);
    background: oklch(from var(--primary-surface) l c h / 0.52);
    transform: none;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card:hover .fc-disclosure {
    color: var(--ink-faint);
    transform: none;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card:active { transform: scale(0.985); }
  html[data-bnu-layout="compact"] .explorer-view .folder-card:focus-visible {
    outline: 2px solid oklch(from var(--primary) l c h / 0.48);
    outline-offset: 2px;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-spine {
    display: block;
    align-self: stretch;
    width: 3px;
    min-height: 58px;
    margin-block: -10px;
    border-radius: 0 2px 2px 0;
    background: var(--primary);
    opacity: 0.9;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    border: 1px solid oklch(from var(--primary) l c h / 0.16);
    border-radius: 10px;
    background: oklch(from var(--primary-surface) l c h / 0.52);
    color: var(--primary);
    box-shadow: none;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-icon svg {
    width: 23px;
    height: 23px;
    color: var(--primary);
    opacity: 1;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    word-break: break-all;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-count {
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-disclosure {
    display: block;
    margin-left: auto;
    padding-left: 4px;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
    transition: color 140ms ease-out, transform 140ms ease-out;
  }
  html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-card-menu-btn { top: 7px; right: 7px; }

  @media (hover: hover) and (pointer: fine) {
    html[data-bnu-layout="compact"] .explorer-view .folder-card:hover {
      border-color: oklch(from var(--primary) l c h / 0.34);
      background: oklch(from var(--primary-surface) l c h / 0.22);
      transform: none;
      box-shadow: none;
    }
    html[data-bnu-layout="compact"] .explorer-view .folder-card:hover .fc-icon {
      border-color: oklch(from var(--primary) l c h / 0.3);
      background: oklch(from var(--primary-surface) l c h / 0.78);
      transform: none;
    }
    html[data-bnu-layout="compact"] .explorer-view .folder-card:hover .fc-disclosure {
      color: var(--primary);
      transform: translateX(2px);
    }
  }
  @media (hover: none) {
    html[data-bnu-layout="compact"] .explorer-view .folder-card:hover .fc-card-menu-btn { display: none; }
    html[data-bnu-layout="compact"] body.mgmt-active .explorer-view .folder-card .fc-card-menu-btn { display: flex; }
  }

  @media (max-width: 640px) {
    /* 窄屏统一页头基线：松散/紧凑只切换卡片密度，面包屑与分类切换共用同一行。 */
    .explorer-view .explorer-top-row,
    .explorer-view .explorer-top-row.has-compact-heading {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      column-gap: 12px;
      row-gap: 0;
    }
    .explorer-view .explorer-top-row .breadcrumb,
    .explorer-view .explorer-top-row.has-compact-heading .breadcrumb {
      grid-column: 1;
      grid-row: 1;
      min-width: 0;
      /* 复用全站面包屑的上方呼吸区，避免紧凑页贴住顶栏；底部仍与右侧控件对齐。 */
      padding: var(--space-lg) 0 var(--space-sm);
    }
    .explorer-view .explorer-top-row .explorer-compact-heading {
      display: none !important;
    }
    /* 子目录的当前目录已在面包屑末项呈现，窄屏仅保留“切换分类”操作，避免挤压面包屑。 */
    .explorer-view .explorer-top-row .course-nav-current {
      display: none;
    }
    .explorer-view .explorer-top-row .course-nav-bar,
    .explorer-view .explorer-top-row.has-compact-heading .course-nav-bar {
      grid-column: 2;
      grid-row: 1;
      align-self: end;
      justify-self: end;
      margin-left: 0;
      /* 让控件外框底线与面包屑链接底线重合，而不是只对齐容器盒子。 */
      padding: 0 0 9px;
    }
    .explorer-view .course-switch-btn {
      /* 子目录按钮没有根页签的内层 2px 留白，补齐视觉底线。 */
      margin-bottom: 3px;
    }
    html[data-bnu-layout="compact"] .explorer-view .explorer-top-row.has-mgmt-new .course-nav-bar {
      grid-column: 1;
      justify-self: start;
    }
    html[data-bnu-layout="compact"] .explorer-view .explorer-top-row.has-mgmt-new .mgmt-new-btn {
      grid-column: 2;
      grid-row: 1;
      justify-self: end;
      align-self: end;
      margin-bottom: 6px;
    }
    html[data-bnu-layout="compact"] .explorer-view .folder-grid {
      grid-template-columns: 1fr;
      grid-auto-rows: minmax(78px, auto);
      gap: 10px;
      padding-top: 2px;
    }
    html[data-bnu-layout="compact"] .explorer-view .folder-card {
      min-height: 78px;
      padding: 9px 12px 9px 0;
      grid-template-columns: 3px 40px minmax(0, 1fr) auto;
    }
    html[data-bnu-layout="compact"] .explorer-view .folder-card .fc-spine { margin-block: -9px; }
  }

  /* v=207：课程页头部收口
     桌面只保留一行「面包屑 + 操作组」，根目录标题不再重复占位；
     新建按钮与课程切换器同组，避免在宽屏上漂到另一列。 */
  .explorer-view .explorer-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 4px;
  }
  .explorer-view .explorer-top-row .breadcrumb {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding: var(--space-lg) 0 var(--space-sm);
  }
  .explorer-view .explorer-top-row .explorer-compact-heading {
    display: none !important;
  }
  .explorer-view .explorer-top-actions {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }
  .explorer-view .explorer-top-actions .course-nav-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
  }
  .explorer-view .explorer-top-actions .mgmt-new-btn {
    margin-left: 0;
    flex: 0 0 auto;
  }

  /* v=209：面包屑跟随当前页面内容左边缘。
     资料页使用宽内容轨时，头部不能再被收进其他页面的居中窄轨，
     否则会与本页标题和文件表格错开。 */
  @media (min-width: 641px) {
    .explorer-view .explorer-top-row {
      max-width: none;
      margin-inline: 0;
    }
  }

  /* ── 管理模式：三点菜单 ─────────────────── */
  .folder-card .fc-card-menu-btn {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px; display: none;
    align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1rem; line-height: 1;
    color: var(--ink-mid); cursor: pointer;
    background: var(--raised);
    border: 1px solid var(--border-light);
    z-index: 2;
    transition: background 0.15s, color 0.15s;
  }
  .folder-card .fc-card-menu-btn:hover {
    background: var(--primary-surface);
    color: var(--primary);
  }
  .folder-card:hover .fc-card-menu-btn { display: flex; }
  .mgmt-active .folder-card .fc-card-menu-btn { display: flex; }
  .folder-card .fc-card-menu-btn.is-open { display: flex; background: var(--primary-surface); color: var(--primary); }

  @media (max-width: 640px) {
    .explorer-view .explorer-top-row {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      column-gap: 10px;
    }
    .explorer-view .explorer-top-row .breadcrumb {
      grid-column: 1;
      grid-row: 1;
      padding: var(--space-lg) 0 var(--space-sm);
    }
    .explorer-view .explorer-top-actions {
      grid-column: 2;
      grid-row: 1;
      align-self: end;
      gap: 7px;
      padding-bottom: 9px;
    }
    .explorer-view .explorer-top-actions .course-nav-bar {
      padding: 0;
    }
    .explorer-view .explorer-top-actions .course-nav-current {
      display: none;
    }
    .explorer-view .explorer-top-actions .mgmt-new-btn,
    .explorer-view .explorer-top-actions .explorer-newcourse-btn {
      margin-bottom: 0;
      /* 窄屏仍与根页签同高同字号，只收水平内边距（页签此断点为 6px 14px） */
      padding: 6px 12px;
    }
  }

  .fc-card-menu {
    position: fixed; z-index: 1000;
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    padding: 4px 0;
  }
  .fc-card-menu .fc-menu-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
  }
  .fc-card-menu .fc-menu-item:hover {
    background: var(--primary-surface);
    color: var(--primary);
  }
  .fc-card-menu .fc-menu-item.danger {
    color: var(--danger, oklch(0.5 0.15 30));
  }
  .fc-card-menu .fc-menu-item.danger:hover {
    background: oklch(0.9 0.05 30);
  }
  .fc-menu-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: transparent;
  }

  .folder-list-item .fc-card-menu-btn {
    width: 24px; height: 24px; display: none;
    align-items: center; justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    font-size: 1rem; line-height: 1;
    color: var(--ink-faint); cursor: pointer;
    transition: background 0.1s, color 0.1s;
    margin-left: auto;
  }
  .folder-list-item .fc-card-menu-btn:hover {
    background: var(--primary-surface);
    color: var(--primary);
  }
  .folder-list-item:hover .fc-card-menu-btn { display: flex; }
  .mgmt-active .folder-list-item .fc-card-menu-btn { display: flex; }

  /* ── 管理模式弹窗 ─────────────────── */
  .mgmt-dialog { max-width: 420px; }
  .mgmt-dialog h3 { margin: 0 0 12px; font-size: 1rem; }
  .mgmt-dialog label { font-size: 0.85rem; display: block; margin-bottom: 4px; color: var(--ink-mid); }
  .mgmt-dialog input, .mgmt-dialog select {
    width: 100%; padding: 8px; border-radius: 6px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem; box-sizing: border-box;
  }
  .mgmt-dialog .ar-actions { margin-top: 14px; }

  /* ── 新建文件夹：课程代码额外输入（选中类型切换）── */
  .mgmt-course-fields { display: none; margin-top: 10px; }
  .mgmt-course-fields.visible { display: block; }
  .mgmt-auto-code { display: flex; align-items: center; padding: 10px 12px; background: var(--bg-subtle); border: 1px dashed var(--border-light); border-radius: 6px; font-size: 0.85rem; color: var(--ink-faint); font-family: monospace; }

  /* ── 修改课程代码：情况说明 ─── */
  .mgmt-situation { padding: 10px; margin: 10px 0; background: var(--primary-surface); border-radius: var(--radius-sm); font-size: 0.85rem; }
  .mgmt-option { padding: 8px 12px; margin: 6px 0; border: 1px solid var(--border-light); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
  .mgmt-option:hover { border-color: var(--primary-light); background: var(--primary-surface); }
  .mgmt-option input[type="radio"] { margin-right: 8px; }
  .mgmt-option label { cursor: pointer; }
  .mgmt-option .mgmt-opt-desc { font-size: 0.8rem; color: var(--ink-faint); margin-top: 2px; }
  .mgmt-course-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
  .mgmt-course-item { padding: 8px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); cursor: pointer; }
  .mgmt-course-item:hover { border-color: var(--primary-light); background: var(--primary-surface); }
  .mgmt-course-item.selected { border-color: var(--primary); background: var(--primary-surface); }

  /* ── Level 2+: Bar List ─────────────────── */
  .folder-list {
    display: flex; flex-direction: column; gap: 3px;
    padding: var(--space-sm) 0 var(--space-xl);
  }
  .folder-list-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: 12px 18px;
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, padding-left 0.15s, box-shadow 0.15s;
  }
  .folder-list-item:hover {
    border-color: var(--primary-light);
    background: var(--primary-surface);
    padding-left: 22px;
    box-shadow: 0 1px 4px oklch(0 0 0 / 0.03);
  }
  .fli-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-surface);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: background 0.15s;
  }
  .folder-list-item:hover .fli-icon { background: oklch(from var(--primary) l c h / 0.12); }
  .fli-info { flex: 1; min-width: 0; }
  /* 课程名单行省略号截断：窄屏标题列被挤压时宁可截断，也不一字一行竖摞 */
  .fli-name {
    font-size: 0.88rem; font-weight: 500; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 同名合并叶子行可能并列多个课程代码：超长省略号截断，完整列表在 title 悬停 */
  .fli-meta {
    font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fli-badge {
    font-size: 0.64rem; font-weight: 600;
    padding: 3px 12px; border-radius: var(--radius-full); flex-shrink: 0;
    letter-spacing: 0.02em;
  }
  .fli-badge.has-data { background: var(--success-light); color: oklch(0.35 0.10 150); }
  /* v=211：暗色主题提升资料数徽章的明度与文字对比度，避免绿色沉入深色背景。 */
  html[data-bnu-theme="dark"] .fli-badge.has-data {
    background: oklch(0.34 0.09 150);
    color: oklch(0.82 0.14 150);
  }
  .fli-badge.no-data { background: var(--bg); color: var(--ink-faint); }

  /* ── 收藏课程星星（叶子课程节点，文件详情页同款星星）── */
  .fli-fav-star {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: 26px; height: 26px;
    cursor: pointer; color: var(--ink-faint);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
  }
  .fli-fav-star:hover { color: var(--star-dark); background: oklch(0.93 0.06 85 / 0.5); }
  .fli-fav-star.favorited { color: var(--star); }

  /* ── Collapsible No-Data Section ────────── */
  .nd-toggle {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 12px 18px; cursor: pointer;
    font-size: 0.8rem; color: var(--ink-faint); font-weight: 500;
    border-radius: var(--radius-md);
    transition: background 0.15s;
    margin-top: var(--space-sm);
    border: 1px dashed var(--border-light);
    user-select: none;
  }
  .nd-toggle:hover { background: var(--bg); border-color: var(--border); }
  .nd-toggle .nd-arrow { transition: transform 0.2s; font-size: 0.7rem; }
  .nd-toggle.open .nd-arrow { transform: rotate(90deg); }
  .nd-content { display: none; }
  .nd-content.open { display: block; }
  .nd-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: 10px 18px; margin-top: 2px;
    background: var(--bg); border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem; color: var(--ink-soft);
    opacity: 0.6;
  }
  .nd-item .nd-icon { font-size: 0.9rem; width: 30px; text-align: center; flex-shrink: 0; }

  /* ── Empty state ────────────────────────── */
  .empty-state {
    text-align: center; padding: 60px 20px; color: var(--ink-faint);
  }
  .empty-state .es-icon { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 0 auto var(--space-md); }
  .empty-state .es-text { font-size: 0.95rem; }
  .empty-state .es-sub { font-size: 0.8rem; margin-top: var(--space-xs); }

  /* ── Mobile responsive ──────────────────── */
  @media (max-width: 640px) {
    .folder-grid { gap: var(--space-sm); }
    /* 移动端不再硬切卡片宽度（原 flex:0 0 100px 导致 640px 断点从 218px 突变到 100px）；
       卡片宽度由 .folder-card 的 clamp 渐变控制，375px 视口自然排 2 列 */
    .folder-card { padding: 8px; }
    .folder-card .fc-icon { width: 58px; height: 58px; }
    .folder-card .fc-icon svg { width: 31px; height: 31px; }
    .folder-card .fc-name { font-size: 0.75rem; }
    .file-table thead th,
    .file-table tbody td { padding: 8px 12px; font-size: 0.78rem; }
  }

  /* ═══════════════════════════════════════════
     Modal / 登录 / 注册 / 上传
     ═══════════════════════════════════════════ */

  .modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: oklch(0 0 0 / 0.4);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-md);
    backdrop-filter: blur(4px);
    overscroll-behavior: contain;
  }
  .modal-card {
    background: var(--raised); border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalIn 0.2s ease-out;
  }
  .modal-card-wide { max-width: 520px; }
  .modal-card, .modal-card-wide { max-height: 85vh; overflow-y: auto; }
  .modal-card, .modal-card-wide { overscroll-behavior: contain; }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  .modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border: none; background: none; font-size: 1.05rem; line-height: 1;
    cursor: pointer; color: var(--ink-faint); border-radius: 50%;
    transition: background 0.15s, color 0.15s;
  }
  .modal-close:hover { color: var(--ink); background: oklch(from var(--ink) l c h / 0.08); }
  .modal-title {
    font-family: var(--serif);
    font-size: 1.3rem; margin-bottom: var(--space-md);
    color: var(--ink); padding-right: 36px;
  }

  .mf-group { margin-bottom: var(--space-sm); }
  .mf-group label {
    display: block; font-size: 0.82rem;
    color: var(--ink-soft); margin-bottom: 4px;
    font-weight: 500;
  }
  .label-required { color: var(--accent); margin-left: 2px; }
  .mf-label-hint { color: var(--ink-faint); font-weight: 400; transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast); }
  .mf-label-hint--warning {
    color: var(--danger); font-weight: 600; background: var(--danger-light);
    border: 1px solid var(--danger-border); border-radius: var(--radius-xs); padding: 1px 5px;
  }
  .mf-pwd-wrap {
    position: relative; display: flex; align-items: center;
  }
  .mf-pwd-wrap .mf-pwd-input {
    padding-right: 52px;
  }
  .mf-pwd-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: none; background: transparent;
    cursor: pointer; font-size: 1rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s; opacity: 0.5;
  }
  .mf-pwd-toggle:hover { background: var(--surface); opacity: 1; }
  .mf-pwd-toggle .pwd-icon {
    width: 18px; height: 18px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .mf-pwd-toggle .pwd-icon--off { display: none; }
  .mf-pwd-toggle.is-visible .pwd-icon--eye { display: none; }
  .mf-pwd-toggle.is-visible .pwd-icon--off { display: block; }
  .mf-input {
    width: 100%; padding: 9px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font: inherit; font-size: 0.9rem;
    background: var(--surface); color: var(--ink);
    transition: border-color 0.15s;
  }
  .mf-input:focus { outline: none; border-color: var(--primary); }
  .mf-textarea { min-height: 70px; resize: vertical; }
  /* 身份标签：培养层次、学院、专业同组排列。 */
  .mf-ident-row {
    display: grid; grid-template-columns: minmax(84px, .75fr) minmax(110px, 1.2fr) minmax(96px, 1fr); gap: 8px;
  }
  .mf-ident-row .mf-input { min-width: 0; padding-inline: 9px; }
  @media (max-width: 480px) {
    .mf-ident-row { grid-template-columns: 1fr 1fr; }
    .mf-ident-row .mf-input:first-child { grid-column: 1 / -1; }
  }

  /* ═══ 紧凑首页（v9 h8 结构；h8 主体样式在文件末尾区块）+ 校园入口管理 ═══ */
  .home-compact-layout { display: none; }
  body.home-layout-compact #homeView > :not(.home-compact-layout) { display: none; }
  body.home-layout-compact .home-compact-layout { display: block; }
  .compact-kicker { color: var(--accent); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.14em; }
  .compact-announcement-content { min-height: 80px; }
  .compact-empty, .compact-loading { display: block; padding: 16px 0; color: var(--ink-faint); font-size: 0.76rem; }
  /* 窄屏合并榜：下载榜 / 收藏榜 / 最近上传 三榜合一；卡片框架样式在 h8 区块的窄屏断点里。 */
  .compact-discovery-block { display: none; }
  .compact-discovery-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border-light); }
  .compact-discovery-tabs button { position: relative; min-height: 44px; border: 0; padding: 0 0 9px; background: transparent; color: var(--ink-faint); font: inherit; font-size: 0.78rem; cursor: pointer; }
  .compact-discovery-tabs button::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--primary); content: ''; opacity: 0; }
  .compact-discovery-tabs button.is-active { color: var(--ink); font-weight: 650; }
  .compact-discovery-tabs button.is-active::after { opacity: 1; }
  .compact-discovery-list { display: grid; grid-template-columns: 1fr; padding-top: 4px; }
  .compact-discovery-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 46px; padding: 9px 8px; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
  .compact-discovery-item:last-child { border-bottom: 0; }
  @media (hover: hover) {
    .compact-discovery-item:hover { background: var(--primary-surface); }
  }
  .compact-discovery-rank { color: var(--ink-faint); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
  .compact-discovery-item:first-child .compact-discovery-rank { color: var(--primary); font-weight: 700; }
  /* 最近上传榜没有名次列：信息列从第 1 列起补位。 */
  .compact-discovery-item[data-material-id] > .compact-discovery-info:first-child { grid-column: 1 / 3; }
  .compact-discovery-info { min-width: 0; }
  .compact-discovery-info strong, .compact-discovery-info small { display: block; overflow-wrap: anywhere; }
  .compact-discovery-info strong { font-size: 0.8rem; font-weight: 600; }
  .compact-discovery-info small { margin-top: 2px; color: var(--ink-faint); font-size: 0.7rem; }
  .compact-discovery-count { color: var(--ink-faint); font-size: 0.7rem; white-space: nowrap; }
  .compact-more-button, .compact-empty a, .compact-data-note button, .compact-error button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--primary); font: inherit; font-size: 0.75rem; cursor: pointer; text-decoration: none; }
  .compact-more-button { width: 100%; margin-top: 10px; }
  .compact-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; color: var(--danger); font-size: 0.76rem; }
  .compact-error button { min-height: 34px; }
  .compact-data-note { min-height: 1.5em; margin-top: 12px; color: var(--danger); font-size: 0.72rem; }
  .compact-data-note button { min-height: 30px; padding-block: 3px; margin-left: 4px; }
  .compact-campus-link { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0; border: 0; border-radius: 0; color: var(--ink); font-size: 13px; text-align: left; }
  .compact-campus-link:hover { color: var(--primary); }
  .compact-campus-link span:last-child { margin-left: auto; color: var(--ink-faint); }
  .compact-announcement-block[hidden], .compact-campus-block[hidden] { display: none; }
  .campus-enabled-status.is-disabled { color: var(--ink-faint); }
  #campusFormStatus.is-saving { color: var(--primary); }
  #campusFormStatus.is-success { color: var(--success); }
  #campusFormStatus.is-error { color: var(--danger); }

  /* ── 游客头部「外观」入口 ── */
  .guest-appearance-trigger {
    min-height: 34px; padding: 0 10px; border: 1px solid var(--border);
    border-radius: var(--radius-full); background: var(--surface); color: var(--ink-soft);
    font: inherit; font-size: 0.74rem; cursor: pointer;
  }
  .guest-appearance-trigger:hover { border-color: var(--primary-light); color: var(--primary); }

  /* 总管理员的校园入口管理面板 */
  .campus-manager-overlay { position: fixed; inset: 0; z-index: 550; display: flex; align-items: center; justify-content: center; padding: 20px; background: oklch(0.12 0.02 250 / 0.4); backdrop-filter: blur(5px); }
  .campus-manager-dialog { width: min(720px, 100%); max-height: min(760px, 90vh); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); color: var(--ink); box-shadow: var(--shadow-xl); }
  .campus-manager-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
  .campus-manager-head h2 { margin-top: 4px; font-family: var(--serif); font-size: 1.25rem; }
  .campus-manager-head > button { border: 0; background: transparent; color: var(--ink-faint); font-size: 1.1rem; cursor: pointer; }
  .campus-link-form { display: grid; grid-template-columns: 0.75fr 1.25fr auto; align-items: end; gap: 9px; padding: 14px; border: 1px solid var(--border-light); background: var(--surface); }
  .campus-link-form label { color: var(--ink-soft); font-size: 0.7rem; }
  .campus-link-form input { display: block; width: 100%; margin-top: 5px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--raised); color: var(--ink); font: inherit; font-size: 0.78rem; }
  .campus-link-form input:focus { border-color: var(--primary); outline: 2px solid var(--primary-surface); }
  .campus-form-actions { display: flex; gap: 5px; }
  .campus-form-actions button, .campus-manager-row button { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px; background: var(--raised); color: var(--primary); font: inherit; font-size: 0.7rem; cursor: pointer; white-space: nowrap; }
  .campus-form-actions button:first-child { border-color: var(--primary); background: var(--primary); color: var(--raised); }
  .campus-form-actions .secondary { color: var(--ink-soft); }
  #campusFormStatus { grid-column: 1 / -1; min-height: 1.3em; color: var(--ink-faint); font-size: 0.7rem; }
  .campus-manager-list { display: grid; gap: 5px; margin-top: 14px; }
  .campus-manager-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto auto auto auto; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
  .campus-drag-handle { color: var(--ink-faint); font-size: 1rem; }
  .campus-manager-row strong, .campus-manager-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .campus-manager-row strong { font-size: 0.78rem; }
  .campus-manager-row small { margin-top: 2px; color: var(--ink-faint); font-size: 0.66rem; }
  .campus-enabled-status { color: var(--success); font-size: 0.65rem; }
  .campus-manager-row button:disabled { opacity: 0.35; cursor: default; }
  .campus-manager-hint { margin-top: 15px; color: var(--ink-faint); font-size: 0.68rem; line-height: 1.5; }
  .campus-more-overlay { position: fixed; inset: 0; z-index: 545; display: flex; align-items: center; justify-content: center; padding: 20px; background: oklch(0.12 0.02 250 / 0.4); backdrop-filter: blur(5px); }
  .campus-more-dialog { width: min(560px, 100%); max-height: min(620px, 86vh); overflow: auto; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--raised); color: var(--ink); box-shadow: var(--shadow-xl); }
  .campus-more-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .campus-more-head h2 { font-family: var(--serif); font-size: 1.15rem; }
  .campus-more-head button { border: 0; background: transparent; color: var(--ink-faint); font-size: 1rem; cursor: pointer; }
  .campus-more-links { display: grid; gap: 7px; }

  @media (max-width: 900px) {
    .campus-link-form { grid-template-columns: 1fr 1fr; }
    .campus-form-actions { grid-column: 1 / -1; }
  }
  @media (max-width: 700px) {
    body { --mobile-bottom-nav-height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: calc(var(--mobile-bottom-nav-height) + 12px); }
    .mobile-bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: var(--mobile-bottom-nav-height); padding-bottom: env(safe-area-inset-bottom); background: var(--raised); }
    .mobile-bottom-nav button.is-active { color: var(--primary); font-weight: 650; }
    .mobile-bottom-nav button svg { width: 20px; height: 20px; }
    .mobile-bottom-nav button span { line-height: 1.2; white-space: nowrap; }
    .campus-manager-overlay { align-items: flex-end; padding: 0; }
    .campus-manager-dialog { width: 100%; max-height: 92vh; padding: 16px; border-radius: 16px 16px 0 0; }
    .campus-link-form { grid-template-columns: 1fr; }
    .campus-form-actions { grid-column: auto; }
    /* 窄屏行改两行目录条目：第一行 把手+名称/网址+状态+编辑，第二行 停用/上移/下移 */
    .campus-manager-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; row-gap: 7px; padding: 10px 0; }
    .campus-manager-row > .campus-drag-handle { grid-row: 1; grid-column: 1; }
    .campus-manager-row > div { grid-row: 1; grid-column: 2; }
    .campus-manager-row > .campus-enabled-status { grid-row: 1; grid-column: 3; }
    .campus-manager-row > button[data-campus-action='edit'] { grid-row: 1; grid-column: 4; }
    .campus-manager-row > button[data-campus-action='toggle'] { grid-row: 2; grid-column: 2; justify-self: start; }
    .campus-manager-row > button[data-campus-action='up'] { grid-row: 2; grid-column: 3; justify-self: start; }
    .campus-manager-row > button[data-campus-action='down'] { grid-row: 2; grid-column: 4; justify-self: start; }
    .campus-manager-row button { min-height: 32px; padding: 5px 12px; }
    .campus-more-overlay { align-items: flex-end; padding: 0; }
    .campus-more-dialog { width: 100%; max-height: 76vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  }
  @media (max-width: 700px) and (max-height: 500px) {
    /* 软键盘或横屏矮视口时收起底栏，避免压住输入区域。 */
    body { padding-bottom: 12px; }
    .mobile-bottom-nav { display: none; }
  }

  /* ── 邮箱后缀输入 ── */
  .mf-email-wrap {
    display: flex; align-items: center;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); transition: border-color 0.15s;
  }
  .mf-email-wrap:focus-within { border-color: var(--primary); }
  .mf-email-prefix {
    flex: 1; border: none !important; outline: none;
    padding: 9px 14px; font: inherit; font-size: 0.9rem;
    background: transparent; color: var(--ink);
    min-width: 80px;
  }
  .mf-email-suffix {
    padding: 9px 14px 9px 0; font-size: 0.85rem;
    color: var(--ink-faint); white-space: nowrap;
    user-select: none;
  }
  .mf-email-suffix-select {
    border: none; outline: none; background: transparent;
    padding: 9px 8px 9px 0; font: inherit; font-size: 0.82rem;
    color: var(--ink-faint); cursor: pointer; max-width: 150px;
  }
  .mf-email-suffix-select:focus { color: var(--ink); }
  .mf-email-hint {
    margin-top: 6px; font-size: 0.72rem; line-height: 1.6;
    color: var(--ink-faint);
  }

  /* ── 记住我复选框 ── */
  .mf-remember {
    display: flex; align-items: center; gap: 6px;
    margin-top: var(--space-sm); font-size: 0.82rem;
    color: var(--ink-faint); cursor: pointer;
  }
  .mf-remember input { width: 15px; height: 15px; accent-color: var(--primary); }
  .register-legal-consent {
    align-items: flex-start; line-height: 1.55;
  }
  .register-legal-consent input { flex: 0 0 auto; margin-top: 2px; }
  .register-legal-consent span { flex: 1; }
  .register-legal-consent a { color: var(--primary); }

  .mf-btn {
    width: 100%; margin-top: var(--space-sm);
    padding: 10px; border: none; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font: inherit; font-weight: 600; font-size: 0.95rem;
    cursor: pointer; transition: background 0.15s;
  }
  .mf-btn:hover { background: var(--primary-dark); }
  .mf-switch { text-align: center; margin-top: var(--space-sm); font-size: 0.85rem; color: var(--ink-faint); }
  .mf-switch a { color: var(--primary); font-weight: 500; }
  .mf-error { margin-top: var(--space-sm); padding: 8px 12px; border-radius: var(--radius-sm);
    background: oklch(0.95 0.06 30); color: oklch(0.4 0.12 30); font-size: 0.85rem; display: none; }
  .mf-error.warn { /* 上传超限等：高亮强调 */
    background: oklch(0.94 0.09 75); color: oklch(0.42 0.14 45);
    font-weight: 600; border: 1px solid oklch(0.8 0.13 60); }
  .mf-progress { margin-top: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); }
  .mf-progress-bar { flex: 1; height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
  .mf-progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s; border-radius: 3px; }
  .mf-progress span { font-size: 0.82rem; color: var(--ink-faint); white-space: nowrap; }
  .mf-hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }

  /* ── Upload Mode Tabs ─────────────────── */
  .upload-mode-tabs {
    display: flex; gap: 0; margin: var(--space-sm) 0;
    border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .um-tab {
    flex: 1; padding: 8px 12px; border: none; background: var(--bg-card);
    color: var(--ink-soft); font: inherit; font-size: 0.85rem;
    cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
  }
  .um-tab:not(:last-child) { border-right: 1px solid var(--border-light); }
  .um-tab:hover { background: var(--bg-alt); color: var(--ink); }
  .um-tab-active {
    background: var(--primary); color: #fff; font-weight: 600;
  }
  .um-tab-active:hover { background: var(--primary-dark); color: #fff; }

  .upload-mode-pane { margin-bottom: var(--space-sm); }

  .mf-textarea-lg { min-height: 200px; }

  /* ── Register Success ───────────────────── */
  .mf-success {
    text-align: center; padding: var(--space-md) 0;
  }
  .mf-success .ms-check {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--success-light); color: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; margin: 0 auto var(--space-sm);
  }
  .mf-success .ms-title {
    font-family: var(--serif); font-size: 1.1rem; font-weight: 600; color: var(--ink);
    margin-bottom: var(--space-xs);
  }
  .mf-success .ms-desc { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: var(--space-xs); }
  .mf-success .ms-pwd {
    font-family: monospace; font-size: 1.4rem; font-weight: 700;
    letter-spacing: 0.15em; color: var(--accent-hover);
    padding: var(--space-sm); background: var(--accent-light);
    border-radius: var(--radius-sm); margin: var(--space-xs) 0 var(--space-sm);
    word-break: break-all;
  }
  .mf-success .ms-secure-hint {
    font-size: 0.78rem; color: var(--ink-faint); line-height: 1.6;
    text-align: left; background: var(--bg); padding: 8px 12px;
    border-radius: var(--radius-sm); margin-bottom: var(--space-sm);
  }
  .mf-success .ms-secure-hint strong { color: var(--accent-hover); }
  .mf-success .ms-hint { font-size: 0.78rem; color: var(--ink-faint); margin-bottom: var(--space-sm); }
  .ms-copy-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 18px; border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm); background: transparent;
    color: var(--primary); font: inherit; font-size: 0.82rem;
    font-weight: 600; cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s; margin-bottom: var(--space-sm);
  }
  .ms-copy-btn:hover { background: var(--primary); color: #fff; }
  .ms-save-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--ink-soft); margin-bottom: var(--space-sm);
    text-align: left; cursor: pointer;
  }
  .ms-save-check input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
  }
  .mf-success .ms-btn:disabled {
    opacity: 0.4; cursor: not-allowed;
  }
  .mf-success .ms-btn { background: var(--accent); }
  .mf-success .ms-btn:hover:not(:disabled) { background: var(--accent-hover); }

  /* ── Register Verification Resend ─────────── */
  .register-resend {
    margin: var(--space-sm) 0;
    text-align: center;
  }
  .register-resend-error {
    padding: 8px 12px 2px;
    border-left: 2px solid var(--accent);
    background: var(--accent-light);
  }
  .register-resend-note {
    margin: 0 0 8px;
    color: var(--ink-soft);
    font-size: 0.8rem;
  }
  .ms-resend-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; margin: 0; padding: 7px 14px;
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    background: transparent; color: var(--primary);
    font: inherit; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: background-color 0.15s, color 0.15s, opacity 0.15s;
  }
  .ms-resend-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
  .ms-resend-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .ms-resend-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .register-resend-status {
    display: block; margin-top: 7px;
    color: var(--ink-faint); font-size: 0.76rem; line-height: 1.5;
  }
  .login-resend-action {
    margin-top: 10px; padding: 10px 12px;
    border-left: 2px solid var(--accent);
    background: var(--accent-light); text-align: center;
  }
  .login-resend-action p {
    margin: 0 0 8px; color: var(--ink-soft); font-size: 0.8rem;
  }

  /* ── External Access ──────────────────────── */
  .external-access {
    text-align: right; margin-top: 12px;
    border-top: 1px solid var(--border-light); padding-top: 12px;
  }
  .external-access-btn {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.78rem; font-weight: 500; color: var(--ink-faint);
    text-decoration: none; transition: color 0.15s;
  }
  .external-access-btn:hover { color: var(--primary); }

  /* ── Panel Empty State ──────────────────── */
  .hc-empty {
    padding: var(--space-xl) var(--space-lg);
    text-align: center; font-size: 0.85rem; color: var(--ink-faint);
    line-height: 1.6;
  }

  /* ── About Page ─────────────────────────── */
  .about-page { padding: 0 0 var(--space-3xl); }
  /* 关于页（无面包屑）单独给顶部分距 */
  #aboutView .about-page { padding-top: var(--space-xl); }
  .about-header { text-align: center; margin-bottom: var(--space-2xl); }
  .rankings-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-xl); text-align: left; }
  .rankings-heading { min-width: 0; }
  .rankings-mode-tabs { display: inline-flex; flex-shrink: 0; gap: 18px; border-bottom: 1px solid var(--border-light); }
  .rankings-mode-tabs button { position: relative; min-height: 40px; padding: 0 0 9px; border: 0; background: transparent; color: var(--ink-faint); font: inherit; font-size: 0.78rem; cursor: pointer; }
  .rankings-mode-tabs button:hover { color: var(--primary); }
  .rankings-mode-tabs button.is-active { color: var(--ink); font-weight: 600; }
  .rankings-mode-tabs button.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--primary); content: ''; }
  .about-title {
    font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700; color: var(--ink); margin-bottom: var(--space-xs);
  }
  .about-subtitle {
    font-size: 0.9rem; color: var(--ink-faint); letter-spacing: 0.05em;
  }
  .about-content { max-width: 640px; margin: 0 auto; }
  .about-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--raised); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
  }
  .about-section h3 {
    font-family: var(--serif); font-size: 1rem; font-weight: 600;
    color: var(--ink); margin-bottom: var(--space-sm);
  }
  .about-section p {
    font-size: 0.88rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: var(--space-xs);
  }
  .about-section a { color: var(--primary); font-weight: 500; }
  .about-section a:hover { text-decoration: underline; }
  /* 用户交流群二维码缩略图：点击新标签页看大图（移动端可直接长按识别） */
  .qr-thumb-link { display: block; width: max-content; }
  .about-section .qr-thumb {
    display: block; margin-top: 10px;
    border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    background: #fff;
    transition: box-shadow 0.15s, transform 0.15s;
  }
  .about-section .qr-thumb-link:hover { text-decoration: none; }
  .about-section .qr-thumb-link:hover .qr-thumb {
    box-shadow: 0 2px 10px oklch(0 0 0 / 0.14);
    transform: translateY(-1px);
  }

  /* ═══════════════════════════════════════════
     Search overlay
     ═══════════════════════════════════════════ */

  .search-overlay {
    position: fixed; inset: 0; z-index: 8888;
    background: oklch(0 0 0 / 0.35);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-md);
    backdrop-filter: blur(6px);
  }
  .search-overlay-inner {
    position: relative;  /* 让 .search-overlay-close(absolute) 锚定在弹窗右上角，而非整个视口 */
    background: var(--raised); border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%; max-width: 580px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
  }
  .search-overlay-close {
    position: absolute; top: 12px; right: 12px;
    border: none; background: none; font-size: 1.1rem;
    cursor: pointer; color: var(--ink-faint); line-height: 1; padding: 4px 6px;
    border-radius: var(--radius-sm); transition: background 0.15s, color 0.15s;
  }
  .search-overlay-close:hover { color: var(--ink); background: var(--primary-surface); }

  /* ── Search Global Overlay — redesigned ── */
  .sg-inner { max-width: 520px; padding: 0; overflow: hidden; }

  .sg-header {
    position: relative; padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-light);
  }
  .sg-close {
    position: absolute; top: 16px; right: 16px; z-index: 1;
    width: 32px; height: 32px; border: none;
    background: var(--bg); border-radius: 50%; font-size: 0.9rem;
    cursor: pointer; color: var(--ink-faint);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .sg-close:hover { background: var(--primary-surface); color: var(--ink); }

  .sg-title-row { display: flex; align-items: center; gap: 10px; }
  .sg-title-icon { font-size: 1.15rem; opacity: 0.45; flex-shrink: 0; }
  .sg-title {
    font-family: var(--serif); font-size: 1.1rem; font-weight: 700;
    color: var(--ink); margin: 0; line-height: 1.3;
  }
  .sg-subtitle {
    margin: 4px 0 0 32px; font-size: 0.76rem; color: var(--ink-faint);
  }

  /* ── Body ── */
  .sg-body { max-height: 460px; overflow-y: auto; overscroll-behavior: contain; }

  /* ── Section ── */
  .sg-section + .sg-section { border-top: 1px solid var(--border-light); }
  .sg-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 24px 8px;
    position: sticky; top: 0;
    background: var(--raised); z-index: 1;
  }
  .sg-section-svg { opacity: 0.4; flex-shrink: 0; }
  .sg-section-label {
    font-size: 0.75rem; font-weight: 600; color: var(--ink-muted);
    letter-spacing: 0.04em;
  }
  .sg-section-badge {
    margin-left: auto; font-size: 0.68rem; font-weight: 600;
    color: var(--ink-faint); background: var(--bg);
    padding: 2px 9px; border-radius: 10px; line-height: 1.5;
  }

  /* ── Items ── */
  .sg-section-body { padding: 4px 12px 14px; }
  .sg-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    text-decoration: none; cursor: pointer;
    transition: background 0.15s; position: relative;
  }
  .sg-item:hover { background: var(--primary-surface); }
  .sg-item::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .sg-item:hover::before { transform: translateY(-50%) scaleY(1); }

  .sg-item-body { flex: 1; min-width: 0; }
  .sg-item-name {
    display: block; font-size: 0.88rem; font-weight: 500;
    color: var(--ink); line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sg-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
  .sg-item-code {
    font-size: 0.74rem; color: var(--ink-faint);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    white-space: nowrap;
  }
  .sg-item-arrow {
    font-size: 0.85rem; color: var(--primary); flex-shrink: 0;
    opacity: 0; transform: translateX(-6px);
    transition: opacity 0.2s, transform 0.2s;
  }
  .sg-item:hover .sg-item-arrow { opacity: 0.6; transform: translateX(0); }

  /* ── Course type pills ── */
  .sg-pill {
    display: inline-flex; align-items: center;
    font-size: 0.63rem; font-weight: 600;
    padding: 1px 7px; border-radius: 4px; line-height: 1.5;
    letter-spacing: 0.02em; flex-shrink: 0;
  }
  .sg-pill-general {
    background: oklch(0.91 0.035 250);
    color: oklch(0.38 0.08 250);
  }
  .sg-pill-major {
    background: oklch(0.91 0.05 150);
    color: oklch(0.36 0.1 150);
  }

  /* ── Empty state ── */
  .sg-empty { text-align: center; padding: 48px 24px; }
  .sg-empty-icon { font-size: 1.8rem; margin-bottom: 12px; opacity: 0.4; }
  .sg-empty-title {
    font-size: 0.9rem; font-weight: 600; color: var(--ink-muted);
    margin-bottom: 4px;
  }
  .sg-empty-desc { font-size: 0.78rem; color: var(--ink-faint); }

  /* ── Upload Search header ── */
  .so-header { text-align: center; padding-bottom: var(--space-lg); position: relative; }
  .so-icon { font-size: 2rem; margin-bottom: var(--space-xs); }
  .so-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--ink); }
  .so-sub { font-size: 0.82rem; color: var(--ink-faint); margin-top: 4px; }

  /* ── Search input ── */
  .so-input-group {
    display: flex; align-items: center;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: var(--radius-full); padding: 0 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .so-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 0.1);
  }
  .so-input-icon { font-size: 0.95rem; margin-right: 10px; opacity: 0.45; flex-shrink: 0; }
  #courseSearchInput {
    flex: 1; border: none; background: transparent;
    padding: 14px 0; font-size: 0.95rem; outline: none;
    color: var(--ink); font-family: var(--sans);
  }
  #courseSearchInput::placeholder { color: var(--ink-faint); opacity: 0.6; }

  /* ── Results ── */
  .search-overlay-results {
    margin-top: var(--space-md); min-height: 60px;
    max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: 4px;
  }
  .so-results-list { display: flex; flex-direction: column; gap: 4px; }
  .so-result-item {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 12px 16px; border-radius: var(--radius-md);
    text-decoration: none; transition: background 0.15s;
    cursor: pointer;
  }
  .so-result-item:hover { background: var(--primary-surface); }
  .so-ri-name { flex: 1; font-size: 0.9rem; font-weight: 500; color: var(--ink); }
  .so-ri-code { font-size: 0.78rem; color: var(--ink-faint); font-family: monospace; white-space: nowrap; }
  .so-ri-arrow {
    font-size: 0.85rem; color: var(--primary); opacity: 0;
    transform: translateX(-6px); transition: opacity 0.2s, transform 0.2s;
  }
  .so-result-item:hover .so-ri-arrow { opacity: 0.6; transform: translateX(0); }

  /* ── Empty / hint states ── */
  .so-hint {
    padding: var(--space-md); background: var(--primary-surface);
    border-radius: var(--radius-md); text-align: center;
  }
  .so-hint-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
  .so-hint-text { font-size: 0.82rem; color: var(--ink-faint); line-height: 1.55; }
  .so-empty { text-align: center; padding: var(--space-lg); }
  .so-empty-icon { font-size: 1.5rem; margin-bottom: var(--space-xs); }
  .so-empty-text { font-size: 0.85rem; color: var(--ink-faint); }
  .so-empty-sub { margin-top: 6px; font-size: 0.78rem; color: var(--primary); line-height: 1.55; }

  /* ── 首页上传弹窗：新建课程入口（静态 views.js 使用） ── */
  .so-new-course {
    margin-top: var(--space-md);
    text-align: center;
    border-top: 1px dashed var(--border);
    padding-top: var(--space-md);
  }
  .so-new-hint { font-size: 0.74rem; color: var(--ink-faint); margin-bottom: 8px; }
  .so-new-btn {
    display: inline-block; border: none; cursor: pointer;
    background: var(--primary); color: #fff;
    padding: 9px 26px; border-radius: var(--radius-full);
    font: inherit; font-weight: 600; font-size: 0.9rem;
    transition: background 0.15s, transform 0.1s;
  }
  .so-new-btn:hover { background: var(--primary-dark); }
  .so-new-btn:active { transform: scale(0.98); }

  /* ═══════════════════════════════════════════
     Same-name sidebar inside file listing
     ═══════════════════════════════════════════ */

  .file-area-row {
    display: flex; gap: var(--space-xl);
    align-items: flex-start;
  }
  .file-area-main { flex: 1; min-width: 0; }
  .file-area-side {
    width: 200px; flex-shrink: 0;
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    position: sticky; top: calc(var(--header-height) + var(--space-md));
  }
  .file-area-side .fas-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--ink-faint);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-light);
  }
  .file-area-side .fas-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.15s;
    margin-top: 2px;
  }
  .file-area-side .fas-item:hover { background: var(--primary-surface); }
  .file-area-side .fas-code {
    font-size: 0.78rem; font-weight: 600; color: var(--primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .file-area-side .fas-course {
    font-size: 0.72rem; color: var(--ink-soft);
    margin-top: 1px;
  }

  /* ── 同名课程（底部横排） ── */
  .file-area-side-bottom {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
  }
  .file-area-side-bottom .fasb-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--ink-faint);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-light);
  }
  .file-area-side-bottom .fasb-list {
    display: flex; flex-wrap: wrap; gap: 8px 12px;
  }
  .file-area-side-bottom .fasb-item {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer; font-size: 0.82rem;
    color: var(--primary); text-decoration: none;
    transition: opacity 0.15s;
  }
  .file-area-side-bottom .fasb-item:hover { opacity: 0.7; }
  .file-area-side-bottom .fasb-code {
    font-weight: 600; white-space: nowrap;
  }
  .file-area-side-bottom .fasb-programs {
    font-size: 0.72rem; color: var(--ink-soft);
  }

  /* ═══════════════════════════════════════════
     File table
     ═══════════════════════════════════════════ */

  .file-area { padding: var(--space-sm) 0 var(--space-xl); }
  .file-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.85rem;
  }
  .file-table thead th {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--ink-faint);
    padding: var(--space-sm) var(--space-sm) var(--space-xs);
    border-bottom: 1.5px solid var(--border-light);
    text-align: left; white-space: nowrap;
    width: auto;
  }
  .file-table thead th:nth-child(1) { width: auto; }     /* 文件名 - 自适应 */
  .file-table thead th:nth-child(2) { width: 60px; }     /* 类型 */
  .file-table thead th:nth-child(3) { width: 85px; }     /* 大小 */
  .file-table thead th:nth-child(4) { width: 90px; }     /* 上传者 */
  .file-table thead th:nth-child(5) { width: 90px; }     /* 任课教师 */
  .file-table thead th:nth-child(6) { width: 72px; }     /* 收藏量 */
  .file-table thead th:nth-child(7) { width: 72px; }     /* 下载量 */
  .file-table thead th.th-name { text-align: center; }
  .file-table thead th.th-size { width: 85px; }
  .file-table thead th.th-download { width: 120px; position: relative; text-align: center; }

  /* ── 下载按钮与多选复选框切换（绝对定位叠层，不影响行高） ── */
  .ft-download {
    position: relative;
    text-align: right;
    white-space: nowrap;
    overflow: visible;
  }
  .dl-normal, .dl-check {
    position: absolute;
    top: 50%;
    left: 50%;
    white-space: nowrap;
  }
  .dl-normal {
    opacity: 1;
    transition: opacity 150ms ease;
    transform: translate(-50%, -50%);
  }
  .dl-check {
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
    transform: translate(-50%, calc(-50% - 4px));
  }
  .dl-check input[type="checkbox"] { cursor: pointer; width: 20px; height: 20px; margin: 0; padding: 0; }
  .file-table.multi-select .dl-normal {
    opacity: 0;
    pointer-events: none;
  }
  .file-table.multi-select .dl-check {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }
  .file-table.multi-select .ft-download { text-align: center; }

  /* ── 批量选择工具栏（display: none/flex + 淡入动画） ── */
  @keyframes bar-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .batch-dl-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--primary-surface);
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 0.82rem;
  }
  .batch-dl-bar.is-visible {
    display: flex;
    animation: bar-fade-in 200ms ease both;
  }
  .file-table tbody td {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    overflow: hidden;
  }
  .file-table tbody tr { cursor: pointer; }
  .file-table tbody tr:hover td { background: var(--primary-surface); }
  .file-table tbody .selected td { background: var(--primary-light); }

  /* 高亮闪烁（排行榜/最近上传跳转定位） */
  @keyframes highlight-fade {
    0%   { background: var(--accent-light); }
    70%  { background: var(--accent-light); }
    100% { background: transparent; }
  }
  .file-table tbody tr.highlight-row td {
    animation: highlight-fade 2.5s ease forwards;
  }
  .file-table .ft-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .file-table .ft-name .fn-wrap {
    display: flex; align-items: center; gap: 8px;
    overflow: hidden;
  }
  .file-table .ft-name .fn-wrap .ext-badge {
    flex-shrink: 0;
  }
  .file-table .ft-name .fn-wrap .fn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .file-table .ft-type-cell,
  .file-table .ft-size-cell,
  .file-table .ft-uploader,
  .file-table .ft-teacher {
    white-space: nowrap; color: var(--ink-soft); font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .file-table .ft-favcount {
  width: 60px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.file-table .ft-dlcount {
    white-space: nowrap; color: var(--ink-faint); font-size: 0.8rem;
    text-align: center;
  }
  .file-table .ft-download {
    text-align: right;
    white-space: nowrap;
    overflow: visible;
  }
  .file-table .dl-link {
    display: inline-flex; align-items: center;
    padding: 4px 14px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--primary); text-decoration: none;
    border: 1.5px solid var(--primary);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
    white-space: nowrap;
  }
  .file-table .dl-link:hover {
    background: var(--primary); color: #fff;
  }
  .file-table .dl-disabled {
    display: inline-flex; align-items: center;
    padding: 4px 14px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--ink-light, oklch(0.5 0 0));
    border: 1.5px solid var(--border);
    white-space: nowrap;
    cursor: default;
  }
  .file-table .dl-login-prompt {
    display: inline-flex; align-items: center;
    padding: 4px 14px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--ink-faint);
    border: 1.5px dashed var(--border);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
  }
  .file-table .dl-login-prompt:hover {
    color: var(--primary);
    border-color: var(--primary-light);
  }
  .file-area-header {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    justify-content: space-between;
  }
  .file-area-header .section-accent {
    flex-shrink: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin: 0;
  }
  .file-area-header .fa-count {
    flex-shrink: 0;
    font-size: 0.75rem; color: var(--ink-faint);
  }
  /* 同名合并显示：课程名旁并列的别名代码（主代码 · 别名代码） */
  .file-area-header .fa-codes {
    flex-shrink: 0;
    font-size: 0.72rem; color: var(--ink-faint);
    font-family: var(--mono, monospace);
    max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .file-area-header .fa-upload-header-btn {
    flex-shrink: 0;
  }
  .fa-upload-header-btn .fa-upload-btn {
    padding: 6px 16px; border-radius: 6px;
    font-size: 0.82rem; font-weight: 600;
    background: transparent; color: var(--primary);
    border: 1.5px solid var(--primary);
    cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
    white-space: nowrap;
  }
  .fa-upload-header-btn .fa-upload-btn:hover {
    background: var(--primary); color: #fff;
  }
  .fa-upload-header-btn .fa-batch-dl-btn {
    margin-left: 12px;
    /* Same visual style as fa-upload-btn / dl-link (outlined primary) */
  }

  .fa-per-page {
    font-size: 0.75rem; color: var(--ink-faint);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
  }
  .fa-per-page .ppc-select {
    font-size: 0.75rem;
    padding: 2px 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--raised);
    color: var(--ink-soft);
    cursor: pointer;
    font-family: inherit;
    outline: none;
  }
  .fa-per-page .ppc-select:hover,
  .fa-per-page .ppc-select:focus {
    border-color: var(--primary-light);
  }

  .fa-back-bar {
    margin-bottom: var(--space-sm);
    font-size: 0.82rem;
  }
  .fa-back-bar a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-faint);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
  }
  .fa-back-bar a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-surface);
  }

  /* ── Pagination ── */
  .file-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-lg) 0 var(--space-xl);
    flex-wrap: wrap;
  }
  .file-pagination .fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--raised);
    color: var(--ink-soft);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
    user-select: none;
    font-family: inherit;
    line-height: 1;
  }
  .file-pagination .fp-btn:hover:not(.fp-active):not(.fp-disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-surface);
  }
  .file-pagination .fp-btn.fp-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    cursor: default;
  }
  .file-pagination .fp-btn.fp-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
  }
  .file-pagination .fp-btn.fp-ellipsis {
    letter-spacing: 2px;
    min-width: 32px;
  }

  /* Jump popup */
  .fp-jump-popup {
    background: var(--raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 10px;
    max-height: 280px;
    overflow-y: auto;
    min-width: 200px;
  }
  .fp-jump-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
  }
  .fp-jump-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background-color 0.1s, border-color 0.1s, color 0.1s, box-shadow 0.1s, opacity 0.1s, transform 0.1s;
    font-family: inherit;
  }
  .fp-jump-num:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-surface);
  }
  .fp-jump-num.fp-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }

  /* ═══════════════════════════════════════════
     File extension badge
     ═══════════════════════════════════════════ */

  .ext-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 22px;
    padding: 0 5px;
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    color: var(--ink-faint);
    background: transparent;
    margin-right: 8px;
    flex-shrink: 0;
  }

  /* ═══════════════════════════════════════════
     Folder list: fli-icon uses text arrow now
     ═══════════════════════════════════════════ */

  .folder-list-item .fli-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-surface);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: background 0.15s;
  }
  .folder-list-item:hover .fli-icon { background: oklch(from var(--primary) l c h / 0.12); }

  /* ── 移动端列表行收紧（置于 fli-icon 重申段之后才能赢过同特异性规则）──
     图标/徽章/间距降档，把宽度让给标题列；配合 .fli-name 单行省略号，
     「概率论与数理统计」这类长课程名不再被挤成一字一行竖摞 */
  @media (max-width: 640px) {
    .folder-list-item { gap: 10px; padding: 10px 12px; }
    .folder-list-item .fli-icon { width: 28px; height: 28px; font-size: 0.8rem; }
    .fli-badge { padding: 3px 9px; }
    .fli-fav-star { width: 24px; height: 24px; }
  }

  /* ═══════════════════════════════════════════
     Homepage Navigation Cards + Dividers
     ═══════════════════════════════════════════ */

  .home-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0 auto;
    max-width: 900px;
  }

  .home-nav-cards {
    padding: var(--space-xl) 0;
  }

  .home-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: 720px;
    margin: 0 auto;
  }

  .home-nav-card {
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
  }

  .home-nav-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px oklch(0 0 0 / 0.04);
  }

  .home-nav-card .hnc-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: oklch(from var(--primary-surface) calc(l + 0.018) c h);
    border: 1px solid oklch(from var(--primary-light) l c h / 0.72);
    border-radius: 14px;
    box-shadow: inset 0 0 0 3px oklch(1 0 0 / 0.46);
  }

  .home-nav-card .hnc-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
  }

  .home-nav-card .hnc-desc {
    font-size: 0.78rem;
    color: var(--ink-faint);
  }
  .home-nav-card .hnc-icon svg {
    width: 31px;
    height: 31px;
    color: var(--primary-dark);
    opacity: 1;
    overflow: visible;
  }

  /* ═══════════════════════════════════════════
     Rankings / Recent All View
     ═══════════════════════════════════════════ */

  .rankings-content {
    padding: var(--space-md) 0 var(--space-xl);
  }

  .rankings-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
  }

  .rankings-item:hover {
    background: var(--primary-surface);
  }

  .rankings-item .ri-rank {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink-faint);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
  }

  .rankings-item .ri-info {
    flex: 1;
    min-width: 0;
  }

  .rankings-item .ri-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
  }

  .rankings-item .ri-meta {
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-top: 2px;
  }

  .rankings-item .ri-stat {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* ── Filter Bar (学院分类) ── */
  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
  }
  .filter-bar .fb-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--raised);
    color: var(--ink-soft);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
    font-family: inherit;
    user-select: none;
    white-space: nowrap;
  }
  .filter-bar .fb-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-surface);
  }
  .filter-bar .fb-pill.fb-active {
    background: var(--primary-surface);
    color: var(--primary-dark);
    border-color: var(--primary-light);
  }

  /* ═══════════════════════════════════════════
     About sections sub-navigation
     ═══════════════════════════════════════════ */

  .about-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
  }

  .about-tab {
    padding: 8px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--raised);
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
  }

  .about-tab:hover {
    border-color: var(--primary-light);
    color: var(--primary);
  }

  .about-tab.active {
    background: var(--primary-surface);
    color: var(--primary-dark);
    border-color: var(--primary-light);
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  /* ═══════════════════════════════════════════
     Stat pills clickable
     ═══════════════════════════════════════════ */

  .stat-pill-link {
    text-decoration: none;
    display: inline-flex;
  }

  /* ═══════════════════════════════════════════
     Mobile responsive for new elements
     ═══════════════════════════════════════════ */

  @media (max-width: 640px) {
    .rankings-header { align-items: flex-start; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-xl); }
    .rankings-mode-tabs { width: 100%; gap: 22px; }
    .rankings-mode-tabs button { flex: 0 0 auto; }
    .home-nav-grid {
      grid-template-columns: 1fr;
      gap: var(--space-md);
    }
    .home-nav-card {
      flex-direction: row;
      text-align: left;
      padding: var(--space-md);
    }
    .home-nav-card .hnc-icon {
      width: 58px;
      height: 58px;
      flex-shrink: 0;
    }
    .rankings-item {
      padding: var(--space-sm) var(--space-md);
    }
  }

  /* ── 文件表格包裹 ── */
  .file-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ═══════════════════════════════════════════
     空间不足时折叠次要列
     ═══════════════════════════════════════════ */

  .file-area-compact .file-table thead th.th-type,
  .file-area-compact .file-table thead th.th-uploader,
  .file-area-compact .file-table thead th.th-teacher,
  .file-area-compact .file-table thead th.th-dlcount,
  .file-area-compact .file-table tbody td.ft-type-cell,
  .file-area-compact .file-table tbody td.ft-uploader,
  .file-area-compact .file-table tbody td.ft-teacher,
  .file-area-compact .file-table tbody td.ft-dlcount {
    display: none;
  }

  @media (max-width: 720px) {
    .file-area-row {
      flex-direction: column;
    }
    .file-area-side {
      width: 100%;
      position: static;
      order: 1;
      margin-top: var(--space-md);
    }
    .file-table thead th.th-type,
    .file-table thead th.th-uploader,
    .file-table thead th.th-teacher,
    .file-table thead th.th-favcount,
    .file-table thead th.th-dlcount,
    .file-table tbody td.ft-type-cell,
    .file-table tbody td.ft-uploader,
    .file-table tbody td.ft-teacher,
    .file-table tbody td.ft-favcount,
    .file-table tbody td.ft-dlcount {
      display: none;
      width: 0;
    }
    .file-table thead th.th-size,
    .file-table tbody td.ft-size-cell {
      min-width: 6ch;
      width: 60px;
    }
    .file-table tbody td.ft-name {
      max-width: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .file-table thead th.th-download,
    .file-table tbody td.ft-download {
      width: 56px;
      min-width: 56px;
    }
    .file-table .dl-link {
      padding: 3px 8px;
      font-size: 0.7rem;
    }
    .file-table-scroll {
      overflow-x: visible;
      margin-left: 0;
      margin-right: 0;
    }
  }

  @media (max-width: 640px) {
    .file-area-header {
      flex-wrap: wrap;
      gap: 6px;
    }
    .file-area-header .section-accent {
      font-size: 0.8rem;
    }
    .file-area-header .fa-count {
      font-size: 0.7rem;
    }
    .fa-upload-header-btn .fa-upload-btn {
      padding: 3px 8px;
      font-size: 0.7rem;
    }
    .fa-back-bar { font-size: 0.78rem; }
    .file-table-scroll {
      overflow-x: visible;
      margin-left: 0;
      margin-right: 0;
    }
    .file-table thead th,
    .file-table tbody td {
      padding: 6px 8px;
      font-size: 0.72rem;
    }
    .file-table .dl-link {
      padding: 3px 8px;
      font-size: 0.7rem;
    }
    .file-table thead th,
    .file-table tbody td { white-space: nowrap; }
    .file-table tbody td.ft-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  }

  @media (max-width: 480px) {
    .file-table thead th.th-dlcount,
    .file-table tbody td.ft-dlcount {
      display: none;
    }
  }

  /* ═══════════════════════════════════════════
     文件简介模态框
     ═══════════════════════════════════════════ */

  .file-info-card {
    max-width: 600px; /* v=148：告别 400px 细长条，加宽容纳文件信息 */
  }

  .file-info-content {
    padding: var(--space-sm) 0;
  }
  .file-info-content .fi-row {
    display: flex;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
  }
  .file-info-content .fi-row:last-child {
    border-bottom: none;
  }
  .file-info-content .fi-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--ink-faint);
    font-weight: 500;
  }
  .file-info-content .fi-value {
    flex: 1;
    color: var(--ink);
    word-break: break-all;
  }
  .fi-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-top: var(--space-md);
    transition: background 0.15s;
  }
  .fi-download-btn:hover {
    background: var(--primary-dark);
  }

  /* ── 文件详情弹窗移动端适配 ── */
  @media (max-width: 640px) {
    .file-info-card {
      max-height: 90vh;
      overflow-y: auto;
      padding: var(--space-md);
    }
    .file-info-card .modal-close {
      top: 10px;
      right: 10px;
      z-index: 1;
    }
  }

  /* ── 紧凑首页 v9 fidelity ─────────────────────────────────────
     只作用于 home-eight（紧凑首页）。松散首页仍使用上方原有结构。
     这里的层级、表面和间距与 docs/personal-home-prototype/v9.html 对齐，
     内容仍来自真实接口，不复制静态稿示例数据。
  */
  :root {
    --v9-surface: oklch(0.97 0.006 80);
    --v9-border: oklch(0.912 0.01 70);
  }
  html[data-bnu-theme="dark"] {
    --v9-surface: var(--bg);
    --v9-border: var(--border);
  }
  html[data-bnu-theme="cool"] {
    --v9-surface: oklch(0.975 0.002 235);
    --v9-border: oklch(0.91 0.006 235);
  }
  body.home-layout-compact #homeView > :not(.home-compact-layout) { display: none !important; }
  body.home-layout-compact #homeView > .home-compact-layout { display: block !important; }
  .main-content:has(#homeView.active .home-eight) { background: var(--v9-surface); }
  .home-eight { max-width: 1440px; margin: 0 auto; padding-top: 30px; padding-bottom: 48px; }
  .h8-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 22px; }
  .h8-heading h1 { color: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 650; letter-spacing: -0.7px; line-height: 1.35; }
  .h8-heading p { margin-top: 7px; color: var(--ink-soft); font-size: 13px; }
  .h8-scale { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 14px; color: var(--ink-faint); font-size: 11px; }
  .h8-scale strong { color: var(--ink); font-family: var(--serif); font-size: 28px; font-weight: 550; letter-spacing: -0.5px; }
  .h8-scale strong small { color: var(--ink-faint); font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: 0; }
  .h8-scale > small { color: var(--ink-faint); font-size: 9px; }
  .h8-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: stretch; }
  .h8-top > * { min-width: 0; }
  /* 公告卡：报头式顶部墨色粗规线 + 铜色日期眉题 + 衬线标题，替代平涂色块 */
  .h8-notices { padding: 12px 20px 16px; border: 1px solid var(--v9-border); border-top: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--raised); color: var(--ink); }
  .h8-notices .h8-section-head { margin-bottom: 6px; }
  .h8-notices .h8-label { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
  .h8-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; margin-bottom: 12px; }
  .h8-section-head h2 { color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 650; letter-spacing: -0.3px; }
  .h8-section-head p { margin-top: 6px; color: var(--ink-faint); font-size: 12px; line-height: 1.5; }
  .h8-section-head > .text-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0; color: var(--primary); font-size: 12px; }
  .h8-notice-main { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
  .h8-notice-main strong { display: block; margin: 5px 0 6px; color: var(--ink); font-family: var(--serif); font-size: 21px; font-weight: 650; letter-spacing: -0.3px; line-height: 1.45; }
  .h8-notice-main > span:last-child { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 12px; }
  .h8-shortcuts { padding: 12px 18px 8px; border: 1px solid var(--v9-border); border-radius: var(--radius-md); background: var(--raised); }
  .h8-shortcuts .h8-section-head { margin-bottom: 2px; }
  .h8-head-actions { display: flex; align-items: center; gap: 14px; }
  .h8-head-actions .text-btn, .h8-head-actions button { display: inline-flex; align-items: center; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 12px; cursor: pointer; }
  /* 入口一行两个：行间发丝线分隔，列间加竖向发丝线；卡片高度随 .h8-top 拉伸与公告对齐 */
  .h8-shortcuts nav { display: grid; grid-template-columns: 1fr 1fr; }
  .h8-shortcuts nav a, .h8-shortcuts nav button { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 40px; padding: 0 12px 0 0; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: left; }
  .h8-shortcuts nav a:nth-child(even), .h8-shortcuts nav button:nth-child(even) { border-left: 1px solid var(--border-light); padding-left: 16px; }
  .h8-shortcuts nav a:nth-last-child(-n+2), .h8-shortcuts nav button:nth-last-child(-n+2) { border-bottom: 0; }
  .h8-shortcuts nav .icon { width: 18px; height: 18px; color: var(--primary); }
  .h8-shortcuts nav span:last-child { margin-left: auto; color: var(--ink-faint); font-size: 11px; }
  .h8-shortcut-note { padding-top: 17px; color: var(--ink-faint); font-size: 11px; }
  .compact-campus-link { min-width: 0; font-weight: 550; }
  .compact-campus-link span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compact-campus-link:hover { color: var(--primary); }
  .h8-recommend { margin: 22px 0; padding: 20px 24px; border: 1px solid var(--v9-border); border-radius: var(--radius-md); background: var(--raised); }
  .h8-recommend > .h8-section-head { margin-bottom: 20px; }
  .h8-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .h8-card { display: flex; min-width: 0; min-height: 158px; flex-direction: column; padding: 14px 16px 8px; border-radius: var(--radius-md); background: var(--v9-surface); }
  .h8-card-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 13px; color: var(--ink-faint); font-size: 12px; }
  .h8-card-head a { overflow-wrap: anywhere; color: var(--primary); font-weight: 550; }
  .h8-card-head > span { color: var(--ink-faint); font-size: 9px; }
  .h8-card-title { display: block; min-height: 28px; padding: 0; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; text-align: left; }
  .h8-card > p { margin: 9px 0 14px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
  .h8-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 3px; margin-top: auto; color: var(--ink-faint); font-size: 10px; }
  .compact-material-favorite { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -10px -10px -10px 0; padding: 0; border: 0; background: transparent; color: var(--ink-faint); }
  .compact-material-favorite:hover, .compact-material-favorite.is-favorited { color: var(--primary); }
  .compact-material-favorite svg { width: 18px; height: 18px; }
  .h8-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .h8-bottom > section { min-width: 0; padding: 18px 24px 8px; border: 1px solid var(--v9-border); border-radius: var(--radius-md); background: var(--raised); }
  .h8-bottom .h8-section-head { align-items: stretch; padding-bottom: 12px; margin-bottom: 0; border-bottom: 1px solid var(--border-light); }
  /* 榜单页签纵向拉伸贴合卡头，与右侧「完整榜单」动作之间用竖向发丝线区分状态与跳转；
     激活下划线沉到卡头分隔线上：bottom -13px = 头部 padding-bottom 12px + 1px 边框，两处需同步改 */
  .h8-rank-tabs { display: flex; flex-shrink: 0; align-self: stretch; gap: 14px; padding-right: 14px; border-right: 1px solid var(--border-light); }
  .h8-rank-tabs button { position: relative; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink-faint); font: inherit; font-size: 12px; cursor: pointer; transition: color 160ms ease-out; }
  .h8-rank-tabs button:hover { color: var(--ink-soft); }
  .h8-rank-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
  .h8-rank-tabs button[aria-selected="true"]::after { position: absolute; right: 0; bottom: -13px; left: 0; height: 2px; background: var(--primary); content: ''; }
  .h8-rank-list { display: grid; }
  .h8-rank-row { display: flex; align-items: center; gap: 15px; min-height: 66px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
  .h8-rank-row:last-child { border-bottom: 0; }
  .h8-rank-row > div { min-width: 0; flex: 1; }
  .h8-rank-row > div > a { display: block; min-height: 24px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; text-align: left; }
  .h8-rank-row > div > small { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 11px; overflow-wrap: anywhere; }
  .h8-meta-sep { color: var(--border); }
  .h8-uploader { color: var(--ink-soft); }
  .h8-rank-num { align-self: flex-start; min-width: 21px; padding-top: 5px; color: var(--ink-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
  .h8-bottom > section:first-child .h8-rank-row:first-child .h8-rank-num { color: var(--primary); font-weight: 700; }
  .h8-metric { flex-shrink: 0; color: var(--ink); font-size: 17px; font-weight: 550; font-variant-numeric: tabular-nums; text-align: right; }
  .h8-metric small { display: block; color: var(--ink-faint); font-size: 10px; font-weight: 400; }
  .h8-rank-row time { flex-shrink: 0; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
  .h8-notice-main:hover strong, .h8-card-title:hover, .h8-rank-row > div > a:hover { color: var(--primary); }
  .h8-notice-main:hover strong { text-decoration: underline; text-underline-offset: 5px; }
  .h8-shortcuts nav a:hover, .h8-shortcuts nav button:hover { color: var(--primary); }

  @media (max-width: 1100px) {
    .home-eight { padding-left: 24px; padding-right: 24px; }
    .h8-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .h8-scale { justify-content: flex-start; }
    .h8-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h8-bottom > section { padding-right: 18px; padding-left: 18px; }
    .h8-bottom .h8-section-head { flex-wrap: wrap; gap: 3px; }
  }

  @media (max-width: 700px) {
    .home-eight { padding: 22px 16px 32px; }
    /* 窄屏：标题与副题退场，仅保留统计行并靠右对齐 */
    .h8-heading { flex-direction: row; justify-content: flex-end; margin-bottom: 14px; }
    .h8-heading h1, .h8-heading p { display: none; }
    .h8-scale { justify-content: flex-end; gap: 7px 12px; font-size: 10px; }
    .h8-scale strong { font-size: 24px; }
    .h8-scale strong small { font-size: 10px; }
    /* 窄屏：公告 + 校园入口 合并为单卡；两节之间只用留白分层，不画横线 */
    .h8-top { display: block; margin-bottom: 16px; padding: 6px 16px 0; border: 1px solid var(--v9-border); border-radius: var(--radius-md); background: var(--raised); }
    .h8-notices { padding: 0 0 6px; border: 0; background: transparent; }
    .h8-section-head { min-height: 0; }
    .h8-top .h8-section-head h2 { font-size: 16px; }
    .h8-notices .h8-section-head, .h8-shortcuts .h8-section-head { margin-bottom: 0; }
    .h8-notices .h8-section-head > .text-btn, .h8-head-actions .text-btn, .h8-head-actions button { min-height: 24px; }
    /* 窄屏公告压成一行：日期眉题 + 标题同行，过长省略号截断 */
    .h8-notice-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; min-height: 0; }
    .h8-notice-main .h8-label { flex-shrink: 0; }
    .h8-notice-main strong { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 1.4; }
    .compact-announcement-content { min-height: 0; }
    /* 窄屏去掉摘要行：日期 + 标题已足够 */
    .h8-notice-main > span:last-child { display: none; }
    .h8-shortcuts { margin-top: 6px; padding: 8px 0 4px; border: 0; background: transparent; }
    .h8-shortcuts nav a, .h8-shortcuts nav button, .compact-campus-link { min-height: 40px; font-size: 13px; }
    .h8-recommend { margin: 18px 0; padding: 18px 20px; }
    .h8-section-head { align-items: flex-start; }
    .h8-section-head h2 { font-size: 19px; }
    .h8-section-head p { font-size: 11px; }
    .h8-cards { grid-template-columns: 1fr; gap: 12px; }
    .h8-card, .h8-card:first-child { min-height: 0; padding: 14px 16px 8px; }
    .h8-card-head { margin-bottom: 8px; }
    .h8-card-title { font-size: 17px; }
    .h8-card > p { margin: 6px 0; font-size: 12px; }
    .h8-card-bottom { font-size: 10px; }
    .h8-recommend > .h8-section-head { align-items: flex-start; gap: 8px; }
    .h8-recommend > .h8-section-head > .text-btn { white-space: nowrap; }
    /* 窄屏：热门资料 / 最近上传 两卡退场，三榜合并进单一「资料动态」卡。 */
    .h8-bottom { display: none; }
    .compact-discovery-block { display: block; margin-top: 18px; padding: 17px 20px 7px; border: 1px solid var(--v9-border); border-radius: var(--radius-md); background: var(--raised); }
    .compact-discovery-block .h8-section-head { margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }
    .compact-discovery-tabs { gap: 16px; }
  }

  /* ═══ 紧凑首页 v10：书脊索引式卡片层级 ═══════════════════════
     让模块的视觉重量服务于内容任务：公告醒目、校园入口轻量、推荐为主焦点，
     榜单与最近上传分别保持台账/动态流的阅读语法。仅作用于紧凑首页。 */
  .home-eight {
    --h8-outline: color-mix(in oklab, var(--ink) 10%, var(--v9-border));
    --h8-card-line: color-mix(in oklab, var(--ink) 8%, var(--v9-border));
    --h8-tool-surface: color-mix(in oklab, var(--primary-surface) 24%, var(--raised));
    --h8-lead-surface: color-mix(in oklab, var(--primary-surface) 22%, var(--v9-surface));
    --h8-ledger-surface: color-mix(in oklab, var(--primary-surface) 10%, var(--raised));
  }

  .home-eight .h8-section-head h2,
  .home-eight .h8-notice-main strong,
  .home-eight .h8-card-title {
    text-wrap: pretty;
  }

  /* 公告：像一张置于桌面最上层的简报。 */
  .home-eight .h8-notices {
    position: relative;
    border-color: var(--h8-outline);
    border-top: 3px solid var(--ink);
    background: var(--raised);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--ink) 5%, transparent);
  }
  .home-eight .h8-notices .h8-section-head h2,
  .home-eight .h8-shortcuts .h8-section-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .home-eight .h8-notices .h8-section-head h2::before {
    width: 18px;
    height: 2px;
    flex: 0 0 18px;
    background: var(--accent);
    content: '';
  }
  .home-eight .h8-notice-main {
    position: relative;
    padding: 8px 12px 9px 14px;
    border-left: 2px solid var(--accent);
    background: color-mix(in oklab, var(--accent-light) 24%, var(--raised));
  }

  /* 校园入口：工具感更强，使用索引格而非内容卡的重量。 */
  .home-eight .h8-shortcuts {
    border-color: color-mix(in oklab, var(--primary) 24%, var(--h8-outline));
    background: var(--h8-tool-surface);
    box-shadow: inset 0 2px 0 color-mix(in oklab, var(--primary) 68%, transparent);
  }
  .home-eight .h8-shortcuts .h8-section-head h2::before {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid var(--primary);
    content: '';
    transform: rotate(45deg);
  }
  .home-eight .h8-shortcuts nav {
    margin-top: 7px;
    border-top: 1px solid color-mix(in oklab, var(--primary) 14%, var(--border-light));
  }
  .home-eight .h8-shortcuts nav a,
  .home-eight .h8-shortcuts nav button {
    position: relative;
    transition: color 160ms ease-out, background-color 160ms ease-out;
  }
  .home-eight .h8-shortcuts nav a::before,
  .home-eight .h8-shortcuts nav button::before {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border: 1px solid color-mix(in oklab, var(--primary) 72%, var(--border));
    content: '';
    transform: rotate(45deg);
  }

  /* 推荐：整块是首页主舞台，顶部的双色短规线是本版的识别签。 */
  .home-eight .h8-recommend {
    position: relative;
    border-color: var(--h8-outline);
    border-top: 2px solid var(--primary);
    background: var(--raised);
    box-shadow: 0 2px 0 color-mix(in oklab, var(--ink) 4%, transparent);
  }
  .home-eight .h8-recommend::before {
    position: absolute;
    top: -2px;
    left: 24px;
    width: 64px;
    height: 2px;
    background: var(--accent);
    content: '';
  }
  .home-eight .h8-card {
    position: relative;
    border: 1px solid var(--h8-card-line);
    border-radius: var(--radius-sm);
    background: var(--v9-surface);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--ink) 5%, transparent);
    transition: border-color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out;
  }
  .home-eight #compactRecommendations > .h8-card:first-child {
    border-color: color-mix(in oklab, var(--primary) 38%, var(--h8-card-line));
    background: var(--h8-lead-surface);
    box-shadow: inset 3px 0 0 var(--primary), 0 1px 0 color-mix(in oklab, var(--primary) 8%, transparent);
  }

  /* 下方两张卡：热门是排行台账，最近上传是克制的动态流。 */
  .home-eight .h8-bottom > section {
    border-color: var(--h8-outline);
  }
  .home-eight .h8-bottom > section:first-child {
    border-top: 2px solid var(--primary);
    background: var(--h8-ledger-surface);
  }
  .home-eight .h8-bottom > section:first-child .h8-section-head {
    border-bottom-color: color-mix(in oklab, var(--primary) 18%, var(--border-light));
  }
  .home-eight .h8-bottom > section:first-child .h8-rank-row:first-child .h8-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding-top: 0;
    border: 1px solid color-mix(in oklab, var(--primary) 45%, var(--border));
    background: color-mix(in oklab, var(--primary-surface) 70%, transparent);
  }
  .home-eight .h8-bottom > section:last-child {
    border-top: 2px solid var(--border);
    background: var(--raised);
  }
  .home-eight .h8-bottom > section:last-child .h8-rank-row time {
    padding: 2px 5px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    background: var(--v9-surface);
    font-variant-numeric: tabular-nums;
  }

  @media (hover: hover) and (pointer: fine) {
    .home-eight .h8-card:hover {
      border-color: color-mix(in oklab, var(--primary) 42%, var(--h8-card-line));
      background: color-mix(in oklab, var(--primary-surface) 18%, var(--v9-surface));
      transform: translateY(-2px);
    }
    .home-eight .h8-shortcuts nav a:hover,
    .home-eight .h8-shortcuts nav button:hover {
      background: color-mix(in oklab, var(--primary-surface) 42%, transparent);
    }
  }

  @media (max-width: 700px) {
    /* 移动端公告与入口仍共用一个外框，但各自保留不同的阅读标记。 */
    .home-eight .h8-notices {
      padding: 8px 0 10px;
      border: 0;
      border-top: 2px solid var(--ink);
      background: transparent;
      box-shadow: none;
    }
    .home-eight .h8-notice-main {
      padding: 5px 0 6px 10px;
      border-left-width: 2px;
      background: color-mix(in oklab, var(--accent-light) 20%, transparent);
    }
    .home-eight .h8-shortcuts {
      margin-top: 6px;
      padding: 9px 0 6px;
      border: 0;
      border-top: 1px solid color-mix(in oklab, var(--primary) 20%, var(--border-light));
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    .home-eight .h8-shortcuts nav {
      margin-top: 4px;
    }
    .home-eight .h8-recommend {
      border-top-width: 2px;
      box-shadow: 0 1px 0 color-mix(in oklab, var(--ink) 4%, transparent);
    }
    .home-eight .h8-recommend::before {
      left: 20px;
      width: 48px;
    }
    .home-eight .h8-card {
      box-shadow: 0 1px 0 color-mix(in oklab, var(--ink) 5%, transparent);
    }
    .home-eight .compact-discovery-block {
      border-top: 2px solid var(--border);
      background: var(--raised);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .home-eight .h8-card:hover {
      transform: none;
    }
  }

  /* ═══ 紧凑首页 v11：层叠纸页式版面层级 ═══════════════════════
     v10 的装饰线稿退场：不使用琥珀色模块规线、菱形标记或统一书脊。
     视觉重点由版面比例、文字尺度和唯一的抬升层来表达。 */
  .home-eight .h8-notices {
    border: 1px solid var(--h8-outline);
    border-top-width: 1px;
    background: var(--raised);
    box-shadow: none;
  }
  .home-eight .h8-notices .h8-section-head h2::before,
  .home-eight .h8-shortcuts .h8-section-head h2::before,
  .home-eight .h8-shortcuts nav a::before,
  .home-eight .h8-shortcuts nav button::before {
    display: none;
    content: none;
  }
  .home-eight .h8-notices .h8-label {
    color: var(--ink-faint);
    letter-spacing: 0.08em;
  }
  .home-eight .h8-notice-main {
    padding: 7px 0 10px;
    border-left: 0;
    background: transparent;
  }

  .home-eight .h8-shortcuts {
    border-color: var(--h8-outline);
    background: var(--raised);
    box-shadow: none;
  }
  .home-eight .h8-shortcuts nav {
    margin-top: 0;
    border-top: 0;
  }
  .home-eight .h8-shortcuts nav a,
  .home-eight .h8-shortcuts nav button {
    transition: color 160ms ease-out, background-color 160ms ease-out;
  }

  /* 唯一的浮层：推荐区承担首页主焦点，其余模块保持同一张纸面的平静。 */
  .home-eight .h8-recommend {
    padding: 26px 28px 24px;
    border: 1px solid var(--h8-outline);
    background: var(--raised);
    box-shadow: var(--shadow-sm);
  }
  .home-eight .h8-recommend::before {
    display: none;
    content: none;
  }
  .home-eight .h8-card {
    border: 1px solid var(--h8-card-line);
    border-radius: var(--radius-sm);
    background: var(--v9-surface);
    box-shadow: none;
    transition: border-color 160ms ease-out, background-color 160ms ease-out;
  }
  .home-eight .h8-card-head a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .home-eight .h8-card-title {
    display: -webkit-box;
    overflow: hidden;
    max-height: calc(1.55em * 2);
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .home-eight .compact-material-card > p {
    display: -webkit-box;
    overflow: hidden;
    max-height: calc(1.65em * 2);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .home-eight #compactRecommendations > .h8-card:first-child {
    border-color: var(--border);
    background: var(--raised);
    box-shadow: var(--shadow-sm);
  }

  /* 宽屏只让首张推荐卡承担 lead card 的比例，不增加额外颜色。 */
  @media (min-width: 1201px) {
    .home-eight .h8-cards {
      grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
    }
    .home-eight #compactRecommendations > .h8-card:first-child {
      padding: 18px 20px 10px;
    }
    .home-eight #compactRecommendations > .h8-card:first-child .h8-card-title {
      font-size: 19px;
      line-height: 1.45;
    }
  }

  /* 榜单靠数字权重，最近上传靠时间秩序；两者都不再使用彩色顶线。 */
  .home-eight .h8-bottom > section,
  .home-eight .h8-bottom > section:first-child,
  .home-eight .h8-bottom > section:last-child {
    border: 1px solid var(--h8-outline);
    border-top-width: 1px;
    background: var(--raised);
    box-shadow: none;
  }
  .home-eight .h8-bottom > section:first-child .h8-section-head {
    border-bottom-color: var(--border-light);
  }
  .home-eight .h8-bottom > section:first-child .h8-rank-row:first-child .h8-rank-num {
    display: block;
    min-width: 21px;
    height: auto;
    padding-top: 5px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
  }
  .home-eight .h8-bottom > section:last-child .h8-rank-row time {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  @media (hover: hover) and (pointer: fine) {
    .home-eight .h8-card:hover {
      border-color: var(--border);
      background: var(--raised);
      transform: none;
    }
    .home-eight .h8-shortcuts nav a:hover,
    .home-eight .h8-shortcuts nav button:hover {
      background: transparent;
    }
  }

  @media (max-width: 700px) {
    .home-eight .h8-notices {
      padding: 8px 0 10px;
      border: 0;
      border-top: 1px solid var(--border-light);
      background: transparent;
      box-shadow: none;
    }
    .home-eight .h8-notice-main {
      padding: 5px 0 6px;
      border-left: 0;
      background: transparent;
    }
    .home-eight .h8-shortcuts {
      margin-top: 6px;
      padding: 9px 0 6px;
      border: 0;
      border-top: 1px solid var(--border-light);
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    .home-eight .h8-recommend {
      padding: 20px 20px 18px;
      border-top-width: 1px;
      box-shadow: var(--shadow-sm);
    }
    .home-eight .h8-card,
    .home-eight #compactRecommendations > .h8-card:first-child {
      box-shadow: none;
    }
    .home-eight #compactRecommendations > .h8-card:first-child {
      background: var(--raised);
    }
    .home-eight .compact-discovery-block {
      border-top: 1px solid var(--border-light);
      background: var(--raised);
    }
  }

  /* ═══ 紧凑首页 v317：按窗口比例分档，而非只看宽度 ═══════════════
     截图所在的 1.9:1 左右桌面视口属于「宽而矮」档：保留四列推荐队列，
     用视口高度收紧纵向留白，把首屏内容往上托；较高/偏竖的桌面视口则切成
     两列，让标题获得稳定的阅读宽度。移动端仍由 max-width:700px 规则接管。 */
  @media (min-width: 701px) and (min-aspect-ratio: 8/5) {
    .home-eight {
      padding-top: clamp(20px, 4.2vh, 28px);
      padding-bottom: clamp(32px, 5.5vh, 48px);
    }
    .home-eight .h8-heading {
      margin-bottom: clamp(16px, 2.8vh, 22px);
    }
    .home-eight .h8-top {
      gap: clamp(12px, 1.4vw, 16px);
    }
    .home-eight .h8-recommend {
      margin-block: clamp(16px, 2.6vh, 22px);
      padding-top: clamp(20px, 3.1vh, 26px);
      padding-bottom: clamp(18px, 2.9vh, 24px);
    }
    .home-eight .h8-recommend > .h8-section-head {
      margin-bottom: clamp(14px, 2.5vh, 20px);
    }
    .home-eight .h8-card {
      min-height: clamp(142px, 23vh, 158px);
    }
  }

  @media (min-width: 1101px) and (max-aspect-ratio: 8/5) {
    .home-eight .h8-cards {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-eight .h8-card {
      min-height: 174px;
    }
  }

/* ── 汉堡导航抽屉（navDrawer）：与用户抽屉（notif-drawer）左右镜像 ──
   宽度/圆角/阴影/动画/页头/条目度量全部对齐 .notif-drawer，仅方向相反 */
/* 轻遮罩：只压暗不糊屏（blur 在部分手机内核会把整屏渲染成灰雾） */
.nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: oklch(0 0 0 / 0.18);
  animation: overlayFadeIn 0.22s ease-out;
  overscroll-behavior: contain;
}
.nav-drawer {
  position: fixed; top: 0; left: 0;
  width: 380px; max-width: 90vw; height: 100vh;
  display: flex; flex-direction: column;
  background: #fff; /* 与 .notif-drawer 同底色，避免 --raised 在冷色主题下偏灰 */
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: 12px 0 32px oklch(0.45 0.01 55 / 0.14), 1px 0 0 oklch(from var(--primary) l c h / 0.10);
  animation: navDrawerIn 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  overscroll-behavior: contain;
}
html[data-bnu-theme="dark"] .nav-drawer {
  background: var(--raised);
  color: var(--ink);
}
@keyframes navDrawerIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.nav-drawer-body {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 12px 14px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
/* 条目直接复用 .dm-item（与用户抽屉逐字节同渲染，避免任何设备上的色差），
   仅补导航所需宽度与激活态；.nd-item 类名让位给通知抽屉既有条目 */
.nav-drawer .dm-item { width: 100%; }
.nav-drawer .dm-item, .nav-drawer .notif-drawer-close { touch-action: manipulation; }
.nav-drawer .dm-item.is-active {
  background: var(--primary-surface); color: var(--primary); font-weight: 650;
  box-shadow: inset -3px 0 0 var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .nav-drawer, .nav-drawer-overlay { animation: none; }
}

/* ═══ 紧凑首页 v12：主题纸面 + 推荐书脊 ═══════════════════════
   校园入口用主题专属的低饱和底板表达“工具区”，推荐区只保留一条左侧书脊。
   不给四个入口随机分色，也不把书脊扩散成全首页装饰。 */
.home-eight {
  --h8-campus-surface: color-mix(in oklab, var(--primary-surface) 30%, var(--raised));
  --h8-recommend-spine: var(--primary);
}

html[data-bnu-theme="warm"] .home-eight {
  --h8-campus-surface: color-mix(in oklab, var(--accent-light) 34%, var(--raised));
}

html[data-bnu-theme="cool"] .home-eight {
  --h8-campus-surface: color-mix(in oklab, var(--primary-surface) 42%, var(--raised));
}

html[data-bnu-theme="dark"] .home-eight {
  --h8-campus-surface: color-mix(in oklab, var(--primary-surface) 68%, var(--raised));
}

.home-eight .h8-shortcuts {
  background: var(--h8-campus-surface);
}

.home-eight .h8-recommend {
  position: relative;
}

.home-eight .h8-recommend::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: -1px;
  width: 3px;
  height: auto;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--h8-recommend-spine);
  content: '';
  display: block;
}

@media (max-width: 700px) {
  .home-eight .h8-shortcuts {
    background: var(--h8-campus-surface);
  }

  .home-eight .h8-recommend::before {
    top: 18px;
    bottom: 18px;
  }
}

/* ═══ 紧凑首页 v13：合并卡片收束 + 圆角书脊 ═══════════════════
   窄屏的公告与校园入口合并为一张纸面后，去掉内部底色和公告残线；
   推荐书脊交给卡片自身的左边框，让圆角外框负责自然收口。 */
.home-eight .h8-recommend {
  border-left: 3px solid var(--h8-recommend-spine);
}

.home-eight .h8-recommend::before {
  display: none;
  content: none;
}

/* ═══ 紧凑首页 v18：公告 × 入口联动卡片 ═══════════════════════
   顶部保留两张独立卡片：收起时公告一条、入口最多六个，展开时公告最多三条
   并与入口同步展开；两张卡片始终共享同一高度。 */
.home-eight .h8-top {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-eight .h8-top > .h8-notices,
.home-eight .h8-top > .h8-shortcuts {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--h8-outline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.home-eight .h8-top > .h8-notices {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 18px;
  background: var(--raised);
}

.home-eight .h8-top > .h8-shortcuts {
  padding: 16px 22px 14px;
  border-color: color-mix(in oklab, var(--primary) 24%, var(--h8-outline));
  background: var(--h8-campus-surface);
}

.home-eight .h8-top.is-expanded > .h8-notices,
.home-eight .h8-top.is-expanded > .h8-shortcuts {
  border-color: color-mix(in oklab, var(--primary) 26%, var(--h8-outline));
}

.home-eight .h8-top .h8-section-head {
  margin-bottom: 8px;
}

.home-eight .h8-top .h8-head-actions {
  gap: 11px;
}

.home-eight #compactAnnouncement {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
  min-height: 0;
}

.home-eight .h8-top .h8-notice-main {
  display: flex;
  flex: 1;
  min-height: 96px;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 14px 12px;
  border-left: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent-light) 22%, var(--raised));
  transition: background-color 180ms ease-out, transform 180ms ease-out;
}

.home-eight #compactTopPanel.is-expanded .h8-notice-main {
  min-height: 138px;
  justify-content: center;
  padding-block: 18px;
}

.home-eight #compactTopPanel.is-expanded .h8-notice-main strong {
  font-size: 24px;
  line-height: 1.35;
}

.home-eight #compactTopPanel.is-expanded .h8-notice-main > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  white-space: normal;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main {
  flex: 0 1 auto;
  min-height: 0;
  justify-content: flex-start;
  padding: 10px 14px 11px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main + .h8-notice-main {
  border-top: 1px solid var(--border-light);
  padding-top: 11px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:first-child {
  min-height: 84px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:not(:first-child) {
  min-height: 56px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:first-child strong {
  font-size: 22px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:not(:first-child) strong {
  font-size: 16px;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:first-child > span:last-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:not(:first-child) > span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-eight .h8-top .h8-shortcuts nav {
  align-content: start;
}

.home-eight .h8-top .h8-shortcuts nav a,
.home-eight .h8-top .h8-shortcuts nav button {
  min-height: 37px;
  transition: background-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}

.home-eight .h8-top .h8-shortcuts nav span:last-child {
  transition: color 180ms ease-out, transform 180ms ease-out;
}

.home-eight .h8-top .h8-section-head > .text-btn,
.home-eight .h8-top .h8-head-actions button {
  transition: color 180ms ease-out, transform 180ms ease-out;
}

.home-eight .h8-top .h8-head-actions button[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .home-eight .h8-top .h8-notice-main:hover {
    background: color-mix(in oklab, var(--accent-light) 36%, var(--raised));
    transform: translateX(2px);
  }

  .home-eight .h8-top .h8-shortcuts nav a:hover,
  .home-eight .h8-top .h8-shortcuts nav button:hover {
    background: color-mix(in oklab, var(--primary-surface) 46%, transparent);
    color: var(--primary);
    transform: translateX(2px);
  }

  .home-eight .h8-top .h8-shortcuts nav a:hover span:last-child,
  .home-eight .h8-top .h8-shortcuts nav button:hover span:last-child {
    color: var(--primary);
    transform: translateX(3px);
  }

  .home-eight .h8-top .h8-section-head > .text-btn:hover,
  .home-eight .h8-top .h8-head-actions button:hover {
    transform: translateX(2px);
  }

  .home-eight .h8-card {
    cursor: pointer;
    transition: border-color 180ms ease-out, background-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
  }

  .home-eight .h8-card:hover {
    border-color: var(--border);
    background: var(--raised);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
  }

  .home-eight .h8-rank-row {
    transition: background-color 160ms ease-out;
  }

  .home-eight .h8-rank-row:hover {
    background: color-mix(in oklab, var(--primary-surface) 32%, transparent);
  }

  .home-eight .compact-material-favorite {
    transition: color 160ms ease-out, transform 160ms ease-out;
  }

  .home-eight .compact-material-favorite:hover {
    transform: scale(1.06);
  }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .home-eight .h8-top > .h8-notices {
    padding-right: 18px;
    padding-left: 18px;
  }

  .home-eight .h8-top > .h8-shortcuts {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 700px) {
  .home-eight .h8-top {
    display: block;
    overflow: hidden;
    padding: 0 16px;
    border: 1px solid var(--h8-outline);
    border-radius: var(--radius-md);
    background: var(--raised);
  }

  .home-eight .h8-top > .h8-notices {
    padding: 12px 0 10px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .home-eight .h8-top > .h8-shortcuts {
    padding: 10px 0 8px;
    border-top: 1px solid var(--border-light);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .home-eight #compactAnnouncement {
    display: block;
  }

  .home-eight .h8-top .h8-notice-main,
  .home-eight #compactTopPanel.is-expanded .h8-notice-main {
    min-height: 0;
    justify-content: flex-start;
    padding: 5px 0 6px 10px;
  }

  .home-eight #compactTopPanel.is-expanded .h8-notice-main strong {
    font-size: 16px;
    line-height: 1.4;
  }

  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main {
    padding: 5px 0 6px 10px;
  }

  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:first-child,
  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:not(:first-child) {
    min-height: 0;
  }

  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:first-child strong,
  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main:not(:first-child) strong {
    font-size: 16px;
  }

  .home-eight #compactTopPanel.is-expanded .h8-notice-main > span:last-child,
  .home-eight #compactTopPanel.is-expanded #compactAnnouncement .h8-notice-main > span:last-child {
    display: none;
  }

  .home-eight .h8-top .h8-shortcuts nav a,
  .home-eight .h8-top .h8-shortcuts nav button {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-eight .h8-top .h8-notice-main,
  .home-eight .h8-top .h8-shortcuts nav a,
  .home-eight .h8-top .h8-shortcuts nav button,
  .home-eight .h8-top .h8-section-head > .text-btn,
  .home-eight .h8-top .h8-head-actions button,
  .home-eight .h8-card,
  .home-eight .h8-rank-row,
  .home-eight .compact-material-favorite {
    transition: none;
  }

  .home-eight .h8-top .h8-notice-main:hover,
  .home-eight .h8-top .h8-shortcuts nav a:hover,
  .home-eight .h8-top .h8-shortcuts nav button:hover,
  .home-eight .h8-top .h8-section-head > .text-btn:hover,
  .home-eight .h8-top .h8-head-actions button:hover,
  .home-eight .h8-card:hover,
  .home-eight .compact-material-favorite:hover {
    transform: none;
  }
}

/* ═══ 紧凑首页 v17：推荐索引独立页 + 窄屏入口下移 ═══════════
   首页保持轻量，完整推荐改用“资料索引”呈现；入口在窄屏落到卡片末尾，
   四张资料卡始终完整展示，不再额外折叠。 */
.home-eight .h8-recommend {
  position: relative;
}

.home-eight .h8-recommend > .h8-section-head {
  padding-right: 112px;
}

.home-eight .h8-recommend-more {
  position: absolute;
  top: 26px;
  right: 28px;
}

.home-eight .h8-recommend-more .text-btn {
  min-height: 40px;
  padding: 0;
  color: var(--primary);
  font-size: 12px;
}

.recommendations-page {
  min-height: 100%;
  padding: 24px 0 64px;
}

.recommendations-container {
  max-width: 1080px;
}

.recommendations-page .breadcrumb {
  /* 面包屑与页面标题、索引板外沿共用左边界。 */
  margin-bottom: 28px;
}

.recommendations-page .breadcrumb a:first-child {
  padding-left: 0;
}

.recommendations-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 32px;
}

.recommendations-kicker,
.recommendations-board-kicker {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.recommendations-header h1 {
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.15;
  text-wrap: pretty;
}

.recommendations-header p {
  max-width: 520px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  text-wrap: pretty;
}

.recommendations-count {
  min-width: 118px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: right;
}

.recommendations-count strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  line-height: 1;
}

.recommendations-count span {
  display: block;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

.recommendations-board {
  padding: 24px 28px 8px;
  border: 1px solid var(--h8-outline, var(--border));
  border-radius: var(--radius-md);
  background: var(--raised);
  box-shadow: var(--shadow-sm);
}

.recommendations-board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.recommendations-board-head h2 {
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 650;
}

.recommendations-board-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.recommendations-board-tools > p {
  color: var(--ink-faint);
  font-size: 11px;
}

.recommendations-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.recommendations-refresh:hover {
  border-color: var(--primary-light);
  background: var(--primary-surface);
  color: var(--primary);
}

.recommendations-refresh:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.recommendations-refresh:disabled {
  cursor: wait;
  opacity: .58;
}

.recommendations-refresh-icon {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
}

.recommendations-refresh.is-loading .recommendations-refresh-icon {
  animation: recommendationsRefreshSpin .7s linear infinite;
}

@keyframes recommendationsRefreshSpin {
  to { transform: rotate(360deg); }
}

.recommendations-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
}

.recommendation-index-card {
  display: flex;
  min-width: 0;
  min-height: 216px;
  flex-direction: column;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border-light);
}

.recommendation-index-card.is-lead {
  grid-column: 1 / -1;
  min-height: 222px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.recommendation-index-overline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.recommendation-index-number {
  color: var(--primary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.recommendation-index-type {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 10px;
}

.recommendation-index-title {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.recommendation-index-card.is-lead .recommendation-index-title {
  max-width: 760px;
  font-size: 27px;
  line-height: 1.35;
}

.recommendation-index-title:hover {
  color: var(--primary);
}

.recommendation-index-reason {
  max-width: 760px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.recommendation-index-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--ink-faint);
  font-size: 11px;
}

.recommendation-index-favorite {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin: -10px -10px -10px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
}

.recommendation-index-favorite:hover,
.recommendation-index-favorite.is-favorited {
  color: var(--primary);
}

.recommendation-index-favorite svg {
  width: 18px;
  height: 18px;
}

.recommendations-empty {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
  padding: 40px 0 48px;
  color: var(--ink-faint);
}

.recommendations-empty strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
}

.recommendations-empty span {
  font-size: 12px;
  line-height: 1.6;
}

.recommendations-empty button {
  min-height: 40px;
  margin-top: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.recommendations-empty button:hover {
  border-color: var(--primary-light);
  background: var(--primary-surface);
}

.recommendations-status {
  min-height: 1.5em;
  margin-top: 8px;
  color: var(--danger);
  font-size: 11px;
}

@media (max-width: 1100px) and (min-width: 701px) {
  .recommendations-page {
    padding-right: 24px;
    padding-left: 24px;
  }

  .recommendations-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recommendation-index-card.is-lead {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .home-eight .h8-recommend > .h8-section-head {
    padding-right: 0;
  }

  .home-eight .h8-recommend-more {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
  }

  .recommendations-page {
    padding: 18px 0 48px;
  }

  .recommendations-page .breadcrumb {
    margin-bottom: 22px;
  }

  .recommendations-header {
    display: block;
    margin-bottom: 24px;
  }

  .recommendations-header h1 {
    font-size: 34px;
  }

  .recommendations-header p {
    margin-top: 10px;
    font-size: 13px;
  }

  .recommendations-count {
    min-width: 0;
    margin-top: 22px;
    text-align: left;
  }

  .recommendations-count strong {
    display: inline;
    margin-right: 7px;
    font-size: 28px;
  }

  .recommendations-count span {
    display: inline;
  }

  .recommendations-board {
    padding: 20px 18px 4px;
  }

  .recommendations-board-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .recommendations-board-tools {
    width: 100%;
    justify-content: space-between;
  }

  .recommendations-board-tools > p {
    font-size: 11px;
  }

  .recommendations-index {
    grid-template-columns: 1fr;
  }

  .recommendation-index-card,
  .recommendation-index-card.is-lead {
    grid-column: auto;
    min-height: 0;
    padding: 22px 0 18px;
    border-top: 0;
  }

  .recommendation-index-card.is-lead {
    padding-top: 24px;
    border-top: 2px solid var(--ink);
  }

  .recommendation-index-card.is-lead .recommendation-index-title {
    font-size: 22px;
  }

  .recommendation-index-title {
    font-size: 18px;
  }
}

@media (max-width: 700px) {
  .home-eight .h8-notices {
    border-top: 0;
  }

  .home-eight .h8-shortcuts {
    background: transparent;
  }
}

/* ═══ 紧凑首页 v14：书脊微延伸 + 暖色淡纸面 ═══════════════════
   书脊只越过上下圆角 2px，保持原有 3px 宽度；暖色入口改用画布底的
   低彩度米白，保留主题差异但不再抢公告与推荐的视觉重心。 */
html[data-bnu-theme="warm"] .home-eight {
  --h8-campus-surface: color-mix(in oklab, var(--bg) 72%, var(--raised));
}

.home-eight .h8-recommend {
  border-left-color: transparent;
}

.home-eight .h8-recommend::before {
  top: -2px;
  bottom: -2px;
  left: -1px;
  height: auto;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  content: '';
  display: block;
}

/* ═══ 紧凑首页 v15：书脊贴合推荐卡外沿 ═════════════════════
   书脊回到卡片真实左边框，交给卡片自身的圆角自然收口，避免伪元素越界造成悬空错位。 */
.home-eight .h8-recommend {
  border-left: 3px solid var(--h8-recommend-spine);
}

.home-eight .h8-recommend::before {
  display: none;
  content: none;
}

/* ═══ 紧凑首页 v19：统计条单行 + 公告纸面留白 ════════════════
   统计项是同一组平台规模信息，窄屏只收缩字号和间距，不拆成多行；
   公告内容回到卡片纸面，不再铺一块抢视觉的暖色底。 */
.home-eight .h8-scale {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.home-eight .h8-scale > strong,
.home-eight .h8-scale > span {
  min-width: 0;
  white-space: nowrap;
}

.home-eight .h8-top .h8-notice-main,
.home-eight .h8-top .h8-notice-main:hover {
  background: transparent;
}

@media (max-width: 700px) {
  .home-eight .h8-heading {
    min-width: 0;
  }

  .home-eight .h8-scale {
    flex: 0 1 auto;
    gap: clamp(4px, 2vw, 10px);
    overflow: hidden;
    font-size: clamp(7px, 2.15vw, 10px);
    letter-spacing: -0.02em;
  }

  .home-eight .h8-scale strong {
    flex-shrink: 1;
    font-size: clamp(18px, 5.7vw, 24px);
    letter-spacing: -0.06em;
  }

  .home-eight .h8-scale strong small {
    font-size: clamp(7px, 2.15vw, 10px);
  }

  .home-eight .h8-scale > span {
    flex-shrink: 1;
  }
}

/* ═══ 紧凑首页 v20：移动端入口回到同一张纸面 ═══════════════
   入口仍与公告分区呈现，但不再铺独立色块；只用一条发丝线和行间距完成分层。 */
@media (max-width: 700px) {
  .home-eight .h8-top > .h8-shortcuts {
    background: transparent;
  }
}

/* ═══ 紧凑首页 v21：上传入口并入平台规模栏 ═══════════════════
   复用松散首页的课程搜索上传流程。v=175 入口分层：上传=实心主操作
   （较高视觉权重），新建课程=描边申请入口（文档/表单图标）；按钮组
   与平台统计之间用分隔线隔开，窄屏同组收紧。 */
.home-eight .h8-heading-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

/* 首页操作组：与右侧平台统计以发丝分隔线表达分区，不靠留白猜 */
.home-eight .h8-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
  border-right: 1px solid var(--v9-border);
}

.home-eight .h8-upload-btn {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font: 600 12px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}

.home-eight .h8-newcourse-btn {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid color-mix(in oklab, var(--primary) 42%, var(--v9-border));
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font: 600 12px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}

.home-eight .h8-upload-btn svg,
.home-eight .h8-newcourse-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.home-eight .h8-upload-btn:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.home-eight .h8-newcourse-btn:hover {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary-surface) 52%, transparent);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.home-eight .h8-upload-btn:active,
.home-eight .h8-newcourse-btn:active {
  transform: translateY(0);
}

.home-eight .h8-upload-btn:focus-visible,
.home-eight .h8-newcourse-btn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .home-eight .h8-heading-tools {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .home-eight .h8-heading-tools {
    width: 100%;
    gap: clamp(6px, 2.5vw, 12px);
    justify-content: space-between;
  }

  .home-eight .h8-actions {
    gap: 6px;
    padding-right: 10px;
  }

  .home-eight .h8-upload-btn,
  .home-eight .h8-newcourse-btn {
    min-height: 28px;
    gap: 5px;
    padding: 0 clamp(8px, 2.3vw, 10px);
    font-size: clamp(10px, 2.9vw, 12px);
  }

  .home-eight .h8-upload-btn svg,
  .home-eight .h8-newcourse-btn svg {
    width: 13px;
    height: 13px;
  }

  .home-eight .h8-scale {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-eight .h8-upload-btn,
  .home-eight .h8-newcourse-btn {
    transition: none;
  }

  .home-eight .h8-upload-btn:hover,
  .home-eight .h8-upload-btn:active,
  .home-eight .h8-newcourse-btn:hover,
  .home-eight .h8-newcourse-btn:active {
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════
   首页动效体系（v306）— 统一滚动 reveal / 视图入场 / 容器 swap /
   骨架屏 / hover 微交互。曲线与时长全部取自 tokens.css 的
   --ease-out-strong / --dur-* 令牌；只动 transform 与 opacity。
   ════════════════════════════════════════════════════════════ */

/* ── 统一滚动 reveal：.motion-reveal 由 JS 添加，进视口后播一次即摘除 ── */
.motion-reveal { opacity: 0; transform: translateY(12px); }
/* 数据就绪前扣住入场编排：区块保持隐藏，releaseHeldReveals 后才加入级联。
   让「编排」与「内容到货」合成一个事件，避免生产慢接口下动画演完骨架、
   内容再逐区弹入的二次闪烁。 */
.motion-hold { opacity: 0; }
.motion-delay-1 { --motion-delay: 40ms; }
.motion-delay-2 { --motion-delay: 80ms; }
.motion-delay-3 { --motion-delay: 120ms; }
.motion-delay-4 { --motion-delay: 160ms; }
.motion-delay-5 { --motion-delay: 200ms; }
.motion-reveal.is-visible {
  animation: reveal-in var(--dur-reveal) var(--ease-out-strong) var(--motion-delay, 0ms) both;
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ── SPA 视图切换入场：switchView 前进导航时由 JS 挂到进入的视图上 ── */
.view-enter { animation: view-in var(--dur-view) var(--ease-out-strong) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── 容器内容替换（tab 切换 / 校园入口展开）：整块 6px 上移淡入 ── */
.motion-swap { animation: swap-in var(--dur-swap) var(--ease-out-strong) both; }
@keyframes swap-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── 首页加载骨架屏：容器扫光一次成型，线条静置；纯 transform 驱动 ── */
.h8-skeleton-card,
.h8-skeleton-row {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface);
}
.h8-skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 158px;
  padding: 14px 16px 8px;
}
.h8-skeleton-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 66px;
}
.h8-skeleton-row .sk-main { width: 86%; }
.h8-skeleton-row .sk-sub { width: 46%; }
.h8-skeleton-row .sk-metric { width: 44px; }
.sk-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.h8-skeleton-card .sk-tag { width: 56px; height: 9px; }
.h8-skeleton-card .sk-title { width: 82%; height: 15px; }
.h8-skeleton-card .sk-body { width: 94%; }
.h8-skeleton-card .sk-short { width: 52%; }
.sk-line {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: var(--border-light);
}
.h8-skeleton-card::after,
.h8-skeleton-row::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 32%, oklch(from var(--ink) l c h / 0.05) 50%, transparent 68%);
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* ── hover 微交互：h8 推荐卡上浮 + 阴影；榜单行/动态行底色提示。
      transform 类 hover 一律用 (hover:hover)+(pointer:fine) 门控，
      避免触屏点按触发假悬浮。按压反馈不门控（触屏同样受益）。 ── */
.h8-card { transition: transform 0.18s var(--ease-out-strong), box-shadow 0.18s var(--ease-out-strong); }
.h8-rank-row, .compact-discovery-item { transition: background-color var(--t-fast); }
@media (hover: hover) and (pointer: fine) {
  .h8-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .h8-rank-row:hover, .compact-discovery-item:hover { background: var(--primary-surface); }
}
.h8-card:active { transform: translateY(-1px) scale(0.99); }
.home-nav-card:active { transform: translateY(0) scale(0.99); }

/* ── 收藏星标点亮：一次性过冲弹跳，由 JS 在收藏成功时挂 .star-pop ── */
.star-pop { animation: star-pop 0.3s var(--ease-out-strong); }
@keyframes star-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* ── 减少动态偏好：位移/扫光全部退场，内容直接可见（双保险，
      防 JS 未运行时 .motion-reveal 初始态把内容藏住） ── */
@media (prefers-reduced-motion: reduce) {
  .motion-reveal, .motion-hold { opacity: 1 !important; transform: none !important; animation: none !important; }
  .view-enter, .motion-swap, .star-pop { animation: none !important; }
  .h8-skeleton-card::after, .h8-skeleton-row::after { animation: none; content: none; }
  .h8-card, .h8-rank-row, .compact-discovery-item { transition: none; }
}

/* ═══ 公告卡头条轮换（v311）══════════════════════════════════
   首帧 = 最新公告，后两帧 = 用户交流群 / 意见反馈常青内容。复刻书脊
   头条解剖（铜色左轨 + 染色卡面 + 衬线标题），置于文件末尾以拥有级联，
   不与上方 .h8-notice-main 旧规则互相牵扯。刻度线页脚兼任轮播与下方
   公告列表的分隔线，激活刻度染铜色。点击常青帧跳「关于 → 联系我们」。 */
/* 裁剪窗在外层包裹元素上：overflow 与 transform 同元素会让裁剪窗跟着平移 */
.home-eight .h8-carousel { overflow: hidden; touch-action: pan-y; cursor: grab; }
.home-eight .h8-carousel.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.home-eight .h8-carousel a { -webkit-user-drag: none; }
.home-eight .h8-carousel-track { display: flex; align-items: flex-start; transition: transform 360ms var(--ease-out-strong); }
.home-eight .h8-carousel.is-dragging .h8-carousel-track { transition: none; }
.home-eight .h8-carousel-slide { flex: 0 0 100%; min-width: 0; }
.home-eight .h8-carousel-notice,
.home-eight .h8-carousel-promo {
  display: flex;
  flex: 0 0 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  padding: 9px 14px 10px;
  border: 0;
  border-left: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent-light) 22%, var(--raised));
  color: var(--ink);
  text-align: left;
}
.home-eight .h8-carousel-promo { flex-direction: row; align-items: center; gap: 16px; }
.home-eight .h8-carousel-body { flex: 1; min-width: 0; }
.home-eight .h8-carousel-notice .h8-label,
.home-eight .h8-carousel-promo .h8-label { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
.home-eight .h8-carousel-notice strong,
.home-eight .h8-carousel-promo strong { display: block; margin: 4px 0 5px; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 650; letter-spacing: -0.3px; line-height: 1.4; }
.home-eight .h8-carousel-notice .h8-carousel-excerpt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.home-eight .h8-carousel-promo .h8-carousel-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 12px; }
.home-eight .h8-carousel-qr { flex: 0 0 56px; width: 56px; height: 56px; border: 1px solid var(--v9-border); border-radius: var(--radius-sm); background: #fff; }
/* v324：常青教程帧——两张轻叠纸卡 + 播放符号（纯 CSS，不在轮播内播放教程动画） */
.home-eight .h8-carousel-tutorial .h8-carousel-visual { position: relative; flex: 0 0 52px; height: 56px; }
.home-eight .h8-carousel-paper {
  position: absolute;
  bottom: 2px;
  width: 30px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--raised);
  box-shadow: var(--shadow-xs);
}
.home-eight .h8-carousel-paper::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 5px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-light);
  box-shadow: 0 7px 0 var(--border-light), 0 14px 0 var(--border-light);
}
.home-eight .h8-carousel-paper-1 { left: 2px; transform: rotate(-7deg); }
.home-eight .h8-carousel-paper-2 { left: 16px; transform: rotate(5deg); }
.home-eight .h8-carousel-play {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 8px;
  padding-left: 2px;
  box-shadow: var(--shadow-sm);
}
.home-eight .h8-carousel-tutorial .h8-carousel-cta {
  flex: none;
  align-self: center;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.home-eight .h8-carousel-ticks { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.home-eight .h8-carousel-ticks button { position: relative; width: 20px; height: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.home-eight .h8-carousel-ticks button::after { content: ''; position: absolute; top: 4px; right: 2px; left: 2px; height: 2px; background: var(--v9-border); transition: background 180ms ease-out; }
.home-eight .h8-carousel-ticks button:hover::after { background: var(--ink-soft); }
.home-eight .h8-carousel-ticks button[aria-current="true"]::after { background: var(--accent); }
/* 展开区：头条轮播之外的公告，行式解剖（16px 衬线 + 单行摘要 + 发丝线分隔） */
.home-eight .h8-notice-rest { display: block; }
.home-eight .h8-notice-rest .h8-notice-row {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.home-eight .h8-notice-rest .h8-notice-row + .h8-notice-row { border-top: 1px solid var(--border-light); }
.home-eight .h8-notice-rest .h8-notice-row strong { display: block; margin: 4px 0 5px; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 650; letter-spacing: -0.3px; line-height: 1.4; }
.home-eight .h8-notice-rest .h8-notice-row .h8-carousel-excerpt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 12px; }
@media (hover: hover) and (pointer: fine) {
  .home-eight .h8-carousel-notice:hover,
  .home-eight .h8-carousel-promo:hover {
    background: color-mix(in oklab, var(--accent-light) 36%, var(--raised));
    transform: translateX(2px);
  }
}
@media (max-width: 700px) {
  .home-eight .h8-carousel-notice,
  .home-eight .h8-carousel-promo { padding: 5px 0 6px 10px; }
  .home-eight .h8-carousel-notice strong,
  .home-eight .h8-carousel-promo strong { margin: 0 0 3px; font-size: 16px; line-height: 1.4; }
  .home-eight .h8-carousel-notice .h8-carousel-excerpt { display: none; }
  .home-eight .h8-carousel-promo { gap: 12px; }
  .home-eight .h8-carousel-promo .h8-carousel-text { font-size: 11px; }
  .home-eight .h8-carousel-qr { flex: 0 0 44px; width: 44px; height: 44px; }
  .home-eight .h8-carousel-ticks { margin-top: 8px; padding-top: 8px; }
  .home-eight .h8-notice-rest .h8-notice-row { min-height: 0; padding: 5px 0 6px 10px; flex-direction: row; align-items: baseline; gap: 10px; }
  .home-eight .h8-notice-rest .h8-notice-row strong { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-eight .h8-notice-rest .h8-notice-row .h8-carousel-excerpt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-eight .h8-carousel-track { transition: none; }
  .home-eight .h8-carousel-notice:hover,
  .home-eight .h8-carousel-promo:hover { transform: none; }
}

/* ════════════════════════════════════════════════════════════
   校园入口工作台（v319）——个人入口与总管理员精选的双层关系。
   个人编辑保持工具感；精选区用一枚铜色星标做唯一识别，不再复制后台卡片。
   ════════════════════════════════════════════════════════════ */
.campus-manager-dialog { width: min(780px, 100%); }
.campus-manager-intro { max-width: 52ch; margin: 7px 0 0; color: var(--ink-soft); font-size: 0.73rem; line-height: 1.55; }
.campus-manager-modebar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 13px 14px;
  border: 1px solid color-mix(in oklab, var(--accent) 28%, var(--border-light));
  background: color-mix(in oklab, var(--accent-light) 18%, var(--surface));
}
.campus-manager-modebar > div { min-width: 0; }
.campus-manager-modebar strong { display: block; margin-top: 4px; color: var(--ink); font-size: 0.88rem; font-weight: 650; }
.campus-manager-modebar small { display: block; margin-top: 3px; overflow: hidden; color: var(--ink-soft); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.campus-manager-modebar > button {
  flex: 0 0 auto; min-height: 32px; padding: 6px 10px;
  border: 1px solid var(--primary-light); border-radius: var(--radius-sm);
  background: var(--raised); color: var(--primary); font: inherit; font-size: 0.7rem; cursor: pointer;
}
.campus-manager-section { margin-top: 16px; }
.campus-manager-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.campus-manager-section-head h3 { margin-top: 3px; color: var(--ink); font-family: var(--serif); font-size: 1rem; font-weight: 650; }
.campus-manager-section-head > span { color: var(--ink-faint); font-size: 0.68rem; white-space: nowrap; }
.campus-ideas-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.campus-featured-list { display: grid; gap: 0; }
.campus-featured-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.campus-featured-copy { display: flex; align-items: center; min-width: 0; gap: 10px; }
.campus-featured-copy > span:last-child { min-width: 0; }
.campus-featured-mark { flex: 0 0 auto; color: var(--accent); font-size: 0.9rem; }
.campus-featured-row strong, .campus-featured-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campus-featured-row strong { color: var(--ink); font-size: 0.78rem; font-weight: 600; }
.campus-featured-row small { margin-top: 2px; color: var(--ink-faint); font-size: 0.66rem; }
.campus-featured-row button { flex: 0 0 auto; min-height: 30px; padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--raised); color: var(--primary); font: inherit; font-size: 0.68rem; cursor: pointer; }
.campus-featured-row button:disabled { border-color: var(--border-light); color: var(--ink-faint); cursor: default; }
.campus-manager-row[data-campus-scope="personal"] { grid-template-columns: 18px minmax(0, 1fr) auto auto auto auto auto; }
.campus-manager-row[data-campus-scope="personal"] button[data-campus-action="delete"] { color: var(--danger); }
.home-eight .h8-top .h8-head-actions { flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 700px) {
  .campus-manager-modebar { align-items: flex-start; flex-direction: column; gap: 9px; }
  .campus-manager-modebar > button { width: 100%; }
  .campus-manager-section-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .campus-manager-section-head > span { white-space: normal; }
  .campus-manager-row[data-campus-scope="personal"] > button[data-campus-action="delete"] { grid-row: 2; grid-column: 2; justify-self: start; }
  .campus-manager-row[data-campus-scope="personal"] > button[data-campus-action="up"] { grid-row: 2; grid-column: 3; justify-self: start; }
  .campus-manager-row[data-campus-scope="personal"] > button[data-campus-action="down"] { grid-row: 2; grid-column: 4; justify-self: start; }
  .campus-featured-row { align-items: flex-start; }
  .campus-featured-row button { margin-top: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .campus-manager-modebar > button,
  .campus-featured-row button { transition: none; }
}

/* 桌面端不渲染收拢版管理入口：桌面保留「自定义入口／管理员精选」原样 */
@media (min-width: 701px) {
  #campusManageCompactButton { display: none !important; }
}

/* ═══ 紧凑首页 v325：移动端阅读层级 ═══════════════════════════
   模块分工：公告轻量（标题+短摘要）、校园入口易点（44px 整块、名称可换行）、
   推荐是主阅读区（减一层缩进、标题为视觉重点、低价值元信息降权）、
   资料动态紧凑扫读（短日期、榜单各表其义）。只覆写 ≤700px 呈现，
   顶部「上传／新建课程／统计」行（v19-v21）保持原样。 */
@media (max-width: 700px) {
  /* ── 区块头动作：44px 有效点击区，负 margin 保持现有行高不变 ── */
  .home-eight .h8-section-head > .text-btn,
  .home-eight .h8-head-actions .text-btn,
  .home-eight .h8-head-actions button {
    min-height: 44px;
    margin-block: -10px;
  }

  /* ── 公告：标题 + 两行短摘要为主，收紧轮播与刻度线周围的空白 ── */
  .home-eight .h8-carousel-notice .h8-carousel-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.55;
    white-space: normal;
  }
  .home-eight .h8-carousel-promo .h8-carousel-visual {
    flex-basis: 44px;
    height: 48px;
  }
  .home-eight .h8-carousel-ticks {
    gap: 12px;
    margin-top: 6px;
    padding-top: 6px;
  }
  /* 刻度视觉保持小条，::before 把有效点击区补到约 44px 高 */
  .home-eight .h8-carousel-ticks button {
    width: 22px;
    height: 12px;
  }
  .home-eight .h8-carousel-ticks button::before {
    content: '';
    position: absolute;
    inset: -16px -6px;
  }
  .home-eight .h8-carousel-ticks button::after {
    top: 5px;
    right: 3px;
    left: 3px;
  }
  /* 展开区的第 2、3 条公告：长标题允许换行，不再单行截断 */
  .home-eight .h8-notice-rest .h8-notice-row strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.45;
  }
  /* 二维码大图链接：图片本身 44px，可独立点击 */
  .home-eight .h8-carousel-body-link {
    display: block;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
  }
  .home-eight .h8-carousel-body-link .h8-carousel-body {
    display: block;
  }
  .home-eight .h8-carousel-qr-link {
    display: block;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
  }
  .home-eight .h8-carousel-qr-link:active {
    opacity: 0.7;
  }

  /* ── 校园入口：整块 44px 可点，名称换行，图标退到行尾示意方向 ── */
  .home-eight .h8-top .h8-shortcuts nav a,
  .home-eight .h8-top .h8-shortcuts nav button {
    min-height: 44px;
  }
  .compact-campus-link span:first-child {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }
  .compact-campus-link svg.ui-icon {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .compact-campus-link:active {
    background: color-mix(in oklab, var(--primary-surface) 40%, transparent);
  }
  /* 配置操作收拢为单一「管理入口」，工作台内仍可切换个人/精选 */
  #campusManageButton,
  #campusFeaturedButton {
    display: none !important;
  }

  /* ── 为你推荐：主阅读区。外面板与内卡只留一层缩进，卡片走轻描边； ──
     标题是视觉重点；查看更多上移到区块标题右侧 */
  .home-eight .h8-recommend {
    margin-block: 16px;
    padding: 14px 12px 10px;
  }
  .home-eight .h8-recommend > .h8-section-head {
    padding-right: 96px;
  }
  .home-eight .h8-recommend-more {
    position: absolute;
    top: 7px;
    right: 12px;
    display: block;
    margin: 0;
  }
  .home-eight .h8-card {
    padding: 12px 14px 6px;
    border-color: var(--border-light);
    background: transparent;
    box-shadow: none;
  }
  .home-eight .h8-card + .h8-card {
    margin-top: 8px;
  }
  .home-eight #compactRecommendations > .h8-card:first-child {
    border-color: var(--border);
    background: var(--v9-surface);
    box-shadow: none;
  }
  .home-eight .h8-card-head {
    margin-bottom: 7px;
  }
  .home-eight .h8-card-head > span {
    flex-shrink: 0;
    font-size: 10px;
  }
  .home-eight .h8-card-title {
    font-size: 18px;
    line-height: 1.5;
  }
  .home-eight .h8-card > p {
    margin: 7px 0 10px;
  }
  .home-eight .h8-card-bottom {
    padding-bottom: 2px;
    font-size: 11px;
  }
  /* 重复的完整日期在首页降权：只保留下载量等真实差异信息 */
  .home-eight .h8-card-meta-date {
    display: none;
  }
  .home-eight .compact-material-favorite {
    margin: -8px -8px -8px 0;
  }

  /* ── 资料动态：连续扫读的行列表；右列统一右对齐、等宽数字 ── */
  .home-eight .compact-discovery-block {
    margin-top: 16px;
    padding: 14px 12px 2px;
  }
  .compact-discovery-item {
    min-height: 48px;
    padding: 10px 4px 10px 2px;
  }
  .compact-discovery-item:active {
    background: color-mix(in oklab, var(--primary-surface) 55%, transparent);
  }
  .compact-discovery-info strong {
    font-size: 0.845rem;
    font-weight: 600;
  }
  .compact-discovery-count {
    align-self: center;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
}
