tab2.page.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. // 页面背景
  2. .tab2-content {
  3. --background: #FFF9E6;
  4. &::part(background) {
  5. background: #46B3DE;
  6. }
  7. }
  8. // 轮播图包装器
  9. .carousel-wrapper {
  10. padding: 16px 16px 0;
  11. }
  12. // 轮播图容器
  13. .carousel-container {
  14. width: 100%;
  15. overflow: hidden;
  16. border-radius: 20px;
  17. position: relative;
  18. .carousel-track {
  19. display: flex;
  20. transition: transform 0.5s ease-in-out;
  21. width: 200%; // 2张幻灯片
  22. }
  23. .slide-item {
  24. position: relative;
  25. width: 100%;
  26. height: 180px;
  27. display: flex;
  28. align-items: center;
  29. padding: 0 20px;
  30. overflow: hidden;
  31. flex-shrink: 0; // 防止被压缩
  32. .slide-bg {
  33. position: absolute;
  34. top: 0;
  35. left: 0;
  36. right: 0;
  37. bottom: 0;
  38. z-index: 0;
  39. }
  40. .slide-content {
  41. position: relative;
  42. z-index: 2;
  43. flex: 1;
  44. h2 {
  45. font-size: 28px;
  46. font-weight: 800;
  47. color: #fff;
  48. margin: 0 0 4px;
  49. text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  50. }
  51. p {
  52. font-size: 14px;
  53. color: rgba(255,255,255,0.9);
  54. margin: 0 0 16px;
  55. font-style: italic;
  56. }
  57. .challenge-btn {
  58. background: #7BC043;
  59. color: white;
  60. border: none;
  61. padding: 10px 24px;
  62. border-radius: 20px;
  63. font-size: 14px;
  64. font-weight: 600;
  65. box-shadow: 0 4px 12px rgba(123, 192, 67, 0.4);
  66. cursor: pointer;
  67. &:active {
  68. transform: scale(0.95);
  69. }
  70. }
  71. }
  72. img {
  73. position: absolute;
  74. right: 10px;
  75. bottom: 0;
  76. height: 160px;
  77. width: auto;
  78. object-fit: contain;
  79. z-index: 1;
  80. }
  81. }
  82. }
  83. // 轮播指示器 - 放在轮播图下面
  84. .carousel-dots {
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. gap: 8px;
  89. margin-top: 12px;
  90. padding-bottom: 4px;
  91. .dot {
  92. width: 8px;
  93. height: 8px;
  94. border-radius: 50%;
  95. background: #FFF9E6;
  96. cursor: pointer;
  97. transition: all 0.3s ease;
  98. &.active {
  99. background: orange;
  100. width: 20px;
  101. border-radius: 4px;
  102. }
  103. &:hover {
  104. background: #46B3DE;
  105. }
  106. }
  107. }
  108. // 专项训练标题
  109. .section-header {
  110. display: flex;
  111. align-items: center;
  112. gap: 6px;
  113. padding: 0 16px;
  114. margin: 20px 0 12px;
  115. h3 {
  116. font-size: 23px;
  117. font-weight: 700;
  118. color: white;
  119. margin: 0;
  120. }
  121. .info-icon {
  122. font-size: 25px;
  123. color: white;
  124. }
  125. }
  126. // 训练卡片网格 - 每行4个
  127. .training-grid {
  128. display: grid;
  129. grid-template-columns: repeat(4, 1fr);
  130. gap: 12px;
  131. padding: 0 16px;
  132. margin-bottom: 24px;
  133. }
  134. // 训练卡片
  135. .training-card {
  136. background: white;
  137. border-radius: 16px;
  138. padding: 12px 8px;
  139. display: flex;
  140. flex-direction: column;
  141. align-items: center;
  142. box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  143. position: relative;
  144. cursor: pointer;
  145. transition: transform 0.2s ease;
  146. &:active {
  147. transform: scale(0.95);
  148. }
  149. .card-icon {
  150. width: 48px;
  151. height: 48px;
  152. margin-bottom: 8px;
  153. img {
  154. width: 90%;
  155. height: 90%;
  156. object-fit: contain;
  157. }
  158. }
  159. .card-title {
  160. font-size: 0.95rem;
  161. color: black;
  162. text-align: center;
  163. line-height: 1.2;
  164. }
  165. }
  166. // 单词随身听区域
  167. .listen-section {
  168. padding: 0 16px 24px;
  169. .section-title {
  170. font-size: 18px;
  171. font-weight: 700;
  172. color: #333;
  173. margin: 0 0 12px;
  174. }
  175. .listen-cards {
  176. display: flex;
  177. flex-direction: column;
  178. gap: 12px;
  179. }
  180. .listen-card {
  181. background: white;
  182. border-radius: 16px;
  183. padding: 16px;
  184. display: flex;
  185. align-items: center;
  186. gap: 12px;
  187. box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  188. position: relative;
  189. cursor: pointer;
  190. .listen-icon {
  191. width: 56px;
  192. height: 56px;
  193. flex-shrink: 0;
  194. img {
  195. width: 100%;
  196. height: 100%;
  197. object-fit: contain;
  198. }
  199. }
  200. .listen-info {
  201. flex: 1;
  202. h4 {
  203. font-size: 16px;
  204. font-weight: 700;
  205. color: #333;
  206. margin: 0 0 4px;
  207. }
  208. p {
  209. font-size: 13px;
  210. color: #999;
  211. margin: 0;
  212. }
  213. }
  214. }
  215. }
  216. // 暗色模式
  217. @media (prefers-color-scheme: dark) {
  218. .tab2-content {
  219. --background: #1a1a2e;
  220. &::part(background) {
  221. background: linear-gradient(180deg, #16213e 0%, #1a1a2e 30%);
  222. }
  223. }
  224. .carousel-dots .dot {
  225. background: #555;
  226. &.active {
  227. background: #46B3DE;
  228. }
  229. }
  230. .section-header h3,
  231. .listen-section .section-title,
  232. .listen-card .listen-info h4 {
  233. color: #fff;
  234. }
  235. .training-card,
  236. .listen-card {
  237. background: #2a2a3e;
  238. .card-title,
  239. .listen-info p {
  240. color: #aaa;
  241. }
  242. }
  243. }