/**
 * 记忆立方 · 手机端完整适配�?v3
 * 
 * 覆盖 4 页：学习｜记忆｜聊天｜我�? * 桌面端不受影响（�?@media �?68px / �?80px / �?75px 触发�? */

/* 桌面默认：案例图仍作小图标；H5 由 [data-mv-wechat-h5] 改为整卡背景 */
.home-card-media {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.home-card-secondary .home-card-media {
  justify-content: center;
  margin-bottom: 8px;
  text-align: center;
}
.home-card-bg {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.home-card-secondary .home-card-bg {
  width: 36px;
  height: 36px;
  margin-left: auto;
  margin-right: auto;
}
.home-card-desc-h5 {
  display: none;
}

/* ================================================================
   1. 基础全局 @ �?80px
   ================================================================ */
@media (max-width: 480px) {

  /* ---- 根级防溢�?---- */
  html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  body {
    font-size: 15px;
    min-height: 100dvh;
  }

  /* ---- 输入�?iOS 缩放 ---- */
  input, select, textarea, button {
    font-size: 16px !important;
  }
  .tab-item-label, .plaza-cat, .breadcrumb-btn, .view-size-btn,
  #plaza-compose-modal input, #plaza-compose-modal textarea,
  #ai-creation-input, #plaza-search-input,
  #plaza-detail-comment-input {
    font-size: inherit !important;
  }

  /* ---- 顶部 Header ---- */
  .header {
    padding: 8px 12px !important;
    height: 48px !important;
  }
  .header h1 { font-size: 17px !important; }
  .user-info { padding: 4px 10px !important; gap: 6px !important; }
  .user-avatar { width: 28px !important; height: 28px !important; font-size: 15px !important; }
  .header-controls { gap: 6px !important; }

  /* ---- 页面容器高度 �?dvh + vh 双保�?---- */
  .page-container {
    height: calc(100vh - 48px - 56px) !important;
    height: calc(100dvh - 48px - 56px) !important;
  }
  body.no-top-header-page #learning-page.active,
  body.no-top-header-page #assets-page.active,
  body.no-top-header-page #friends-page.active,
  body.no-top-header-page #profile-page.active {
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
  }

  /* ---- 底部导航�?---- */
  .bottom-tabbar {
    height: 56px !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    height: calc(56px + constant(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-bottom: constant(safe-area-inset-bottom, 0px) !important;
  }
  .tab-item { min-height: 44px !important; padding: 4px 2px !important; }
  .tab-item-icon { width: 22px !important; height: 22px !important; }
  .tab-item-label { font-size: 10px !important; }

  /* ---- 模态框：功能子页满屏；小弹窗仍居中卡片 ---- */
  .modal {
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
  }
  /* 打开时 JS 常写 block；改为 flex 以便内容区撑满 */
  .modal[style*="display: block"],
  .modal[style*="display:block"],
  .modal[style*="display: flex"],
  .modal[style*="display:flex"] {
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-content {
    width: 100% !important; max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 12px 16px 20px !important;
    min-height: 100% !important;
    min-height: 100dvh !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100% !important;
    max-height: 100dvh !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .modal-content:has(.close-modal) { padding-top: 52px !important; }
  .modal-header h2 { font-size: 18px !important; }
  /* 小弹窗例外：二维码 / 资料编辑 仍居中卡片 */
  #profile-qrcode-modal.modal,
  #profile-extra-edit-modal.modal,
  #login-modal.modal {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  #profile-qrcode-modal .modal-content,
  #profile-extra-edit-modal .modal-content,
  #login-modal .modal-content {
    border-radius: 16px !important;
    width: 90% !important;
    max-width: 360px !important;
    min-height: auto !important;
    height: auto !important;
    max-height: 85dvh !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18) !important;
  }

  /* ---- 按钮触摸优化 ---- */
  button, .btn, [role="button"] { min-height: 44px; min-width: 44px; touch-action: manipulation; }
  .toolbar-btn { min-height: 44px; min-width: 44px; padding: 8px 6px; touch-action: manipulation; }

  /* ---- Toast ---- */
  .toast-container { bottom: 80px !important; }
  .toast { padding: 12px 18px !important; font-size: 14px !important; min-width: 200px !important; }

  /* ---- 滚动优化 ---- */
  .page-container.active {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* ---- 按钮组堆�?---- */
  .btn-group, .action-buttons { flex-direction: column !important; gap: 8px !important; }
  .btn-group button, .action-buttons button { width: 100% !important; }
}


/* ================================================================
   2. 📚 学习�?@ �?80px
   ================================================================ */
@media (max-width: 480px) {
  #learning-page.active,
  body.no-top-header-page #learning-page.active {
    padding: 0 !important;
    margin: 0 !important;
    background: #f5f5f7 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #learning-page > div {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  /* 标题�?*/
  #learning-page > div > div:first-of-type {
    padding: 16px 16px 12px !important;
  }
  #learning-page h2 { font-size: 18px !important; }
  #learning-page > div > div:first-of-type p { font-size: 12px !important; }

  /* 场景卡片横向滚动 */
  #learning-scenarios {
    padding: 0 12px 12px !important;
    gap: 8px !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  #learning-scenarios::-webkit-scrollbar { display: none; }
  .learning-scenario-card {
    min-width: 72px !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
  }
  .learning-scenario-card:active { transform: scale(0.95); }
  .learning-scenario-card > div:first-child { font-size: 22px !important; }
  .learning-scenario-card > div:last-child { font-size: 12px !important; }

  /* 智能体网�?*/
  #learning-agents-scroll {
    padding: 0 12px 80px !important;
    overflow-y: auto !important;
    flex: 1 !important;
  }
  #learning-agents-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* 空状�?*/
  #learning-agents-empty {
    padding: 48px 16px !important;
  }
  #learning-agents-empty > div:first-child { font-size: 36px !important; }
  #learning-agents-empty p { font-size: 14px !important; }

  /* 加载状�?*/
  #learning-agents-loading {
    padding: 40px !important;
    font-size: 14px !important;
  }
}


/* ================================================================
   3. 🏛�?记忆（资产）�?@ �?80px
   ================================================================ */
@media (max-width: 480px) {

  /* ---- 侧栏隐藏 ---- */
  #assets-page .sidebar { display: none !important; }

  /* ---- 主容器全宽全�?---- */
  #assets-page .main-container { flex-direction: column !important; height: 100% !important; }
  #file-grid-container { width: 100% !important; flex: 1 !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; }

  /* ---- 工具栏：强制横排（覆盖 styles.css ≤768 的 column） ---- */
  .file-grid-toolbar {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    align-items: center !important; justify-content: space-between !important;
    padding: 6px 10px 6px 4px !important; gap: 4px !important;
    background: #fff !important; border-bottom: 0.5px solid #e5e5e5 !important;
    flex-shrink: 0 !important; overflow: hidden !important;
    min-height: 44px !important; height: 44px !important; box-sizing: border-box !important;
  }

  /* 面包�?�?单行可横向滚�?*/
  .file-breadcrumb {
    flex: 1 1 auto !important; min-width: 0 !important; width: auto !important;
    flex-wrap: nowrap !important; overflow-x: auto !important;
    padding: 0 4px !important; font-size: 15px !important; gap: 2px !important;
    -webkit-overflow-scrolling: touch;
  }
  .file-breadcrumb::-webkit-scrollbar { display: none; }
  .breadcrumb-btn {
    padding: 6px 8px !important; font-size: 15px !important;
    white-space: nowrap !important; flex-shrink: 0 !important;
    border-radius: 4px !important;
  }

  /* 工具栏右侧图标按�?*/
  #h5-assets-toolbar-actions {
    display: flex !important; flex-direction: row !important; align-items: center !important;
    gap: 2px !important; margin-left: 4px !important; flex: 0 0 auto !important;
  }
  #mobile-search-toggle,
  #mobile-view-toggle {
    width: 40px !important; height: 40px !important;
    padding: 0 !important; min-width: 40px !important; min-height: 40px !important;
    border-radius: 6px !important; border: none !important;
    background: transparent !important; color: #191919 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer !important; flex-shrink: 0 !important;
  }

  /* 隐藏桌面工具栏中的冗余按�?*/
  .toolbar-action-buttons { display: none !important; }
  .view-size-btns { display: none !important; }
  #flat-view-hint { display: none !important; }

  /* ---- 搜索�?�?默认隐藏，点击放大镜展开 ---- */
  #mobile-search-bar {
    display: none;
    padding: 8px 10px !important; gap: 6px !important;
    background: #fff !important; border-bottom: 1px solid #f0f0f0 !important;
    flex-shrink: 0 !important; flex-wrap: wrap !important;
  }
  #mobile-search-bar.show { display: flex !important; }
  #mobile-search-bar input {
    flex: 1 !important; min-width: 0 !important;
    padding: 8px 12px !important; border: 1px solid #e5e5e5 !important;
    border-radius: 8px !important; font-size: 14px !important;
    background: #f9f9f9 !important;
  }
  #mobile-search-bar select {
    padding: 6px 8px !important; font-size: 12px !important;
    border: 1px solid #e5e5e5 !important; border-radius: 8px !important;
    background: #f9f9f9 !important;
  }

  /* ---- 文件卡片网格 ---- */
  .file-grid-content {
    flex: 1 !important; overflow-y: auto !important; overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    background: #f5f5f7 !important;
  }

  .file-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important; padding: 8px !important;
  }
  .file-grid.size-large {
    grid-template-columns: 1fr !important; gap: 8px !important; padding: 8px !important;
  }
  .file-grid.size-small {
    grid-template-columns: 1fr 1fr !important; gap: 6px !important; padding: 6px !important;
  }

  /* ---- 文件卡片 �?类iOS照片App风格 ---- */
  .file-card {
    border-radius: 10px !important; overflow: hidden !important;
    background: #fff !important; box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    transition: transform 0.15s !important;
    aspect-ratio: 1 !important;
    width: 100% !important; max-width: 100% !important;
  }
  .file-card:active { transform: scale(0.97); }
  .file-card.selected {
    box-shadow: 0 0 0 3px var(--mc-primary, #6366f1) !important;
    transform: scale(0.97);
  }

  /* 缩略图区 �?占卡片主�?*/
  .file-card-thumb {
    border-radius: 0 !important;
    aspect-ratio: 1 !important;
  }
  .file-card-thumb img, .file-card-thumb video {
    width: 100% !important; height: 100% !important; object-fit: cover !important;
  }

  /* 文件�?�?单行省略 */
  .file-card-name {
    padding: 6px 8px !important;
    font-size: 12px !important; color: #333 !important;
    white-space: nowrap !important; overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: #fff !important;
  }

  /* 更多菜单按钮 �?缩小到右上角 */
  .file-card-more {
    width: 28px !important; height: 28px !important;
    padding: 0 !important; font-size: 16px !important;
    background: rgba(0,0,0,0.35) !important; color: #fff !important;
    border-radius: 50% !important; border: none !important;
    right: 6px !important; top: 6px !important;
  }

  /* 文件夹卡�?*/
  .file-card.folder-card {
    aspect-ratio: 1 !important;
  }
  .file-card.folder-card .file-card-thumb {
    display: flex !important; align-items: center !important; justify-content: center !important;
  }
  .file-card.folder-card .file-card-thumb span[style*="font-size: 48px"] {
    font-size: 40px !important;
  }

  /* ---- 浮动上传按钮 (FAB)：有文件时显示；空态/多选时 .is-hidden ---- */
  #mobile-upload-fab {
    position: fixed !important; bottom: 72px !important; right: 16px !important;
    width: 52px !important; height: 52px !important;
    border-radius: 50% !important;
    background: var(--mc-gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6)) !important;
    color: #fff !important; font-size: 28px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4) !important;
    z-index: 48 !important; cursor: pointer !important;
    border: none !important; transition: transform 0.2s, box-shadow 0.2s !important;
    -webkit-tap-highlight-color: transparent;
  }
  #mobile-upload-fab.is-hidden {
    display: none !important;
  }
  #mobile-upload-fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3) !important;
  }

  /* ---- 选中模式底栏（须高于 FAB，避免被挡住） ---- */
  #mobile-selection-bar {
    display: none;
    position: fixed !important; bottom: 56px !important; left: 0 !important; right: 0 !important;
    height: 48px !important; background: #fff !important;
    border-top: 1px solid #e5e5e5 !important;
    align-items: center !important; justify-content: space-between !important;
    padding: 0 16px !important; z-index: 55 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06) !important;
  }
  #mobile-selection-bar.show { display: flex !important; }
  #mobile-selection-bar .sel-count {
    font-size: 14px !important; font-weight: 600 !important; color: var(--mc-primary, #6366f1) !important;
  }
  #mobile-selection-bar button {
    padding: 6px 14px !important; font-size: 13px !important;
    border-radius: 6px !important; border: none !important;
    min-height: 36px !important;
  }

  /* ---- 3D查看器全�?---- */
  .viewer-container {
    position: fixed !important; top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
    z-index: 100 !important;
  }
  .viewer-topbar { padding: 8px 12px !important; }
  .viewer-back-btn { width: 40px !important; height: 40px !important; }
  .viewer-toolbar { padding: 8px 4px !important; }
  .toolbar-btn { padding: 4px 2px !important; min-width: 36px !important; }
  .toolbar-btn span { font-size: 9px !important; }
  .toolbar-btn svg { width: 20px !important; height: 20px !important; }
  /* H5 查看器：隐藏"上一个/下一个"箭头，手机用滑动手势切图 */
  [data-mv-wechat-h5] .toolbar-btn[onclick="navigateToPrevFile()"],
  [data-mv-wechat-h5] .toolbar-btn[onclick="navigateToNextFile()"] {
    display: none !important;
  }

  /* ---- 空�?---- */
  #assets-page .empty-state {
    text-align: center !important; padding: 40px 20px !important;
  }
  #assets-page .empty-state h3 { font-size: 18px !important; }
}


