/* ============================================================
   mobile-app.css —— 移动端 App 感增强层（基于 shoutu40 主题）
   激活条件：竖屏/窄屏（<=820px）自动生效，桌面端不受影响
   ============================================================ */
@media (max-width: 820px) {
  /* ---------- 全局 App 化基调 ---------- */
  html { -webkit-text-size-adjust: 100%; }
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    background: #0e0f13 !important;
  }
  img, video { -webkit-touch-callout: none; }
  a, button { -webkit-tap-highlight-color: transparent; }

  /* ---------- 顶部 App 导航条 ---------- */
  .navbar, header .container, .d2-nav {
    position: sticky !important; top: 0; z-index: 900;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: rgba(14,15,19,.82) !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding-top: env(safe-area-inset-top);
    min-height: 52px;
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
    animation: d2nav-in .28s ease both;
  }
  @keyframes d2nav-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* ---------- 底部 TabBar（App 灵魂）---------- */
  .d2-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
    display: flex; justify-content: space-around; align-items: center;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(17,18,23,.92);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 -8px 28px rgba(0,0,0,.42);
  }
  .d2-tabbar a {
    flex: 1; text-align: center; color: #8b90a0; text-decoration: none;
    font-size: 10.5px; letter-spacing: .4px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0 5px; transition: color .18s, transform .18s;
  }
  .d2-tabbar a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; }
  .d2-tabbar a:active { transform: scale(.9); }
  .d2-tabbar a.d2-on { color: var(--d2-accent, #00aeec); }
  .d2-tabbar a.d2-on svg { filter: drop-shadow(0 2px 8px rgba(0,174,236,.55)); }

  /* ---------- 卡片/内容 App 化 ---------- */
  .d2-card, .list-unstyled li, .video-img-box, .vod-item, .module-item {
    border-radius: 14px !important; overflow: hidden;
    background: rgba(255,255,255,.035);
    box-shadow: 0 4px 18px rgba(0,0,0,.28);
  }
  .d2-card:active, .vod-item:active, .module-item:active { transform: scale(.975); transition: transform .12s; }

  /* ---------- 分区标题（App 区块感）---------- */
  .title-box h6, .title-with-more h2, .sub-title {
    letter-spacing: 1px;
  }
  .title-with-more {
    padding: 14px 16px 8px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .title-with-more::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.10), transparent);
    margin-left: 12px; align-self: center; max-width: 34%;
  }

  /* ---------- 骨架屏（加载态）---------- */
  .d2-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.11) 37%, rgba(255,255,255,.05) 63%);
    background-size: 400% 100%;
    animation: d2sk 1.2s ease infinite;
    border-radius: 12px;
  }
  @keyframes d2sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

  /* ---------- 页面切换动效（App 推入感）---------- */
  .d2-page-anim { animation: d2slide-in .26s cubic-bezier(.22,.61,.36,1) both; }
  @keyframes d2slide-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

  /* ---------- 顶部进度条（App 加载感）---------- */
  #d2Loadbar {
    position: fixed; top: 0; left: 0; height: 3px; z-index: 1200;
    width: 0; background: linear-gradient(90deg, var(--d2-accent, #00aeec), #33bdf5);
    box-shadow: 0 0 12px rgba(0,174,236,.7);
    transition: width .35s ease, opacity .4s ease;
  }

  /* ---------- 安装引导卡（参考 dsapp 的步骤风格）---------- */
  .d2-install-guide {
    position: fixed; inset: 0; z-index: 1500; display: none;
    background: rgba(8,9,12,.96); backdrop-filter: blur(10px);
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto; animation: d2slide-in .3s ease both;
  }
  .d2-install-guide.d2-show { display: block; }
  .d2-install-guide h3 { color: #fff; font-size: 19px; margin: 6px 0 4px; letter-spacing: 1px; }
  .d2-install-guide .d2-sub { color: #9aa0b0; font-size: 12.5px; margin-bottom: 18px; }
  .d2-step {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px; padding: 15px 16px; margin-bottom: 13px;
    box-shadow: 0 8px 26px rgba(0,0,0,.35);
  }
  .d2-step .d2-badge {
    display: inline-block; background: linear-gradient(135deg, var(--d2-accent, #00aeec), #33bdf5);
    color: #fff; font-size: 11px; border-radius: 999px; padding: 3px 11px; margin-bottom: 9px;
    letter-spacing: 1px; box-shadow: 0 4px 14px rgba(0,174,236,.4);
  }
  .d2-step p { color: #d7dae2; font-size: 13.5px; line-height: 1.75; margin: 0; }
  .d2-step .d2-hand { font-size: 22px; margin-right: 6px; vertical-align: -3px; }
  .d2-guide-btn {
    display: block; width: 100%; text-align: center; border: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--d2-accent, #00aeec), #22b5f2);
    color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
    border-radius: 999px; padding: 13px 0; margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0,174,236,.45);
  }
  .d2-guide-close { position: absolute; top: 18px; right: 18px; color: #fff; font-size: 22px; opacity: .8; }

  /* ---------- 播放页全屏沉浸 ---------- */
  .d2-play .d2-sources, .d2-play .d2-epbar { border-radius: 14px; }
  video { border-radius: 0; background: #000; }
}
