MobileH5.scss 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // MobileH5 容器样式
  2. // 仅在移动端(≤768px)生效
  3. @media (max-width: 768px) {
  4. .mobile-h5-container {
  5. display: flex;
  6. flex-direction: column;
  7. height: 100vh;
  8. width: 100vw;
  9. background: var(--h5-bg-primary);
  10. overflow: hidden;
  11. position: relative;
  12. }
  13. // 内容区域
  14. .mobile-content {
  15. flex: 1;
  16. overflow-y: auto;
  17. -webkit-overflow-scrolling: touch; // iOS 平滑滚动
  18. padding-bottom: calc(60px + env(safe-area-inset-bottom)); // 留出 Tab 空间
  19. position: relative;
  20. }
  21. // ===== 智能问答包装器 =====
  22. .chat-wrapper {
  23. position: relative;
  24. height: 100%;
  25. // 隐藏"开放平台"返回按钮(H5 不显示)
  26. .back-btn {
  27. display: none !important;
  28. }
  29. // 汉堡菜单按钮
  30. .hamburger-toggle {
  31. position: fixed;
  32. top: var(--h5-spacing-lg);
  33. left: var(--h5-spacing-lg);
  34. z-index: 1001;
  35. width: 40px;
  36. height: 40px;
  37. border-radius: var(--h5-radius-full);
  38. background: var(--h5-bg-secondary);
  39. border: 1px solid var(--h5-border);
  40. font-size: 20px;
  41. color: var(--h5-text-primary);
  42. cursor: pointer;
  43. display: flex;
  44. align-items: center;
  45. justify-content: center;
  46. box-shadow: var(--h5-shadow-md);
  47. transition: var(--h5-transition);
  48. &:active {
  49. background: var(--h5-bg-tertiary);
  50. }
  51. }
  52. // Sidebar 包装器
  53. .sidebar-wrapper {
  54. position: fixed;
  55. top: 0;
  56. left: 0;
  57. bottom: 0;
  58. width: 280px;
  59. z-index: 1002;
  60. transform: translateX(-100%);
  61. transition: transform 0.3s ease;
  62. &.open {
  63. transform: translateX(0);
  64. }
  65. }
  66. // 遮罩层
  67. .sidebar-overlay {
  68. position: fixed;
  69. top: 0;
  70. left: 0;
  71. right: 0;
  72. bottom: 0;
  73. background: rgba(0, 0, 0, 0.5);
  74. z-index: 1001;
  75. animation: fadeIn 0.3s ease;
  76. }
  77. }
  78. @keyframes fadeIn {
  79. from {
  80. opacity: 0;
  81. }
  82. to {
  83. opacity: 1;
  84. }
  85. }
  86. // 底部 Tab 导航
  87. .bottom-tab-bar {
  88. flex-shrink: 0;
  89. display: flex;
  90. height: 60px;
  91. background: var(--h5-bg-secondary);
  92. border-top: 1px solid var(--h5-border);
  93. padding: var(--h5-spacing-sm) var(--h5-spacing-md);
  94. padding-bottom: calc(var(--h5-spacing-sm) + env(safe-area-inset-bottom));
  95. box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  96. }
  97. // Tab 项
  98. .tab-item {
  99. flex: 1;
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. gap: 4px;
  105. background: transparent;
  106. border: none;
  107. cursor: pointer;
  108. transition: var(--h5-transition);
  109. .tab-icon {
  110. font-size: 24px;
  111. color: var(--h5-text-muted);
  112. transition: color 0.2s;
  113. line-height: 1;
  114. }
  115. .tab-label {
  116. font-size: var(--h5-font-xs);
  117. color: var(--h5-text-muted);
  118. font-weight: 400;
  119. transition: color 0.2s;
  120. }
  121. // 激活状态
  122. &.active {
  123. .tab-icon {
  124. color: var(--h5-accent);
  125. }
  126. .tab-label {
  127. color: var(--h5-accent);
  128. font-weight: 500;
  129. }
  130. }
  131. // 点击反馈
  132. &:active {
  133. opacity: 0.7;
  134. }
  135. }
  136. }