style.css 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /* 基本样式重置 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  9. line-height: 1.6;
  10. color: #333;
  11. background-color: #f5f7fa;
  12. background-image: linear-gradient(to right, rgba(245, 247, 250, 0.8) 1px, transparent 1px),
  13. linear-gradient(to bottom, rgba(245, 247, 250, 0.8) 1px, transparent 1px);
  14. background-size: 20px 20px;
  15. padding-top: 15px;
  16. max-width: 1200px;
  17. margin: 0 auto;
  18. font-size:100%;
  19. }
  20. .container {
  21. width: 100%;
  22. max-width: 1200px;
  23. margin: 0 auto;
  24. padding: 0 20px;
  25. }
  26. /* 主内容区 */
  27. main {
  28. padding: 40px 0;
  29. }
  30. .app-container {
  31. display: flex;
  32. gap: 30px;
  33. margin-bottom: 30px;
  34. }
  35. /* 左侧边栏 */
  36. .sidebar {
  37. flex: 0 0 350px;
  38. display: flex;
  39. flex-direction: column;
  40. gap: 15px;
  41. }
  42. /* 面板共用样式 */
  43. .panel {
  44. background: white;
  45. border-radius: 12px;
  46. padding: 15px;
  47. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  48. transition: box-shadow 0.3s;
  49. position: relative;
  50. overflow: hidden;
  51. }
  52. .panel:hover {
  53. box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  54. }
  55. .panel::after {
  56. content: '';
  57. position: absolute;
  58. top: 0;
  59. left: 0;
  60. width: 100%;
  61. height: 4px;
  62. background: linear-gradient(90deg, #4568dc, #b06ab3);
  63. }
  64. .panel h2 {
  65. font-size: 1.4rem;
  66. font-weight: 600;
  67. margin-bottom: 20px;
  68. color: #333;
  69. border-bottom: 1px solid #eee;
  70. padding-bottom: 15px;
  71. position: relative;
  72. }
  73. .panel h2::after {
  74. content: '';
  75. position: absolute;
  76. bottom: -1px;
  77. left: 0;
  78. width: 60px;
  79. height: 3px;
  80. background: linear-gradient(90deg, #4568dc, #b06ab3);
  81. border-radius: 3px;
  82. }
  83. /* 输入组样式 */
  84. .input-group {
  85. margin-bottom: 20px;
  86. }
  87. .input-group label {
  88. display: block;
  89. margin-bottom: 8px;
  90. font-weight: 500;
  91. color: #444;
  92. }
  93. .input-group input[type="text"],
  94. .input-group select,
  95. .input-group textarea {
  96. width: 100%;
  97. padding: 12px;
  98. border: 1px solid #ddd;
  99. border-radius: 8px;
  100. font-size: 12.6px;
  101. transition: all 0.3s;
  102. background-color: #f9f9f9;
  103. }
  104. .input-group input[type="text"]:focus,
  105. .input-group select:focus,
  106. .input-group textarea:focus {
  107. border-color: #4568dc;
  108. outline: none;
  109. box-shadow: 0 0 0 3px rgba(69, 104, 220, 0.2);
  110. background-color: white;
  111. }
  112. .checkbox-group {
  113. display: flex;
  114. align-items: center;
  115. position: relative;
  116. left: -230px;
  117. }
  118. .checkbox-group label {
  119. display: flex;
  120. align-items: center;
  121. cursor: pointer;
  122. margin-right: 10px;
  123. }
  124. .checkbox-group input[type="checkbox"] {
  125. margin-right: 2px;
  126. accent-color: #4568dc;
  127. width: 16px;
  128. height: 16px;
  129. }
  130. .csv-options {
  131. display: flex;
  132. gap: 15px;
  133. margin-top: 10px;
  134. }
  135. /* 按钮样式 */
  136. .btn {
  137. display: inline-block;
  138. padding: 12px 20px;
  139. border: none;
  140. border-radius: 8px;
  141. font-size: 13.5px;
  142. font-weight: 500;
  143. cursor: pointer;
  144. transition: all 0.3s;
  145. position: relative;
  146. overflow: hidden;
  147. }
  148. .btn::after {
  149. content: '';
  150. position: absolute;
  151. top: 0;
  152. left: -100%;
  153. width: 100%;
  154. height: 100%;
  155. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  156. transition: left 0.5s;
  157. }
  158. .btn:hover::after {
  159. left: 100%;
  160. }
  161. .btn-primary {
  162. background: linear-gradient(135deg, #4568dc, #5c7be5);
  163. color: white;
  164. box-shadow: 0 5px 15px rgba(69, 104, 220, 0.3);
  165. }
  166. .btn-primary:hover {
  167. background: linear-gradient(135deg, #3a56bb, #4d69cd);
  168. transform: translateY(-2px);
  169. box-shadow: 0 8px 20px rgba(69, 104, 220, 0.4);
  170. }
  171. .btn-primary:disabled {
  172. background: #a5b1e2;
  173. cursor: not-allowed;
  174. box-shadow: none;
  175. }
  176. .btn-secondary {
  177. background: linear-gradient(135deg, #f0f2f5, #e4e7f0);
  178. color: #444;
  179. box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  180. }
  181. .btn-secondary:hover {
  182. background: linear-gradient(135deg, #e4e6e9, #d8dce6);
  183. transform: translateY(-2px);
  184. box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  185. }
  186. .input-group .btn {
  187. margin-right: 10px;
  188. }
  189. /* 右侧主要内容区 */
  190. .main-content {
  191. flex: 1;
  192. display: flex;
  193. flex-direction: column;
  194. gap: 25px;
  195. max-width: 800px;
  196. margin: 0 auto;
  197. }
  198. .chart-container {
  199. background-color: #fff;
  200. border-radius: 12px;
  201. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  202. padding: 25px;
  203. margin-bottom: 6px;
  204. transition: box-shadow 0.3s;
  205. position: relative;
  206. overflow: hidden;
  207. max-width: 100%;
  208. overflow-x: auto;
  209. }
  210. .chart-container::after {
  211. content: '';
  212. position: absolute;
  213. top: 0;
  214. left: 0;
  215. width: 100%;
  216. height: 4px;
  217. background: linear-gradient(90deg, #4568dc, #b06ab3);
  218. }
  219. .chart-container:hover {
  220. box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  221. }
  222. #chart-wrapper {
  223. flex: 1;
  224. position: relative;
  225. border-radius: 8px;
  226. overflow: hidden;
  227. margin: 0 0 20px 0;
  228. border: 1px solid #e0e0e0;
  229. padding: 15px;
  230. background: white;
  231. transition: all 0.3s ease;
  232. box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
  233. }
  234. /* 添加图表区域默认背景样式 */
  235. #chart-wrapper:empty {
  236. background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='grad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23f0f4ff;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%23eef4ff;stop-opacity:1' /%3E%3C/linearGradient%3E%3Cpattern id='grid' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 0 10 L 40 10 M 10 0 L 10 40 M 0 20 L 40 20 M 20 0 L 20 40 M 0 30 L 40 30 M 30 0 L 30 40' fill='none' stroke='%23e0e0e0' stroke-width='0.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23grad)'/%3E%3Crect width='100%25' height='100%25' fill='url(%23grid)'/%3E%3Ctext x='50%25' y='50%25' font-family='Arial, sans-serif' font-size='16' font-weight='bold' text-anchor='middle' fill='%23aaaaaa' dominant-baseline='middle'%3E选择数据并点击"生成图表"%3C/text%3E%3Cg transform='translate(50%25, 40%25)'%3E%3Cpath d='M-40,-30 L-40,30 L40,30' stroke='%234568dc' stroke-width='2' fill='none' stroke-opacity='0.3'/%3E%3Ccircle cx='-20' cy='10' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Ccircle cx='0' cy='-10' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Ccircle cx='20' cy='0' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Cpath d='M-20,10 L0,-10 L20,0' stroke='%234568dc' stroke-width='2' fill='none' stroke-opacity='0.3'/%3E%3C/g%3E%3C/svg%3E");
  237. background-size: cover;
  238. background-position: center;
  239. min-height: 300px;
  240. display: flex;
  241. align-items: center;
  242. justify-content: center;
  243. }
  244. .chart-actions {
  245. display: flex;
  246. justify-content: flex-end;
  247. gap: 12px;
  248. margin-bottom: 20px;
  249. padding: 0 0 15px 0;
  250. border-bottom: 1px solid #e0e0e0;
  251. }
  252. /* 提示面板 */
  253. .tips-panel {
  254. background: white;
  255. border-radius: 12px;
  256. padding: 25px;
  257. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  258. position: relative;
  259. overflow: hidden;
  260. max-width: 100%;
  261. overflow-x: auto;
  262. }
  263. .tips-panel::after {
  264. content: '';
  265. position: absolute;
  266. top: 0;
  267. left: 0;
  268. width: 100%;
  269. height: 4px;
  270. background: linear-gradient(90deg, #4568dc, #b06ab3);
  271. }
  272. .tips-panel h3 {
  273. font-size: 1.2rem;
  274. margin-bottom: 15px;
  275. color: #333;
  276. position: relative;
  277. padding-bottom: 10px;
  278. }
  279. .tips-panel h3::after {
  280. content: '';
  281. position: absolute;
  282. bottom: 0;
  283. left: 0;
  284. width: 40px;
  285. height: 3px;
  286. background: linear-gradient(90deg, #4568dc, #b06ab3);
  287. border-radius: 3px;
  288. }
  289. .tips-panel ul {
  290. padding-left: 20px;
  291. }
  292. .tips-panel li {
  293. margin-bottom: 10px;
  294. color: #555;
  295. position: relative;
  296. }
  297. .tips-panel li::before {
  298. content: '';
  299. position: absolute;
  300. left: -20px;
  301. top: 8px;
  302. width: 8px;
  303. height: 8px;
  304. background: linear-gradient(135deg, #4568dc, #b06ab3);
  305. border-radius: 50%;
  306. }
  307. /* 响应式设计 */
  308. @media (max-width: 900px) {
  309. .app-container {
  310. flex-direction: column;
  311. }
  312. .sidebar {
  313. flex: initial;
  314. width: 100%;
  315. }
  316. .chart-container {
  317. height: 400px;
  318. }
  319. }
  320. /* 数据格式切换相关样式 */
  321. #simple-data-container,
  322. #series-data-container,
  323. #csv-data-container {
  324. transition: all 0.3s ease;
  325. }
  326. /* 图表导出loading效果 */
  327. .loading-overlay {
  328. position: absolute;
  329. top: 0;
  330. left: 0;
  331. right: 0;
  332. bottom: 0;
  333. background: rgba(255, 255, 255, 0.8);
  334. display: flex;
  335. align-items: center;
  336. justify-content: center;
  337. z-index: 10;
  338. backdrop-filter: blur(3px);
  339. }
  340. .loading-spinner {
  341. width: 45px;
  342. height: 45px;
  343. border: 4px solid rgba(69, 104, 220, 0.3);
  344. border-radius: 50%;
  345. border-top: 4px solid #4568dc;
  346. animation: spin 1s linear infinite;
  347. box-shadow: 0 0 10px rgba(69, 104, 220, 0.2);
  348. }
  349. @keyframes spin {
  350. 0% { transform: rotate(0deg); }
  351. 100% { transform: rotate(360deg); }
  352. }
  353. /* 通知弹窗样式 */
  354. .notification {
  355. position: fixed;
  356. top: 20px;
  357. right: 20px;
  358. padding: 15px 25px;
  359. background: linear-gradient(135deg, #4caf50, #45a049);
  360. color: white;
  361. border-radius: 8px;
  362. box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  363. z-index: 100;
  364. opacity: 0;
  365. transform: translateY(-20px);
  366. transition: all 0.3s;
  367. }
  368. .notification.show {
  369. opacity: 1;
  370. transform: translateY(0);
  371. }
  372. .notification.error {
  373. background: linear-gradient(135deg, #f44336, #e53935);
  374. }
  375. /* 添加引导动画 */
  376. @keyframes pulse {
  377. 0% { box-shadow: 0 0 0 0 rgba(69, 104, 220, 0.6); }
  378. 70% { box-shadow: 0 0 0 12px rgba(69, 104, 220, 0); }
  379. 100% { box-shadow: 0 0 0 0 rgba(69, 104, 220, 0); }
  380. }
  381. #generate-btn {
  382. animation: pulse 2s infinite;
  383. }
  384. /* 图表类型画廊 */
  385. .chart-type-gallery {
  386. margin-top: 25px;
  387. border-top: 1px solid #e0e0e0;
  388. padding-top: 20px;
  389. }
  390. .chart-type-gallery h3 {
  391. font-size: 1.08rem;
  392. margin-bottom: 15px;
  393. color: #333;
  394. position: relative;
  395. display: inline-block;
  396. padding-bottom: 8px;
  397. }
  398. .chart-type-gallery h3::after {
  399. content: '';
  400. position: absolute;
  401. bottom: 0;
  402. left: 0;
  403. width: 100%;
  404. height: 3px;
  405. background: linear-gradient(90deg, #4568dc, #b06ab3);
  406. border-radius: 3px;
  407. }
  408. .chart-type-scroller {
  409. overflow-x: auto;
  410. white-space: nowrap;
  411. padding-bottom: 15px;
  412. /* 自定义滚动条 */
  413. scrollbar-width: thin;
  414. scrollbar-color: #ccc #f0f0f0;
  415. }
  416. .chart-type-scroller::-webkit-scrollbar {
  417. height: 8px;
  418. }
  419. .chart-type-scroller::-webkit-scrollbar-track {
  420. background: #f0f0f0;
  421. border-radius: 10px;
  422. }
  423. .chart-type-scroller::-webkit-scrollbar-thumb {
  424. background: linear-gradient(90deg, #4568dc, #b06ab3);
  425. border-radius: 10px;
  426. }
  427. .chart-type-group {
  428. display: inline-block;
  429. vertical-align: top;
  430. margin-right: 25px;
  431. min-width: 250px;
  432. }
  433. .chart-type-group h4 {
  434. font-size: 15.3px;
  435. margin: 0 0 12px 0;
  436. color: #444;
  437. border-bottom: 1px dashed #e0e0e0;
  438. padding-bottom: 8px;
  439. }
  440. .chart-type-items {
  441. display: flex;
  442. flex-wrap: wrap;
  443. gap: 12px;
  444. }
  445. .chart-type-item {
  446. width: 85px;
  447. text-align: center;
  448. cursor: pointer;
  449. transition: box-shadow 0.3s, background-color 0.3s;
  450. border-radius: 8px;
  451. padding: 10px 5px;
  452. background-color: #f9f9f9;
  453. box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  454. }
  455. .chart-type-item:hover {
  456. background-color: #f0f8ff;
  457. box-shadow: 0 8px 15px rgba(0,0,0,0.1);
  458. }
  459. .chart-type-item.active {
  460. background: linear-gradient(135deg, #e6f2ff, #eef8ff);
  461. border: 1px solid #b3d7ff;
  462. box-shadow: 0 5px 15px rgba(69, 104, 220, 0.15);
  463. }
  464. .chart-type-item img {
  465. width: 60px;
  466. height: 60px;
  467. object-fit: contain;
  468. margin-bottom: 8px;
  469. border-radius: 4px;
  470. background: white;
  471. padding: 3px;
  472. border: 1px solid #eee;
  473. }
  474. .chart-type-item span {
  475. display: block;
  476. font-size: 11.7px;
  477. color: #444;
  478. white-space: normal;
  479. line-height: 1.3;
  480. }
  481. /* 添加canvas样式 */
  482. canvas#chart-canvas {
  483. height: 450px !important;
  484. }
  485. /* 为canvas添加默认背景,但在绘制图表时不显示背景 */
  486. canvas#chart-canvas:not([data-chart-rendered]) {
  487. background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='grad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%23f0f4ff;stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:%23eef4ff;stop-opacity:1' /%3E%3C/linearGradient%3E%3Cpattern id='grid' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 0 10 L 40 10 M 10 0 L 10 40 M 0 20 L 40 20 M 20 0 L 20 40 M 0 30 L 40 30 M 30 0 L 30 40' fill='none' stroke='%23e0e0e0' stroke-width='0.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23grad)'/%3E%3Crect width='100%25' height='100%25' fill='url(%23grid)'/%3E%3Cg transform='translate(50%25, 50%25)'%3E%3Cpath d='M-40,-30 L-40,30 L40,30' stroke='%234568dc' stroke-width='2' fill='none' stroke-opacity='0.3'/%3E%3Ccircle cx='-20' cy='10' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Ccircle cx='0' cy='-10' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Ccircle cx='20' cy='0' r='5' fill='%234568dc' fill-opacity='0.3'/%3E%3Cpath d='M-20,10 L0,-10 L20,0' stroke='%234568dc' stroke-width='2' fill='none' stroke-opacity='0.3'/%3E%3C/g%3E%3C/svg%3E");
  488. background-size: cover;
  489. background-position: center;
  490. }
  491. /* 确保有data-chart-rendered属性的canvas没有背景图 */
  492. canvas#chart-canvas[data-chart-rendered] {
  493. background-image: none !important;
  494. }
  495. /* 美化文件上传控件 */
  496. .input-group input[type="file"] {
  497. width: 0.1px;
  498. height: 0.1px;
  499. opacity: 0;
  500. overflow: hidden;
  501. position: absolute;
  502. z-index: -1;
  503. }
  504. .input-group input[type="file"] + label {
  505. display: flex;
  506. align-items: center;
  507. justify-content: center;
  508. padding: 12px 15px;
  509. border-radius: 8px;
  510. background: linear-gradient(135deg, #f0f2f5, #e4e7f0);
  511. color: #444;
  512. cursor: pointer;
  513. font-weight: 500;
  514. transition: all 0.3s;
  515. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  516. margin-bottom: 0;
  517. text-align: center;
  518. width: 100%;
  519. }
  520. .input-group input[type="file"] + label:hover {
  521. background: #e9ecef;
  522. border-color: #adb5bd;
  523. }
  524. .input-group input[type="file"] + label::before {
  525. content: '\f07c'; /* Use Font Awesome icon code for folder */
  526. font-family: "Font Awesome 5 Free"; /* Ensure Font Awesome is loaded */
  527. font-weight: 900;
  528. margin-right: 8px;
  529. display: inline-block; /* Ensure icon aligns properly */
  530. }
  531. /* 新增的页面头部样式 */
  532. .page-header {
  533. background-color: #f8f9fa;
  534. padding: 12px 20px;
  535. border-bottom: 1px solid #e3e6f0;
  536. display: flex;
  537. align-items: center;
  538. margin-bottom: 20px;
  539. }
  540. .page-header .header-link {
  541. display: inline-flex;
  542. align-items: center;
  543. text-decoration: none;
  544. color: #5a5c69;
  545. font-weight: 500;
  546. font-size: 1.2rem;
  547. transition: color 0.2s ease-in-out;
  548. }
  549. .page-header .header-link:hover {
  550. color: #4e73df;
  551. }
  552. .page-header .header-link img {
  553. margin-right: 8px;
  554. height: 18px;
  555. width: 18px;
  556. }
  557. .page-header .header-link .fehelper-text {
  558. font-weight: 700;
  559. }
  560. .page-header .page-title-suffix {
  561. margin-left: 8px;
  562. font-size: 1.2rem;
  563. color: #858796;
  564. }