parentMobileCourse.css 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* ============================================ */
  2. /* 家长课堂-手机端课程列表样式 */
  3. /* 包含电脑端和移动端适配 */
  4. /* ============================================ */
  5. /* -------------------------- */
  6. /* 默认状态(电脑端) */
  7. /* -------------------------- */
  8. /* 默认隐藏移动端容器 */
  9. .parent-mobile-container {
  10. display: none !important;
  11. }
  12. /* 默认显示电脑端课程项 */
  13. .parent-mobile-course-item {
  14. display: flex !important;
  15. }
  16. /* -------------------------- */
  17. /* 移动端样式(≤768px) */
  18. /* -------------------------- */
  19. @media screen and (max-width: 768px) {
  20. /* 隐藏电脑端课程项 */
  21. .parent-mobile-course-item {
  22. display: none !important;
  23. }
  24. /* 显示移动端容器 */
  25. .parent-mobile-container {
  26. display: block !important;
  27. width: 100%;
  28. max-width: 100vw; /* 最大宽度不超过视口宽度 */
  29. padding: 8px;
  30. box-sizing: border-box;
  31. overflow: hidden;
  32. }
  33. /* 移动端课程项 */
  34. .parent-mobile-item {
  35. display: flex;
  36. align-items: center;
  37. background: #fff;
  38. border-radius: 12px;
  39. padding: 10px;
  40. margin-bottom: 10px;
  41. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  42. cursor: pointer;
  43. transition: box-shadow 0.2s ease;
  44. box-sizing: border-box;
  45. overflow: hidden;
  46. width: 100%;
  47. max-width: 100%;
  48. }
  49. .parent-mobile-item:active {
  50. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  51. }
  52. /* 左侧图片 */
  53. .parent-mobile-image {
  54. width: 80px;
  55. height: 60px;
  56. border-radius: 8px;
  57. overflow: hidden;
  58. flex-shrink: 0;
  59. }
  60. .parent-mobile-image img {
  61. width: 100%;
  62. height: 100%;
  63. object-fit: cover;
  64. }
  65. /* 中间内容 */
  66. .parent-mobile-content {
  67. flex: 1;
  68. padding: 0 12px 0 16px; /* 增加左边距,距离图片更远 */
  69. display: flex;
  70. flex-direction: column;
  71. min-width: 0;
  72. max-width: calc(100% - 130px); /* 减去图片和三点按钮的宽度 */
  73. align-items: flex-start; /* 居左显示 */
  74. }
  75. .parent-mobile-title {
  76. font-size: 14px;
  77. font-weight: 600;
  78. color: #333;
  79. margin-bottom: 4px;
  80. overflow: hidden;
  81. text-overflow: ellipsis;
  82. white-space: nowrap;
  83. word-break: break-all;
  84. }
  85. .parent-mobile-index {
  86. margin-right: 6px;
  87. color: #999;
  88. font-weight: normal;
  89. }
  90. .parent-mobile-desc {
  91. font-size: 12px;
  92. color: #999;
  93. overflow: hidden;
  94. text-overflow: ellipsis;
  95. white-space: nowrap;
  96. }
  97. /* 右侧三点按钮 */
  98. .parent-mobile-more {
  99. width: 36px;
  100. height: 36px;
  101. display: flex;
  102. align-items: center;
  103. justify-content: center;
  104. color: #ccc;
  105. font-size: 18px;
  106. }
  107. }
  108. /* -------------------------- */
  109. /* 电脑端样式(>768px) */
  110. /* -------------------------- */
  111. @media screen and (min-width: 769px) {
  112. /* 确保移动端容器隐藏 */
  113. .parent-mobile-container {
  114. display: none !important;
  115. }
  116. /* 确保电脑端课程项显示 */
  117. .parent-mobile-course-item {
  118. display: flex !important;
  119. }
  120. }