2
0

globals.css 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @tailwind base;
  2. @tailwind components;
  3. @tailwind utilities;
  4. :root {
  5. --background: #ffffff;
  6. --foreground: #171717;
  7. }
  8. @media (prefers-color-scheme: dark) {
  9. :root {
  10. --background: #0a0a0a;
  11. --foreground: #ededed;
  12. }
  13. }
  14. body {
  15. color: var(--foreground);
  16. background: var(--background);
  17. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  18. -webkit-font-smoothing: antialiased;
  19. -moz-osx-font-smoothing: grayscale;
  20. }
  21. /* 移动端优化 */
  22. @media (max-width: 768px) {
  23. body {
  24. font-size: 16px;
  25. line-height: 1.5;
  26. }
  27. }
  28. @layer utilities {
  29. .text-balance {
  30. text-wrap: balance;
  31. }
  32. }
  33. /* 自定义样式 - 消息气泡 */
  34. .message-bubble {
  35. @apply max-w-[85%] md:max-w-[75%] rounded-2xl px-4 py-3 shadow-sm;
  36. }
  37. @media (max-width: 768px) {
  38. .message-bubble {
  39. @apply max-w-[90%] rounded-2xl px-3 py-2 text-[15px];
  40. }
  41. }
  42. .user-message {
  43. @apply bg-gradient-to-br from-blue-500 to-blue-600 text-white ml-auto;
  44. }
  45. .user-message:hover {
  46. @apply from-blue-600 to-blue-700;
  47. }
  48. .assistant-message {
  49. @apply bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 border border-gray-200 dark:border-gray-700 shadow-sm;
  50. }
  51. /* 工具调用样式 */
  52. .tool-call {
  53. @apply bg-purple-50 dark:bg-purple-950/30 border-l-4 border-purple-500 p-3 my-2 rounded-r-lg;
  54. }
  55. @media (max-width: 768px) {
  56. .tool-call {
  57. @apply p-2 my-1 text-sm;
  58. }
  59. }
  60. .tool-error {
  61. @apply bg-red-50 dark:bg-red-950/30 border-l-4 border-red-500 p-3 my-2 rounded-r-lg text-red-700 dark:text-red-400;
  62. }
  63. @media (max-width: 768px) {
  64. .tool-error {
  65. @apply p-2 my-1 text-sm;
  66. }
  67. }
  68. /* 移动端滚动条优化 */
  69. @media (max-width: 768px) {
  70. * {
  71. -webkit-tap-highlight-color: transparent;
  72. }
  73. /* 自定义滚动条 */
  74. ::-webkit-scrollbar {
  75. width: 4px;
  76. height: 4px;
  77. }
  78. ::-webkit-scrollbar-track {
  79. background: transparent;
  80. }
  81. ::-webkit-scrollbar-thumb {
  82. background: rgba(156, 163, 175, 0.5);
  83. border-radius: 2px;
  84. }
  85. ::-webkit-scrollbar-thumb:hover {
  86. background: rgba(156, 163, 175, 0.7);
  87. }
  88. }
  89. /* 触摸友好的按钮 */
  90. @media (max-width: 768px) {
  91. button, .btn {
  92. min-height: 44px;
  93. min-width: 44px;
  94. }
  95. /* 安全区域支持 - iPhone 刘海屏 */
  96. .safe-area-inset-bottom {
  97. padding-bottom: calc(env(safe-area-inset-bottom, 0) + 0.5rem);
  98. }
  99. .safe-area-inset-top {
  100. padding-top: calc(env(safe-area-inset-top, 0) + 0.5rem);
  101. }
  102. /* 固定底部输入框安全区域 */
  103. .pb-safe {
  104. padding-bottom: calc(env(safe-area-inset-bottom, 0) + 0.75rem);
  105. }
  106. }