app.css 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  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. /* UI baseline */
  33. .ui-page {
  34. @apply min-h-screen bg-slate-50;
  35. }
  36. .ui-header {
  37. @apply flex flex-col gap-4 rounded-2xl border border-slate-200 bg-white px-6 py-5 shadow-sm;
  38. }
  39. .ui-title {
  40. @apply text-2xl font-semibold text-slate-900;
  41. }
  42. .ui-subtitle {
  43. @apply text-sm text-slate-500;
  44. }
  45. .ui-section-title {
  46. @apply text-lg font-semibold text-slate-900;
  47. }
  48. .ui-kicker {
  49. @apply text-xs font-medium uppercase tracking-widest text-slate-400;
  50. }
  51. .ui-card {
  52. @apply rounded-2xl border border-slate-200 bg-white shadow-sm;
  53. }
  54. .ui-card-header {
  55. @apply flex items-center justify-between border-b border-slate-200 px-5 py-4;
  56. }
  57. .ui-card-body {
  58. @apply px-5 py-4;
  59. }
  60. .ui-stat {
  61. @apply rounded-xl border border-slate-200 bg-white px-4 py-4 shadow-sm;
  62. }
  63. .ui-stat-label {
  64. @apply text-xs font-medium text-slate-500;
  65. }
  66. .ui-stat-value {
  67. @apply mt-1 text-2xl font-semibold text-slate-900;
  68. }
  69. .ui-badge-muted {
  70. @apply inline-flex items-center rounded-full bg-slate-100 px-2.5 py-0.5 text-xs text-slate-600;
  71. }
  72. .ui-action-group {
  73. @apply inline-flex items-center gap-1 rounded-lg border border-slate-200 bg-white p-1;
  74. }
  75. .ui-action-icon {
  76. @apply btn btn-ghost btn-sm h-8 w-8 min-h-0 p-0;
  77. }
  78. .ui-filter-bar {
  79. @apply rounded-2xl border border-slate-200 bg-white px-5 py-4 shadow-sm;
  80. }
  81. .ui-empty {
  82. @apply flex flex-col items-center justify-center gap-3 rounded-2xl border border-dashed border-slate-200 bg-white px-6 py-10 text-center;
  83. }
  84. .ui-empty-title {
  85. @apply text-base font-semibold text-slate-900;
  86. }
  87. .ui-empty-desc {
  88. @apply text-sm text-slate-500;
  89. }
  90. /* Table density */
  91. body[data-density="compact"] .table :where(th, td),
  92. body[data-density="compact"] .fi-ta-table :where(th, td) {
  93. padding-top: 0.4rem;
  94. padding-bottom: 0.4rem;
  95. }
  96. body[data-density="comfortable"] .table :where(th, td),
  97. body[data-density="comfortable"] .fi-ta-table :where(th, td) {
  98. padding-top: 0.75rem;
  99. padding-bottom: 0.75rem;
  100. }
  101. /* Standard table header */
  102. .ui-table-head th {
  103. @apply text-xs font-semibold uppercase tracking-wide text-slate-500;
  104. }
  105. /* Status tags */
  106. .ui-tag {
  107. @apply inline-flex items-center gap-1 rounded-full border border-slate-200 px-2.5 py-0.5 text-xs text-slate-600;
  108. }
  109. /* 教材管理页面美化 */
  110. .textbook-page {
  111. @apply bg-slate-50 min-h-screen;
  112. }
  113. .textbook-header {
  114. @apply mb-6 p-6 bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl border border-blue-100 shadow-sm;
  115. }
  116. .textbook-header h1 {
  117. @apply text-3xl font-bold text-blue-600 mb-2;
  118. }
  119. .textbook-header p {
  120. @apply text-sm text-slate-600;
  121. }
  122. /* 卡片美化 */
  123. .textbook-card {
  124. @apply bg-white rounded-xl shadow-lg border border-slate-200 p-6 transition-all duration-300 hover:shadow-xl;
  125. }
  126. .textbook-card-header {
  127. @apply mb-4 p-4 bg-slate-50 rounded-lg border border-slate-200;
  128. }
  129. .textbook-card-header h2 {
  130. @apply text-lg font-semibold text-slate-900;
  131. }
  132. .textbook-card-header p {
  133. @apply text-sm text-slate-600 mt-1;
  134. }
  135. /* 表格美化 */
  136. .textbook-table {
  137. @apply w-full border-collapse overflow-hidden rounded-lg shadow-sm border border-slate-200 bg-white;
  138. }
  139. .textbook-table thead th {
  140. @apply px-6 py-4 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider bg-slate-50;
  141. }
  142. .textbook-table tbody tr {
  143. @apply transition-colors duration-200 hover:bg-slate-50;
  144. }
  145. .textbook-table tbody td {
  146. @apply px-6 py-4 text-sm text-slate-900 border-t border-slate-200;
  147. }
  148. /* 按钮美化 */
  149. .textbook-btn {
  150. @apply px-4 py-2 rounded-lg font-medium transition-all duration-200;
  151. }
  152. .textbook-btn-primary {
  153. @apply bg-blue-600 text-white hover:bg-blue-700 shadow-sm hover:shadow-md;
  154. }
  155. .textbook-btn-secondary {
  156. @apply bg-white text-slate-700 border border-slate-300 hover:bg-slate-50;
  157. }
  158. .textbook-btn-danger {
  159. @apply bg-red-600 text-white hover:bg-red-700 shadow-sm hover:shadow-md;
  160. }
  161. /* 表单美化 */
  162. .textbook-form-field {
  163. @apply mb-4;
  164. }
  165. .textbook-form-label {
  166. @apply block text-sm font-medium text-slate-700 mb-2;
  167. }
  168. .textbook-form-input {
  169. @apply w-full px-4 py-3 text-sm border border-slate-300 rounded-lg transition-all duration-200 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:outline-none hover:border-slate-400;
  170. }
  171. /* 徽章美化 */
  172. .textbook-badge {
  173. @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium;
  174. }
  175. .textbook-badge-primary {
  176. @apply bg-blue-100 text-blue-800;
  177. }
  178. .textbook-badge-success {
  179. @apply bg-green-100 text-green-800;
  180. }
  181. .textbook-badge-warning {
  182. @apply bg-yellow-100 text-yellow-800;
  183. }
  184. .textbook-badge-danger {
  185. @apply bg-red-100 text-red-800;
  186. }
  187. /* 状态指示器 */
  188. .textbook-status {
  189. @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
  190. }
  191. .textbook-status-active {
  192. @apply bg-green-100 text-green-800;
  193. }
  194. .textbook-status-inactive {
  195. @apply bg-red-100 text-red-800;
  196. }
  197. .textbook-status-pending {
  198. @apply bg-yellow-100 text-yellow-800;
  199. }
  200. /* Filament 登录页面定制 */
  201. .fi-logo {
  202. display: none !important;
  203. }
  204. .fi-logo::after {
  205. content: '数学知识图谱管理系统' !important;
  206. display: inline-block !important;
  207. font-size: 1.25rem !important;
  208. font-weight: 600 !important;
  209. color: #0ea5e9 !important;
  210. }
  211. /* 玻璃态面板 */
  212. .glass-panel {
  213. @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;
  214. }
  215. /* 卡片组件 */
  216. .metric-card {
  217. @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;
  218. }
  219. /* 渐变背景 */
  220. .gradient-bg {
  221. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  222. }
  223. .gradient-bg-light {
  224. background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  225. }
  226. /* 现代化按钮 */
  227. .btn-modern {
  228. @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;
  229. }
  230. .btn-modern-outline {
  231. @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;
  232. }
  233. /* 输入框样式 */
  234. .input-modern {
  235. @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;
  236. }
  237. /* 表格样式增强 */
  238. .table-modern {
  239. @apply w-full border-collapse overflow-hidden rounded-lg shadow-sm border border-slate-200 dark:border-slate-700;
  240. }
  241. .table-modern thead th {
  242. @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;
  243. }
  244. .table-modern tbody tr {
  245. @apply transition-colors duration-200 hover:bg-slate-50/70 dark:hover:bg-slate-800/50;
  246. }
  247. .table-modern tbody td {
  248. @apply px-6 py-4 text-sm text-slate-900 border-t border-slate-200 dark:border-slate-700 dark:text-slate-100;
  249. }
  250. /* 导航栏样式 */
  251. .navbar-modern {
  252. @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;
  253. }
  254. /* 侧边栏样式 */
  255. .sidebar-modern {
  256. @apply bg-white border-r border-slate-200 dark:bg-slate-900 dark:border-slate-700;
  257. }
  258. /* 页面标题 */
  259. .page-title {
  260. @apply text-3xl font-bold text-slate-900 mb-2 dark:text-white;
  261. }
  262. .page-subtitle {
  263. @apply text-sm text-slate-600 dark:text-slate-400;
  264. }
  265. /* 状态指示器 */
  266. .status-online {
  267. @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;
  268. }
  269. .status-offline {
  270. @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;
  271. }
  272. .status-pending {
  273. @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;
  274. }
  275. /* 加载动画 */
  276. .loading-spinner {
  277. @apply inline-block w-4 h-4 border-2 border-slate-300 border-t-primary-600 rounded-full animate-spin;
  278. }
  279. /* 动画效果 */
  280. .animate-fade-in {
  281. @apply animate-fadeIn;
  282. }
  283. .animate-slide-up {
  284. @apply animate-slideUp;
  285. }
  286. /* OCR记录详情页面特有样式 */
  287. .ocr-record-table {
  288. @apply table-zebra table-compact;
  289. }
  290. .ocr-record-table thead th {
  291. @apply bg-base-200 text-sm font-semibold text-base-content/80;
  292. }
  293. .ocr-record-table tbody tr {
  294. @apply hover:bg-base-100;
  295. }
  296. .ocr-record-table tbody td {
  297. @apply border-t border-base-300;
  298. vertical-align: middle;
  299. }
  300. /* 时间轴样式增强 */
  301. .timeline.timeline-vertical .timeline-middle .timeline-box {
  302. @apply border-2 shadow-lg transition-all duration-300 hover:scale-110;
  303. }
  304. .timeline.timeline-vertical .timeline-middle .timeline-box:hover {
  305. @apply transform hover:scale-125 hover:shadow-xl;
  306. }
  307. /* 状态徽章增强 */
  308. .status-badge {
  309. @apply inline-flex items-center gap-1 px-3 py-1 rounded-full text-xs font-medium transition-all duration-200;
  310. }
  311. .status-badge:hover {
  312. @apply transform hover:scale-105;
  313. }
  314. /* Filament 页面头部统一样式 */
  315. .fi-header {
  316. @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;
  317. }
  318. .fi-header-heading {
  319. @apply text-2xl font-bold text-slate-900 leading-tight;
  320. }
  321. .fi-header-subheading {
  322. @apply mt-1 text-sm text-slate-600;
  323. }
  324. /* Filament 内置面包屑全局样式 */
  325. .fi-breadcrumbs {
  326. @apply mb-4 flex items-center rounded-lg bg-base-100 px-4 py-2 shadow-sm ring-1 ring-base-200;
  327. }
  328. .fi-breadcrumbs-list {
  329. @apply breadcrumbs text-sm text-base-content/70;
  330. }
  331. .fi-breadcrumbs-item-label {
  332. @apply inline-flex items-center gap-1 text-base-content/70 transition-colors duration-150 hover:text-primary-600;
  333. }
  334. .fi-breadcrumbs-item .fi-breadcrumbs-item-separator {
  335. @apply text-base-300;
  336. }
  337. /* 当前节点加粗,禁用 hover 色 */
  338. .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label {
  339. @apply font-semibold text-base-content cursor-default hover:text-base-content;
  340. }
  341. /* 头部栏里的面包屑去掉额外下边距 */
  342. .fi-header nav.fi-breadcrumbs {
  343. @apply mb-0;
  344. }
  345. /* 面包屑样式增强(全局) */
  346. nav[aria-label="Breadcrumb"],
  347. .breadcrumb-modern {
  348. @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;
  349. }
  350. nav[aria-label="Breadcrumb"] ol,
  351. .breadcrumb-modern ol {
  352. @apply flex items-center gap-3 text-sm text-slate-600;
  353. }
  354. nav[aria-label="Breadcrumb"] a,
  355. .breadcrumb-modern a {
  356. @apply inline-flex items-center gap-1 text-slate-600 transition-colors duration-150 hover:text-primary-600;
  357. }
  358. nav[aria-label="Breadcrumb"] .crumb-current,
  359. .breadcrumb-modern .crumb-current {
  360. @apply inline-flex items-center gap-1 font-semibold text-slate-900;
  361. }
  362. nav[aria-label="Breadcrumb"] .crumb-divider,
  363. .breadcrumb-modern .crumb-divider {
  364. @apply h-4 w-px bg-slate-200;
  365. }
  366. /* 图片预览框架 */
  367. .mockup-window {
  368. @apply border border-slate-300 rounded-t-lg overflow-hidden;
  369. }
  370. .mockup-browser-toolbar {
  371. @apply bg-slate-200 px-2 py-1 flex items-center gap-1 border-b border-slate-300;
  372. }
  373. .mockup-browser-content {
  374. @apply bg-white;
  375. min-height: 200px;
  376. }
  377. .mockup-browser-dot {
  378. @apply w-2 h-2 rounded-full bg-slate-300;
  379. }
  380. /* OCR置信度指示器 */
  381. .confidence-indicator {
  382. @apply w-2 h-2 rounded-full;
  383. transition: all 0.3s ease;
  384. }
  385. .confidence-high {
  386. @apply bg-green-500;
  387. }
  388. .confidence-medium {
  389. @apply bg-yellow-500;
  390. }
  391. .confidence-low {
  392. @apply bg-red-500;
  393. }
  394. /* AI分析结果卡片 */
  395. .ai-result-card {
  396. @apply bg-gradient-to-br from-success/10 to-success/5 border border-success/20 rounded-lg p-4;
  397. }
  398. .ai-result-card.high-score {
  399. @apply from-success/10 to-success/5;
  400. }
  401. .ai-result-card.medium-score {
  402. @apply from-yellow/10 to-yellow/5;
  403. }
  404. .ai-result-card.low-score {
  405. @apply from-error/10 to-error/5;
  406. }
  407. /* 提交按钮区域 */
  408. .submit-analysis-section {
  409. @apply bg-gradient-to-r from-primary/5 to-primary/10 border border-primary/20 rounded-xl p-6 transition-all duration-300;
  410. }
  411. .submit-analysis-section:hover {
  412. @apply bg-primary/10 border-primary/30;
  413. }
  414. .submit-analysis-section.completed {
  415. @apply bg-gradient-to-r from-success/5 to-success/10 border border-success/20;
  416. }
  417. /* 响应式优化 */
  418. @media (max-width: 768px) {
  419. .stats-vertical,
  420. .stats-horizontal {
  421. @apply grid grid-cols-2;
  422. }
  423. .ocr-record-table {
  424. @apply text-xs;
  425. }
  426. .ocr-record-table th,
  427. .ocr-record-table td {
  428. @apply px-2 py-1;
  429. }
  430. /* 移动端隐藏部分列 */
  431. .mobile-hidden {
  432. @apply hidden;
  433. }
  434. }
  435. @media (max-width: 480px) {
  436. .stats-vertical,
  437. .stats-horizontal {
  438. @apply grid grid-cols-1;
  439. }
  440. .ocr-record-table {
  441. @apply text-xs;
  442. }
  443. .mobile-sm-only {
  444. @apply block;
  445. }
  446. .mobile-hidden {
  447. @apply hidden;
  448. }
  449. }
  450. /* 深色模式适配 */
  451. @media (prefers-color-scheme: dark) {
  452. .mockup-window {
  453. @apply border-slate-700;
  454. }
  455. .mockup-browser-toolbar {
  456. @apply bg-slate-800 border-slate-700;
  457. }
  458. .mockup-browser-content {
  459. @apply bg-slate-800;
  460. }
  461. .mockup-browser-dot {
  462. @apply bg-slate-600;
  463. }
  464. }
  465. /* 毛玻璃效果 */
  466. .frosted-glass {
  467. @apply bg-white/10 backdrop-blur-lg border border-white/20 shadow-xl;
  468. }
  469. .frosted-glass-dark {
  470. @apply bg-slate-900/10 backdrop-blur-lg border border-slate-700/20 shadow-xl;
  471. }
  472. /* 悬停效果 */
  473. .hover-lift {
  474. @apply transition-transform duration-300 hover:-translate-y-1 hover:shadow-lg;
  475. }
  476. /* 统计卡片特殊样式 */
  477. .stat-card {
  478. @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;
  479. }
  480. .stat-card::before {
  481. content: '';
  482. @apply absolute inset-0 bg-gradient-to-br from-primary-500/10 to-transparent opacity-0 transition-opacity duration-300;
  483. }
  484. .stat-card:hover::before {
  485. @apply opacity-100;
  486. }
  487. /* 徽章样式 */
  488. .badge-modern {
  489. @apply inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium transition-colors duration-200;
  490. }
  491. .badge-primary {
  492. @apply bg-primary-100 text-primary-800 dark:bg-primary-900/50 dark:text-primary-300;
  493. }
  494. .badge-secondary {
  495. @apply bg-secondary-100 text-secondary-800 dark:bg-secondary-900/50 dark:text-secondary-300;
  496. }
  497. .badge-success {
  498. @apply bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-400;
  499. }
  500. .badge-warning {
  501. @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900/50 dark:text-yellow-400;
  502. }
  503. .badge-error {
  504. @apply bg-red-100 text-red-800 dark:bg-red-900/50 dark:text-red-400;
  505. }
  506. /* 分割线 */
  507. .divider-modern {
  508. @apply my-6 border-0 border-t border-slate-200 dark:border-slate-700;
  509. }
  510. /* =========================================
  511. 全局输入框美化 (Global Input Polish)
  512. ========================================= */
  513. /*
  514. 策略:
  515. 1. 对于登录页 (.fi-simple-layout),我们禁用 Filament 的 wrapper 样式,直接对 input 应用 DaisyUI 组件样式。
  516. 2. 对于后台管理页,我们保留 Filament 的 wrapper 结构(为了兼容前缀/后缀图标),但用 CSS 模拟 DaisyUI 的外观。
  517. */
  518. /* --- 登录页面 (Simple Layout) --- */
  519. /* 移除 Filament wrapper 的默认样式 */
  520. .fi-simple-layout .fi-input-wrp {
  521. @apply ring-0 shadow-none bg-transparent !important;
  522. }
  523. /* 直接对 input 应用 DaisyUI 样式 */
  524. .fi-simple-layout input:not([type='checkbox']):not([type='radio']),
  525. .fi-simple-layout select {
  526. @apply input input-bordered input-primary w-full bg-white text-gray-900 !important;
  527. height: 2.75rem !important;
  528. /* 修复高度 */
  529. }
  530. .fi-simple-layout input:focus,
  531. .fi-simple-layout select:focus {
  532. @apply outline-none border-primary-500 ring-2 ring-primary-500/20 !important;
  533. }
  534. /* 登录按钮美化 */
  535. .fi-simple-layout .fi-btn {
  536. @apply btn btn-primary w-full text-white font-bold shadow-lg hover:shadow-xl transition-all duration-300 !important;
  537. border: none !important;
  538. }
  539. /* 复选框美化 */
  540. .fi-simple-layout input[type='checkbox'] {
  541. @apply checkbox checkbox-primary rounded border-gray-300 !important;
  542. }
  543. /* 链接美化 */
  544. .fi-simple-layout a {
  545. @apply link link-primary hover:link-hover transition-colors !important;
  546. }
  547. /* --- 后台管理页面 (Admin Panel) --- */
  548. /* 模拟 DaisyUI input-bordered 的外观 */
  549. .fi-input-wrp,
  550. .fi-select-input {
  551. @apply bg-white border border-base-300 shadow-sm rounded-lg transition-all duration-200 !important;
  552. /* 覆盖 Filament 的默认 ring */
  553. box-shadow: none !important;
  554. ring: 0 !important;
  555. }
  556. /* 聚焦状态 */
  557. .fi-input-wrp:focus-within,
  558. .fi-select-input:focus-within {
  559. @apply border-primary-500 ring-2 ring-primary-500/20 !important;
  560. }
  561. /* 内部 input 保持透明 */
  562. .fi-input-wrp input,
  563. .fi-select-input select {
  564. @apply bg-transparent border-none shadow-none ring-0 focus:ring-0 !important;
  565. }
  566. /* 暗色模式适配 */
  567. :is(.dark) .fi-simple-layout input:not([type='checkbox']):not([type='radio']),
  568. :is(.dark) .fi-simple-layout select {
  569. @apply bg-base-200 text-base-content border-base-content/20 !important;
  570. }
  571. :is(.dark) .fi-input-wrp,
  572. :is(.dark) .fi-select-input {
  573. @apply bg-base-200 border-base-content/20 !important;
  574. }
  575. :is(.dark) .fi-simple-layout .fi-btn {
  576. @apply btn-primary text-white !important;
  577. }
  578. /* =========================================
  579. 教材管理表单美化 (Textbook Form Polish)
  580. ========================================= */
  581. /* 表单容器美化 */
  582. .fi-fo-component-ctn {
  583. @apply space-y-6 !important;
  584. }
  585. /* 表单字段组美化 */
  586. .fi-fo-field-wrp {
  587. @apply mb-5 !important;
  588. }
  589. /* 标签美化 */
  590. .fi-fo-field-wrp-label {
  591. @apply text-sm font-semibold text-slate-700 mb-2 flex items-center gap-2 !important;
  592. }
  593. .fi-fo-field-wrp-label sup {
  594. @apply text-red-500 font-bold !important;
  595. }
  596. /* 输入框容器 - 玻璃态效果 */
  597. .fi-input-wrp {
  598. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl shadow-sm transition-all duration-300 overflow-hidden !important;
  599. }
  600. .fi-input-wrp:hover {
  601. @apply border-slate-300 shadow-md !important;
  602. }
  603. .fi-input-wrp:focus-within {
  604. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 !important;
  605. }
  606. /* 输入框本体 */
  607. .fi-input-wrp input,
  608. .fi-input-wrp textarea {
  609. @apply bg-transparent px-4 py-3 text-slate-800 placeholder-slate-400 text-base !important;
  610. }
  611. .fi-input-wrp input::placeholder,
  612. .fi-input-wrp textarea::placeholder {
  613. @apply text-slate-400 !important;
  614. }
  615. /* 选择框美化 */
  616. .fi-select-wrp {
  617. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl shadow-sm transition-all duration-300 !important;
  618. }
  619. .fi-select-wrp:hover {
  620. @apply border-slate-300 shadow-md !important;
  621. }
  622. .fi-select-wrp:focus-within {
  623. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 !important;
  624. }
  625. /* 原生选择框 */
  626. .fi-select-input {
  627. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl shadow-sm px-4 py-3 text-slate-800 transition-all duration-300 !important;
  628. }
  629. .fi-select-input:hover {
  630. @apply border-slate-300 shadow-md !important;
  631. }
  632. .fi-select-input:focus {
  633. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 outline-none !important;
  634. }
  635. /* 多选框美化 */
  636. .fi-checkbox-input {
  637. @apply w-5 h-5 rounded-lg border-2 border-slate-300 text-blue-600 transition-all duration-200 cursor-pointer !important;
  638. }
  639. .fi-checkbox-input:hover {
  640. @apply border-blue-400 !important;
  641. }
  642. .fi-checkbox-input:checked {
  643. @apply bg-blue-600 border-blue-600 !important;
  644. }
  645. .fi-checkbox-input:focus {
  646. @apply ring-4 ring-blue-500/20 !important;
  647. }
  648. /* Radio 美化 */
  649. .fi-radio-input {
  650. @apply w-5 h-5 border-2 border-slate-300 text-blue-600 transition-all duration-200 cursor-pointer !important;
  651. }
  652. .fi-radio-input:hover {
  653. @apply border-blue-400 !important;
  654. }
  655. .fi-radio-input:checked {
  656. @apply border-blue-600 !important;
  657. }
  658. .fi-radio-input:focus {
  659. @apply ring-4 ring-blue-500/20 !important;
  660. }
  661. /* Toggle 开关美化 */
  662. .fi-toggle-input {
  663. @apply w-11 h-6 bg-slate-200 rounded-full transition-all duration-300 cursor-pointer !important;
  664. }
  665. .fi-toggle-input:checked {
  666. @apply bg-blue-600 !important;
  667. }
  668. /* 文本域美化 */
  669. .fi-textarea-wrp {
  670. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl shadow-sm transition-all duration-300 !important;
  671. }
  672. .fi-textarea-wrp:hover {
  673. @apply border-slate-300 shadow-md !important;
  674. }
  675. .fi-textarea-wrp:focus-within {
  676. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 !important;
  677. }
  678. .fi-textarea-wrp textarea {
  679. @apply bg-transparent px-4 py-3 text-slate-800 placeholder-slate-400 text-base min-h-[120px] !important;
  680. }
  681. /* 帮助文本美化 */
  682. .fi-fo-field-wrp-hint {
  683. @apply mt-2 text-xs text-slate-500 flex items-center gap-1 !important;
  684. }
  685. .fi-fo-field-wrp-hint::before {
  686. content: '💡';
  687. @apply text-sm;
  688. }
  689. /* 错误提示美化 */
  690. .fi-fo-field-wrp-error-message {
  691. @apply mt-2 text-sm text-red-600 flex items-center gap-1 bg-red-50 px-3 py-2 rounded-lg !important;
  692. }
  693. .fi-fo-field-wrp-error-message::before {
  694. content: '⚠️';
  695. }
  696. /* 表单区块美化 */
  697. .fi-fo-section {
  698. @apply bg-white/60 backdrop-blur-sm rounded-2xl border border-slate-200/50 p-6 mb-6 shadow-sm !important;
  699. }
  700. .fi-fo-section-header {
  701. @apply pb-4 mb-4 border-b border-slate-200 !important;
  702. }
  703. .fi-fo-section-header-heading {
  704. @apply text-lg font-bold text-slate-800 !important;
  705. }
  706. .fi-fo-section-header-description {
  707. @apply text-sm text-slate-500 mt-1 !important;
  708. }
  709. /* =========================================
  710. 表单按钮美化 (Enhanced Form Actions)
  711. ========================================= */
  712. /* 按钮容器 */
  713. .fi-ac {
  714. @apply flex items-center justify-between gap-4 pt-8 mt-8 border-t border-slate-200 bg-gradient-to-r from-slate-50 to-white px-6 py-6 rounded-xl shadow-sm !important;
  715. }
  716. /* 基础按钮样式重写 - 扩展到所有按钮 */
  717. .fi-btn,
  718. button[wire*="click"],
  719. button[type="submit"],
  720. button[type="button"],
  721. .fi-icon-btn,
  722. .fi-dropdown-list-item-button {
  723. @apply transition-all duration-300 !important;
  724. }
  725. /* ===== 主要按钮 (保存/提交) ===== */
  726. button.fi-btn[class*="bg-primary"],
  727. a.fi-btn[class*="bg-primary"],
  728. .fi-btn-fi-color-primary,
  729. button[type="submit"] {
  730. @apply bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold px-8 py-3 rounded-xl shadow-lg shadow-blue-500/30 transition-all duration-300 hover:shadow-xl hover:shadow-blue-500/40 hover:-translate-y-0.5 focus:ring-4 focus:ring-blue-500/20 active:translate-y-0 active:shadow-md border-0 relative overflow-hidden !important;
  731. }
  732. button.fi-btn[class*="bg-primary"]::before,
  733. a.fi-btn[class*="bg-primary"]::before,
  734. .fi-btn-fi-color-primary::before,
  735. button[type="submit"]::before {
  736. content: '';
  737. @apply absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 transition-transform duration-700;
  738. transform: translateX(-100%);
  739. }
  740. button.fi-btn[class*="bg-primary"]:hover::before,
  741. a.fi-btn[class*="bg-primary"]:hover::before,
  742. .fi-btn-fi-color-primary:hover::before,
  743. button[type="submit"]:hover::before {
  744. transform: translateX(100%);
  745. }
  746. button.fi-btn[class*="bg-primary"]:hover,
  747. a.fi-btn[class*="bg-primary"]:hover,
  748. .fi-btn-fi-color-primary:hover,
  749. button[type="submit"]:hover {
  750. @apply shadow-blue-500/40 !important;
  751. }
  752. /* ===== 次要按钮 (取消/返回) ===== */
  753. button.fi-btn[class*="bg-gray"],
  754. a.fi-btn[class*="bg-gray"],
  755. .fi-btn-fi-color-gray {
  756. @apply bg-white hover:bg-slate-50 text-slate-700 font-semibold px-8 py-3 rounded-xl border-2 border-slate-200 shadow-md hover:shadow-lg transition-all duration-300 hover:-translate-y-0.5 focus:ring-4 focus:ring-slate-300/50 active:translate-y-0 active:shadow-sm !important;
  757. }
  758. button.fi-btn[class*="bg-gray"]:hover,
  759. a.fi-btn[class*="bg-gray"]:hover,
  760. .fi-btn-fi-color-gray:hover {
  761. @apply border-slate-300 text-slate-900 !important;
  762. }
  763. /* ===== 成功按钮 (保存并创建另一个) ===== */
  764. button.fi-btn[class*="bg-success"],
  765. a.fi-btn[class*="bg-success"],
  766. .fi-btn-fi-color-success {
  767. @apply bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-700 hover:to-teal-700 text-white font-semibold px-8 py-3 rounded-xl shadow-lg shadow-emerald-500/30 transition-all duration-300 hover:shadow-xl hover:shadow-emerald-500/40 hover:-translate-y-0.5 focus:ring-4 focus:ring-emerald-500/20 active:translate-y-0 active:shadow-md border-0 relative overflow-hidden !important;
  768. }
  769. button.fi-btn[class*="bg-success"]::before,
  770. a.fi-btn[class*="bg-success"]::before,
  771. .fi-btn-fi-color-success::before {
  772. content: '';
  773. @apply absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 transition-transform duration-700;
  774. transform: translateX(-100%);
  775. }
  776. button.fi-btn[class*="bg-success"]:hover::before,
  777. a.fi-btn[class*="bg-success"]:hover::before,
  778. .fi-btn-fi-color-success:hover::before {
  779. transform: translateX(100%);
  780. }
  781. button.fi-btn[class*="bg-success"]:hover,
  782. a.fi-btn[class*="bg-success"]:hover,
  783. .fi-btn-fi-color-success:hover {
  784. @apply shadow-emerald-500/40 !important;
  785. }
  786. /* ===== 危险按钮 (删除) ===== */
  787. button.fi-btn[class*="bg-danger"],
  788. a.fi-btn[class*="bg-danger"],
  789. .fi-btn-fi-color-danger {
  790. @apply bg-gradient-to-r from-red-500 to-rose-500 hover:from-red-600 hover:to-rose-600 text-white font-semibold px-8 py-3 rounded-xl shadow-lg shadow-red-500/30 transition-all duration-300 hover:shadow-xl hover:shadow-red-500/40 hover:-translate-y-0.5 focus:ring-4 focus:ring-red-500/20 active:translate-y-0 active:shadow-md border-0 relative overflow-hidden !important;
  791. }
  792. button.fi-btn[class*="bg-danger"]::before,
  793. a.fi-btn[class*="bg-danger"]::before,
  794. .fi-btn-fi-color-danger::before {
  795. content: '';
  796. @apply absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 transition-transform duration-700;
  797. transform: translateX(-100%);
  798. }
  799. button.fi-btn[class*="bg-danger"]:hover::before,
  800. a.fi-btn[class*="bg-danger"]:hover::before,
  801. .fi-btn-fi-color-danger:hover::before {
  802. transform: translateX(100%);
  803. }
  804. button.fi-btn[class*="bg-danger"]:hover,
  805. a.fi-btn[class*="bg-danger"]:hover,
  806. .fi-btn-fi-color-danger:hover {
  807. @apply shadow-red-500/40 !important;
  808. }
  809. /* ===== 警告按钮 ===== */
  810. button.fi-btn[class*="bg-warning"],
  811. a.fi-btn[class*="bg-warning"],
  812. .fi-btn-fi-color-warning {
  813. @apply bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white font-semibold px-8 py-3 rounded-xl shadow-lg shadow-amber-500/30 transition-all duration-300 hover:shadow-xl hover:shadow-amber-500/40 hover:-translate-y-0.5 focus:ring-4 focus:ring-amber-500/20 active:translate-y-0 active:shadow-md border-0 relative overflow-hidden !important;
  814. }
  815. button.fi-btn[class*="bg-warning"]::before,
  816. a.fi-btn[class*="bg-warning"]::before,
  817. .fi-btn-fi-color-warning::before {
  818. content: '';
  819. @apply absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 transition-transform duration-700;
  820. transform: translateX(-100%);
  821. }
  822. button.fi-btn[class*="bg-warning"]:hover::before,
  823. a.fi-btn[class*="bg-warning"]:hover::before,
  824. .fi-btn-fi-color-warning:hover::before {
  825. transform: translateX(100%);
  826. }
  827. button.fi-btn[class*="bg-warning"]:hover,
  828. a.fi-btn[class*="bg-warning"]:hover,
  829. .fi-btn-fi-color-warning:hover {
  830. @apply shadow-amber-500/40 !important;
  831. }
  832. /* ===== 操作按钮 (编辑/查看) ===== */
  833. .fi-btn-fi-color-secondary {
  834. @apply bg-gradient-to-r from-indigo-500 to-purple-600 hover:from-indigo-600 hover:to-purple-700 text-white font-semibold px-6 py-2.5 rounded-lg shadow-md transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 !important;
  835. }
  836. /* ===== 通用轮廓按钮 ===== */
  837. .fi-outlined.fi-btn,
  838. button.fi-btn.outline,
  839. a.fi-btn.outline {
  840. @apply bg-white hover:bg-slate-50 text-slate-700 border-2 border-slate-200 shadow-sm hover:shadow-md transition-all duration-300 hover:-translate-y-0.5 !important;
  841. }
  842. .fi-outlined.fi-btn:hover,
  843. button.fi-btn.outline:hover,
  844. a.fi-btn.outline:hover {
  845. @apply border-slate-300 text-slate-900 !important;
  846. }
  847. /* ===== 表格操作按钮 ===== */
  848. .fi-table .fi-btn,
  849. [data-fi-table] button,
  850. .fi-bulk-action,
  851. .fi-dropdown-list-item-button {
  852. @apply transition-all duration-300 !important;
  853. }
  854. .fi-table .fi-btn:hover,
  855. [data-fi-table] button:hover,
  856. .fi-bulk-action:hover,
  857. .fi-dropdown-list-item-button:hover {
  858. @apply -translate-y-0.5 shadow-lg !important;
  859. }
  860. /* ===== 批量操作按钮 ===== */
  861. .fi-bulk-action-group .fi-btn {
  862. @apply mx-1 !important;
  863. }
  864. /* ===== 响应式按钮 ===== */
  865. @media (max-width: 640px) {
  866. .fi-ac {
  867. @apply flex-col !important;
  868. }
  869. .fi-ac .fi-btn {
  870. @apply w-full justify-center !important;
  871. }
  872. .fi-btn,
  873. button[type="submit"],
  874. button[type="button"],
  875. a.fi-btn {
  876. @apply px-6 py-3 text-sm !important;
  877. }
  878. .fi-table .fi-btn {
  879. @apply px-3 py-2 text-xs !important;
  880. }
  881. }
  882. /* KeyValue 组件美化 */
  883. .fi-fo-key-value {
  884. @apply bg-white/80 backdrop-blur-sm rounded-xl border-2 border-slate-200 overflow-hidden !important;
  885. }
  886. .fi-fo-key-value-header {
  887. @apply bg-slate-50 px-4 py-3 border-b border-slate-200 !important;
  888. }
  889. .fi-fo-key-value-row {
  890. @apply flex items-center border-b border-slate-100 last:border-b-0 !important;
  891. }
  892. .fi-fo-key-value-row input {
  893. @apply px-4 py-3 text-slate-800 !important;
  894. }
  895. /* TagsInput 美化 */
  896. .fi-fo-tags-input {
  897. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl p-2 transition-all duration-300 !important;
  898. }
  899. .fi-fo-tags-input:focus-within {
  900. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 !important;
  901. }
  902. .fi-fo-tags-input-tag {
  903. @apply bg-blue-100 text-blue-800 px-3 py-1 rounded-lg text-sm font-medium !important;
  904. }
  905. /* Repeater 美化 */
  906. .fi-fo-repeater-item {
  907. @apply bg-white/80 backdrop-blur-sm rounded-xl border-2 border-slate-200 p-4 mb-4 transition-all duration-300 !important;
  908. }
  909. .fi-fo-repeater-item:hover {
  910. @apply border-slate-300 shadow-md !important;
  911. }
  912. /* 文件上传美化 */
  913. .fi-fo-file-upload {
  914. @apply bg-white/90 backdrop-blur-sm border-2 border-dashed border-slate-300 rounded-xl p-8 text-center transition-all duration-300 !important;
  915. }
  916. .fi-fo-file-upload:hover {
  917. @apply border-blue-400 bg-blue-50/50 !important;
  918. }
  919. .fi-fo-file-upload-icon {
  920. @apply text-slate-400 mb-3 !important;
  921. }
  922. /* 日期选择器美化 */
  923. .fi-fo-date-time-picker {
  924. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl shadow-sm transition-all duration-300 !important;
  925. }
  926. .fi-fo-date-time-picker:focus-within {
  927. @apply border-blue-500 shadow-lg shadow-blue-500/10 ring-4 ring-blue-500/10 !important;
  928. }
  929. /* 富文本编辑器美化 */
  930. .fi-fo-rich-editor {
  931. @apply bg-white/90 backdrop-blur-sm border-2 border-slate-200 rounded-xl overflow-hidden transition-all duration-300 !important;
  932. }
  933. .fi-fo-rich-editor:focus-within {
  934. @apply border-blue-500 shadow-lg shadow-blue-500/10 !important;
  935. }
  936. .fi-fo-rich-editor-toolbar {
  937. @apply bg-slate-50 border-b border-slate-200 px-3 py-2 !important;
  938. }
  939. .fi-fo-rich-editor-content {
  940. @apply px-4 py-3 min-h-[200px] !important;
  941. }
  942. }
  943. @layer utilities {
  944. /* 文字渐变 */
  945. .text-gradient {
  946. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  947. -webkit-background-clip: text;
  948. -webkit-text-fill-color: transparent;
  949. background-clip: text;
  950. }
  951. /* 隐藏滚动条 */
  952. .no-scrollbar {
  953. -ms-overflow-style: none;
  954. scrollbar-width: none;
  955. }
  956. .no-scrollbar::-webkit-scrollbar {
  957. display: none;
  958. }
  959. /* 混合模式 */
  960. .mix-blend-multiply {
  961. mix-blend-mode: multiply;
  962. }
  963. .mix-blend-screen {
  964. mix-blend-mode: screen;
  965. }
  966. }