style.css 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /* 基础样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. font-family: 'PingFang SC', "STSongtiSC", "Microsoft YaHei", sans-serif;
  7. }
  8. body {
  9. color: #333;
  10. line-height: 1.6;
  11. }
  12. a {
  13. text-decoration: none;
  14. color: #333;
  15. }
  16. ul {
  17. list-style: none;
  18. }
  19. .container {
  20. width: 100%;
  21. max-width: 1200px;
  22. margin: 0 auto;
  23. padding: 0 20px;
  24. }
  25. /* 头部样式 */
  26. header {
  27. background-color: #fff;
  28. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  29. }
  30. .header-top {
  31. display: flex;
  32. justify-content: space-between;
  33. align-items: center;
  34. padding: 15px 0;
  35. }
  36. .logo {
  37. font-size: 24px;
  38. font-weight: bold;
  39. color: #c8102e;
  40. }
  41. .search-bar {
  42. position: relative;
  43. }
  44. .search-bar input {
  45. padding: 8px 15px;
  46. border: 1px solid #ddd;
  47. border-radius: 20px;
  48. outline: none;
  49. width: 200px;
  50. transition: width 0.3s;
  51. }
  52. .search-bar input:focus {
  53. width: 250px;
  54. border-color: #c8102e;
  55. }
  56. .search-bar button {
  57. position: absolute;
  58. right: 10px;
  59. top: 50%;
  60. transform: translateY(-50%);
  61. background: none;
  62. border: none;
  63. color: #999;
  64. cursor: pointer;
  65. }
  66. /* 导航样式 */
  67. nav {
  68. background-color: #c8102e;
  69. }
  70. .nav-list {
  71. display: flex;
  72. justify-content: center;
  73. }
  74. .nav-item {
  75. position: relative;
  76. }
  77. .nav-item a {
  78. display: block;
  79. color: #fff;
  80. padding: 12px 20px;
  81. font-weight: 500;
  82. transition: background-color 0.3s;
  83. }
  84. .nav-item a:hover {
  85. background-color: #a60d24;
  86. }
  87. /* 轮播图样式 */
  88. .carousel {
  89. position: relative;
  90. width: 100%;
  91. height: 400px;
  92. overflow: hidden;
  93. }
  94. .carousel-inner {
  95. display: flex;
  96. width: 100%;
  97. height: 100%;
  98. transition: transform 0.5s ease;
  99. }
  100. .carousel-item {
  101. min-width: 100%;
  102. height: 100%;
  103. }
  104. .carousel-item img {
  105. width: 100%;
  106. height: 100%;
  107. object-fit: cover;
  108. }
  109. .carousel-control {
  110. position: absolute;
  111. top: 50%;
  112. transform: translateY(-50%);
  113. background-color: rgba(0, 0, 0, 0.3);
  114. color: white;
  115. border: none;
  116. width: 50px;
  117. height: 50px;
  118. border-radius: 50%;
  119. font-size: 20px;
  120. cursor: pointer;
  121. transition: background-color 0.3s;
  122. }
  123. .carousel-control:hover {
  124. background-color: rgba(0, 0, 0, 0.5);
  125. }
  126. .carousel-control.prev {
  127. left: 20px;
  128. }
  129. .carousel-control.next {
  130. right: 20px;
  131. }
  132. .carousel-indicators {
  133. position: absolute;
  134. bottom: 20px;
  135. left: 50%;
  136. transform: translateX(-50%);
  137. display: flex;
  138. gap: 10px;
  139. }
  140. .indicator {
  141. width: 12px;
  142. height: 12px;
  143. border-radius: 50%;
  144. background-color: rgba(255, 255, 255, 0.5);
  145. cursor: pointer;
  146. transition: background-color 0.3s;
  147. }
  148. .indicator.active {
  149. background-color: white;
  150. }
  151. /* 主要内容区域 */
  152. .main-content {
  153. padding: 40px 0;
  154. }
  155. /* 标题样式 */
  156. .section-title {
  157. display: flex;
  158. align-items: center;
  159. margin-bottom: 20px;
  160. padding-bottom: 10px;
  161. border-bottom: 2px solid #c8102e;
  162. }
  163. .section-title h2 {
  164. font-family: "STSongtiSC";
  165. font-synthesis: none;
  166. font-size: 20px;
  167. color: #c8102e;
  168. margin-right: 15px;
  169. }
  170. .section-title .sub-title {
  171. color: #666;
  172. padding-left: 15px;
  173. border-left: 1px solid #ddd;
  174. }
  175. .section-more {
  176. margin-left: auto;
  177. color: #666;
  178. }
  179. .section-more:hover {
  180. color: #c8102e;
  181. }
  182. /* 通知公告区域 */
  183. .notices-section {
  184. display: flex;
  185. gap: 30px;
  186. margin-bottom: 40px;
  187. }
  188. .notices-list {
  189. flex: 1;
  190. }
  191. .notice-item {
  192. padding: 15px 0;
  193. border-bottom: 1px dashed #ddd;
  194. display: flex;
  195. justify-content: space-between;
  196. align-items: center;
  197. }
  198. .notice-item:last-child {
  199. border-bottom: none;
  200. }
  201. .notice-title {
  202. flex: 1;
  203. margin-right: 15px;
  204. white-space: nowrap;
  205. overflow: hidden;
  206. text-overflow: ellipsis;
  207. transition: color 0.3s;
  208. }
  209. .notice-title:hover {
  210. color: #c8102e;
  211. }
  212. .notice-date {
  213. color: #999;
  214. font-size: 14px;
  215. }
  216. .featured-image {
  217. width: 400px;
  218. height: 250px;
  219. overflow: hidden;
  220. position: relative;
  221. }
  222. .featured-image img {
  223. width: 100%;
  224. height: 100%;
  225. object-fit: cover;
  226. transition: transform 0.5s;
  227. }
  228. .featured-image:hover img {
  229. transform: scale(1.05);
  230. }
  231. .featured-caption {
  232. position: absolute;
  233. bottom: 0;
  234. left: 0;
  235. right: 0;
  236. background-color: rgba(0, 0, 0, 0.6);
  237. color: white;
  238. padding: 10px 15px;
  239. }
  240. .featured-caption h3 {
  241. font-size: 18px;
  242. margin-bottom: 5px;
  243. }
  244. .featured-caption p {
  245. font-size: 14px;
  246. opacity: 0.9;
  247. }
  248. /* 工作动态和党建工作区域 */
  249. .two-columns {
  250. display: flex;
  251. gap: 30px;
  252. margin-bottom: 40px;
  253. }
  254. .two-columns > div {
  255. flex: 1;
  256. }
  257. .news-item {
  258. padding: 12px 0;
  259. border-bottom: 1px dashed #ddd;
  260. display: flex;
  261. justify-content: space-between;
  262. align-items: center;
  263. }
  264. .news-item:last-child {
  265. border-bottom: none;
  266. }
  267. .news-title {
  268. flex: 1;
  269. margin-right: 15px;
  270. white-space: nowrap;
  271. overflow: hidden;
  272. text-overflow: ellipsis;
  273. transition: color 0.3s;
  274. }
  275. .news-title:hover {
  276. color: #c8102e;
  277. }
  278. .news-date {
  279. color: #999;
  280. font-size: 14px;
  281. }
  282. /* 精彩推荐区域 */
  283. .featured-section {
  284. margin-bottom: 40px;
  285. }
  286. .featured-grid {
  287. display: grid;
  288. grid-template-columns: repeat(3, 1fr);
  289. gap: 20px;
  290. }
  291. .featured-card {
  292. border: 1px solid #eee;
  293. border-radius: 5px;
  294. overflow: hidden;
  295. transition:
  296. transform 0.3s,
  297. box-shadow 0.3s;
  298. }
  299. .featured-card:hover {
  300. transform: translateY(-5px);
  301. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  302. }
  303. .featured-card img {
  304. width: 100%;
  305. height: 200px;
  306. object-fit: cover;
  307. }
  308. .featured-card p {
  309. padding: 15px;
  310. text-align: center;
  311. height: 60px;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. }
  316. /* 公共服务区域 */
  317. .services-section {
  318. margin-bottom: 40px;
  319. display: flex;
  320. flex-direction: row;
  321. align-items: center;
  322. }
  323. .services-grid {
  324. flex: 1;
  325. display: grid;
  326. grid-template-columns: repeat(3, 1fr);
  327. gap: 30px;
  328. margin-top: 60px;
  329. background-color: #fff1ee;
  330. padding: 0px 30px 40px 230px;
  331. border-radius: 15px;
  332. margin-left: -180px;
  333. z-index: 0;
  334. z-index: 0;
  335. }
  336. .service-card h3 {
  337. font-size: 15px;
  338. }
  339. .service-card {
  340. background-color: #fff;
  341. border-radius: 8px;
  342. padding: 30px 20px;
  343. margin-top: -15px;
  344. box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  345. transition:
  346. transform 0.3s,
  347. box-shadow 0.3s;
  348. }
  349. .service-card:hover {
  350. transform: translateY(-5px);
  351. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  352. }
  353. .service-icon {
  354. width: 40px;
  355. height: 40px;
  356. margin-bottom: 10px;
  357. }
  358. .services-section .title {
  359. width: 220px;
  360. height: 220px;
  361. z-index: 10;
  362. }
  363. /* 底部区域 */
  364. footer {
  365. color: #fff;
  366. background-color: #f5f5f5;
  367. background-image: url(/images/footer-bg.png);
  368. background-position: center;
  369. background-size: cover;
  370. padding: 40px 0 20px;
  371. }
  372. .footer-links {
  373. display: flex;
  374. justify-content: center;
  375. margin-bottom: 20px;
  376. flex-wrap: wrap;
  377. }
  378. .footer-link {
  379. margin: 0 15px;
  380. color: #eee;
  381. }
  382. .footer-link:hover {
  383. color: #fcacb9;
  384. }
  385. .footer-info {
  386. text-align: center;
  387. color: #eee;
  388. font-size: 14px;
  389. line-height: 1.8;
  390. }
  391. .footer-select {
  392. text-align: center;
  393. margin-bottom: 20px;
  394. }
  395. .footer-select select {
  396. padding: 8px 15px;
  397. border: 1px solid #ddd;
  398. border-radius: 4px;
  399. background-color: #fff;
  400. cursor: pointer;
  401. }
  402. /* 响应式设计 */
  403. @media (max-width: 992px) {
  404. .notices-section {
  405. flex-direction: column;
  406. }
  407. .featured-image {
  408. width: 100%;
  409. height: 300px;
  410. }
  411. .featured-grid {
  412. grid-template-columns: repeat(2, 1fr);
  413. }
  414. }
  415. @media (max-width: 768px) {
  416. .two-columns {
  417. flex-direction: column;
  418. }
  419. .nav-list {
  420. flex-wrap: wrap;
  421. }
  422. .nav-item a {
  423. padding: 10px 15px;
  424. }
  425. .services-grid {
  426. grid-template-columns: 1fr;
  427. }
  428. }
  429. @media (max-width: 576px) {
  430. .carousel {
  431. height: 250px;
  432. }
  433. .featured-grid {
  434. grid-template-columns: 1fr;
  435. }
  436. .header-top {
  437. flex-direction: column;
  438. gap: 15px;
  439. }
  440. .search-bar {
  441. width: 100%;
  442. }
  443. .search-bar input {
  444. width: 100%;
  445. }
  446. .search-bar input:focus {
  447. width: 100%;
  448. }
  449. }