articles.css 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* 文章列表页面样式 */
  2. .articles-main {
  3. padding-top: 6rem;
  4. max-width: 1200px;
  5. margin: 0 auto;
  6. padding-bottom: 4rem;
  7. }
  8. .articles-header {
  9. text-align: center;
  10. margin-bottom: 3rem;
  11. }
  12. .articles-header h1 {
  13. font-size: 2.5rem;
  14. color: #1e40af;
  15. margin-bottom: 1rem;
  16. }
  17. .articles-header p {
  18. color: #64748b;
  19. font-size: 1.2rem;
  20. }
  21. .articles-grid {
  22. display: grid;
  23. grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  24. gap: 2rem;
  25. padding: 0 1rem;
  26. }
  27. .article-card {
  28. background: white;
  29. border-radius: 1rem;
  30. overflow: hidden;
  31. box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  32. transition: transform 0.3s ease;
  33. }
  34. .article-card:hover {
  35. transform: translateY(-5px);
  36. }
  37. .article-image {
  38. width: 100%;
  39. height: 200px;
  40. overflow: hidden;
  41. }
  42. .article-image img {
  43. width: 100%;
  44. height: 100%;
  45. object-fit: cover;
  46. transition: transform 0.3s ease;
  47. }
  48. .article-card:hover .article-image img {
  49. transform: scale(1.05);
  50. }
  51. .article-content {
  52. padding: 1.5rem;
  53. }
  54. .article-content h2 {
  55. font-size: 1.25rem;
  56. color: #1e40af;
  57. margin-bottom: 0.5rem;
  58. line-height: 1.4;
  59. }
  60. .article-meta {
  61. color: #64748b;
  62. font-size: 0.875rem;
  63. margin-bottom: 1rem;
  64. }
  65. .article-excerpt {
  66. color: #4b5563;
  67. margin-bottom: 1.5rem;
  68. line-height: 1.6;
  69. }
  70. .article-link {
  71. color: #2563eb;
  72. text-decoration: none;
  73. font-weight: 500;
  74. display: inline-block;
  75. transition: color 0.3s ease;
  76. }
  77. .article-link:hover {
  78. color: #1d4ed8;
  79. }
  80. /* 导航栏激活状态 */
  81. .nav-links a.active {
  82. color: #2563eb;
  83. font-weight: 500;
  84. }
  85. /* 响应式设计 */
  86. @media (max-width: 768px) {
  87. .articles-main {
  88. padding-top: 5rem;
  89. }
  90. .articles-header h1 {
  91. font-size: 2rem;
  92. }
  93. .articles-grid {
  94. grid-template-columns: 1fr;
  95. }
  96. }