/* ================================================================
   4. 💬 聊天�?@ �?80px
   ================================================================ */
@media (max-width: 480px) {

  #friends-page .friends-inner { padding: 10px 0 !important; max-width: 100% !important; overflow: visible !important; }

  /* 内容滚动�?*/
  #friends-content-scroll { overflow-y: auto !important; overflow-x: hidden !important; -webkit-overflow-scrolling: touch; }

  /* Tab 切换�?*/
  #friends-tab-bar { margin-bottom: 8px !important; padding: 0 12px !important; }
  .friends-subtab { font-size: 15px !important; padding: 10px 0 !important; font-weight: 400 !important; }

  /* 会话列表头部 */
  #chat-list-header, #contacts-header { padding: 0 12px !important; margin-bottom: 8px !important; }
  #chat-list-header h2, #contacts-header h2 { font-size: 15px !important; font-weight: 500 !important; }
  .friends-inner-btns { gap: 6px !important; }
  .friends-inner-btns button { padding: 5px 10px !important; font-size: 12px !important; border-radius: 4px !important; }

  /* 会话列表 */
  #chat-session-list { border-radius: 0 !important; box-shadow: none !important; }
  #chat-session-list-items > div { padding: 10px 12px !important; }

  /* 通讯�?*/
  .contacts-quick-row { padding: 11px 16px !important; }
  .contacts-quick-row span { font-size: 16px !important; }

  /* 待处理请求、群聊、亲友列�?*/
  #pending-requests-section, #agent-friends-section { padding: 0 12px !important; }

  /* 聊天窗口 �?全屏覆盖 */
  #friends-chat-window {
    position: fixed !important; top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; max-width: 100% !important;
    z-index: 200 !important; border-radius: 0 !important;
  }
}


/* ================================================================
   5. 👤 我的�?@ �?80px
   ================================================================ */
@media (max-width: 480px) {

  /* 头部 �?紧凑、防溢出 */
  #profile-page { max-width: 100% !important; overflow-x: hidden !important; }
  #profile-page .profile-page-body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #profile-page .profile-page-header {
    padding: 8px 12px !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
  #profile-header { padding: 0 !important; gap: 8px !important; }
  #profile-page-avatar { width: 36px !important; height: 36px !important; flex-shrink: 0 !important; }
  /* H5 用户信息�?*/
  #h5-profile-info-card { margin: 8px 14px 0 !important; border-radius: 12px !important; }
  #h5-profile-info-content { font-size: 14px !important; }
  #profile-page-name { font-size: 16px !important; }
  #profile-page-stats { flex-wrap: wrap !important; gap: 3px !important; }
  #profile-page-stats > * { font-size: 11px !important; padding: 2px 6px !important; }

  /* 主题行：仅限制本行，勿用 [class*="mc-theme"] 以免误伤 */
  .profile-menu-item.mc-theme-row {
    max-height: none !important;
    overflow: visible !important;
  }
  .mc-theme-segment { max-width: 100% !important; flex-wrap: wrap !important; }

  /* 菜单项紧凑 */
  .profile-menu-item {
    padding: 10px 14px !important;
    min-height: 44px !important;
  }
  .profile-menu-item span:first-of-type { font-size: 14px !important; }

  /* 菜单说明文字 �?内联不换�?*/
  .profile-menu-item > div:first-child > div {
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .profile-menu-item span[style*="font-size: 11px"] {
    font-size: 11px !important;
  }

  /* H5 信息�?�?更紧�?*/
  #h5-profile-info-card {
    margin: 4px 12px 0 !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
  }
  #h5-profile-info-content {
    font-size: 13px !important;
  }
  #h5-profile-info-content > div {
    padding: 3px 0 !important;
  }


  /* ===== H5 首页适配 ===== */
  [data-mv-wechat-h5] #home-page {
    -webkit-overflow-scrolling: touch !important;
  }
  /* hero 区域 �?极简，直接隐�?*/
  [data-mv-wechat-h5] .home-hero-section {
    padding: 16px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 12px !important;
  }
  [data-mv-wechat-h5] .home-hero-section h1 {
    font-size: 18px !important;
    margin-bottom: 6px !important;
  }
  [data-mv-wechat-h5] .home-hero-section p {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }
  [data-mv-wechat-h5] .home-quick-steps {
    flex-direction: row !important;
    gap: 6px !important;
    font-size: 12px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* 新手引导条 H5 精简 */
  /* 卡片区标...不需...*/
  [data-mv-wechat-h5] #home-page section h2 {
    display: none !important;
  }
  /* 标题栏精简 �?只要记忆立方 + 用户�?*/
  [data-mv-wechat-h5] .header .status-indicator,
  [data-mv-wechat-h5] .header .health-indicator,
  [data-mv-wechat-h5] .header .refresh-btn,
  [data-mv-wechat-h5] .header #home-user-status-bar {
    display: none !important;
  }
  [data-mv-wechat-h5] .header h1 {
    font-size: 16px !important;
    margin-left: 4px !important;
  }
  [data-mv-wechat-h5] .header {
    padding: 0 8px !important;
    height: 44px !important;
    justify-content: space-between !important;
  }
  /* 首页页面高度 �?占满�?header */
  [data-mv-wechat-h5] #home-page.active {
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
  }
  /* 首页内边�?*/
  [data-mv-wechat-h5] #home-page > div {
    padding: 12px !important;
  }
  /* 4 卡片改单�?*/
  [data-mv-wechat-h5] #home-page section > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  /* 主卡�?�?紧凑（与 §19 大封面规则一致，此处仅作窄屏兜底） */
  [data-mv-wechat-h5] .home-card-primary,
  [data-mv-wechat-h5] .home-card-secondary {
    padding: 0 !important;
    height: 176px !important;
    min-height: 176px !important;
    max-height: 176px !important;
    border-radius: 12px !important;
  }
  [data-mv-wechat-h5] .home-card-primary h3,
  [data-mv-wechat-h5] .home-card-secondary h3 {
    font-size: 16px !important;
    margin-bottom: 4px !important;
    font-weight: 600 !important;
  }
  [data-mv-wechat-h5] .home-card-primary p,
  [data-mv-wechat-h5] .home-card-secondary p {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }
  [data-mv-wechat-h5] .home-card-primary button,
  [data-mv-wechat-h5] .home-card-secondary button {
    font-size: 14px !important;
    padding: 9px 12px !important;
    min-height: 36px !important;
  }
  /* 按住卡片 hover �?无（移动端无效） */
  [data-mv-wechat-h5] #home-page [onmouseover],
  [data-mv-wechat-h5] #home-page [onmouseout] {
    transform: none !important;
    box-shadow: inherit !important;
  }
  /* 首次引导弹窗 �?H5 适配 */
  [data-mv-wechat-h5] #home-first-visit-guide > div {
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    padding: 20px !important;
  }
  [data-mv-wechat-h5] #home-first-visit-guide h3 {
    font-size: 20px !important;
  }
  [data-mv-wechat-h5] #home-first-visit-guide button {
    min-height: 44px !important;
    font-size: 15px !important;
    touch-action: manipulation !important;
  }

}


/* ================================================================
   6. 平板/小屏补充 @ �?68px
   ================================================================ */
