style.css 2.0 KB

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