article.css 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* 文章详情页样式 */
  2. .article-main {
  3. padding-top: 6rem;
  4. max-width: 800px;
  5. margin: 0 auto;
  6. padding-bottom: 4rem;
  7. }
  8. .article-header {
  9. text-align: center;
  10. margin-bottom: 3rem;
  11. }
  12. .article-header h1 {
  13. font-size: 2.5rem;
  14. color: #1e40af;
  15. margin-bottom: 1rem;
  16. line-height: 1.3;
  17. }
  18. .article-meta {
  19. color: #64748b;
  20. font-size: 1rem;
  21. margin-bottom: 2rem;
  22. }
  23. .article-image {
  24. width: 100%;
  25. height: 400px;
  26. margin-bottom: 2rem;
  27. border-radius: 1rem;
  28. overflow: hidden;
  29. }
  30. .article-image img {
  31. width: 100%;
  32. height: 100%;
  33. object-fit: cover;
  34. }
  35. .article-content {
  36. font-size: 1.1rem;
  37. line-height: 1.8;
  38. color: #4b5563;
  39. }
  40. .article-content p {
  41. margin-bottom: 1.5rem;
  42. }
  43. .article-content h2 {
  44. font-size: 1.8rem;
  45. color: #1e40af;
  46. margin: 2rem 0 1rem;
  47. }
  48. .article-content h3 {
  49. font-size: 1.5rem;
  50. color: #1e40af;
  51. margin: 1.5rem 0 1rem;
  52. }
  53. .article-content ul,
  54. .article-content ol {
  55. margin: 1rem 0;
  56. padding-left: 2rem;
  57. }
  58. .article-content li {
  59. margin-bottom: 0.5rem;
  60. }
  61. .article-content blockquote {
  62. border-left: 4px solid #2563eb;
  63. padding-left: 1rem;
  64. margin: 1.5rem 0;
  65. color: #64748b;
  66. font-style: italic;
  67. }
  68. .article-content code {
  69. background: #f1f5f9;
  70. padding: 0.2rem 0.4rem;
  71. border-radius: 0.25rem;
  72. font-family: monospace;
  73. }
  74. .article-content pre {
  75. background: #f1f5f9;
  76. padding: 1rem;
  77. border-radius: 0.5rem;
  78. overflow-x: auto;
  79. margin: 1.5rem 0;
  80. }
  81. .article-content pre code {
  82. background: none;
  83. padding: 0;
  84. }
  85. .article-content img {
  86. max-width: 100%;
  87. height: auto;
  88. border-radius: 0.5rem;
  89. margin: 1.5rem 0;
  90. }
  91. .article-content a {
  92. color: #2563eb;
  93. text-decoration: none;
  94. transition: color 0.3s ease;
  95. }
  96. .article-content a:hover {
  97. color: #1d4ed8;
  98. text-decoration: underline;
  99. }
  100. .article-footer {
  101. margin-top: 3rem;
  102. padding-top: 2rem;
  103. border-top: 1px solid #e2e8f0;
  104. }
  105. .article-tags {
  106. display: flex;
  107. gap: 0.5rem;
  108. flex-wrap: wrap;
  109. margin-bottom: 1rem;
  110. }
  111. .article-tag {
  112. background: #f1f5f9;
  113. color: #64748b;
  114. padding: 0.3rem 0.8rem;
  115. border-radius: 1rem;
  116. font-size: 0.875rem;
  117. transition: all 0.3s ease;
  118. }
  119. .article-tag:hover {
  120. background: #e2e8f0;
  121. color: #1e40af;
  122. }
  123. .article-nav {
  124. display: flex;
  125. justify-content: space-between;
  126. margin-top: 2rem;
  127. }
  128. .article-nav a {
  129. color: #2563eb;
  130. text-decoration: none;
  131. display: flex;
  132. align-items: center;
  133. gap: 0.5rem;
  134. transition: color 0.3s ease;
  135. }
  136. .article-nav a:hover {
  137. color: #1d4ed8;
  138. }
  139. /* 响应式设计 */
  140. @media (max-width: 768px) {
  141. .article-main {
  142. padding: 5rem 1rem 2rem;
  143. }
  144. .article-header h1 {
  145. font-size: 2rem;
  146. }
  147. .article-image {
  148. height: 300px;
  149. }
  150. .article-content {
  151. font-size: 1rem;
  152. }
  153. }