@media (max-width: 768px) {
  .form-group input, .form-group select, .form-group textarea { width: 100%; box-sizing: border-box; }
  .btn-group, .action-buttons { flex-direction: column; gap: 8px; }
  .btn-group button, .action-buttons button { width: 100%; }
  .file-grid, .template-grid, .asset-grid { grid-template-columns: 1fr !important; gap: 12px !important; padding: 12px !important; }
  .welcome-page { padding: 12px 14px 14px !important; }
  .welcome-hero { padding: 16px 18px !important; border-radius: 14px !important; }
  .welcome-hero-title { font-size: 22px !important; }
  .welcome-hero-subtitle { font-size: 14px !important; }
  .welcome-cta-group { flex-direction: column !important; gap: 8px !important; margin-top: 16px !important; }
  .welcome-cta-group button, .welcome-cta-group .btn { width: 100% !important; min-height: 48px !important; }
  .welcome-features-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .welcome-feature-card { padding: 12px 14px !important; }
  .header { padding: 8px 14px !important; height: 50px !important; }
  .header h1 { font-size: 18px !important; }
  .page-container { height: calc(100vh - 50px - 56px) !important; height: calc(100dvh - 50px - 56px) !important; }
  #assets-page .sidebar { display: none !important; }
  #file-grid-container { width: 100% !important; }
}


/* ================================================================
   7. 小屏 @ �?75px
   ================================================================ */
@media (max-width: 375px) {
  .header { height: 44px !important; padding: 6px 10px !important; }
  .header h1 { font-size: 16px !important; }
  .bottom-tabbar { height: 50px !important; height: calc(50px + env(safe-area-inset-bottom, 0px)) !important; height: calc(50px + constant(safe-area-inset-bottom, 0px)) !important; }
  .tab-item-icon { width: 20px !important; height: 20px !important; }
  .tab-item-label { font-size: 9px !important; }
  .page-container { height: calc(100vh - 44px - 50px) !important; height: calc(100dvh - 44px - 50px) !important; }
  .modal-content { padding: 16px 12px 20px !important; }
  .modal-header h2 { font-size: 16px !important; }
  #learning-scenarios { gap: 6px !important; padding: 0 8px 10px !important; }
  .learning-scenario-card { min-width: 64px !important; padding: 8px 10px !important; }
  .learning-scenario-card > div:first-child { font-size: 20px !important; }
  .learning-scenario-card > div:last-child { font-size: 11px !important; }
  #learning-page > div > div:first-of-type { padding: 12px 12px 8px !important; }
  #learning-page h2 { font-size: 16px !important; }
  #learning-agents-scroll { padding: 0 8px 72px !important; }
  .ai-creation-action-btn { padding: 6px 4px !important; font-size: 11px !important; }
  .ai-creation-action-btn svg { width: 12px !important; height: 12px !important; }
}


/* ================================================================
   8. 微信 H5 特殊适配
   ================================================================ */
html[data-mv-wechat-h5="1"] .header {
  /* WeChat 自带状态栏处理，不需要额外 safe-area-inset-top */
  height: 48px !important;
}
html[data-mv-wechat-h5="1"] .page-container {
  padding-bottom: constant(safe-area-inset-bottom, 0px) !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
html[data-mv-wechat-h5="1"] .bottom-tabbar {
  padding-bottom: constant(safe-area-inset-bottom, 0px) !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
html[data-mv-wechat-h5="1"] .desktop-only { display: none !important; }
html[data-mv-wechat-h5="1"] .h5-only { display: block !important; }
html[data-mv-wechat-h5="1"] #ai-creation-input-area {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}


/* ================================================================
   9. 通用增强（不限断点）
   ================================================================ */

/* 深色主题 */
:root[data-theme="pro"] .bottom-tabbar { border-top-color: rgba(255,255,255,0.08); }

/* 4 Tab 等分 */
.bottom-tabbar .tab-item { flex: 1; }

/* 过渡动画 */
.tab-item { transition: color 0.15s, background 0.15s; }
/* ================================================================
   H5 聊天输入栏 — 微信风格
   布局：语音 | 输入框(flex:1) | 表情 | (+ 或 发送，互斥)
   ================================================================ */

[data-mv-wechat-h5] #chat-form {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 6px 8px !important;
  padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
  background: #f7f7f7 !important;
  border-top: 0.5px solid #d9d9d9 !important;
  position: relative !important;
  align-items: flex-end !important;
  min-height: 49px !important;
  box-sizing: border-box !important;
}
/* 左右图标：紧凑触控区，不抢输入宽度 */
[data-mv-wechat-h5] #chat-voice-btn,
[data-mv-wechat-h5] #chat-more-attach-btn,
[data-mv-wechat-h5] #emoji-button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1a1a1a !important;
  -webkit-tap-highlight-color: transparent;
}
[data-mv-wechat-h5] #chat-more-attach-btn {
  font-size: 28px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  color: #1a1a1a !important;
}
[data-mv-wechat-h5] #chat-voice-btn svg {
  width: 24px !important;
  height: 24px !important;
}
/* 隐藏桌面资产按钮；礼物不放输入框内（改由「+」面板） */
[data-mv-wechat-h5] #chat-form > button[onclick*="openAssetSelector"],
[data-mv-wechat-h5] #chat-gift-btn {
  display: none !important;
  pointer-events: none !important;
}
/* 输入框容器占满中间剩余宽度 */
[data-mv-wechat-h5] #chat-form > div[style*="position: relative"],
[data-mv-wechat-h5] #chat-form > div[style*="flex: 1"] {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
/* 输入框：白底圆角，尽量宽 */
[data-mv-wechat-h5] #chat-message-input {
  width: 100% !important;
  padding: 8px 10px !important;
  font-size: 16px !important;
  border-radius: 6px !important;
  min-height: 36px !important;
  max-height: 100px !important;
  border: none !important;
  background: #fff !important;
  line-height: 1.35 !important;
  color: #191919 !important;
  caret-color: #FF8C42 !important;
  outline: none !important;
  box-shadow: none !important;
  resize: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
[data-mv-wechat-h5] #chat-message-input::-webkit-resizer {
  display: none !important;
}
[data-mv-wechat-h5] #chat-message-input:focus {
  border: none !important;
  box-shadow: none !important;
  background: #fff !important;
}
/* 发送：默认不强制 display；由 JS 与 + 互斥切换 */
[data-mv-wechat-h5] #chat-send-btn {
  width: auto !important;
  min-width: 56px !important;
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  border-radius: 4px !important;
  border: none !important;
  background: #FF8C42 !important;
  color: #fff !important;
  box-shadow: none !important;
  line-height: 32px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}
/* 表情按钮 */
[data-mv-wechat-h5] #emoji-button {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  font-size: 24px !important;
  opacity: 1 !important;
}
/* H5：气泡内朗读按钮占宽，默认隐藏（长按/详情再播可后续加） */
[data-mv-wechat-h5] button[title="点击朗读"],
[data-mv-wechat-h5] .feedback-btn {
  display: none !important;
}
/* H5 表情+礼物面板（挂 body，需单独限宽） */
[data-mv-wechat-h5] #h5-emoji-gift-panel {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  z-index: 20000 !important;
}
[data-mv-wechat-h5] #h5-eg-content .h5-eg-emoji-grid {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  box-shadow: none !important;
  border: none !important;
  max-height: none !important;
  padding: 8px !important;
}
[data-mv-wechat-h5] #h5-eg-content .h5-eg-emoji-grid > div {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 2px !important;
  width: 100% !important;
}
[data-mv-wechat-h5] #h5-eg-content .h5-eg-emoji-grid .emoji-btn {
  width: 100% !important;
  min-width: 0 !important;
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  padding: 4px !important;
  box-sizing: border-box !important;
}

/* 表情面板：底部固定滑出 */
[data-mv-wechat-h5] #emoji-picker {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  max-width: 100vw !important;
  border-radius: 12px 12px 0 0 !important;
  max-height: 220px !important;
  padding: 12px !important;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: calc(12px + constant(safe-area-inset-bottom, 0px)) !important;
  z-index: 20000 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1) !important;
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] #emoji-picker > div {
  grid-template-columns: repeat(8, 1fr) !important;
  gap: 4px !important;
}
[data-mv-wechat-h5] #emoji-picker .emoji-btn {
  padding: 8px !important;
  font-size: 22px !important;
}
/* +面板 �?底部滑出，留�?Home 指示�?*/
[data-mv-wechat-h5] #chat-more-attach-panel {
  position: fixed !important;
  bottom: 48px !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  padding: 16px !important;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: calc(16px + constant(safe-area-inset-bottom, 0px)) !important;
  border-radius: 12px 12px 0 0 !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
  z-index: 20001 !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1) !important;
}
/* 聊天消息�?*/
[data-mv-wechat-h5] #chat-messages-container {
  padding: 10px 12px !important;
  -webkit-overflow-scrolling: touch !important;
}

/* H5 学习页高度（带顶栏时�?*/
@media (max-width: 480px) {
  body:not(.no-top-header-page) #learning-page {
    height: calc(100vh - 48px - 56px) !important;
    height: calc(100dvh - 48px - 56px) !important;
  }
}

