style.css 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. /* CSS变量 - 浅色主题 */
  7. :root {
  8. --bg-color: #f5f5f5;
  9. --card-bg: #ffffff;
  10. --text-primary: #2d3748;
  11. --text-secondary: #4a5568;
  12. --border-color: #e2e8f0;
  13. --header-bg: #4a5568;
  14. --header-text: #ffffff;
  15. --primary-btn: #667eea;
  16. --primary-btn-hover: #5a67d8;
  17. --danger-btn: #e53e3e;
  18. --danger-btn-hover: #c53030;
  19. --nav-active: #667eea;
  20. --nav-text: #718096;
  21. }
  22. /* 深色主题 */
  23. body.dark-theme {
  24. --bg-color: #1a202c;
  25. --card-bg: #2d3748;
  26. --text-primary: #f7fafc;
  27. --text-secondary: #e2e8f0;
  28. --border-color: #4a5568;
  29. --header-bg: #2d3748;
  30. --header-text: #ffffff;
  31. --primary-btn: #667eea;
  32. --primary-btn-hover: #5a67d8;
  33. --danger-btn: #fc8181;
  34. --danger-btn-hover: #f56565;
  35. --nav-active: #667eea;
  36. --nav-text: #a0aec0;
  37. }
  38. body {
  39. font-family: 'Arial', sans-serif;
  40. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  41. min-height: 100vh;
  42. display: flex;
  43. justify-content: center;
  44. align-items: center;
  45. padding: 20px;
  46. }
  47. .phone-container {
  48. width: 375px;
  49. height: 812px;
  50. background: #ffffff;
  51. border-radius: 40px;
  52. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  53. position: relative;
  54. overflow: hidden;
  55. border: 8px solid #000;
  56. }
  57. .screen {
  58. position: absolute;
  59. top: 0;
  60. left: 0;
  61. width: 100%;
  62. height: calc(100% - 60px);
  63. background: #f5f5f5;
  64. display: none;
  65. flex-direction: column;
  66. }
  67. .screen.active {
  68. display: flex;
  69. }
  70. header {
  71. background: #4a5568;
  72. color: white;
  73. padding: 20px;
  74. text-align: center;
  75. position: relative;
  76. }
  77. header h1 {
  78. font-size: 20px;
  79. font-weight: bold;
  80. }
  81. .back-btn {
  82. position: absolute;
  83. left: 20px;
  84. top: 50%;
  85. transform: translateY(-50%);
  86. background: none;
  87. border: none;
  88. color: white;
  89. font-size: 24px;
  90. cursor: pointer;
  91. }
  92. main {
  93. flex: 1;
  94. padding: 20px;
  95. overflow-y: auto;
  96. }
  97. .canvas-container {
  98. position: relative;
  99. display: flex;
  100. justify-content: center;
  101. align-items: center;
  102. margin-bottom: 20px;
  103. }
  104. #avatarCanvas {
  105. border: 4px solid #e2e8f0;
  106. border-radius: 12px;
  107. background: white;
  108. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  109. }
  110. .canvas-overlay {
  111. position: absolute;
  112. bottom: 10px;
  113. left: 50%;
  114. transform: translateX(-50%);
  115. }
  116. .customization-panel {
  117. background: white;
  118. border-radius: 12px;
  119. padding: 16px;
  120. margin-bottom: 20px;
  121. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  122. }
  123. .customization-panel h3 {
  124. margin-bottom: 16px;
  125. color: #2d3748;
  126. font-size: 16px;
  127. }
  128. .option-group {
  129. margin-bottom: 16px;
  130. }
  131. .option-group:last-child {
  132. margin-bottom: 0;
  133. }
  134. .option-group label {
  135. display: block;
  136. margin-bottom: 8px;
  137. font-weight: bold;
  138. color: #4a5568;
  139. font-size: 14px;
  140. }
  141. .color-themes, .style-options, .detail-options {
  142. display: grid;
  143. grid-template-columns: repeat(2, 1fr);
  144. gap: 0.5rem;
  145. }
  146. .seed-input-group {
  147. display: flex;
  148. flex-direction: column;
  149. gap: 0.5rem;
  150. }
  151. .seed-input-group input {
  152. padding: 0.5rem;
  153. border: 1px solid var(--border-color);
  154. border-radius: 4px;
  155. background-color: var(--input-bg);
  156. color: var(--text-primary);
  157. font-size: 1rem;
  158. }
  159. .seed-input-group button.action-btn.small {
  160. padding: 0.375rem 0.75rem;
  161. font-size: 0.875rem;
  162. }
  163. .theme-btn, .style-btn, .detail-btn {
  164. padding: 8px 12px;
  165. border: 2px solid #e2e8f0;
  166. border-radius: 8px;
  167. background: white;
  168. cursor: pointer;
  169. font-size: 14px;
  170. transition: all 0.2s;
  171. }
  172. .theme-btn:hover, .style-btn:hover, .detail-btn:hover {
  173. background: #edf2f7;
  174. border-color: #cbd5e0;
  175. }
  176. .theme-btn.active, .style-btn.active, .detail-btn.active {
  177. background: #667eea;
  178. color: white;
  179. border-color: #667eea;
  180. }
  181. .bottom-actions {
  182. display: grid;
  183. grid-template-columns: repeat(4, 1fr);
  184. gap: 8px;
  185. margin-top: 20px;
  186. }
  187. .action-btn {
  188. padding: 12px;
  189. border: none;
  190. border-radius: 8px;
  191. font-size: 14px;
  192. font-weight: bold;
  193. cursor: pointer;
  194. transition: all 0.2s;
  195. }
  196. .action-btn.primary {
  197. background: #667eea;
  198. color: white;
  199. }
  200. .action-btn.primary:hover {
  201. background: #5a67d8;
  202. }
  203. .action-btn:hover {
  204. background: #e2e8f0;
  205. }
  206. .action-btn.danger {
  207. background: #e53e3e;
  208. color: white;
  209. }
  210. .action-btn.danger:hover {
  211. background: #c53030;
  212. }
  213. .favorites-grid,
  214. .history-grid {
  215. display: grid;
  216. grid-template-columns: repeat(3, 1fr);
  217. gap: 12px;
  218. margin-top: 20px;
  219. }
  220. .history-actions {
  221. display: flex;
  222. justify-content: center;
  223. padding: 1rem;
  224. gap: 1rem;
  225. }
  226. .favorite-item {
  227. position: relative;
  228. border: 2px solid #e2e8f0;
  229. border-radius: 8px;
  230. overflow: hidden;
  231. cursor: pointer;
  232. transition: all 0.2s;
  233. }
  234. .favorite-item:hover {
  235. border-color: #667eea;
  236. transform: scale(1.05);
  237. }
  238. .favorite-item img {
  239. width: 100%;
  240. height: auto;
  241. display: block;
  242. }
  243. .remove-favorite {
  244. position: absolute;
  245. top: 4px;
  246. right: 4px;
  247. background: rgba(255, 0, 0, 0.8);
  248. color: white;
  249. border: none;
  250. border-radius: 50%;
  251. width: 20px;
  252. height: 20px;
  253. font-size: 12px;
  254. cursor: pointer;
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. }
  259. .settings-panel {
  260. background: white;
  261. border-radius: 12px;
  262. padding: 16px;
  263. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  264. }
  265. .setting-item {
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. padding: 12px 0;
  270. border-bottom: 1px solid #e2e8f0;
  271. }
  272. .setting-item:last-child {
  273. border-bottom: none;
  274. }
  275. .setting-item label {
  276. font-weight: bold;
  277. color: #4a5568;
  278. }
  279. .setting-item select, .setting-item input {
  280. padding: 6px 10px;
  281. border: 2px solid var(--border-color);
  282. border-radius: 6px;
  283. font-size: 14px;
  284. background: var(--card-bg);
  285. color: var(--text-primary);
  286. }
  287. .bottom-nav {
  288. position: absolute;
  289. bottom: 0;
  290. left: 0;
  291. width: 100%;
  292. height: 60px;
  293. background: white;
  294. border-top: 1px solid #e2e8f0;
  295. display: flex;
  296. }
  297. .nav-btn {
  298. flex: 1;
  299. background: none;
  300. border: none;
  301. font-size: 14px;
  302. font-weight: bold;
  303. color: #718096;
  304. cursor: pointer;
  305. transition: all 0.2s;
  306. }
  307. .nav-btn:hover {
  308. background: #f7fafc;
  309. }
  310. .nav-btn.active {
  311. color: #667eea;
  312. border-top: 3px solid #667eea;
  313. }
  314. /* 响应式设计 */
  315. @media (max-width: 400px) {
  316. .phone-container {
  317. width: 100%;
  318. height: 100vh;
  319. border-radius: 0;
  320. border: none;
  321. }
  322. body {
  323. padding: 0;
  324. }
  325. }
  326. /* 滚动条样式 */
  327. main::-webkit-scrollbar {
  328. width: 4px;
  329. }
  330. main::-webkit-scrollbar-track {
  331. background: var(--border-color);
  332. }
  333. main::-webkit-scrollbar-thumb {
  334. background: var(--text-secondary);
  335. border-radius: 2px;
  336. }
  337. main::-webkit-scrollbar-thumb:hover {
  338. background: var(--text-primary);
  339. }
  340. /* 编辑界面样式 */
  341. .edit-tools {
  342. background: var(--card-bg);
  343. border-radius: 12px;
  344. padding: 16px;
  345. margin-top: 20px;
  346. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  347. }
  348. #colorPicker {
  349. width: 100%;
  350. height: 40px;
  351. border: 2px solid var(--border-color);
  352. border-radius: 6px;
  353. cursor: pointer;
  354. }
  355. .tool-buttons {
  356. display: grid;
  357. grid-template-columns: repeat(3, 1fr);
  358. gap: 8px;
  359. }
  360. .tool-btn {
  361. padding: 8px 12px;
  362. border: 2px solid var(--border-color);
  363. border-radius: 8px;
  364. background: var(--card-bg);
  365. color: var(--text-primary);
  366. cursor: pointer;
  367. font-size: 14px;
  368. transition: all 0.2s;
  369. }
  370. .tool-btn:hover {
  371. background: var(--border-color);
  372. border-color: var(--primary-btn);
  373. }
  374. .tool-btn.active {
  375. background: var(--primary-btn);
  376. color: white;
  377. border-color: var(--primary-btn);
  378. }
  379. .edit-actions {
  380. display: grid;
  381. grid-template-columns: repeat(3, 1fr);
  382. gap: 8px;
  383. margin-top: 16px;
  384. }
  385. /* 编辑画布样式 */
  386. #editCanvas {
  387. border: 4px solid var(--border-color);
  388. border-radius: 12px;
  389. background: white;
  390. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  391. cursor: crosshair;
  392. }