/* 基础样式 */ * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'PingFang SC', "STSongtiSC", "Microsoft YaHei", sans-serif; } body { color: #333; line-height: 1.6; } a { text-decoration: none; color: #333; } ul { list-style: none; } .container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; } /* 头部样式 */ header { background-color: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } .header-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; } .logo { font-size: 24px; font-weight: bold; color: #c8102e; } .search-bar { position: relative; } .search-bar input { padding: 8px 15px; border: 1px solid #ddd; border-radius: 20px; outline: none; width: 200px; transition: width 0.3s; } .search-bar input:focus { width: 250px; border-color: #c8102e; } .search-bar button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #999; cursor: pointer; } /* 导航样式 */ nav { background-color: #c8102e; } .nav-list { display: flex; justify-content: center; } .nav-item { position: relative; } .nav-item a { display: block; color: #fff; padding: 12px 20px; font-weight: 500; transition: background-color 0.3s; } .nav-item a:hover { background-color: #a60d24; } /* 轮播图样式 */ .carousel { position: relative; width: 100%; height: 400px; overflow: hidden; } .carousel-inner { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease; } .carousel-item { min-width: 100%; height: 100%; } .carousel-item img { width: 100%; height: 100%; object-fit: cover; } .carousel-control { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0, 0, 0, 0.3); color: white; border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 20px; cursor: pointer; transition: background-color 0.3s; } .carousel-control:hover { background-color: rgba(0, 0, 0, 0.5); } .carousel-control.prev { left: 20px; } .carousel-control.next { right: 20px; } .carousel-indicators { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; } .indicator { width: 12px; height: 12px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.5); cursor: pointer; transition: background-color 0.3s; } .indicator.active { background-color: white; } /* 主要内容区域 */ .main-content { padding: 40px 0; } /* 标题样式 */ .section-title { display: flex; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #c8102e; } .section-title h2 { font-family: "STSongtiSC"; font-synthesis: none; font-size: 20px; color: #c8102e; margin-right: 15px; } .section-title .sub-title { color: #666; padding-left: 15px; border-left: 1px solid #ddd; } .section-more { margin-left: auto; color: #666; } .section-more:hover { color: #c8102e; } /* 通知公告区域 */ .notices-section { display: flex; gap: 30px; margin-bottom: 40px; } .notices-list { flex: 1; } .notice-item { padding: 15px 0; border-bottom: 1px dashed #ddd; display: flex; justify-content: space-between; align-items: center; } .notice-item:last-child { border-bottom: none; } .notice-title { flex: 1; margin-right: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; } .notice-title:hover { color: #c8102e; } .notice-date { color: #999; font-size: 14px; } .featured-image { width: 400px; height: 250px; overflow: hidden; position: relative; } .featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; } .featured-image:hover img { transform: scale(1.05); } .featured-caption { position: absolute; bottom: 0; left: 0; right: 0; background-color: rgba(0, 0, 0, 0.6); color: white; padding: 10px 15px; } .featured-caption h3 { font-size: 18px; margin-bottom: 5px; } .featured-caption p { font-size: 14px; opacity: 0.9; } /* 工作动态和党建工作区域 */ .two-columns { display: flex; gap: 30px; margin-bottom: 40px; } .two-columns > div { flex: 1; } .news-item { padding: 12px 0; border-bottom: 1px dashed #ddd; display: flex; justify-content: space-between; align-items: center; } .news-item:last-child { border-bottom: none; } .news-title { flex: 1; margin-right: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; } .news-title:hover { color: #c8102e; } .news-date { color: #999; font-size: 14px; } /* 精彩推荐区域 */ .featured-section { margin-bottom: 40px; } .featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; } .featured-card { border: 1px solid #eee; border-radius: 5px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; } .featured-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); } .featured-card img { width: 100%; height: 200px; object-fit: cover; } .featured-card p { padding: 15px; text-align: center; height: 60px; display: flex; align-items: center; justify-content: center; } /* 公共服务区域 */ .services-section { margin-bottom: 40px; display: flex; flex-direction: row; align-items: center; } .services-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 60px; background-color: #fff1ee; padding: 0px 30px 40px 230px; border-radius: 15px; margin-left: -180px; z-index: 0; z-index: 0; } .service-card h3 { font-size: 15px; } .service-card { background-color: #fff; border-radius: 8px; padding: 30px 20px; margin-top: -15px; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); transition: transform 0.3s, box-shadow 0.3s; } .service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); } .service-icon { width: 40px; height: 40px; margin-bottom: 10px; } .services-section .title { width: 220px; height: 220px; z-index: 10; } /* 底部区域 */ footer { color: #fff; background-color: #f5f5f5; background-image: url(/images/footer-bg.png); background-position: center; background-size: cover; padding: 40px 0 20px; } .footer-links { display: flex; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; } .footer-link { margin: 0 15px; color: #eee; } .footer-link:hover { color: #fcacb9; } .footer-info { text-align: center; color: #eee; font-size: 14px; line-height: 1.8; } .footer-select { text-align: center; margin-bottom: 20px; } .footer-select select { padding: 8px 15px; border: 1px solid #ddd; border-radius: 4px; background-color: #fff; cursor: pointer; } /* 响应式设计 */ @media (max-width: 992px) { .notices-section { flex-direction: column; } .featured-image { width: 100%; height: 300px; } .featured-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 768px) { .two-columns { flex-direction: column; } .nav-list { flex-wrap: wrap; } .nav-item a { padding: 10px 15px; } .services-grid { grid-template-columns: 1fr; } } @media (max-width: 576px) { .carousel { height: 250px; } .featured-grid { grid-template-columns: 1fr; } .header-top { flex-direction: column; gap: 15px; } .search-bar { width: 100%; } .search-bar input { width: 100%; } .search-bar input:focus { width: 100%; } }