/* ---- ?? ͨѶ¼΢�ŷ� @ ��480px ---- */
@media (max-width: 480px) {
  .wx-contact-row:active {
    background: #ececec !important;
  }
  #contacts-quick-list {
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
  }
  #wx-contacts-all {
    margin-top: 0 !important;
    border-radius: 0 !important;
  }
  /* ���ؾɵ��������� */
  #agent-friends-section,
  #pending-requests-section,
  #friends-groups-list-container > div[id$="-loading"],
  #agent-friends-list-container > .loading {
    display: none !important;
  }
}
/* ---- ?? ������Ϣ΢�ŷ� @ ��480px ---- */
@media (max-width: 480px) {
  [data-mv-wechat-h5] #chat-messages-container {
    background: #ededed !important;
    padding: 8px 12px !important;
  }
  /* 聊天弹窗钉死窗口四边 + 锁 body 滚动（X5 地址栏不影响 inset） */
  [data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
  }
  [data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen .chat-modal-content-fullscreen {
    height: 100% !important;
  }
  [data-mv-wechat-h5] #chat-modal-header {
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    padding-top: calc(12px + constant(safe-area-inset-top, 0px)) !important;
    gap: 6px !important;
    min-width: 0 !important;
  }
  /* 微信风底部输入栏（勿强制 #chat-send-btn 的 display，由 JS 与 + 互斥） */
  [data-mv-wechat-h5] #chat-form {
    background: #f7f7f7 !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 6px !important;
    align-items: flex-end !important;
    border-top: 0.5px solid #d9d9d9 !important;
    position: relative !important;
    z-index: 10 !important;
  }
  [data-mv-wechat-h5] #chat-form > div[style*="position: relative"] {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  [data-mv-wechat-h5] #chat-message-input {
    border: none !important;
    border-radius: 6px !important;
    background: #fff !important;
    padding: 8px 10px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    min-height: 36px !important;
    max-height: 100px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
    box-shadow: none !important;
    resize: none !important;
    overflow-y: auto !important;
  }
  [data-mv-wechat-h5] #chat-voice-btn,
  [data-mv-wechat-h5] #chat-more-attach-btn,
  [data-mv-wechat-h5] #emoji-button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 4px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
  }
  [data-mv-wechat-h5] #chat-send-btn {
    background: #FF8C42 !important;
    color: #fff !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 0 12px !important;
    width: auto !important;
    min-width: 56px !important;
    height: 32px !important;
    line-height: 32px !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
  }
  [data-mv-wechat-h5] #chat-more-attach-btn {
    font-size: 28px !important;
    font-weight: 300 !important;
    color: #1a1a1a !important;
  }
  [data-mv-wechat-h5] #emoji-button {
    opacity: 1 !important;
    font-size: 24px !important;
  }
  /* 表情面板适配 */
  [data-mv-wechat-h5] #emoji-picker {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    bottom: 100% !important;
    border-radius: 0 !important;
  }
  /* 加号面板适配 */
  [data-mv-wechat-h5] #chat-more-attach-panel {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    bottom: 100% !important;
    border-radius: 0 !important;
    grid-template-columns: repeat(4, 1fr) !important;
  }
  /* 广场详情 — H5 隐藏左右箭头和圆点（直接滑动即可） */
  [data-mv-wechat-h5] #plaza-detail-media-prev,
  [data-mv-wechat-h5] #plaza-detail-media-next,
  [data-mv-wechat-h5] #plaza-detail-media-dots,
  [data-mv-wechat-h5] #partner-album-viewer-prev,
  [data-mv-wechat-h5] #partner-album-viewer-next {
    display: none !important;
  }
  [data-mv-wechat-h5] .wx-msg-sent {
    background: #95ec69 !important;
    color: #000 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    transform: none !important;
  }
  [data-mv-wechat-h5] .wx-msg-sent:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  /* ΢�Ű����ݣ��Է����ģ� */
  [data-mv-wechat-h5] .wx-msg-recv {
    background: #fff !important;
    color: #000 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    transform: none !important;
  }
  [data-mv-wechat-h5] .wx-msg-recv:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  /* 隐藏非微信风元素：朗读按钮在时间行内，非 chat-msg-text 相邻 */
  [data-mv-wechat-h5] .chat-msg-text + button[onclick*="playTTS"],
  [data-mv-wechat-h5] button[title="点击朗读"],
  [data-mv-wechat-h5] .feedback-btn {
    display: none !important;
  }
  /* 消息区更疏一点，气泡不撑满 */
  [data-mv-wechat-h5] [data-message-id] {
    margin-bottom: 10px !important;
  }
  [data-mv-wechat-h5] .wx-msg-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px !important;
  }
  [data-mv-wechat-h5] .wx-msg-sent,
  [data-mv-wechat-h5] .wx-msg-recv {
    max-width: min(70%, 260px) !important;
    padding: 10px 12px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
}
/* ---- 礼物面板微信风 @ ≤480px ---- */
@media (max-width: 480px) {
  [data-mv-wechat-h5] #h5-eg-gift-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    padding: 8px !important;
  }
  [data-mv-wechat-h5] #h5-eg-gift-grid .chat-gift-item {
    min-height: 72px !important;
  }
  [data-mv-wechat-h5] #h5-eg-gift-tabs button {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  /* footer ��ȫ�� */
  [data-mv-wechat-h5] #h5-eg-footer {
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ===== 个人资料弹窗 H5 适配 ===== */
  [data-mv-wechat-h5] .profile-modal { align-items: flex-start !important; }
  [data-mv-wechat-h5] .profile-modal-content {
    margin: 0 !important; max-width: 100% !important; width: 100% !important;
    border-radius: 0 !important; min-height: 100dvh !important;
  }
  [data-mv-wechat-h5] .profile-modal-content .modal-fixed-header-top {
    background: #f5f5f5 !important; padding: 12px 16px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    position: sticky !important; top: 0 !important; z-index: 10 !important;
  }
  [data-mv-wechat-h5] .profile-modal-content .modal-fixed-header-top h2 {
    font-size: 16px !important; font-weight: 600 !important; color: #333 !important;
  }
  [data-mv-wechat-h5] .profile-modal-content .close-modal { font-size: 24px !important; color: #999 !important; }
  [data-mv-wechat-h5] .profile-modal-body { padding: 0 !important; }
  [data-mv-wechat-h5] .profile-avatar-block { padding: 20px 0 16px !important; background: #fafafa !important; }
  [data-mv-wechat-h5] .profile-avatar-wrap { width: 64px !important; height: 64px !important; border-radius: 8px !important; }
  [data-mv-wechat-h5] .profile-avatar-img { width: 64px !important; height: 64px !important; border-radius: 8px !important; }
  [data-mv-wechat-h5] .profile-avatar-placeholder { font-size: 28px !important; }
  [data-mv-wechat-h5] .profile-avatar-change { font-size: 11px !important; padding: 2px 8px !important; border-radius: 10px !important; }
  [data-mv-wechat-h5] .profile-section { padding: 0 16px !important; margin-top: 0 !important; }
  [data-mv-wechat-h5] .profile-section-title {
    font-size: 13px !important; color: #999 !important; padding: 14px 0 6px !important;
    margin: 0 !important; border-bottom: none !important;
  }
  [data-mv-wechat-h5] .profile-form-group {
    margin-bottom: 0 !important; padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    display: flex !important; align-items: center !important; gap: 12px !important;
  }
  [data-mv-wechat-h5] .profile-form-group label {
    font-size: 14px !important; color: #333 !important; flex-shrink: 0 !important;
    width: 72px !important; margin-bottom: 0 !important; text-align: right !important;
  }
  [data-mv-wechat-h5] .profile-form-group input,
  [data-mv-wechat-h5] .profile-form-group textarea {
    font-size: 14px !important; border: none !important; padding: 0 !important;
    background: transparent !important; flex: 1 !important;
    outline: none !important; border-radius: 0 !important;
  }
  [data-mv-wechat-h5] .profile-bio-group { align-items: flex-start !important; padding: 10px 0 14px !important; }
  [data-mv-wechat-h5] .profile-bio-group textarea { min-height: 36px !important; resize: none !important; }
  [data-mv-wechat-h5] .profile-char-count { display: none !important; }
  [data-mv-wechat-h5] .profile-phone-row { display: flex !important; align-items: center !important; flex: 1 !important; gap: 8px !important; }
  [data-mv-wechat-h5] .profile-phone-readonly { color: #999 !important; flex: 1 !important; }
  [data-mv-wechat-h5] .profile-btn-secondary {
    font-size: 12px !important; padding: 4px 10px !important; border-radius: 4px !important;
    background: #f5f5f5 !important; color: #07c160 !important;
    border: 1px solid #07c160 !important; flex-shrink: 0 !important;
  }
  [data-mv-wechat-h5] .profile-extra-rows { margin: 0 -16px !important; }
  [data-mv-wechat-h5] .profile-row {
    display: flex !important; align-items: center !important; padding: 12px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important; cursor: pointer !important; background: #fff !important;
  }
  [data-mv-wechat-h5] .profile-row:hover { background: #f5f5f5 !important; }
  [data-mv-wechat-h5] .profile-row-label { font-size: 14px !important; color: #333 !important; flex-shrink: 0 !important; }
  [data-mv-wechat-h5] .profile-row-value {
    flex: 1 !important; text-align: right !important; font-size: 13px !important;
    color: #999 !important; margin-right: 6px !important;
  }
  [data-mv-wechat-h5] .profile-row-arrow { color: #c7c7cc !important; font-size: 16px !important; }
  [data-mv-wechat-h5] .profile-modal-body form { padding-bottom: 80px !important; }
  [data-mv-wechat-h5] .profile-modal-body form > button[type="submit"] {
    position: fixed !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    left: 16px !important; right: 16px !important;
    background: #FF8C42 !important; color: white !important;
    border: none !important; border-radius: 8px !important;
    padding: 12px !important; font-size: 16px !important; font-weight: 600 !important;
    z-index: 100 !important; width: calc(100% - 32px) !important;
  }
}

/* ===== H5 弹窗内容适配 ===== */
[data-mv-wechat-h5] [onmouseover],
[data-mv-wechat-h5] [onmouseout] {
  transform: none !important;
  box-shadow: none !important;
}
[data-mv-wechat-h5] #ai-creation-templates-grid {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}
[data-mv-wechat-h5] #ai-creation-detail-img,
[data-mv-wechat-h5] #ai-creation-quick-result-img {
  max-width: 100% !important;
  max-height: 240px !important;
}
[data-mv-wechat-h5] #asset-selector-modal .asset-grid,
[data-mv-wechat-h5] #single-image-asset-selector-modal .asset-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
}
[data-mv-wechat-h5] .img-zoom-overlay img {
  max-width: 95vw !important;
  max-height: 85vh !important;
}

/* ================================================================
   9b. H5「我的」页：头/身分离滚动 + 底栏留白（宽屏手机壳也生效）
   ================================================================ */
[data-mv-wechat-h5] #profile-page.active {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  height: calc(100vh - 56px) !important;
  height: calc(100dvh - 56px) !important;
}
[data-mv-wechat-h5] #profile-page .profile-page-header {
  flex-shrink: 0 !important;
  overflow: visible !important;
  padding: 8px 12px !important;
}
[data-mv-wechat-h5] #profile-page .profile-page-body {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}
[data-mv-wechat-h5] #profile-menu {
  background: #fff !important;
}
[data-mv-wechat-h5] #profile-page .profile-menu-item.mc-theme-row {
  max-height: none !important;
  overflow: visible !important;
  flex-wrap: wrap !important;
}
[data-mv-wechat-h5] #profile-page .mc-theme-segment {
  max-width: 100% !important;
  width: 100% !important;
}

/* ================================================================
   10. H5 记忆页标题栏（不依赖视口宽度，电脑宽屏预览也一致）
   ================================================================ */
[data-mv-wechat-h5] #assets-page .sidebar {
  display: none !important;
}
[data-mv-wechat-h5] #assets-page .main-container {
  flex-direction: column !important;
  height: 100% !important;
  width: 100% !important;
}
[data-mv-wechat-h5] #file-grid-container {
  width: 100% !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* 标题栏：左面包屑 + 右工具，强制横排（覆盖 styles.css ≤768 的 column） */
[data-mv-wechat-h5] #assets-page .file-grid-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 6px 10px 6px 4px !important;
  gap: 4px !important;
  background: #fff !important;
  border-bottom: 0.5px solid #e5e5e5 !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] #assets-page .file-breadcrumb {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  padding: 0 4px !important;
  margin: 0 !important;
  font-size: 16px !important;
  gap: 2px !important;
  -webkit-overflow-scrolling: touch;
  align-self: center !important;
}
[data-mv-wechat-h5] #assets-page .file-breadcrumb::-webkit-scrollbar {
  display: none;
}
[data-mv-wechat-h5] #assets-page .breadcrumb-btn {
  padding: 6px 8px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border-radius: 4px !important;
  border: none !important;
  background: transparent !important;
  color: #191919 !important;
}
[data-mv-wechat-h5] #assets-page .toolbar-action-buttons,
[data-mv-wechat-h5] #assets-page .file-search-filter,
[data-mv-wechat-h5] #assets-page .view-size-btns,
[data-mv-wechat-h5] #assets-page #flat-view-hint,
[data-mv-wechat-h5] #assets-page #toggle-viewer-btn {
  display: none !important;
}
[data-mv-wechat-h5] #h5-assets-toolbar-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  margin-left: 4px !important;
  flex: 0 0 auto !important;
  align-self: center !important;
}
[data-mv-wechat-h5] #mobile-search-toggle,
[data-mv-wechat-h5] #mobile-view-toggle {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  color: #191919 !important;
  font-size: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
