main.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. @import url("all.min.css");
  2. /* 全局样式 */
  3. :root {
  4. --primary-color: #4a6bff;
  5. --secondary-color: #6c757d;
  6. --background-color: #f8f9fa;
  7. --card-bg: #ffffff;
  8. --text-color: #333333;
  9. --border-color: #e0e0e0;
  10. --success-color: #28a745;
  11. --danger-color: #dc3545;
  12. --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  13. --radius: 8px;
  14. --transition: all 0.3s ease;
  15. }
  16. * {
  17. margin: 0;
  18. padding: 0;
  19. box-sizing: border-box;
  20. }
  21. body {
  22. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  23. background-color: var(--background-color);
  24. color: var(--text-color);
  25. line-height: 1.6;
  26. }
  27. .app-container {
  28. max-width: 1200px;
  29. margin: 0 auto;
  30. padding: 0 20px 20px;
  31. }
  32. /* 头部样式 */
  33. .app-header {
  34. text-align: center;
  35. margin-bottom: 20px;
  36. padding: 15px 0;
  37. border-bottom: 1px solid var(--border-color);
  38. }
  39. .app-header h1 {
  40. font-size: 2.2rem;
  41. color: var(--primary-color);
  42. margin-bottom: 5px;
  43. }
  44. .app-description {
  45. font-size: 1rem;
  46. color: var(--secondary-color);
  47. }
  48. /* 主内容区域 */
  49. .app-main {
  50. display: flex;
  51. gap: 20px;
  52. max-height: calc(100vh - 150px);
  53. height: calc(100vh - 150px); /* 添加固定高度 */
  54. }
  55. .tool-panel {
  56. flex: 1;
  57. display: flex;
  58. flex-direction: column;
  59. background-color: var(--card-bg);
  60. border-radius: var(--radius);
  61. box-shadow: var(--shadow);
  62. overflow: hidden;
  63. min-height: 0; /* 确保 flex 子元素可以正确滚动 */
  64. }
  65. .preview-panel {
  66. flex: 1;
  67. background-color: var(--card-bg);
  68. border-radius: var(--radius);
  69. box-shadow: var(--shadow);
  70. display: flex;
  71. flex-direction: column;
  72. }
  73. /* 面板选项卡 */
  74. .panel-tabs {
  75. display: flex;
  76. border-bottom: 1px solid var(--border-color);
  77. height: 46px; /* 统一高度 */
  78. flex-shrink: 0; /* 防止压缩 */
  79. }
  80. .panel-tab {
  81. flex: 1;
  82. padding: 12px 15px;
  83. background: none;
  84. border: none;
  85. font-size: 0.95rem;
  86. font-weight: 500;
  87. color: var(--secondary-color);
  88. cursor: pointer;
  89. transition: var(--transition);
  90. display: flex;
  91. align-items: center;
  92. justify-content: center;
  93. gap: 8px;
  94. }
  95. .panel-tab i {
  96. font-size: 1rem;
  97. }
  98. .panel-tab span {
  99. margin-top: 1px;
  100. }
  101. .panel-tab:hover {
  102. background-color: rgba(0, 0, 0, 0.03);
  103. }
  104. .panel-tab.active {
  105. color: var(--primary-color);
  106. border-bottom: 2px solid var(--primary-color);
  107. }
  108. .panel-tab.active i {
  109. color: var(--primary-color);
  110. }
  111. .panel-content {
  112. flex: 1;
  113. display: flex;
  114. flex-direction: column;
  115. min-height: 0; /* 确保内容可以滚动 */
  116. height: 100%;
  117. }
  118. .tab-content {
  119. display: none;
  120. width: 100%;
  121. height: 100%;
  122. padding: 15px;
  123. overflow-y: auto;
  124. }
  125. .tab-content.active {
  126. display: block;
  127. }
  128. /* 模板选择区域 */
  129. .template-selection {
  130. height: 100%;
  131. display: flex;
  132. flex-direction: column;
  133. }
  134. .template-categories {
  135. display: flex;
  136. flex-wrap: wrap;
  137. gap: 8px;
  138. margin-bottom: 12px;
  139. flex-shrink: 0; /* 防止压缩 */
  140. }
  141. .category-btn {
  142. padding: 5px 10px;
  143. border-radius: 16px;
  144. border: 1px solid var(--border-color);
  145. background-color: white;
  146. font-size: 0.85rem;
  147. cursor: pointer;
  148. transition: var(--transition);
  149. }
  150. .category-btn:hover {
  151. background-color: var(--background-color);
  152. }
  153. .category-btn.active {
  154. background-color: var(--primary-color);
  155. color: white;
  156. border-color: var(--primary-color);
  157. }
  158. .templates-container {
  159. display: grid;
  160. grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  161. gap: 12px;
  162. flex: 1;
  163. overflow-y: auto;
  164. padding: 5px;
  165. align-items: start;
  166. min-height: 0; /* 确保可以滚动 */
  167. }
  168. .template-item {
  169. border: 2px solid transparent;
  170. border-radius: var(--radius);
  171. overflow: hidden;
  172. cursor: pointer;
  173. transition: var(--transition);
  174. position: relative;
  175. display: flex;
  176. flex-direction: column;
  177. height: 130px; /* 固定高度 */
  178. }
  179. .template-item:hover {
  180. transform: translateY(-3px);
  181. box-shadow: var(--shadow);
  182. }
  183. .template-item.selected {
  184. border-color: var(--primary-color);
  185. }
  186. .template-thumbnail {
  187. width: 100%;
  188. height: 100%;
  189. object-fit: cover;
  190. flex: 1;
  191. }
  192. .template-name {
  193. font-size: 0.8rem;
  194. text-align: center;
  195. padding: 4px;
  196. background-color: rgba(0, 0, 0, 0.7);
  197. color: white;
  198. position: absolute;
  199. bottom: 0;
  200. width: 100%;
  201. white-space: nowrap;
  202. overflow: hidden;
  203. text-overflow: ellipsis;
  204. }
  205. /* 编辑区域 */
  206. .editor-panel {
  207. height: 100%;
  208. overflow-y: auto;
  209. }
  210. .edit-form {
  211. display: flex;
  212. flex-direction: column;
  213. gap: 12px;
  214. padding-right: 5px;
  215. }
  216. .form-group {
  217. display: flex;
  218. flex-direction: column;
  219. }
  220. .form-group label {
  221. margin-bottom: 4px;
  222. font-weight: 500;
  223. font-size: 0.9rem;
  224. }
  225. .form-control {
  226. padding: 8px 10px;
  227. border: 1px solid var(--border-color);
  228. border-radius: var(--radius);
  229. font-size: 0.95rem;
  230. transition: var(--transition);
  231. }
  232. .form-control:focus {
  233. outline: none;
  234. border-color: var(--primary-color);
  235. box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
  236. }
  237. .color-picker {
  238. height: 36px;
  239. padding: 4px;
  240. border: 1px solid var(--border-color);
  241. border-radius: var(--radius);
  242. }
  243. /* 高级选项区域 */
  244. .advanced-options {
  245. height: 100%;
  246. overflow-y: auto;
  247. display: flex;
  248. flex-direction: column;
  249. gap: 20px;
  250. padding-right: 5px;
  251. }
  252. .option-group {
  253. background-color: #f8f9fa;
  254. border-radius: var(--radius);
  255. padding: 15px;
  256. }
  257. .option-group h3 {
  258. font-size: 1rem;
  259. margin-bottom: 12px;
  260. color: var(--primary-color);
  261. font-weight: 600;
  262. }
  263. .range-slider-container {
  264. display: flex;
  265. align-items: center;
  266. gap: 10px;
  267. }
  268. .range-slider {
  269. flex: 1;
  270. -webkit-appearance: none;
  271. height: 6px;
  272. border-radius: 3px;
  273. background: #ddd;
  274. outline: none;
  275. }
  276. .range-slider::-webkit-slider-thumb {
  277. -webkit-appearance: none;
  278. appearance: none;
  279. width: 16px;
  280. height: 16px;
  281. border-radius: 50%;
  282. background: var(--primary-color);
  283. cursor: pointer;
  284. }
  285. .range-value {
  286. width: 40px;
  287. font-size: 0.85rem;
  288. text-align: right;
  289. }
  290. .watermark-options {
  291. margin-top: 10px;
  292. padding-top: 10px;
  293. border-top: 1px dashed var(--border-color);
  294. }
  295. /* 预览区域标题栏 */
  296. .preview-header {
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. height: 46px; /* 统一高度 */
  301. border-bottom: 1px solid var(--border-color);
  302. padding: 0 15px;
  303. }
  304. .preview-header h2 {
  305. margin: 0;
  306. color: var(--primary-color);
  307. font-size: 0.95rem; /* 统一字体大小 */
  308. font-weight: 500; /* 统一字重 */
  309. }
  310. .zoom-controls {
  311. display: flex;
  312. gap: 8px;
  313. }
  314. .zoom-btn {
  315. padding: 4px 12px;
  316. border: 1px solid var(--border-color);
  317. border-radius: 4px;
  318. background-color: white;
  319. color: var(--text-color);
  320. font-size: 13px;
  321. cursor: pointer;
  322. transition: var(--transition);
  323. height: 28px; /* 固定按钮高度 */
  324. line-height: 20px; /* 文字垂直居中 */
  325. }
  326. .zoom-btn:hover {
  327. background-color: var(--background-color);
  328. border-color: var(--primary-color);
  329. color: var(--primary-color);
  330. }
  331. /* 预览区域 */
  332. .preview-container {
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. flex: 1;
  337. margin-bottom: 15px;
  338. background-color: #f0f2f5;
  339. padding: 15px;
  340. overflow: hidden;
  341. position: relative;
  342. }
  343. .poster-preview {
  344. width: 375px;
  345. height: 667px;
  346. background-color: white;
  347. box-shadow: var(--shadow);
  348. border-radius: var(--radius);
  349. overflow: hidden;
  350. position: relative;
  351. transform-origin: center;
  352. transition: transform 0.3s ease;
  353. }
  354. .poster-preview.with-filter {
  355. filter: brightness(var(--brightness, 100%)) contrast(var(--contrast, 100%)) saturate(var(--saturation, 100%));
  356. }
  357. .poster-preview-container {
  358. position: relative;
  359. }
  360. .poster-watermark {
  361. position: absolute;
  362. color: white;
  363. font-size: 16px;
  364. padding: 5px 10px;
  365. font-weight: 500;
  366. text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  367. pointer-events: none;
  368. }
  369. /* 图片上传 */
  370. .image-upload {
  371. display: flex;
  372. flex-direction: column;
  373. gap: 10px;
  374. }
  375. .upload-preview {
  376. max-width: 100%;
  377. height: 120px;
  378. border: 1px dashed var(--border-color);
  379. border-radius: var(--radius);
  380. display: flex;
  381. align-items: center;
  382. justify-content: center;
  383. overflow: hidden;
  384. }
  385. .upload-preview img {
  386. max-width: 100%;
  387. max-height: 100%;
  388. object-fit: contain;
  389. }
  390. .upload-btn {
  391. display: inline-block;
  392. padding: 6px 12px;
  393. background-color: var(--secondary-color);
  394. color: white;
  395. border: none;
  396. border-radius: var(--radius);
  397. cursor: pointer;
  398. transition: var(--transition);
  399. font-size: 0.9rem;
  400. }
  401. .upload-btn:hover {
  402. background-color: #5a6268;
  403. }
  404. .placeholder-message {
  405. text-align: center;
  406. color: var(--secondary-color);
  407. padding: 20px;
  408. }
  409. .detection-notice {
  410. margin-bottom: 15px;
  411. }
  412. .info-message {
  413. padding: 10px;
  414. background-color: rgba(74, 107, 255, 0.1);
  415. border-radius: var(--radius);
  416. display: flex;
  417. align-items: center;
  418. gap: 8px;
  419. font-size: 0.9rem;
  420. color: var(--primary-color);
  421. }
  422. .info-message i {
  423. font-size: 1rem;
  424. }
  425. /* 按钮样式 */
  426. .action-buttons {
  427. display: flex;
  428. justify-content: center;
  429. gap: 15px;
  430. margin-bottom: 10px;
  431. }
  432. .btn {
  433. padding: 10px 20px;
  434. border: none;
  435. border-radius: var(--radius);
  436. font-size: 1rem;
  437. font-weight: 500;
  438. cursor: pointer;
  439. transition: var(--transition);
  440. display: flex;
  441. align-items: center;
  442. gap: 8px;
  443. }
  444. .btn i {
  445. font-size: 1.1rem;
  446. }
  447. .primary-btn {
  448. background-color: var(--primary-color);
  449. color: white;
  450. }
  451. .primary-btn:hover {
  452. background-color: #3a5bd9;
  453. }
  454. .secondary-btn {
  455. background-color: var(--secondary-color);
  456. color: white;
  457. }
  458. .secondary-btn:hover {
  459. background-color: #5a6268;
  460. }
  461. .btn:disabled {
  462. background-color: #cccccc;
  463. cursor: not-allowed;
  464. }
  465. /* 模态框样式 */
  466. .overlay {
  467. position: fixed;
  468. top: 0;
  469. left: 0;
  470. width: 100%;
  471. height: 100%;
  472. background-color: rgba(0, 0, 0, 0.5);
  473. z-index: 999;
  474. display: none;
  475. }
  476. .modal {
  477. position: fixed;
  478. top: 50%;
  479. left: 50%;
  480. transform: translate(-50%, -50%);
  481. background-color: white;
  482. padding: 30px;
  483. border-radius: var(--radius);
  484. box-shadow: var(--shadow);
  485. z-index: 1000;
  486. width: 80%;
  487. max-width: 500px;
  488. display: none;
  489. }
  490. .close-modal {
  491. position: absolute;
  492. right: 20px;
  493. top: 15px;
  494. font-size: 1.5rem;
  495. cursor: pointer;
  496. color: var(--secondary-color);
  497. }
  498. .close-modal:hover {
  499. color: var(--danger-color);
  500. }
  501. .modal h2 {
  502. margin-bottom: 20px;
  503. color: var(--primary-color);
  504. }
  505. .share-options {
  506. display: flex;
  507. justify-content: space-around;
  508. margin-bottom: 30px;
  509. }
  510. .share-option {
  511. display: flex;
  512. flex-direction: column;
  513. align-items: center;
  514. gap: 10px;
  515. cursor: pointer;
  516. transition: var(--transition);
  517. }
  518. .share-option i {
  519. font-size: 2rem;
  520. color: var(--primary-color);
  521. }
  522. .share-option:hover {
  523. transform: translateY(-5px);
  524. }
  525. .share-instructions {
  526. background-color: var(--background-color);
  527. padding: 15px;
  528. border-radius: var(--radius);
  529. }
  530. .share-instructions p {
  531. margin-bottom: 8px;
  532. }
  533. /* 响应式设计 */
  534. @media (max-width: 992px) {
  535. .app-main {
  536. flex-direction: column;
  537. }
  538. .preview-panel {
  539. margin-top: 20px;
  540. }
  541. }
  542. @media (max-width: 576px) {
  543. .app-header h1 {
  544. font-size: 2rem;
  545. }
  546. .templates-container {
  547. grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  548. }
  549. .action-buttons {
  550. flex-direction: column;
  551. }
  552. .btn {
  553. width: 100%;
  554. justify-content: center;
  555. }
  556. }
  557. /* 动画效果 */
  558. @keyframes fadeIn {
  559. from { opacity: 0; }
  560. to { opacity: 1; }
  561. }
  562. .fade-in {
  563. animation: fadeIn 0.5s ease forwards;
  564. }
  565. /* 导航栏样式 */
  566. .main-navbar {
  567. background-color: #fff;
  568. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  569. padding: 10px 20px;
  570. margin-bottom: 20px;
  571. }
  572. .navbar-brand {
  573. display: flex;
  574. align-items: center;
  575. }
  576. .brand-link {
  577. display: flex;
  578. align-items: center;
  579. text-decoration: none;
  580. color: var(--text-color);
  581. }
  582. .brand-link img {
  583. width: 24px;
  584. height: 24px;
  585. margin-right: 8px;
  586. }
  587. .brand-text {
  588. font-size: 18px;
  589. font-weight: 600;
  590. margin-right: 8px;
  591. }
  592. .brand-subtitle {
  593. font-size: 14px;
  594. color: var(--secondary-color);
  595. padding-left: 8px;
  596. border-left: 1px solid var(--border-color);
  597. }
  598. /* 移除旧的预览面板标题样式 */
  599. .preview-panel h2 {
  600. margin-bottom: 0;
  601. padding-bottom: 0;
  602. border-bottom: none;
  603. }