app.css 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /* 使用系统字体栈,避免依赖外部CDN */
  2. @tailwind base;
  3. @tailwind components;
  4. @tailwind utilities;
  5. @layer base {
  6. :root {
  7. /* 使用系统字体:PingFang SC (macOS), 苹方-简 (iOS), 微软雅黑 (Windows), 文泉驿微米黑 (Linux) */
  8. --font-sans: 'PingFang SC', 'PingFang SC Regular', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  9. }
  10. body {
  11. @apply bg-slate-50 text-slate-900 font-sans antialiased;
  12. }
  13. /* 平滑滚动 */
  14. html {
  15. scroll-behavior: smooth;
  16. }
  17. /* 自定义滚动条 */
  18. ::-webkit-scrollbar {
  19. @apply w-2 h-2;
  20. }
  21. ::-webkit-scrollbar-track {
  22. @apply bg-slate-100 rounded-lg;
  23. }
  24. ::-webkit-scrollbar-thumb {
  25. @apply bg-slate-300 rounded-lg hover:bg-slate-400 transition-colors duration-200;
  26. }
  27. ::-webkit-scrollbar-thumb:hover {
  28. @apply bg-slate-400;
  29. }
  30. }
  31. @layer components {
  32. /* Filament 登录页面定制 */
  33. .fi-logo {
  34. display: none !important;
  35. }
  36. .fi-logo::after {
  37. content: '数学知识图谱管理系统' !important;
  38. display: inline-block !important;
  39. font-size: 1.25rem !important;
  40. font-weight: 600 !important;
  41. color: #0ea5e9 !important;
  42. }
  43. /* 玻璃态面板 */
  44. .glass-panel {
  45. @apply rounded-2xl border border-white/20 bg-white/70 shadow-lg backdrop-blur-md transition-all duration-300 hover:shadow-xl dark:border-white/10 dark:bg-slate-900/60;
  46. }
  47. /* 卡片组件 */
  48. .metric-card {
  49. @apply rounded-xl border border-slate-200/80 bg-white/90 px-6 py-5 shadow-sm transition-all duration-300 hover:shadow-md hover:scale-[1.02] dark:border-slate-700/80 dark:bg-slate-900/50;
  50. }
  51. /* 渐变背景 */
  52. .gradient-bg {
  53. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  54. }
  55. .gradient-bg-light {
  56. background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  57. }
  58. /* 现代化按钮 */
  59. .btn-modern {
  60. @apply relative inline-flex items-center justify-center px-6 py-3 text-sm font-medium text-white bg-primary-600 rounded-lg shadow-md transition-all duration-300 hover:bg-primary-700 hover:shadow-lg hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 active:scale-95;
  61. }
  62. .btn-modern-outline {
  63. @apply relative inline-flex items-center justify-center px-6 py-3 text-sm font-medium text-primary-600 bg-transparent border border-primary-600 rounded-lg shadow-sm transition-all duration-300 hover:bg-primary-50 hover:shadow-md hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 active:scale-95;
  64. }
  65. /* 输入框样式 */
  66. .input-modern {
  67. @apply w-full px-4 py-3 text-sm border border-slate-300 rounded-lg transition-all duration-200 focus:border-primary-500 focus:ring-2 focus:ring-primary-200 focus:outline-none hover:border-slate-400 dark:bg-slate-800 dark:border-slate-600 dark:text-slate-100 dark:hover:border-slate-500;
  68. }
  69. /* 表格样式增强 */
  70. .table-modern {
  71. @apply w-full border-collapse overflow-hidden rounded-lg shadow-sm border border-slate-200 dark:border-slate-700;
  72. }
  73. .table-modern thead th {
  74. @apply px-6 py-4 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider bg-slate-50/50 dark:bg-slate-800/50 dark:text-slate-300;
  75. }
  76. .table-modern tbody tr {
  77. @apply transition-colors duration-200 hover:bg-slate-50/70 dark:hover:bg-slate-800/50;
  78. }
  79. .table-modern tbody td {
  80. @apply px-6 py-4 text-sm text-slate-900 border-t border-slate-200 dark:border-slate-700 dark:text-slate-100;
  81. }
  82. /* 导航栏样式 */
  83. .navbar-modern {
  84. @apply backdrop-blur-md bg-white/80 shadow-sm border-b border-slate-200/50 dark:bg-slate-900/80 dark:border-slate-700/50;
  85. }
  86. /* 侧边栏样式 */
  87. .sidebar-modern {
  88. @apply bg-white border-r border-slate-200 dark:bg-slate-900 dark:border-slate-700;
  89. }
  90. /* 页面标题 */
  91. .page-title {
  92. @apply text-3xl font-bold text-slate-900 mb-2 dark:text-white;
  93. }
  94. .page-subtitle {
  95. @apply text-sm text-slate-600 dark:text-slate-400;
  96. }
  97. /* 状态指示器 */
  98. .status-online {
  99. @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-400;
  100. }
  101. .status-offline {
  102. @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900/50 dark:text-red-400;
  103. }
  104. .status-pending {
  105. @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900/50 dark:text-yellow-400;
  106. }
  107. /* 加载动画 */
  108. .loading-spinner {
  109. @apply inline-block w-4 h-4 border-2 border-slate-300 border-t-primary-600 rounded-full animate-spin;
  110. }
  111. /* 动画效果 */
  112. .animate-fade-in {
  113. @apply animate-fadeIn;
  114. }
  115. .animate-slide-up {
  116. @apply animate-slideUp;
  117. }
  118. /* OCR记录详情页面特有样式 */
  119. .ocr-record-table {
  120. @apply table-zebra table-compact;
  121. }
  122. .ocr-record-table thead th {
  123. @apply bg-base-200 text-sm font-semibold text-base-content/80;
  124. }
  125. .ocr-record-table tbody tr {
  126. @apply hover:bg-base-100;
  127. }
  128. .ocr-record-table tbody td {
  129. @apply border-t border-base-300;
  130. vertical-align: middle;
  131. }
  132. /* 时间轴样式增强 */
  133. .timeline.timeline-vertical .timeline-middle .timeline-box {
  134. @apply border-2 shadow-lg transition-all duration-300 hover:scale-110;
  135. }
  136. .timeline.timeline-vertical .timeline-middle .timeline-box:hover {
  137. @apply transform hover:scale-125 hover:shadow-xl;
  138. }
  139. /* 状态徽章增强 */
  140. .status-badge {
  141. @apply inline-flex items-center gap-1 px-3 py-1 rounded-full text-xs font-medium transition-all duration-200;
  142. }
  143. .status-badge:hover {
  144. @apply transform hover:scale-105;
  145. }
  146. /* Filament 页面头部统一样式 */
  147. .fi-header {
  148. @apply mb-6 flex flex-wrap items-start justify-between gap-3 rounded-xl bg-white/90 px-5 py-4 shadow-sm ring-1 ring-slate-200/80 backdrop-blur-sm;
  149. }
  150. .fi-header-heading {
  151. @apply text-2xl font-bold text-slate-900 leading-tight;
  152. }
  153. .fi-header-subheading {
  154. @apply mt-1 text-sm text-slate-600;
  155. }
  156. /* Filament 内置面包屑全局样式 */
  157. .fi-breadcrumbs {
  158. @apply mb-4 flex items-center rounded-lg bg-base-100 px-4 py-2 shadow-sm ring-1 ring-base-200;
  159. }
  160. .fi-breadcrumbs-list {
  161. @apply breadcrumbs text-sm text-base-content/70;
  162. }
  163. .fi-breadcrumbs-item-label {
  164. @apply inline-flex items-center gap-1 text-base-content/70 transition-colors duration-150 hover:text-primary-600;
  165. }
  166. .fi-breadcrumbs-item .fi-breadcrumbs-item-separator {
  167. @apply text-base-300;
  168. }
  169. /* 当前节点加粗,禁用 hover 色 */
  170. .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label {
  171. @apply font-semibold text-base-content cursor-default hover:text-base-content;
  172. }
  173. /* 头部栏里的面包屑去掉额外下边距 */
  174. .fi-header nav.fi-breadcrumbs {
  175. @apply mb-0;
  176. }
  177. /* 面包屑样式增强(全局) */
  178. nav[aria-label="Breadcrumb"],
  179. .breadcrumb-modern {
  180. @apply mb-4 flex items-center rounded-xl bg-white/80 px-4 py-2 shadow-sm ring-1 ring-slate-200/80 backdrop-blur-sm;
  181. }
  182. nav[aria-label="Breadcrumb"] ol,
  183. .breadcrumb-modern ol {
  184. @apply flex items-center gap-3 text-sm text-slate-600;
  185. }
  186. nav[aria-label="Breadcrumb"] a,
  187. .breadcrumb-modern a {
  188. @apply inline-flex items-center gap-1 text-slate-600 transition-colors duration-150 hover:text-primary-600;
  189. }
  190. nav[aria-label="Breadcrumb"] .crumb-current,
  191. .breadcrumb-modern .crumb-current {
  192. @apply inline-flex items-center gap-1 font-semibold text-slate-900;
  193. }
  194. nav[aria-label="Breadcrumb"] .crumb-divider,
  195. .breadcrumb-modern .crumb-divider {
  196. @apply h-4 w-px bg-slate-200;
  197. }
  198. /* 图片预览框架 */
  199. .mockup-window {
  200. @apply border border-slate-300 rounded-t-lg overflow-hidden;
  201. }
  202. .mockup-browser-toolbar {
  203. @apply bg-slate-200 px-2 py-1 flex items-center gap-1 border-b border-slate-300;
  204. }
  205. .mockup-browser-content {
  206. @apply bg-white;
  207. min-height: 200px;
  208. }
  209. .mockup-browser-dot {
  210. @apply w-2 h-2 rounded-full bg-slate-300;
  211. }
  212. /* OCR置信度指示器 */
  213. .confidence-indicator {
  214. @apply w-2 h-2 rounded-full;
  215. transition: all 0.3s ease;
  216. }
  217. .confidence-high {
  218. @apply bg-green-500;
  219. }
  220. .confidence-medium {
  221. @apply bg-yellow-500;
  222. }
  223. .confidence-low {
  224. @apply bg-red-500;
  225. }
  226. /* AI分析结果卡片 */
  227. .ai-result-card {
  228. @apply bg-gradient-to-br from-success/10 to-success/5 border border-success/20 rounded-lg p-4;
  229. }
  230. .ai-result-card.high-score {
  231. @apply from-success/10 to-success/5;
  232. }
  233. .ai-result-card.medium-score {
  234. @apply from-yellow/10 to-yellow/5;
  235. }
  236. .ai-result-card.low-score {
  237. @apply from-error/10 to-error/5;
  238. }
  239. /* 提交按钮区域 */
  240. .submit-analysis-section {
  241. @apply bg-gradient-to-r from-primary/5 to-primary/10 border border-primary/20 rounded-xl p-6 transition-all duration-300;
  242. }
  243. .submit-analysis-section:hover {
  244. @apply bg-primary/10 border-primary/30;
  245. }
  246. .submit-analysis-section.completed {
  247. @apply bg-gradient-to-r from-success/5 to-success/10 border border-success/20;
  248. }
  249. /* 响应式优化 */
  250. @media (max-width: 768px) {
  251. .stats-vertical,
  252. .stats-horizontal {
  253. @apply grid grid-cols-2;
  254. }
  255. .ocr-record-table {
  256. @apply text-xs;
  257. }
  258. .ocr-record-table th,
  259. .ocr-record-table td {
  260. @apply px-2 py-1;
  261. }
  262. /* 移动端隐藏部分列 */
  263. .mobile-hidden {
  264. @apply hidden;
  265. }
  266. }
  267. @media (max-width: 480px) {
  268. .stats-vertical,
  269. .stats-horizontal {
  270. @apply grid grid-cols-1;
  271. }
  272. .ocr-record-table {
  273. @apply text-xs;
  274. }
  275. .mobile-sm-only {
  276. @apply block;
  277. }
  278. .mobile-hidden {
  279. @apply hidden;
  280. }
  281. }
  282. /* 深色模式适配 */
  283. @media (prefers-color-scheme: dark) {
  284. .mockup-window {
  285. @apply border-slate-700;
  286. }
  287. .mockup-browser-toolbar {
  288. @apply bg-slate-800 border-slate-700;
  289. }
  290. .mockup-browser-content {
  291. @apply bg-slate-800;
  292. }
  293. .mockup-browser-dot {
  294. @apply bg-slate-600;
  295. }
  296. }
  297. /* 毛玻璃效果 */
  298. .frosted-glass {
  299. @apply bg-white/10 backdrop-blur-lg border border-white/20 shadow-xl;
  300. }
  301. .frosted-glass-dark {
  302. @apply bg-slate-900/10 backdrop-blur-lg border border-slate-700/20 shadow-xl;
  303. }
  304. /* 悬停效果 */
  305. .hover-lift {
  306. @apply transition-transform duration-300 hover:-translate-y-1 hover:shadow-lg;
  307. }
  308. /* 统计卡片特殊样式 */
  309. .stat-card {
  310. @apply relative overflow-hidden rounded-xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-sm transition-all duration-300 hover:shadow-md hover:border-primary-200 dark:border-slate-700 dark:from-slate-800 dark:to-slate-900 dark:hover:border-primary-800;
  311. }
  312. .stat-card::before {
  313. content: '';
  314. @apply absolute inset-0 bg-gradient-to-br from-primary-500/10 to-transparent opacity-0 transition-opacity duration-300;
  315. }
  316. .stat-card:hover::before {
  317. @apply opacity-100;
  318. }
  319. /* 徽章样式 */
  320. .badge-modern {
  321. @apply inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium transition-colors duration-200;
  322. }
  323. .badge-primary {
  324. @apply bg-primary-100 text-primary-800 dark:bg-primary-900/50 dark:text-primary-300;
  325. }
  326. .badge-secondary {
  327. @apply bg-secondary-100 text-secondary-800 dark:bg-secondary-900/50 dark:text-secondary-300;
  328. }
  329. .badge-success {
  330. @apply bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-400;
  331. }
  332. .badge-warning {
  333. @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900/50 dark:text-yellow-400;
  334. }
  335. .badge-error {
  336. @apply bg-red-100 text-red-800 dark:bg-red-900/50 dark:text-red-400;
  337. }
  338. /* 分割线 */
  339. .divider-modern {
  340. @apply my-6 border-0 border-t border-slate-200 dark:border-slate-700;
  341. }
  342. /* =========================================
  343. 全局输入框美化 (Global Input Polish)
  344. ========================================= */
  345. /*
  346. 策略:
  347. 1. 对于登录页 (.fi-simple-layout),我们禁用 Filament 的 wrapper 样式,直接对 input 应用 DaisyUI 组件样式。
  348. 2. 对于后台管理页,我们保留 Filament 的 wrapper 结构(为了兼容前缀/后缀图标),但用 CSS 模拟 DaisyUI 的外观。
  349. */
  350. /* --- 登录页面 (Simple Layout) --- */
  351. /* 移除 Filament wrapper 的默认样式 */
  352. .fi-simple-layout .fi-input-wrp {
  353. @apply ring-0 shadow-none bg-transparent !important;
  354. }
  355. /* 直接对 input 应用 DaisyUI 样式 */
  356. .fi-simple-layout input:not([type='checkbox']):not([type='radio']),
  357. .fi-simple-layout select {
  358. @apply input input-bordered input-primary w-full bg-white text-gray-900 !important;
  359. height: 2.75rem !important;
  360. /* 修复高度 */
  361. }
  362. .fi-simple-layout input:focus,
  363. .fi-simple-layout select:focus {
  364. @apply outline-none border-primary-500 ring-2 ring-primary-500/20 !important;
  365. }
  366. /* 登录按钮美化 */
  367. .fi-simple-layout .fi-btn {
  368. @apply btn btn-primary w-full text-white font-bold shadow-lg hover:shadow-xl transition-all duration-300 !important;
  369. border: none !important;
  370. }
  371. /* 复选框美化 */
  372. .fi-simple-layout input[type='checkbox'] {
  373. @apply checkbox checkbox-primary rounded border-gray-300 !important;
  374. }
  375. /* 链接美化 */
  376. .fi-simple-layout a {
  377. @apply link link-primary hover:link-hover transition-colors !important;
  378. }
  379. /* --- 后台管理页面 (Admin Panel) --- */
  380. /* 模拟 DaisyUI input-bordered 的外观 */
  381. .fi-input-wrp,
  382. .fi-select-input {
  383. @apply bg-white border border-base-300 shadow-sm rounded-lg transition-all duration-200 !important;
  384. /* 覆盖 Filament 的默认 ring */
  385. box-shadow: none !important;
  386. ring: 0 !important;
  387. }
  388. /* 聚焦状态 */
  389. .fi-input-wrp:focus-within,
  390. .fi-select-input:focus-within {
  391. @apply border-primary-500 ring-2 ring-primary-500/20 !important;
  392. }
  393. /* 内部 input 保持透明 */
  394. .fi-input-wrp input,
  395. .fi-select-input select {
  396. @apply bg-transparent border-none shadow-none ring-0 focus:ring-0 !important;
  397. }
  398. /* 暗色模式适配 */
  399. :is(.dark) .fi-simple-layout input:not([type='checkbox']):not([type='radio']),
  400. :is(.dark) .fi-simple-layout select {
  401. @apply bg-base-200 text-base-content border-base-content/20 !important;
  402. }
  403. :is(.dark) .fi-input-wrp,
  404. :is(.dark) .fi-select-input {
  405. @apply bg-base-200 border-base-content/20 !important;
  406. }
  407. :is(.dark) .fi-simple-layout .fi-btn {
  408. @apply btn-primary text-white !important;
  409. }
  410. }
  411. @layer utilities {
  412. /* 文字渐变 */
  413. .text-gradient {
  414. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  415. -webkit-background-clip: text;
  416. -webkit-text-fill-color: transparent;
  417. background-clip: text;
  418. }
  419. /* 隐藏滚动条 */
  420. .no-scrollbar {
  421. -ms-overflow-style: none;
  422. scrollbar-width: none;
  423. }
  424. .no-scrollbar::-webkit-scrollbar {
  425. display: none;
  426. }
  427. /* 混合模式 */
  428. .mix-blend-multiply {
  429. mix-blend-mode: multiply;
  430. }
  431. .mix-blend-screen {
  432. mix-blend-mode: screen;
  433. }
  434. }