[data-mv-wechat-h5] #mobile-search-toggle svg,
[data-mv-wechat-h5] #mobile-view-toggle svg {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
}
[data-mv-wechat-h5] #mobile-search-toggle.is-active,
[data-mv-wechat-h5] #mobile-view-toggle.is-active {
  background: #f2f2f2 !important;
  color: #07c160 !important;
}
[data-mv-wechat-h5] #mobile-search-bar {
  display: none;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  padding: 8px 12px !important;
  gap: 8px !important;
  background: #f7f7f7 !important;
  border-bottom: 0.5px solid #e5e5e5 !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] #mobile-search-bar.show {
  display: flex !important;
}
[data-mv-wechat-h5] #mobile-search-bar input {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 8px 12px !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 15px !important;
  background: #fff !important;
  color: #191919 !important;
}
[data-mv-wechat-h5] #mobile-search-bar select {
  flex-shrink: 0 !important;
  max-width: 96px !important;
  padding: 8px 6px !important;
  font-size: 13px !important;
  border: none !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #333 !important;
}
[data-mv-wechat-h5] #assets-page .file-grid-content {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  background: #f5f5f7 !important;
}
[data-mv-wechat-h5] #assets-page .file-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  padding: 8px !important;
}
[data-mv-wechat-h5] #mobile-upload-fab:not(.is-hidden) {
  display: flex !important;
}
[data-mv-wechat-h5] #mobile-upload-fab.is-hidden {
  display: none !important;
}
[data-mv-wechat-h5] #mobile-selection-bar {
  z-index: 55 !important;
}
/* H5 文件卡片：隐藏 ⋮ 按钮（长按出菜单替代） */
[data-mv-wechat-h5] .file-card-more {
  display: none !important;
}
/* H5 长按菜单：全宽底部弹出，替代桌面绝对定位 */
[data-mv-wechat-h5] .file-card-menu {
  position: fixed !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 16px 16px 0 0 !important;
  background: #fff !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15) !important;
  padding: 8px 0 !important;
  z-index: 10001 !important;
  transform: translateY(100%) !important;
  transition: transform 0.25s ease-out !important;
}
[data-mv-wechat-h5] .file-card-menu.active {
  transform: translateY(0) !important;
}
/* H5 菜单项：大触控区 */
[data-mv-wechat-h5] .file-card-menu-item {
  padding: 14px 20px !important;
  font-size: 16px !important;
  border-bottom: 1px solid #f0f0f0 !important;
}
[data-mv-wechat-h5] .file-card-menu-item:last-child {
  border-bottom: none !important;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
}
/* 长按菜单遮罩 */
[data-mv-wechat-h5] .file-card.menu-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 10000;
}

/* ================================================================
   11. 电脑宽屏：H5 手机预览壳（390px，便于改手机问题）
   ================================================================ */
#mv-h5-shell-hint {
  display: none;
}

@media (min-width: 481px) {
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"],
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] body {
    background: #1c1c1e !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #mv-h5-shell-hint {
    display: block;
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    pointer-events: none;
    letter-spacing: 0.02em;
  }
  /* 含未登录欢迎页：#welcome-page 不是 .page-container，原先未进 390 壳 */
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .header,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .page-container,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .bottom-tabbar,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #welcome-page,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .welcome-page {
    width: 390px !important;
    max-width: 390px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #welcome-page,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .welcome-page {
    background: #f7f7f7 !important;
    /* 固定视口高度 + 内部滚动，才能用鼠标滚轮（body 本身 overflow:hidden） */
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 14px 24px !important;
    border-radius: 0 !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
  /* 登录后各 Tab：宽屏预览壳内也要能滚轮滚动 */
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .page-container.active {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #welcome-page > *,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .welcome-page > * {
    max-width: 100% !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .welcome-features-grid {
    grid-template-columns: 1fr !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .header {
    position: relative !important;
    left: auto !important;
    right: auto !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .bottom-tabbar {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 390px !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .page-container.active {
    position: relative !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #mobile-upload-fab {
    right: calc(50% - 195px + 16px) !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #mobile-selection-bar {
    left: 50% !important;
    right: auto !important;
    width: 390px !important;
    transform: translateX(-50%) !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .modal {
    align-items: stretch !important;
    justify-content: flex-start !important;
    left: 50% !important;
    right: auto !important;
    width: 390px !important;
    max-width: 390px !important;
    transform: translateX(-50%) !important;
    height: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
  }
  /* 全屏聊天/相册/密友：禁止垂直居中，否则顶部留白 */
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-modal.chat-modal-fullscreen,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #partner-album-modal.partner-album-modal-fullscreen,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #close-friend-modal.close-friend-modal-fullscreen {
    align-items: stretch !important;
    justify-content: center !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #1c1c1e !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-modal.chat-modal-fullscreen .chat-modal-content-fullscreen,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-modal.chat-modal-fullscreen .modal-content {
    width: 390px !important;
    max-width: 390px !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-modal-header {
    /* 电脑预览无刘海，勿叠加 safe-area 造成额外顶白 */
    padding-top: 12px !important;
  }
  /* 390 壳内：功能子页白底满高满宽，勿再缩 24px 边距 */
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] .modal-content {
    max-width: 390px !important;
    width: 390px !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #profile-qrcode-modal .modal-content,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #profile-extra-edit-modal .modal-content,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #login-modal .modal-content {
    width: min(360px, calc(100% - 32px)) !important;
    max-width: 360px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 85% !important;
    border-radius: 16px !important;
  }
  /* 表情/礼物/+ 面板：与 390px 手机壳对齐，避免拉满整屏 */
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #h5-emoji-gift-panel,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #emoji-picker,
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-more-attach-panel {
    left: 50% !important;
    right: auto !important;
    width: 390px !important;
    max-width: 390px !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #h5-eg-backdrop {
    left: 50% !important;
    right: auto !important;
    width: 390px !important;
    max-width: 390px !important;
    transform: translateX(-50%) !important;
  }
  html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #chat-more-attach-panel {
    bottom: 48px !important;
  }
}
@media (max-width: 480px) {
  #mv-h5-shell-hint {
    display: none !important;
  }
}

/* ================================================================
   12. H5 我的智能体弹窗适配
   ================================================================ */
[data-mv-wechat-h5] #my-agent-studio-modal .modal-content {
  max-width: 100vw !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
[data-mv-wechat-h5] #my-agent-studio-modal .modal-content > div {
  padding: 12px !important;
}
[data-mv-wechat-h5] #my-agent-studio-form > div:first-of-type {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
[data-mv-wechat-h5] #my-agent-studio-avatar-preview {
  width: 80px !important;
  height: 80px !important;
  border-radius: 20px !important;
  margin: 0 auto !important;
}
[data-mv-wechat-h5] #my-agent-studio-quick-gen-btn,
[data-mv-wechat-h5] #my-agent-studio-avatar-preview + button {
  max-width: 200px !important;
  margin: 8px auto 0 !important;
}
[data-mv-wechat-h5] #my-agent-studio-form div[style*="grid-template-columns:1fr 1fr"] {
  grid-template-columns: 1fr !important;
}



/* ================================================================
   13. H5 AI创作页适配
   ================================================================ */
[data-mv-wechat-h5] #ai-creation-page > div:first-of-type {
  max-width: 100vw !important;
  height: 100% !important;
}
/* H5 / 窄屏：AI创作广场可操作 — 压缩底栏，腾出对话区 */
@media (max-width: 480px) {
  #ai-creation-page.active {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 48px - 56px) !important;
    max-height: calc(100dvh - 48px - 56px) !important;
    overflow: hidden !important;
  }
  body.no-top-header-page #ai-creation-page.active {
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
  }
  #ai-creation-page > div:first-of-type {
    height: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
  }
  #ai-creation-messages {
    flex: 1 1 auto !important;
    min-height: 120px !important;
    padding: 10px 12px !important;
  }
  #ai-creation-input-area {
    max-height: 38vh !important;
    padding: 8px 10px !important;
  }
  #ai-creation-action-toolbar {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #ai-creation-action-toolbar::-webkit-scrollbar { display: none; }
  #ai-creation-action-toolbar .ai-creation-action-btn {
    flex-shrink: 0 !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
    min-height: 36px !important;
  }
  #ai-creation-action-toolbar .ai-creation-secondary-btn {
    display: none !important;
  }
  #ai-creation-tools-row {
    display: none !important;
  }
  #ai-creation-chat-mode-hint {
    font-size: 11px !important;
    padding: 5px 8px !important;
    margin-bottom: 4px !important;
  }
  #ai-creation-form > div {
    padding: 8px 10px !important;
  }
  #ai-creation-send-btn {
    min-width: 64px !important;
    padding: 10px 14px !important;
  }
}
[data-mv-wechat-h5] #ai-creation-modal .ai-creation-modal-content {
  max-width: 100vw !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  border-radius: 0 !important;
  padding-top: 0 !important;
}
[data-mv-wechat-h5] #ai-creation-modal .ai-creation-modal-header {
  padding: 8px 12px !important;
  margin-bottom: 0 !important;
  border-bottom: 0.5px solid #eee !important;
}
[data-mv-wechat-h5] #ai-creation-modal .ai-creation-modal-header h2 {
  margin-bottom: 0 !important;
  font-size: 17px !important;
}
[data-mv-wechat-h5] #ai-creation-modal-subtitle {
  margin: 2px 0 0 0 !important;
  font-size: 12px !important;
}
[data-mv-wechat-h5] #ai-creation-modal-body {
  padding: 10px 12px 16px !important;
}
[data-mv-wechat-h5] #ai-creation-modal-footer {
  display: none !important;
}
/* 全屏/半屏子页：隐藏右上角 ×，统一用左上角回退 */
[data-mv-wechat-h5] #ai-creation-modal > .modal-content > .close-modal,
[data-mv-wechat-h5] #my-private-albums-modal > .modal-content > .close-modal,
[data-mv-wechat-h5] #partner-album-modal > .modal-content > .close-modal {
  display: none !important;
}
[data-mv-wechat-h5] .mv-subpage-back-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 8px !important;
  -webkit-tap-highlight-color: transparent;
}
[data-mv-wechat-h5] #ai-creation-templates-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  padding: 8px !important;
}
[data-mv-wechat-h5] #ai-creation-prompt-result-box {
  max-width: 100vw !important;
  width: calc(100vw - 32px) !important;
}
[data-mv-wechat-h5] .ai-creation-template-card {
  min-width: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}
