main.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. :root {
  2. --primary: #5468FF;
  3. --primary-light: #8590FF;
  4. --primary-dark: #3A4DB2;
  5. --student: #E9EFFF;
  6. --teacher: #EBFAEF;
  7. --teacher-accent: #4CAF50;
  8. --text-dark: #1A2138;
  9. --text-light: #5F6A8A;
  10. --background: #F9FAFC;
  11. --panel: #FFFFFF;
  12. --border: #E1E5EE;
  13. --shadow: 0 4px 12px rgba(84, 104, 255, 0.10);
  14. --hover-shadow: 0 6px 16px rgba(84, 104, 255, 0.18);
  15. --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  16. }
  17. /*
  18. * {
  19. margin: 0;
  20. padding: 0;
  21. box-sizing: border-box;
  22. font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  23. }
  24. body {
  25. background-color: var(--background);
  26. color: var(--text-dark);
  27. width: 100%;
  28. height: 100vh;
  29. display: flex;
  30. align-items: center;
  31. justify-content: center;
  32. overflow: hidden;
  33. }
  34. */
  35. .chat-container {
  36. width: 700px;
  37. height: 700px;
  38. display: flex;
  39. flex-direction: column;
  40. border-radius: 16px;
  41. background-color: var(--panel);
  42. box-shadow: var(--shadow);
  43. overflow: hidden;
  44. position: relative;
  45. }
  46. .header {
  47. padding: 16px 24px;
  48. background-color: var(--panel);
  49. border-bottom: 1px solid var(--border);
  50. display: flex;
  51. align-items: center;
  52. justify-content: space-between;
  53. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  54. position: relative;
  55. z-index: 10;
  56. }
  57. .header-left {
  58. display: flex;
  59. align-items: center;
  60. gap: 12px;
  61. }
  62. .course-info {
  63. display: flex;
  64. flex-direction: column;
  65. }
  66. .course-title {
  67. font-weight: 600;
  68. font-size: 16px;
  69. color: var(--text-dark);
  70. }
  71. .course-participants {
  72. font-size: 12px;
  73. color: var(--text-light);
  74. }
  75. .header-actions {
  76. display: flex;
  77. gap: 12px;
  78. }
  79. .icon-button {
  80. width: 36px;
  81. height: 36px;
  82. border-radius: 50%;
  83. border: none;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. background-color: var(--background);
  88. color: var(--text-light);
  89. cursor: pointer;
  90. transition: var(--transition);
  91. }
  92. .icon-button:hover {
  93. background-color: var(--primary-light);
  94. color: white;
  95. transform: translateY(-2px);
  96. box-shadow: var(--hover-shadow);
  97. }
  98. .icon-button svg {
  99. width: 18px;
  100. height: 18px;
  101. }
  102. .tabs {
  103. display: flex;
  104. padding: 0 20px;
  105. background-color: var(--panel);
  106. border-bottom: 1px solid var(--border);
  107. position: relative;
  108. z-index: 5;
  109. }
  110. .tab {
  111. padding: 12px 16px;
  112. font-size: 14px;
  113. font-weight: 500;
  114. color: var(--text-light);
  115. cursor: pointer;
  116. border-bottom: 2px solid transparent;
  117. transition: var(--transition);
  118. position: relative;
  119. }
  120. .tab.active {
  121. color: var(--primary);
  122. border-bottom: 2px solid var(--primary);
  123. }
  124. .tab:hover:not(.active) {
  125. color: var(--text-dark);
  126. }
  127. .badge {
  128. position: absolute;
  129. top: 8px;
  130. right: 8px;
  131. background-color: var(--primary);
  132. color: white;
  133. font-size: 10px;
  134. font-weight: 500;
  135. padding: 1px 6px;
  136. border-radius: 10px;
  137. }
  138. .chat-content {
  139. flex: 1;
  140. overflow-y: auto;
  141. padding: 24px;
  142. display: flex;
  143. flex-direction: column;
  144. gap: 16px;
  145. scroll-behavior: smooth;
  146. }
  147. .chat-content::-webkit-scrollbar {
  148. width: 6px;
  149. }
  150. .chat-content::-webkit-scrollbar-track {
  151. background: transparent;
  152. }
  153. .chat-content::-webkit-scrollbar-thumb {
  154. background-color: var(--border);
  155. border-radius: 6px;
  156. }
  157. .message {
  158. display: flex;
  159. flex-direction: column;
  160. max-width: 80%;
  161. animation: fadeIn 0.3s ease-out;
  162. }
  163. @keyframes fadeIn {
  164. from {
  165. opacity: 0;
  166. transform: translateY(10px);
  167. }
  168. to {
  169. opacity: 1;
  170. transform: translateY(0);
  171. }
  172. }
  173. .message.student {
  174. align-self: flex-end;
  175. }
  176. .message.teacher {
  177. align-self: flex-start;
  178. }
  179. .message-header {
  180. display: flex;
  181. align-items: center;
  182. gap: 8px;
  183. margin-bottom: 4px;
  184. }
  185. .avatar {
  186. width: 28px;
  187. height: 28px;
  188. border-radius: 50%;
  189. display: flex;
  190. align-items: center;
  191. justify-content: center;
  192. font-weight: 600;
  193. font-size: 12px;
  194. color: white;
  195. flex-shrink: 0;
  196. }
  197. .student .avatar {
  198. background-color: var(--primary);
  199. }
  200. .teacher .avatar {
  201. background-color: var(--teacher-accent);
  202. }
  203. .sender-name {
  204. font-size: 13px;
  205. font-weight: 600;
  206. }
  207. .student .sender-name {
  208. color: var(--primary-dark);
  209. }
  210. .teacher .sender-name {
  211. color: var(--teacher-accent);
  212. }
  213. .timestamp {
  214. font-size: 11px;
  215. color: var(--text-light);
  216. margin-left: auto;
  217. }
  218. .message-bubble {
  219. padding: 12px 16px;
  220. border-radius: 16px;
  221. font-size: 14px;
  222. line-height: 1.5;
  223. position: relative;
  224. transition: var(--transition);
  225. }
  226. .student .message-bubble {
  227. background-color: var(--student);
  228. border-top-right-radius: 4px;
  229. }
  230. .teacher .message-bubble {
  231. background-color: var(--teacher);
  232. border-top-left-radius: 4px;
  233. }
  234. .message-bubble:hover {
  235. transform: translateY(-2px);
  236. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  237. }
  238. .message-actions {
  239. display: flex;
  240. gap: 8px;
  241. margin-top: 6px;
  242. justify-content: flex-end;
  243. opacity: 0;
  244. transition: var(--transition);
  245. }
  246. .message:hover .message-actions {
  247. opacity: 1;
  248. }
  249. .action-button {
  250. background: none;
  251. border: none;
  252. font-size: 12px;
  253. color: var(--text-light);
  254. cursor: pointer;
  255. padding: 2px 6px;
  256. border-radius: 4px;
  257. transition: var(--transition);
  258. }
  259. .action-button:hover {
  260. background-color: rgba(84, 104, 255, 0.1);
  261. color: var(--primary);
  262. }
  263. .embed-content {
  264. margin-top: 10px;
  265. border-radius: 8px;
  266. overflow: hidden;
  267. border: 1px solid var(--border);
  268. background-color: white;
  269. transition: var(--transition);
  270. }
  271. .embed-content:hover {
  272. box-shadow: var(--shadow);
  273. transform: translateY(-2px);
  274. }
  275. .embed-header {
  276. padding: 10px 12px;
  277. background-color: rgba(84, 104, 255, 0.05);
  278. display: flex;
  279. align-items: center;
  280. gap: 8px;
  281. border-bottom: 1px solid var(--border);
  282. }
  283. .embed-icon {
  284. width: 20px;
  285. height: 20px;
  286. display: flex;
  287. align-items: center;
  288. justify-content: center;
  289. color: var(--primary);
  290. }
  291. .embed-title {
  292. font-size: 12px;
  293. font-weight: 500;
  294. flex: 1;
  295. }
  296. .embed-body {
  297. padding: 12px;
  298. }
  299. .embed-image {
  300. width: 100%;
  301. border-radius: 6px;
  302. height: auto;
  303. object-fit: cover;
  304. }
  305. .embed-text {
  306. font-size: 13px;
  307. color: var(--text-light);
  308. margin-top: 8px;
  309. line-height: 1.4;
  310. }
  311. .embed-footer {
  312. padding: 8px 12px;
  313. border-top: 1px solid var(--border);
  314. display: flex;
  315. align-items: center;
  316. justify-content: space-between;
  317. }
  318. .embed-button {
  319. background-color: var(--primary-light);
  320. color: white;
  321. font-size: 12px;
  322. font-weight: 500;
  323. padding: 6px 12px;
  324. border-radius: 6px;
  325. border: none;
  326. cursor: pointer;
  327. transition: var(--transition);
  328. }
  329. .embed-button:hover {
  330. background-color: var(--primary);
  331. transform: translateY(-1px);
  332. box-shadow: 0 3px 8px rgba(84, 104, 255, 0.2);
  333. }
  334. .date-divider {
  335. display: flex;
  336. align-items: center;
  337. gap: 12px;
  338. margin: 16px 0;
  339. opacity: 0.7;
  340. }
  341. .divider-line {
  342. flex: 1;
  343. height: 1px;
  344. background-color: var(--border);
  345. }
  346. .divider-text {
  347. font-size: 12px;
  348. color: var(--text-light);
  349. white-space: nowrap;
  350. }
  351. .typing-indicator {
  352. display: flex;
  353. align-items: center;
  354. gap: 4px;
  355. font-size: 12px;
  356. color: var(--text-light);
  357. padding: 8px 12px;
  358. margin-bottom: 8px;
  359. }
  360. .typing-dot {
  361. width: 5px;
  362. height: 5px;
  363. background-color: var(--text-light);
  364. border-radius: 50%;
  365. animation: typingAnimation 1.4s infinite ease-in-out;
  366. }
  367. .typing-dot:nth-child(1) {
  368. animation-delay: 0s;
  369. }
  370. .typing-dot:nth-child(2) {
  371. animation-delay: 0.2s;
  372. }
  373. .typing-dot:nth-child(3) {
  374. animation-delay: 0.4s;
  375. }
  376. @keyframes typingAnimation {
  377. 0%,
  378. 100% {
  379. transform: translateY(0);
  380. opacity: 0.5;
  381. }
  382. 50% {
  383. transform: translateY(-4px);
  384. opacity: 1;
  385. }
  386. }
  387. .input-area {
  388. padding: 16px 24px 24px;
  389. background-color: var(--panel);
  390. border-top: 1px solid var(--border);
  391. z-index: 10;
  392. }
  393. .toolbar {
  394. display: flex;
  395. align-items: center;
  396. gap: 8px;
  397. margin-bottom: 12px;
  398. }
  399. .tool-button {
  400. background: none;
  401. border: none;
  402. cursor: pointer;
  403. width: 32px;
  404. height: 32px;
  405. border-radius: 4px;
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. color: var(--text-light);
  410. transition: var(--transition);
  411. }
  412. .tool-button:hover {
  413. background-color: rgba(84, 104, 255, 0.1);
  414. color: var(--primary);
  415. }
  416. .tool-button svg {
  417. width: 18px;
  418. height: 18px;
  419. }
  420. .input-container {
  421. display: flex;
  422. gap: 12px;
  423. align-items: center;
  424. }
  425. .message-input {
  426. flex: 1;
  427. padding: 14px 16px;
  428. border-radius: 10px;
  429. border: 1px solid var(--border);
  430. background-color: var(--background);
  431. font-size: 14px;
  432. resize: none;
  433. transition: var(--transition);
  434. height: 50px;
  435. outline: none;
  436. }
  437. .message-input:focus {
  438. border-color: var(--primary-light);
  439. box-shadow: 0 0 0 2px rgba(84, 104, 255, 0.1);
  440. }
  441. .send-button {
  442. background-color: var(--primary);
  443. color: white;
  444. border: none;
  445. width: 50px;
  446. height: 50px;
  447. border-radius: 12px;
  448. cursor: pointer;
  449. display: flex;
  450. align-items: center;
  451. justify-content: center;
  452. transition: var(--transition);
  453. }
  454. .send-button:hover {
  455. background-color: var(--primary-dark);
  456. transform: translateY(-2px);
  457. box-shadow: 0 4px 12px rgba(84, 104, 255, 0.2);
  458. }
  459. .poll-container {
  460. padding: 12px;
  461. background-color: rgba(84, 104, 255, 0.05);
  462. border-radius: 8px;
  463. margin-top: 8px;
  464. }
  465. .poll-question {
  466. font-weight: 500;
  467. margin-bottom: 10px;
  468. font-size: 13px;
  469. }
  470. .poll-options {
  471. display: flex;
  472. flex-direction: column;
  473. gap: 8px;
  474. }
  475. .poll-option {
  476. background-color: white;
  477. border: 1px solid var(--border);
  478. padding: 8px 12px;
  479. border-radius: 6px;
  480. font-size: 13px;
  481. position: relative;
  482. cursor: pointer;
  483. transition: var(--transition);
  484. display: flex;
  485. justify-content: space-between;
  486. }
  487. .poll-option:hover {
  488. border-color: var(--primary-light);
  489. background-color: rgba(84, 104, 255, 0.03);
  490. }
  491. .poll-option.selected {
  492. border-color: var(--primary);
  493. background-color: rgba(84, 104, 255, 0.1);
  494. }
  495. .poll-option.selected::before {
  496. content: '';
  497. position: absolute;
  498. left: 0;
  499. top: 0;
  500. height: 100%;
  501. width: 3px;
  502. background-color: var(--primary);
  503. border-top-left-radius: 6px;
  504. border-bottom-left-radius: 6px;
  505. }
  506. .poll-percent {
  507. font-size: 12px;
  508. font-weight: 500;
  509. color: var(--primary);
  510. }
  511. .poll-votes {
  512. margin-top: 10px;
  513. font-size: 12px;
  514. color: var(--text-light);
  515. text-align: right;
  516. }
  517. .resource-link {
  518. display: flex;
  519. align-items: center;
  520. gap: 8px;
  521. padding: 10px;
  522. background-color: var(--background);
  523. border-radius: 6px;
  524. cursor: pointer;
  525. transition: var(--transition);
  526. text-decoration: none;
  527. color: var(--text-dark);
  528. border: 1px solid var(--border);
  529. }
  530. .resource-link:hover {
  531. background-color: rgba(84, 104, 255, 0.05);
  532. border-color: var(--primary-light);
  533. transform: translateY(-2px);
  534. box-shadow: var(--shadow);
  535. }
  536. .resource-icon {
  537. width: 36px;
  538. height: 36px;
  539. background-color: rgba(84, 104, 255, 0.1);
  540. border-radius: 6px;
  541. display: flex;
  542. align-items: center;
  543. justify-content: center;
  544. color: var(--primary);
  545. }
  546. .resource-info {
  547. flex: 1;
  548. }
  549. .resource-title {
  550. font-size: 13px;
  551. font-weight: 500;
  552. }
  553. .resource-desc {
  554. font-size: 11px;
  555. color: var(--text-light);
  556. }
  557. /* Responsive Styles */
  558. @media (max-width: 700px) {
  559. .chat-container {
  560. width: 100%;
  561. height: 100%;
  562. border-radius: 0;
  563. }
  564. .message {
  565. max-width: 90%;
  566. }
  567. .header-actions {
  568. gap: 8px;
  569. }
  570. .icon-button {
  571. width: 32px;
  572. height: 32px;
  573. }
  574. .tabs {
  575. padding: 0 10px;
  576. }
  577. .tab {
  578. padding: 12px 10px;
  579. font-size: 13px;
  580. }
  581. }
  582. /* Animation for new messages */
  583. @keyframes popIn {
  584. 0% {
  585. transform: scale(0.8);
  586. opacity: 0;
  587. }
  588. 50% {
  589. transform: scale(1.05);
  590. }
  591. 100% {
  592. transform: scale(1);
  593. opacity: 1;
  594. }
  595. }
  596. .pop-in {
  597. animation: popIn 0.3s forwards;
  598. }
  599. /* Resource expansion animation */
  600. .resource-expanded {
  601. max-height: 0;
  602. overflow: hidden;
  603. transition: max-height 0.3s ease;
  604. }
  605. .resource-expanded.active {
  606. max-height: 200px;
  607. }
  608. /* Tooltip Styles */
  609. .tooltip {
  610. position: relative;
  611. }
  612. .tooltip::after {
  613. content: attr(data-tooltip);
  614. position: absolute;
  615. bottom: 130%;
  616. left: 50%;
  617. transform: translateX(-50%);
  618. padding: 5px 10px;
  619. border-radius: 4px;
  620. background-color: rgba(26, 33, 56, 0.9);
  621. color: white;
  622. font-size: 11px;
  623. white-space: nowrap;
  624. opacity: 0;
  625. visibility: hidden;
  626. transition: all 0.2s ease;
  627. pointer-events: none;
  628. z-index: 100;
  629. }
  630. .tooltip::before {
  631. content: '';
  632. position: absolute;
  633. bottom: 120%;
  634. left: 50%;
  635. transform: translateX(-50%);
  636. border-width: 4px;
  637. border-style: solid;
  638. border-color: rgba(26, 33, 56, 0.9) transparent transparent transparent;
  639. opacity: 0;
  640. visibility: hidden;
  641. transition: all 0.2s ease;
  642. pointer-events: none;
  643. z-index: 100;
  644. }
  645. .tooltip:hover::after,
  646. .tooltip:hover::before {
  647. opacity: 1;
  648. visibility: visible;
  649. }
  650. /* Reaction Styles */
  651. .reactions {
  652. display: flex;
  653. flex-wrap: wrap;
  654. gap: 4px;
  655. margin-top: 8px;
  656. }
  657. .reaction {
  658. font-size: 12px;
  659. padding: 2px 6px 2px 4px;
  660. background-color: rgba(84, 104, 255, 0.06);
  661. border-radius: 12px;
  662. display: flex;
  663. align-items: center;
  664. gap: 3px;
  665. cursor: pointer;
  666. transition: var(--transition);
  667. }
  668. .reaction:hover {
  669. background-color: rgba(84, 104, 255, 0.15);
  670. }
  671. .reaction.active {
  672. background-color: rgba(84, 104, 255, 0.2);
  673. font-weight: 500;
  674. }