index.css 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. /* 全局样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  9. background-color: #f5f6fa;
  10. color: #2c3e50;
  11. line-height: 1.4;
  12. }
  13. /* 头部样式 */
  14. .header {
  15. background-color: #fff;
  16. padding: 0.8rem 1.5rem;
  17. box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  18. position: sticky;
  19. top: 0;
  20. z-index: 100;
  21. }
  22. .logo {
  23. display: flex;
  24. align-items: center;
  25. gap: 0.8rem;
  26. }
  27. .logo h1 {
  28. font-size: 1.2rem;
  29. margin: 0;
  30. }
  31. .subtitle {
  32. color: #3498db;
  33. font-size: 0.9rem;
  34. margin-left: 0.5rem;
  35. padding: 0.2rem 0.5rem;
  36. background-color: rgba(52, 152, 219, 0.1);
  37. border-radius: 4px;
  38. }
  39. /* 主容器样式 */
  40. .container {
  41. max-width: 1200px;
  42. margin: 0.5rem auto;
  43. padding: 0 0.5rem;
  44. }
  45. /* 正则分类样式 */
  46. .regex-categories {
  47. column-count: 3;
  48. column-gap: 0.5rem;
  49. margin: 0 auto;
  50. }
  51. .category {
  52. background: #fff;
  53. border-radius: 8px;
  54. padding: 0.8rem;
  55. box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  56. break-inside: avoid;
  57. margin-bottom: 0.5rem;
  58. page-break-inside: avoid;
  59. -webkit-column-break-inside: avoid;
  60. }
  61. .category h2 {
  62. font-size: 1rem;
  63. color: #2c3e50;
  64. margin-bottom: 0.5rem;
  65. padding-bottom: 0.3rem;
  66. border-bottom: 2px solid #3498db;
  67. }
  68. .regex-list {
  69. display: grid;
  70. grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  71. gap: 0.5rem;
  72. }
  73. /* 正则项目和工具提示样式 */
  74. .regex-item {
  75. padding: 0.5rem;
  76. background-color: #f8f9fa;
  77. border: 1px solid #e9ecef;
  78. border-radius: 4px;
  79. cursor: pointer;
  80. font-size: 0.9rem;
  81. transition: all 0.2s ease;
  82. text-align: center;
  83. position: relative;
  84. }
  85. .regex-item:hover {
  86. background-color: #3498db;
  87. color: #fff;
  88. transform: translateY(-1px);
  89. box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  90. }
  91. /* 工具提示气泡 */
  92. .regex-item::after {
  93. content: "点击获取正则表达式";
  94. position: absolute;
  95. bottom: 100%;
  96. left: 50%;
  97. transform: translateX(-50%);
  98. padding: 0.4rem 0.8rem;
  99. background-color: #2c3e50;
  100. color: #fff;
  101. font-size: 0.8rem;
  102. border-radius: 4px;
  103. white-space: nowrap;
  104. opacity: 0;
  105. visibility: hidden;
  106. transition: all 0.2s ease;
  107. z-index: 10;
  108. pointer-events: none;
  109. }
  110. /* 工具提示三角形 */
  111. .regex-item::before {
  112. content: "";
  113. position: absolute;
  114. bottom: 100%;
  115. left: 50%;
  116. transform: translateX(-50%);
  117. border: 6px solid transparent;
  118. border-top-color: #2c3e50;
  119. opacity: 0;
  120. visibility: hidden;
  121. transition: all 0.2s ease;
  122. z-index: 10;
  123. pointer-events: none;
  124. }
  125. /* 显示工具提示 */
  126. .regex-item:hover::after {
  127. opacity: 1;
  128. visibility: visible;
  129. bottom: calc(100% + 10px);
  130. }
  131. .regex-item:hover::before {
  132. opacity: 1;
  133. visibility: visible;
  134. bottom: calc(100% + 4px);
  135. }
  136. /* 模态框样式 */
  137. .modal {
  138. display: none;
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. width: 100%;
  143. height: 100%;
  144. background-color: rgba(0,0,0,0.5);
  145. z-index: 1000;
  146. }
  147. .modal-content {
  148. position: relative;
  149. background-color: #fff;
  150. margin: 2rem auto;
  151. padding: 1.5rem;
  152. width: 700px;
  153. max-width: 800px;
  154. border-radius: 8px;
  155. box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  156. max-height: calc(100vh - 4rem);
  157. overflow-y: auto;
  158. }
  159. .close {
  160. position: absolute;
  161. right: 1rem;
  162. top: 1rem;
  163. font-size: 1.5rem;
  164. cursor: pointer;
  165. color: #666;
  166. }
  167. .close:hover {
  168. color: #e74c3c;
  169. }
  170. .regex-versions {
  171. display: grid;
  172. grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  173. gap: 1rem;
  174. margin: 1rem 0;
  175. }
  176. .version {
  177. background-color: #f8f9fa;
  178. padding: 0.8rem;
  179. border-radius: 4px;
  180. }
  181. .version h3 {
  182. font-size: 0.9rem;
  183. margin-bottom: 0.5rem;
  184. color: #2c3e50;
  185. }
  186. pre {
  187. background-color: #fff;
  188. padding: 0.5rem;
  189. border-radius: 4px;
  190. border: 1px solid #e9ecef;
  191. font-size: 0.85rem;
  192. overflow-x: auto;
  193. }
  194. .copy-btn {
  195. margin-top: 0.5rem;
  196. padding: 0.3rem 0.8rem;
  197. background-color: #3498db;
  198. color: #fff;
  199. border: none;
  200. border-radius: 4px;
  201. cursor: pointer;
  202. font-size: 0.85rem;
  203. transition: background-color 0.2s;
  204. }
  205. .copy-btn:hover {
  206. background-color: #2980b9;
  207. }
  208. .regex-description {
  209. margin-top: 1rem;
  210. padding-top: 1rem;
  211. border-top: 1px solid #e9ecef;
  212. }
  213. .regex-description h3 {
  214. font-size: 0.9rem;
  215. margin-bottom: 0.5rem;
  216. color: #2c3e50;
  217. }
  218. .regex-description p {
  219. font-size: 0.9rem;
  220. color: #666;
  221. line-height: 1.5;
  222. }
  223. /* 响应式调整 */
  224. @media (max-width: 1024px) {
  225. .regex-categories {
  226. column-count: 2;
  227. }
  228. }
  229. @media (max-width: 768px) {
  230. .regex-categories {
  231. column-count: 1;
  232. }
  233. .regex-list {
  234. grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  235. }
  236. .regex-versions {
  237. grid-template-columns: 1fr;
  238. }
  239. .modal-content {
  240. width: 95%;
  241. margin: 1rem auto;
  242. }
  243. .subtitle {
  244. display: none;
  245. }
  246. .container {
  247. padding: 0 0.3rem;
  248. }
  249. /* 移动端工具提示调整 */
  250. .regex-item::after {
  251. display: none;
  252. }
  253. .regex-item::before {
  254. display: none;
  255. }
  256. }
  257. .search-container {
  258. width: 100%;
  259. padding: 10px 0;
  260. display: flex;
  261. justify-content: center;
  262. margin-bottom: 10px;
  263. }
  264. .search-box {
  265. position: relative;
  266. width: 60%;
  267. max-width: 600px;
  268. }
  269. .search-box input {
  270. width: 100%;
  271. padding: 15px 45px 15px 20px;
  272. border: 2px solid #3498db;
  273. border-radius: 25px;
  274. font-size: 16px;
  275. transition: all 0.3s ease;
  276. outline: none;
  277. background-color: rgba(255, 255, 255, 0.9);
  278. box-shadow: 0 4px 6px rgba(52, 152, 219, 0.1);
  279. }
  280. .search-box input:focus {
  281. border-color: #2980b9;
  282. box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
  283. background-color: #ffffff;
  284. transform: translateY(-1px);
  285. }
  286. .search-box input::placeholder {
  287. color: #95a5a6;
  288. }
  289. .search-box .search-icon {
  290. position: absolute;
  291. right: 20px;
  292. top: 50%;
  293. transform: translateY(-50%);
  294. color: #3498db;
  295. font-size: 20px;
  296. pointer-events: none;
  297. transition: all 0.3s ease;
  298. }
  299. .search-box input:focus + .search-icon {
  300. color: #2980b9;
  301. }
  302. /* 搜索结果高亮样式 */
  303. .regex-item.highlight {
  304. background-color: #fff3cd;
  305. border-color: #3498db;
  306. box-shadow: 0 2px 4px rgba(52, 152, 219, 0.15);
  307. transform: translateY(-1px);
  308. }
  309. .regex-item.hidden {
  310. display: none;
  311. }
  312. /* 响应式调整 */
  313. @media (max-width: 768px) {
  314. .search-box {
  315. width: 90%;
  316. }
  317. .search-container {
  318. padding: 15px 0;
  319. }
  320. }
  321. /* 工具市场按钮样式(保持不变) */
  322. .panel-title>a.x-other-tools {
  323. margin: 1px 0 0;
  324. font-size: 13px;
  325. cursor: pointer;
  326. text-decoration: none;
  327. -webkit-user-select: none;
  328. user-select: none;
  329. color: #333;
  330. float: right;
  331. background-color: #f5f8ff;
  332. padding: 5px 10px;
  333. border-radius: 15px;
  334. border: 1px solid #d0d9ff;
  335. transition: all 0.3s ease;
  336. display: flex;
  337. align-items: center;
  338. position: absolute;
  339. right: 15px;
  340. top: 8px;
  341. }
  342. .panel-title>a.x-other-tools .icon-plus-circle {
  343. display: inline-block;
  344. width: 16px;
  345. height: 16px;
  346. background: url(../static/img/plus-circle.svg) no-repeat center center;
  347. background-size: contain;
  348. margin-right: 5px;
  349. }
  350. .panel-title>a.x-other-tools .tool-market-badge {
  351. display: inline-block;
  352. background-color: #4d89fe;
  353. color: white;
  354. padding: 2px 6px;
  355. border-radius: 10px;
  356. margin-left: 5px;
  357. font-size: 12px;
  358. font-weight: bold;
  359. }
  360. .panel-title>a.x-other-tools:hover {
  361. color: #333;
  362. background-color: #e6edff;
  363. box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  364. transform: translateY(-1px);
  365. }
  366. /* 保持原有的顶部导航样式 */
  367. .x-donate-link {
  368. float: right;
  369. line-height: 18px;
  370. color: #2563eb;
  371. cursor: pointer;
  372. text-decoration: none;
  373. border: none;
  374. white-space: nowrap;
  375. margin-right: auto;
  376. border-radius: 20px;
  377. background-color: #eff6ff;
  378. transition: all 0.2s ease;
  379. position: relative;
  380. display: inline-flex;
  381. align-items: center;
  382. box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
  383. position: absolute;
  384. right: 230px;
  385. top: 12px;
  386. padding: 4px 12px;
  387. margin: 0 10px;
  388. font-size: 12px;
  389. font-weight: normal;
  390. }
  391. .x-donate-link:hover {
  392. background-color: #dbeafe;
  393. color: #1d4ed8;
  394. text-decoration: none;
  395. box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
  396. transform: translateY(-1px);
  397. }
  398. .x-donate-link>a {
  399. font-size: 12px;
  400. color: blue;
  401. cursor: pointer;
  402. text-decoration: underline;
  403. }
  404. .x-donate-link>a:hover {
  405. text-decoration: underline;
  406. color: #f00;
  407. }