/* H5 隐藏 AI 创作分类标签栏的左右箭头（手机横滑即可） */
[data-mv-wechat-h5] #ai-creation-tabs-left-arrow,
[data-mv-wechat-h5] #ai-creation-tabs-right-arrow {
  display: none !important;
}
[data-mv-wechat-h5] #ai-creation-prompt-tabs {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ================================================================
   14. H5 广场页适配
   ================================================================ */
[data-mv-wechat-h5] .plaza-inner {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #plaza-feed {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  padding: 10px !important;
}
[data-mv-wechat-h5] #plaza-post-sheet .modal-content,
[data-mv-wechat-h5] #plaza-post-sheet-content {
  max-width: 100vw !important;
  width: 100vw !important;
  border-radius: 0 !important;
}
[data-mv-wechat-h5] #plaza-compose-modal .modal-content {
  max-width: 100vw !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  border-radius: 0 !important;
}
[data-mv-wechat-h5] #plaza-search-wrap {
  max-width: 100vw !important;
  padding: 12px !important;
}
[data-mv-wechat-h5] #plaza-detail-modal .modal-content {
  max-width: 100vw !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  border-radius: 0 !important;
}
[data-mv-wechat-h5] #plaza-compose-media {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
[data-mv-wechat-h5] .plaza-header {
  padding: 8px 10px !important;
  gap: 6px !important;
}
[data-mv-wechat-h5] .plaza-tabs {
  gap: 14px !important;
}
[data-mv-wechat-h5] .plaza-tabs::-webkit-scrollbar {
  display: none !important;
}
[data-mv-wechat-h5] .plaza-tab {
  font-size: 15px !important;
}

/* ================================================================
   15. H5 学习页适配
   ================================================================ */
[data-mv-wechat-h5] #learning-page > div:first-of-type {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #learning-agents-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
[data-mv-wechat-h5] #learning-scenarios {
  padding: 0 12px 12px !important;
  gap: 8px !important;
}
/* 学习智能体列表：微信通讯录风格 */
[data-mv-wechat-h5] #learning-agents-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
}
[data-mv-wechat-h5] #learning-agents-grid > div {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: #fff !important;
  border-bottom: 1px solid #f0f0f0 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  position: relative !important;
}
[data-mv-wechat-h5] #learning-agents-grid > div:active {
  background: #ececec !important;
}
[data-mv-wechat-h5] #learning-agents-grid > div img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 8px !important;
}
/* 右侧箭头 */

[data-mv-wechat-h5] #learning-agents-grid > div::after {

  content: '';

  position: absolute;

  right: 16px;

  top: 50%;

  width: 8px;

  height: 8px;

  border-top: 2px solid #c7c7cc;

  border-right: 2px solid #c7c7cc;

  transform: translateY(-50%) rotate(45deg);

}

/* ================================================================
   16. H5 通用弹窗：功能子页一律满屏贴底（内容少也不留底空）
   ================================================================ */
[data-mv-wechat-h5] #share-modal,
[data-mv-wechat-h5] #add-friend-modal,
[data-mv-wechat-h5] #group-modal,
[data-mv-wechat-h5] #chat-search-modal,
[data-mv-wechat-h5] #profile-modal,
[data-mv-wechat-h5] #chat-background-modal,
[data-mv-wechat-h5] #chat-report-modal,
[data-mv-wechat-h5] #recycle-bin-modal,
[data-mv-wechat-h5] #template-selector-modal,
[data-mv-wechat-h5] #points-recharge-modal,
[data-mv-wechat-h5] #duplicate-file-modal,
[data-mv-wechat-h5] #single-image-model-modal,
[data-mv-wechat-h5] #multi-image-video-model-modal,
[data-mv-wechat-h5] #service-point-booking-modal,
[data-mv-wechat-h5] #thumbnail-crop-modal,
[data-mv-wechat-h5] #partner-album-modal,
[data-mv-wechat-h5] #my-private-albums-modal,
[data-mv-wechat-h5] #add-address-modal,
[data-mv-wechat-h5] #address-modal,
[data-mv-wechat-h5] #close-friend-modal,
[data-mv-wechat-h5] #phone-contacts-modal,
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal,
[data-mv-wechat-h5] #generate-figure-modal,
[data-mv-wechat-h5] #feedback-management-modal,
[data-mv-wechat-h5] #error-management-modal,
[data-mv-wechat-h5] #ai-creation-modal,
[data-mv-wechat-h5] #my-agent-studio-modal {
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  background: #fff !important;
  backdrop-filter: none !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  box-sizing: border-box !important;
}
/* JS 常写 display:block；满屏子页需 flex 才能贴顶贴底 */
[data-mv-wechat-h5] #share-modal[style*="display: block"],
[data-mv-wechat-h5] #share-modal[style*="display:block"],
[data-mv-wechat-h5] #add-friend-modal[style*="display: block"],
[data-mv-wechat-h5] #add-friend-modal[style*="display:block"],
[data-mv-wechat-h5] #group-modal[style*="display: block"],
[data-mv-wechat-h5] #group-modal[style*="display:block"],
[data-mv-wechat-h5] #chat-search-modal[style*="display: block"],
[data-mv-wechat-h5] #chat-search-modal[style*="display:block"],
[data-mv-wechat-h5] #profile-modal[style*="display: block"],
[data-mv-wechat-h5] #profile-modal[style*="display:block"],
[data-mv-wechat-h5] #chat-background-modal[style*="display: block"],
[data-mv-wechat-h5] #chat-background-modal[style*="display:block"],
[data-mv-wechat-h5] #chat-report-modal[style*="display: block"],
[data-mv-wechat-h5] #chat-report-modal[style*="display:block"],
[data-mv-wechat-h5] #recycle-bin-modal[style*="display: block"],
[data-mv-wechat-h5] #recycle-bin-modal[style*="display:block"],
[data-mv-wechat-h5] #template-selector-modal[style*="display: block"],
[data-mv-wechat-h5] #template-selector-modal[style*="display:block"],
[data-mv-wechat-h5] #points-recharge-modal[style*="display: block"],
[data-mv-wechat-h5] #points-recharge-modal[style*="display:block"],
[data-mv-wechat-h5] #duplicate-file-modal[style*="display: block"],
[data-mv-wechat-h5] #duplicate-file-modal[style*="display:block"],
[data-mv-wechat-h5] #single-image-model-modal[style*="display: block"],
[data-mv-wechat-h5] #single-image-model-modal[style*="display:block"],
[data-mv-wechat-h5] #multi-image-video-model-modal[style*="display: block"],
[data-mv-wechat-h5] #multi-image-video-model-modal[style*="display:block"],
[data-mv-wechat-h5] #service-point-booking-modal[style*="display: block"],
[data-mv-wechat-h5] #service-point-booking-modal[style*="display:block"],
[data-mv-wechat-h5] #thumbnail-crop-modal[style*="display: block"],
[data-mv-wechat-h5] #thumbnail-crop-modal[style*="display:block"],
[data-mv-wechat-h5] #add-address-modal[style*="display: block"],
[data-mv-wechat-h5] #add-address-modal[style*="display:block"],
[data-mv-wechat-h5] #address-modal[style*="display: block"],
[data-mv-wechat-h5] #address-modal[style*="display:block"],
[data-mv-wechat-h5] #phone-contacts-modal[style*="display: block"],
[data-mv-wechat-h5] #phone-contacts-modal[style*="display:block"],
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal[style*="display: block"],
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal[style*="display:block"],
[data-mv-wechat-h5] #generate-figure-modal[style*="display: block"],
[data-mv-wechat-h5] #generate-figure-modal[style*="display:block"],
[data-mv-wechat-h5] #feedback-management-modal[style*="display: block"],
[data-mv-wechat-h5] #feedback-management-modal[style*="display:block"],
[data-mv-wechat-h5] #error-management-modal[style*="display: block"],
[data-mv-wechat-h5] #error-management-modal[style*="display:block"],
[data-mv-wechat-h5] #ai-creation-modal[style*="display: block"],
[data-mv-wechat-h5] #ai-creation-modal[style*="display:block"],
[data-mv-wechat-h5] #my-agent-studio-modal[style*="display: block"],
[data-mv-wechat-h5] #my-agent-studio-modal[style*="display:block"],
[data-mv-wechat-h5] #share-modal[style*="display: flex"],
[data-mv-wechat-h5] #share-modal[style*="display:flex"],
[data-mv-wechat-h5] #add-friend-modal[style*="display: flex"],
[data-mv-wechat-h5] #add-friend-modal[style*="display:flex"],
[data-mv-wechat-h5] #group-modal[style*="display: flex"],
[data-mv-wechat-h5] #group-modal[style*="display:flex"],
[data-mv-wechat-h5] #chat-search-modal[style*="display: flex"],
[data-mv-wechat-h5] #chat-search-modal[style*="display:flex"],
[data-mv-wechat-h5] #profile-modal[style*="display: flex"],
[data-mv-wechat-h5] #profile-modal[style*="display:flex"],
[data-mv-wechat-h5] #chat-background-modal[style*="display: flex"],
[data-mv-wechat-h5] #chat-background-modal[style*="display:flex"],
[data-mv-wechat-h5] #chat-report-modal[style*="display: flex"],
[data-mv-wechat-h5] #chat-report-modal[style*="display:flex"],
[data-mv-wechat-h5] #recycle-bin-modal[style*="display: flex"],
[data-mv-wechat-h5] #recycle-bin-modal[style*="display:flex"],
[data-mv-wechat-h5] #template-selector-modal[style*="display: flex"],
[data-mv-wechat-h5] #template-selector-modal[style*="display:flex"],
[data-mv-wechat-h5] #points-recharge-modal[style*="display: flex"],
[data-mv-wechat-h5] #points-recharge-modal[style*="display:flex"],
[data-mv-wechat-h5] #duplicate-file-modal[style*="display: flex"],
[data-mv-wechat-h5] #duplicate-file-modal[style*="display:flex"],
[data-mv-wechat-h5] #single-image-model-modal[style*="display: flex"],
[data-mv-wechat-h5] #single-image-model-modal[style*="display:flex"],
[data-mv-wechat-h5] #multi-image-video-model-modal[style*="display: flex"],
[data-mv-wechat-h5] #multi-image-video-model-modal[style*="display:flex"],
[data-mv-wechat-h5] #service-point-booking-modal[style*="display: flex"],
[data-mv-wechat-h5] #service-point-booking-modal[style*="display:flex"],
[data-mv-wechat-h5] #thumbnail-crop-modal[style*="display: flex"],
[data-mv-wechat-h5] #thumbnail-crop-modal[style*="display:flex"],
[data-mv-wechat-h5] #add-address-modal[style*="display: flex"],
[data-mv-wechat-h5] #add-address-modal[style*="display:flex"],
[data-mv-wechat-h5] #address-modal[style*="display: flex"],
[data-mv-wechat-h5] #address-modal[style*="display:flex"],
[data-mv-wechat-h5] #phone-contacts-modal[style*="display: flex"],
[data-mv-wechat-h5] #phone-contacts-modal[style*="display:flex"],
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal[style*="display: flex"],
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal[style*="display:flex"],
[data-mv-wechat-h5] #generate-figure-modal[style*="display: flex"],
[data-mv-wechat-h5] #generate-figure-modal[style*="display:flex"],
[data-mv-wechat-h5] #feedback-management-modal[style*="display: flex"],
[data-mv-wechat-h5] #feedback-management-modal[style*="display:flex"],
[data-mv-wechat-h5] #error-management-modal[style*="display: flex"],
[data-mv-wechat-h5] #error-management-modal[style*="display:flex"],
[data-mv-wechat-h5] #ai-creation-modal[style*="display: flex"],
[data-mv-wechat-h5] #ai-creation-modal[style*="display:flex"],
[data-mv-wechat-h5] #my-agent-studio-modal[style*="display: flex"],
[data-mv-wechat-h5] #my-agent-studio-modal[style*="display:flex"] {
  display: flex !important;
  flex-direction: column !important;
}
[data-mv-wechat-h5] #share-modal .modal-content,
[data-mv-wechat-h5] #add-friend-modal .modal-content,
[data-mv-wechat-h5] #group-modal .modal-content,
[data-mv-wechat-h5] #chat-search-modal .modal-content,
[data-mv-wechat-h5] #profile-modal .modal-content,
[data-mv-wechat-h5] #chat-background-modal .modal-content,
[data-mv-wechat-h5] #chat-report-modal .modal-content,
[data-mv-wechat-h5] #recycle-bin-modal .modal-content,
[data-mv-wechat-h5] #template-selector-modal .modal-content,
[data-mv-wechat-h5] #points-recharge-modal .modal-content,
[data-mv-wechat-h5] #duplicate-file-modal .modal-content,
[data-mv-wechat-h5] #single-image-model-modal .modal-content,
[data-mv-wechat-h5] #multi-image-video-model-modal .modal-content,
[data-mv-wechat-h5] #service-point-booking-modal .modal-content,
[data-mv-wechat-h5] #service-point-booking-modal .sp-booking-modal,
[data-mv-wechat-h5] #thumbnail-crop-modal .modal-content,
[data-mv-wechat-h5] #partner-album-modal .modal-content,
[data-mv-wechat-h5] #my-private-albums-modal .modal-content,
[data-mv-wechat-h5] #add-address-modal .modal-content,
[data-mv-wechat-h5] #address-modal .modal-content,
[data-mv-wechat-h5] #close-friend-modal .modal-content,
[data-mv-wechat-h5] #phone-contacts-modal .modal-content,
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal .modal-content,
[data-mv-wechat-h5] #generate-figure-modal .modal-content,
[data-mv-wechat-h5] #feedback-management-modal .modal-content,
[data-mv-wechat-h5] #error-management-modal .modal-content,
[data-mv-wechat-h5] #ai-creation-modal .modal-content,
[data-mv-wechat-h5] #my-agent-studio-modal .modal-content {
  max-width: 100% !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  height: 100dvh !important;
  min-height: 100% !important;
  min-height: 100dvh !important;
  max-height: none !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}
