style.css 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. /* Custom styles that complement Tailwind CSS */
  2. @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
  3. body {
  4. font-family: 'Inter', sans-serif;
  5. min-height: 100vh;
  6. transition: background-color 0.3s ease;
  7. }
  8. /* Theme-specific styles */
  9. body.light-mode {
  10. --bg-primary: #ffffff;
  11. --bg-secondary: #f8fafc;
  12. --text-primary: #1e293b;
  13. --text-secondary: #64748b;
  14. --border-color: #cbd5e1; /* 更深的边框色,提高对比度 */
  15. --card-bg: #ffffff;
  16. --button-primary: #3b82f6;
  17. --button-primary-hover: #2563eb;
  18. --button-secondary: #64748b; /* 调整为中等灰色,提高对比度 */
  19. --button-secondary-hover: #475569;
  20. }
  21. body.dark-mode {
  22. --bg-primary: #0f172a;
  23. --bg-secondary: #1e293b;
  24. --text-primary: #f8fafc;
  25. --text-secondary: #cbd5e1;
  26. --border-color: #334155;
  27. --card-bg: #1e293b;
  28. --button-primary: #3b82f6;
  29. --button-primary-hover: #2563eb;
  30. --button-secondary: #64748b;
  31. --button-secondary-hover: #94a3b8;
  32. }
  33. .container {
  34. max-width: 1200px;
  35. margin: 0 auto;
  36. border-radius: 1rem;
  37. box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  38. overflow: hidden;
  39. background-color: var(--bg-primary);
  40. }
  41. .header {
  42. padding: 2rem;
  43. text-align: center;
  44. background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  45. color: white;
  46. }
  47. .header h1 {
  48. font-size: 2.5rem;
  49. font-weight: 700;
  50. margin-bottom: 0.5rem;
  51. }
  52. .subtitle {
  53. font-size: 1.1rem;
  54. opacity: 0.9;
  55. font-weight: 400;
  56. }
  57. .theme-toggle {
  58. position: absolute;
  59. top: 1.5rem;
  60. right: 1.5rem;
  61. background: rgba(255, 255, 255, 0.2);
  62. border: none;
  63. border-radius: 50%;
  64. width: 2.5rem;
  65. height: 2.5rem;
  66. cursor: pointer;
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. backdrop-filter: blur(10px);
  71. transition: all 0.3s ease;
  72. }
  73. .theme-toggle:hover {
  74. transform: scale(1.1);
  75. background: rgba(255, 255, 255, 0.3);
  76. }
  77. body.dark-mode .theme-toggle {
  78. background: rgba(0, 0, 0, 0.2);
  79. }
  80. body.dark-mode .theme-toggle:hover {
  81. background: rgba(0, 0, 0, 0.3);
  82. }
  83. .main-content {
  84. display: grid;
  85. grid-template-columns: 1fr 1fr;
  86. gap: 1.25rem;
  87. padding: 2rem;
  88. }
  89. .card {
  90. border-radius: 0.75rem;
  91. padding: 1.5rem;
  92. background-color: var(--card-bg);
  93. box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  94. color: var(--text-primary);
  95. }
  96. .card h2 {
  97. margin-bottom: 1.25rem;
  98. font-size: 1.5rem;
  99. font-weight: 600;
  100. color: var(--text-primary);
  101. }
  102. .form-group {
  103. margin-bottom: 1rem;
  104. }
  105. .form-group label {
  106. display: block;
  107. margin-bottom: 0.25rem;
  108. font-weight: 500;
  109. color: var(--text-primary);
  110. font-size: 0.875rem;
  111. }
  112. .form-control {
  113. width: 100%;
  114. padding: 0.5rem 0.75rem;
  115. border-radius: 0.375rem;
  116. font-size: 0.875rem;
  117. border: 2px solid var(--border-color);
  118. background-color: var(--bg-primary);
  119. color: var(--text-primary);
  120. transition: all 0.3s;
  121. }
  122. /* Enhanced form control visibility in light mode */
  123. body.light-mode .form-control {
  124. border-color: #cbd5e1; /* Darker border for better visibility */
  125. }
  126. body.light-mode .form-control:focus {
  127. border-color: #3b82f6;
  128. box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  129. }
  130. .form-control:focus {
  131. outline: none;
  132. border-color: #3b82f6;
  133. box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  134. }
  135. .form-control.error {
  136. border-color: #ef4444;
  137. }
  138. .btn-group {
  139. display: flex;
  140. gap: 0.75rem;
  141. margin-top: 1.25rem;
  142. flex-wrap: wrap;
  143. }
  144. .btn {
  145. padding: 0.5rem 1rem;
  146. border: none;
  147. border-radius: 0.375rem;
  148. cursor: pointer;
  149. font-size: 0.875rem;
  150. font-weight: 600;
  151. transition: all 0.3s;
  152. display: inline-flex;
  153. align-items: center;
  154. justify-content: center;
  155. }
  156. .btn-primary {
  157. background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  158. color: white;
  159. box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
  160. }
  161. .btn-primary:hover {
  162. transform: translateY(-2px);
  163. box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
  164. }
  165. .btn-secondary {
  166. background-color: var(--button-secondary);
  167. color: white;
  168. }
  169. .btn-secondary:hover {
  170. background-color: var(--button-secondary-hover);
  171. transform: translateY(-2px);
  172. }
  173. .results-grid {
  174. display: grid;
  175. grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  176. gap: 1rem;
  177. margin-top: 1rem;
  178. }
  179. .result-card {
  180. padding: 1rem;
  181. border-radius: 0.5rem;
  182. text-align: center;
  183. background-color: var(--bg-secondary);
  184. transition: all 0.3s ease;
  185. }
  186. .result-label {
  187. font-size: 0.75rem;
  188. margin-bottom: 0.25rem;
  189. color: var(--text-secondary);
  190. font-weight: 500;
  191. }
  192. .result-value {
  193. font-size: 1.125rem;
  194. font-weight: 700;
  195. color: var(--text-primary);
  196. }
  197. .placeholder {
  198. font-style: italic;
  199. text-align: center;
  200. padding: 1.25rem;
  201. color: var(--text-secondary);
  202. }
  203. .warning {
  204. padding: 0.75rem;
  205. border-radius: 0.5rem;
  206. margin-top: 1rem;
  207. background-color: #fffbeb;
  208. color: #92400e;
  209. border: 1px solid #fbbf24;
  210. }
  211. body.dark-mode .warning {
  212. background-color: #451a03;
  213. color: #fde68a;
  214. border-color: #f59e0b;
  215. }
  216. .error {
  217. padding: 0.75rem;
  218. border-radius: 0.5rem;
  219. margin-top: 1rem;
  220. background-color: #fef2f2;
  221. color: #b91c1c;
  222. border: 1px solid #f87171;
  223. }
  224. body.dark-mode .error {
  225. background-color: #7f1d1d;
  226. color: #fecaca;
  227. border-color: #f87171;
  228. }
  229. .hidden {
  230. display: none !important;
  231. }
  232. .guidance-section ul {
  233. list-style-type: none;
  234. padding-left: 0;
  235. }
  236. .guidance-section li {
  237. margin-bottom: 0.5rem;
  238. padding: 0.5rem;
  239. border-radius: 0.5rem;
  240. background-color: var(--bg-secondary);
  241. font-size: 0.875rem;
  242. }
  243. .alert {
  244. position: fixed;
  245. top: 1.25rem;
  246. right: 1.25rem;
  247. padding: 0.75rem 1rem;
  248. border-radius: 0.5rem;
  249. font-weight: 600;
  250. z-index: 1000;
  251. animation: slideIn 0.3s ease-out;
  252. transition: all 0.3s ease;
  253. color: white;
  254. }
  255. .alert-info {
  256. background: #0ea5e9;
  257. }
  258. .alert-success {
  259. background: #22c55e;
  260. }
  261. .alert-warning {
  262. background: #f59e0b;
  263. }
  264. .alert-error {
  265. background: #ef4444;
  266. }
  267. @keyframes slideIn {
  268. from {
  269. transform: translateX(100%);
  270. opacity: 0;
  271. }
  272. to {
  273. transform: translateX(0);
  274. opacity: 1;
  275. }
  276. }
  277. /* Responsive design */
  278. @media (max-width: 768px) {
  279. .main-content {
  280. grid-template-columns: 1fr;
  281. }
  282. .header h1 {
  283. font-size: 2rem;
  284. }
  285. .btn-group {
  286. flex-direction: column;
  287. }
  288. .theme-toggle {
  289. top: 1rem;
  290. right: 1rem;
  291. width: 2rem;
  292. height: 2rem;
  293. }
  294. .results-grid {
  295. grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  296. }
  297. }