copy-button.css 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* 复制按钮样式 */
  2. .message {
  3. position: relative;
  4. margin-bottom: 50px;
  5. }
  6. .message-content {
  7. position: relative;
  8. }
  9. .copy-button,
  10. .copy-button-direct {
  11. position: absolute;
  12. width: 32px;
  13. height: 32px;
  14. background: var(--primary-indigo);
  15. color: white;
  16. border: none;
  17. border-radius: 50%;
  18. display: flex;
  19. align-items: center;
  20. justify-content: center;
  21. cursor: pointer;
  22. z-index: 1001;
  23. box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  24. transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  25. opacity: 0;
  26. }
  27. .copy-button {
  28. bottom: 8px;
  29. right: 8px;
  30. }
  31. .copy-button-direct {
  32. top: 10px;
  33. right: 10px;
  34. }
  35. /* Show button on hover */
  36. .message:hover .copy-button,
  37. .message-content:hover .copy-button-direct {
  38. opacity: 1;
  39. }
  40. /* 确保AI消息的复制按钮可见 */
  41. .message.bot:hover .copy-button,
  42. .message.bot-message:hover .copy-button {
  43. opacity: 1;
  44. }
  45. .copy-button:hover,
  46. .copy-button-direct:hover {
  47. transform: scale(1.1);
  48. box-shadow: 0 6px 10px rgba(0,0,0,0.25);
  49. }
  50. .copy-button svg,
  51. .copy-button-direct svg {
  52. width: 18px;
  53. height: 18px;
  54. }
  55. /* 复制通知样式 */
  56. .copy-notification {
  57. position: fixed;
  58. top: 50%;
  59. left: 50%;
  60. transform: translate(-50%, -50%);
  61. padding: 12px 20px;
  62. border-radius: 8px;
  63. color: white;
  64. font-size: 14px;
  65. font-weight: 500;
  66. z-index: 9999;
  67. box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  68. opacity: 0;
  69. transition: all 0.3s ease;
  70. }
  71. .copy-notification.success {
  72. background-color: rgba(16, 185, 129, 0.95);
  73. }
  74. .copy-notification.error {
  75. background-color: rgba(239, 68, 68, 0.95);
  76. }
  77. .copy-notification.show {
  78. opacity: 1;
  79. }
  80. /* 深色模式适配 */
  81. @media (prefers-color-scheme: dark) {
  82. .copy-button {
  83. background: var(--primary-indigo);
  84. color: white;
  85. }
  86. .copy-button:hover {
  87. background: var(--primary-purple);
  88. }
  89. .copy-notification {
  90. background: var(--glass-background-dark);
  91. }
  92. .copy-notification.success {
  93. background: rgba(16, 185, 129, 0.8);
  94. }
  95. .copy-notification.error {
  96. background: rgba(239, 68, 68, 0.8);
  97. }
  98. }