/* 子页内容区可滚，白底撑满剩余高度 */
[data-mv-wechat-h5] #single-image-model-modal .modal-content > div:not(.modal-header):not(.close-modal),
[data-mv-wechat-h5] #multi-image-video-model-modal .modal-content > div:not(.modal-header):not(.close-modal),
[data-mv-wechat-h5] #service-point-booking-modal .modal-content > .sp-booking-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
/* 满屏子页：右上角 × → 左上角回退样式 */
[data-mv-wechat-h5] #single-image-model-modal .close-modal,
[data-mv-wechat-h5] #multi-image-video-model-modal .close-modal,
[data-mv-wechat-h5] #service-point-booking-modal .close-modal,
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal .close-modal,
[data-mv-wechat-h5] #generate-figure-modal .close-modal,
[data-mv-wechat-h5] #points-recharge-modal .close-modal,
[data-mv-wechat-h5] #share-modal .close-modal,
[data-mv-wechat-h5] #add-friend-modal .close-modal,
[data-mv-wechat-h5] #group-modal .close-modal,
[data-mv-wechat-h5] #profile-modal .close-modal,
[data-mv-wechat-h5] #address-modal .close-modal,
[data-mv-wechat-h5] #add-address-modal .close-modal,
[data-mv-wechat-h5] #phone-contacts-modal .close-modal,
[data-mv-wechat-h5] #my-agent-studio-modal .close-modal {
  position: absolute !important;
  left: 12px !important;
  right: auto !important;
  top: 10px !important;
  float: none !important;
  margin: 0 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 8px !important;
  background: rgba(126, 87, 194, 0.15) !important;
  color: transparent !important;
  font-size: 0 !important;
  box-shadow: none !important;
  z-index: 20 !important;
}
[data-mv-wechat-h5] #single-image-model-modal .close-modal::before,
[data-mv-wechat-h5] #multi-image-video-model-modal .close-modal::before,
[data-mv-wechat-h5] #service-point-booking-modal .close-modal::before,
[data-mv-wechat-h5] #generate-3d-model-from-asset-modal .close-modal::before,
[data-mv-wechat-h5] #generate-figure-modal .close-modal::before,
[data-mv-wechat-h5] #points-recharge-modal .close-modal::before,
[data-mv-wechat-h5] #share-modal .close-modal::before,
[data-mv-wechat-h5] #add-friend-modal .close-modal::before,
[data-mv-wechat-h5] #group-modal .close-modal::before,
[data-mv-wechat-h5] #profile-modal .close-modal::before,
[data-mv-wechat-h5] #address-modal .close-modal::before,
[data-mv-wechat-h5] #add-address-modal .close-modal::before,
[data-mv-wechat-h5] #phone-contacts-modal .close-modal::before,
[data-mv-wechat-h5] #my-agent-studio-modal .close-modal::before {
  content: '' !important;
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  border-left: 2.5px solid #5e35b1 !important;
  border-bottom: 2.5px solid #5e35b1 !important;
  transform: rotate(45deg) !important;
  margin-left: 3px !important;
}
[data-mv-wechat-h5] #single-image-model-modal .modal-header,
[data-mv-wechat-h5] #multi-image-video-model-modal .modal-header,
[data-mv-wechat-h5] #service-point-booking-modal .modal-header {
  padding-left: 52px !important;
  padding-right: 52px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}
/* 二维码等小卡仍居中，不要满屏 */
[data-mv-wechat-h5] #profile-qrcode-modal,
[data-mv-wechat-h5] #profile-extra-edit-modal {
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  background: rgba(0,0,0,0.45) !important;
}
[data-mv-wechat-h5] #profile-qrcode-modal .modal-content,
[data-mv-wechat-h5] #profile-extra-edit-modal .modal-content {
  width: 90% !important;
  max-width: 360px !important;
  height: auto !important;
  min-height: auto !important;
  max-height: 85dvh !important;
  border-radius: 16px !important;
}
/* 聊天详情：与主区域同级，打开时绝对铺满内容区 */
[data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen .chat-modal-content-fullscreen {
  position: relative !important;
}
[data-mv-wechat-h5] #chat-details-panel {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  align-self: stretch !important;
  background: #f5f5f5 !important;
  color: #333 !important;
}
[data-mv-wechat-h5] #chat-details-panel.is-open {
  display: flex !important;
  flex-direction: column !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 40 !important;
  width: 100% !important;
  height: 100% !important;
}
[data-mv-wechat-h5] #chat-details-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  background: #f5f5f5 !important;
}
[data-mv-wechat-h5] #chat-details-private.is-visible,
[data-mv-wechat-h5] #chat-details-group.is-visible {
  display: block !important;
}
/* 聊天顶栏右侧图标统一尺寸 */
[data-mv-wechat-h5] #chat-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex: 0 0 auto !important;
}
[data-mv-wechat-h5] #chat-header-actions > button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
[data-mv-wechat-h5] #chat-header-actions > button svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
}
[data-mv-wechat-h5] #share-tab-friend,
[data-mv-wechat-h5] #share-friend-content {
  grid-template-columns: 1fr !important;
}
[data-mv-wechat-h5] #chat-gift-panel {
  max-width: 100vw !important;
  width: 100vw !important;
  border-radius: 16px 16px 0 0 !important;
  max-height: 70dvh !important;
  bottom: 0 !important;
  top: auto !important;
}
[data-mv-wechat-h5] #chat-gift-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}
[data-mv-wechat-h5] #chat-more-attach-panel {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  max-width: 100vw !important;
  width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
}

/* ================================================================
   17. H5 订单/手办/通讯录/通知页适配
   ================================================================ */
[data-mv-wechat-h5] #order-page {
  padding: 0 !important;
}
[data-mv-wechat-h5] #order-page > div {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #banana-pro-page {
  padding: 0 !important;
}
[data-mv-wechat-h5] #banana-pro-page > div {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #hongqian-page {
  padding: 0 !important;
}
[data-mv-wechat-h5] #hongqian-page > div {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #friends-page {
  padding: 0 !important;
}
[data-mv-wechat-h5] #friends-page > div {
  max-width: 100vw !important;
}
[data-mv-wechat-h5] #notifications-page {
  padding: 0 !important;
}
[data-mv-wechat-h5] #notifications-page > div {
  max-width: 100vw !important;
}
/* H5 隐藏桌面翻页组件（订单/反馈/错误管理） */
[data-mv-wechat-h5] #orders-pagination,
[data-mv-wechat-h5] #feedback-pagination,
[data-mv-wechat-h5] #error-pagination {
  display: none !important;
}
/* H5 欢迎页：手机宽优先；宽屏预览壳另有 390px 规则覆盖 */
[data-mv-wechat-h5] #welcome-page {
  padding: 12px 14px 20px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] #welcome-page > * {
  max-width: 100% !important;
}
[data-mv-wechat-h5] .welcome-features-grid {
  grid-template-columns: 1fr !important;
}
/* H5 欢迎页图标：强制显示，不依赖 IntersectionObserver（X5 老内核不触发懒加载） */
[data-mv-wechat-h5] #welcome-page .welcome-feature-icon {
  opacity: 1 !important;
}

/* ================================================================
   18. WeChat Alignment #10/#12: 列表/菜单右侧箭头
   ================================================================ */
