style.css 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* 添加字体声明 */
  2. @font-face {
  3. font-family: 'SourceHanSansCN-Regular';
  4. src: url('../assets/typeface/SourceHanSansCN-Regular_0.otf') format('opentype');
  5. font-weight: normal;
  6. font-style: normal;
  7. }
  8. :root {
  9. /* font-family: 'SourceHanSansCN-Regular'; */
  10. font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  11. line-height: 1.5;
  12. font-weight: normal;
  13. color-scheme: light dark;
  14. color: rgba(255, 255, 255, 0.87);
  15. background-color: #242424;
  16. font-synthesis: none;
  17. text-rendering: optimizeLegibility;
  18. -webkit-font-smoothing: antialiased;
  19. -moz-osx-font-smoothing: grayscale;
  20. }
  21. a {
  22. font-weight: 500;
  23. color: #646cff;
  24. text-decoration: inherit;
  25. }
  26. a:hover {
  27. color: #535bf2;
  28. }
  29. body {
  30. margin: 0;
  31. display: flex;
  32. place-items: center;
  33. min-width: 320px;
  34. min-height: 100vh;
  35. }
  36. h1 {
  37. font-size: 3.2em;
  38. line-height: 1.1;
  39. }
  40. button {
  41. border-radius: 8px;
  42. border: 1px solid transparent;
  43. padding: 0.6em 1.2em;
  44. font-size: 1em;
  45. font-weight: 500;
  46. font-family: inherit;
  47. background-color: #1a1a1a;
  48. cursor: pointer;
  49. transition: border-color 0.25s;
  50. }
  51. button:hover {
  52. border-color: #646cff;
  53. }
  54. button:focus,
  55. button:focus-visible {
  56. outline: 4px auto -webkit-focus-ring-color;
  57. }
  58. .card {
  59. padding: 2em;
  60. }
  61. #app {
  62. max-width: 1280px;
  63. margin: 0 auto;
  64. padding: 2rem;
  65. text-align: center;
  66. }
  67. @media (prefers-color-scheme: light) {
  68. :root {
  69. color: #213547;
  70. background-color: #ffffff;
  71. }
  72. a:hover {
  73. color: #747bff;
  74. }
  75. button {
  76. background-color: #f9f9f9;
  77. }
  78. }
  79. /* 移动端样式 - 屏幕宽度小于 768px */
  80. @media (max-width: 768px) {
  81. h1 {
  82. font-size: 2em;
  83. }
  84. #app {
  85. padding: 1rem;
  86. }
  87. .card {
  88. padding: 1em;
  89. }
  90. button {
  91. padding: 0.4em 0.8em;
  92. font-size: 0.9em;
  93. }
  94. }
  95. /* PC 端样式 - 屏幕宽度大于 1200px */
  96. @media (min-width: 1200px) {
  97. h1 {
  98. font-size: 4em;
  99. }
  100. #app {
  101. padding: 3rem;
  102. }
  103. }