/* #10: 通讯录好友列表项右侧箭头（WeChat风格 > ） */
[data-mv-wechat-h5] #friends-list > div[style*="border-radius"],
[data-mv-wechat-h5] #friends-list > div,
[data-mv-wechat-h5] #agent-friends-list > div,
[data-mv-wechat-h5] .friends-list-item {
  position: relative !important;
}
[data-mv-wechat-h5] #friends-list > div[style*="border-radius"]::after,
[data-mv-wechat-h5] #friends-list > div::after,
[data-mv-wechat-h5] #agent-friends-list > div::after,
[data-mv-wechat-h5] .friends-list-item::after {
  content: "›" !important;
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 18px !important;
  color: #c7c7cc !important;
  font-weight: 300 !important;
  pointer-events: none !important;
}
/* #10: WeChat-style arrow for group list items */
[data-mv-wechat-h5] #friends-groups-list > div::after {
  content: "›" !important;
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 18px !important;
  color: #c7c7cc !important;
  font-weight: 300 !important;
  pointer-events: none !important;
}
[data-mv-wechat-h5] #friends-groups-list > div {
  position: relative !important;
}
/* #10: 学习页智能体列表右侧箭头 */
[data-mv-wechat-h5] #learning-agents-grid > div::after {
  content: "›" !important;
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 16px !important;
  color: #c7c7cc !important;
  pointer-events: none !important;
}
[data-mv-wechat-h5] #learning-agents-grid > div {
  position: relative !important;
  padding-right: 28px !important;
}

/* #12: "我的"页菜单行右侧箭头 */
[data-mv-wechat-h5] #profile-menu > div[style*="cursor:pointer"]::after,
[data-mv-wechat-h5] #profile-menu > div[onclick]::after,
[data-mv-wechat-h5] #profile-menu .menu-item::after {
  content: "›" !important;
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 16px !important;
  color: #c7c7cc !important;
  pointer-events: none !important;
}
[data-mv-wechat-h5] #profile-menu > div[style*="cursor:pointer"],
[data-mv-wechat-h5] #profile-menu > div[onclick],
[data-mv-wechat-h5] #profile-menu .menu-item {
  position: relative !important;
  padding-right: 24px !important;
}

/* ================================================================
   19. H5 首页：电脑预览壳与真机对齐（不依赖 max-width:480）
   宽屏浏览器只把内容画成 390px 时，媒体查询仍按窗口宽度计算，
   会导致本地仍是桌面 2×2，苹果手机才是单列。以下规则在 H5 模式下始终生效。
   ================================================================ */
[data-mv-wechat-h5] #home-page section > div[style*="grid-template-columns"] {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}
[data-mv-wechat-h5] #home-page > div {
  padding: 12px !important;
  max-width: 100% !important;
}
[data-mv-wechat-h5] #home-page section h2 {
  display: none !important;
}
[data-mv-wechat-h5] .header .status-indicator,
[data-mv-wechat-h5] .header .health-indicator,
[data-mv-wechat-h5] .header .refresh-btn,
[data-mv-wechat-h5] .header #home-user-status-bar {
  display: none !important;
}
[data-mv-wechat-h5] .header {
  padding: 0 8px !important;
  height: 44px !important;
  justify-content: space-between !important;
}
[data-mv-wechat-h5] .header h1 {
  font-size: 16px !important;
}
[data-mv-wechat-h5] #home-page.active {
  height: calc(100dvh - 56px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
[data-mv-wechat-h5] .home-card-primary,
[data-mv-wechat-h5] .home-card-secondary {
  position: relative !important;
  padding: 0 !important;
  height: 176px !important;
  min-height: 176px !important;
  max-height: 176px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  background: #1a1a1a !important;
  box-sizing: border-box !important;
}
/* 四卡统一高度与第二张图同款叠层排版 */
[data-mv-wechat-h5] .home-card-primary.home-card-showcase,
[data-mv-wechat-h5] .home-card-secondary.home-card-showcase {
  height: 176px !important;
  min-height: 176px !important;
  max-height: 176px !important;
}
/* 案例图铺满整卡作背景 */
[data-mv-wechat-h5] .home-card-showcase .home-card-media {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 0 !important;
  display: block !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-bg {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 !important;
  filter: none !important;
}
[data-mv-wechat-h5] .home-card--ai .home-card-bg {
  object-position: center 32% !important;
}
[data-mv-wechat-h5] .home-card--3d .home-card-bg {
  object-position: center 38% !important;
}
[data-mv-wechat-h5] .home-card--store .home-card-bg {
  object-position: center 42% !important;
}
[data-mv-wechat-h5] .home-card--memory .home-card-bg {
  object-position: center 38% !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-badge {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  z-index: 3 !important;
  font-size: 10px !important;
  padding: 2px 7px !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
/* 文案叠层：仅底部窄条遮罩，避免整卡压暗案例图 */
[data-mv-wechat-h5] .home-card-showcase .home-card-body {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2 !important;
  margin: 0 !important;
  padding: 28px 12px 10px !important;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.28) 42%, rgba(0,0,0,0.62) 100%) !important;
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  flex: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 58% !important;
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-body h3 {
  font-size: 15px !important;
  margin: 0 0 3px !important;
  font-weight: 600 !important;
  color: #fff !important;
  text-align: left !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  line-height: 1.25 !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-body p,
[data-mv-wechat-h5] .home-card-showcase .home-card-desc-h5 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 11px !important;
  margin: 0 0 8px !important;
  line-height: 1.35 !important;
  color: rgba(255,255,255,0.9) !important;
  text-align: left !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  flex: 0 0 auto !important; /* 禁止 flex:1 把标题顶到卡片上方 */
}
[data-mv-wechat-h5] .home-card-showcase .home-card-body button {
  width: 100% !important;
  font-size: 13px !important;
  padding: 8px 12px !important;
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  box-sizing: border-box !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
  margin: 0 !important;
  width: 100% !important;
}
[data-mv-wechat-h5] .home-card-showcase .home-card-actions button {
  flex: 1 1 0 !important;
  width: auto !important;
  font-size: 12px !important;
  padding: 8px 4px !important;
}
[data-mv-wechat-h5] #home-page [onmouseover],
[data-mv-wechat-h5] #home-page [onmouseout] {
  transform: none !important;
}
html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #home-page section[style*="text-align: center"],
[data-mv-wechat-h5] #home-page section[style*="text-align: center"] {
  padding: 12px !important;
  margin-bottom: 8px !important;
  border-radius: 8px !important;
}
html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #home-page section[style*="text-align: center"] h1,
[data-mv-wechat-h5] #home-page section[style*="text-align: center"] h1 {
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  margin-bottom: 4px !important;
  color: #191919 !important;
}
html.mv-h5-phone-shell[data-mv-wechat-h5="1"] #home-page section[style*="text-align: center"] p,
[data-mv-wechat-h5] #home-page section[style*="text-align: center"] p {
  font-size: 12px !important;
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
  color: #888 !important;
}

/* ================================================================
   20. H5 全屏聊天：任意视口钉死四边（含电脑 390 预览壳）
   注意：禁止写 display:flex !important（会盖住 display:none，导致未打开也一直显示「加载消息中」）
   ================================================================ */
[data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  justify-content: center !important;
  z-index: 10050 !important;
  background: #fff !important;
}
/* 从聊天打开的全屏页必须高于聊天层，否则用户看不到 */
[data-mv-wechat-h5] #partner-album-modal.partner-album-modal-fullscreen,
[data-mv-wechat-h5] #close-friend-modal.close-friend-modal-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10060 !important;
  align-items: stretch !important;
  justify-content: center !important;
  background: #fff !important;
  backdrop-filter: none !important;
}
[data-mv-wechat-h5] #partner-album-modal.partner-album-modal-fullscreen .partner-album-content-fullscreen,
[data-mv-wechat-h5] #close-friend-modal.close-friend-modal-fullscreen .close-friend-modal-content-fullscreen {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
/* 仅在 JS 打开时显示（与 inline display:flex 双保险） */
[data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen.is-open {
  display: flex !important;
}
[data-mv-wechat-h5] #chat-modal.chat-modal-fullscreen .chat-modal-content-fullscreen {
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* ================================================================
   21. 字号贴近微信（H5 全视口生效，含 /h5-preview.html）
   会话名 16 / 摘要 13 / 顶栏 15；首页标题 17、卡片标题 15–16
   ================================================================ */
[data-mv-wechat-h5] #friends-tab-bar {
  margin-bottom: 6px !important;
  padding: 0 12px !important;
}
[data-mv-wechat-h5] .friends-subtab {
  font-size: 15px !important;
  padding: 10px 0 !important;
  font-weight: 400 !important;
}
[data-mv-wechat-h5] #chat-list-header,
[data-mv-wechat-h5] #contacts-header {
  padding: 4px 12px 6px !important;
  margin-bottom: 4px !important;
}
[data-mv-wechat-h5] #chat-list-header h2,
[data-mv-wechat-h5] #contacts-header h2 {
  font-size: 15px !important;
  font-weight: 500 !important;
}
[data-mv-wechat-h5] .friends-inner-btns {
  gap: 6px !important;
}
[data-mv-wechat-h5] .friends-inner-btns button {
  padding: 5px 10px !important;
  font-size: 12px !important;
  border-radius: 4px !important;
  font-weight: 400 !important;
}
[data-mv-wechat-h5] #friends-page .friends-inner {
  padding: 6px 0 !important;
}
[data-mv-wechat-h5] .chat-session-item {
  padding: 10px 12px !important;
  gap: 10px !important;
  border-bottom: 0.5px solid #e5e5e5 !important;
}
[data-mv-wechat-h5] .contacts-quick-row {
  padding: 11px 16px !important;
}
[data-mv-wechat-h5] .contacts-quick-row span {
  font-size: 16px !important;
  font-weight: 400 !important;
}
[data-mv-wechat-h5] .wx-contact-row {
  padding: 10px 16px !important;
}
[data-mv-wechat-h5] .bottom-tabbar .tab-item-label {
  font-size: 10px !important;
}
[data-mv-wechat-h5] .bottom-tabbar .tab-item-icon {
  font-size: 22px !important;
}
[data-mv-wechat-h5] .home-hero-section h1,
[data-mv-wechat-h5] #home-page .home-hero-section h1 {
  font-size: 16px !important;
}
[data-mv-wechat-h5] #home-page > div {
  padding: 8px 10px !important;
  gap: 0 !important;
}
[data-mv-wechat-h5] #home-page section > div[style*="grid-template-columns"] {
  gap: 10px !important;
}
[data-mv-wechat-h5] #learning-page h2 {
  font-size: 16px !important;
  font-weight: 500 !important;
}
[data-mv-wechat-h5] #learning-page [data-agent-id] {
  padding: 10px 12px !important;
}
[data-mv-wechat-h5] #learning-page [data-agent-id] img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 6px !important;
}
[data-mv-wechat-h5] #chat-friend-name-text {
  font-size: 16px !important;
  font-weight: 500 !important;
}
[data-mv-wechat-h5] #chat-message-input {
  font-size: 16px !important;
}
[data-mv-wechat-h5] #chat-send-btn {
  font-size: 15px !important;
}

