/* 基础样式 */ :root { --color-primary: #db5f46; --color-secondary: #ac361e; --color-text: #333; --color-text-light: #fff; --color-border: #999; --color-box: #f9fafb; --color-mask: rgba(0, 0, 0, 0.4); --swiper-navigation-color: var(--color-primary); --swiper-pagination-color: var(--color-primary); --container-width: 1200px; } html, body { position: relative; color: var(--color-text); line-height: 1.6; font-family: 'PingFang SC', 'STSongtiSC', "Microsoft YaHei", sans-serif; margin: 0; padding: 0; } a { text-decoration: none; color: var(--color-text); } ul { list-style: none; } /* 头部样式 */ header { padding: 15px 0; background-color: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } header .inner { display: flex; flex-direction: row; justify-content: space-between; align-items: center; max-width: var(--container-width); margin: 0 auto; } header .logo { font-family: 'STSongtiSC', "Microsoft YaHei", sans-serif; font-size: 24px; font-weight: bold; color: var(--color-primary); } header .mobile-menu-toggle { display: none; width: 60px; height: 60px; } button { display: flex; align-items: center; justify-content: center; border: none; background-color: var(--color-primary); color: var(--color-text-light); } button:hover { background-color: var(--color-secondary); } button i { color: var(--color-text-light); } /* 导航样式 */ nav { position: relative; } .nav-list { display: flex; justify-content: center; align-items: center; margin-bottom: 0; } .nav-item { position: relative; } .nav-item a { display: block; color: var(--color-text); padding: 12px 20px; font-weight: 500; transition: background-color 0.3s; } .nav-item a:hover { color: var(--color-primary); } .nav-item.active a { font-weight: bold; color: var(--color-primary); } .search-bar { position: relative; } .search-bar button { width: 60px; height: 60px; } .search-bar button i { color: var(--color-text-light); } .search-bar input { position: absolute; right: 0; padding: 8px 15px; border: 1px solid var(--color-border); outline: none; width: 200px; height: 60px; transition: all 0.3s; opacity: 0; z-index: 20; } .search-bar input.show { width: 250px; opacity: 1; border-color: var(--color-primary); } /* 主要内容区域 */ .main-content { position: relative; width: 100%; padding: 40px 0; } .main-box { background-color: var(--color-box); border-radius: 10px; padding: 26px; } .main-hr { border-color: var(--color-border); margin: 50px 0; } /* 标题样式 */ .section-title { display: flex; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--color-primary); } .section-title h2 { font-family: "STSongtiSC"; font-synthesis: none; font-size: 20px; color: var(--color-primary); 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: var(--color-primary); } /* 通知公告区域 */ .notices-section { display: flex; gap: 30px; margin-bottom: 40px; } .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: var(--color-primary); } .notice-date { color: #999; font-size: 14px; } .featured-image { border-radius: 6px; overflow: hidden; position: relative; } .featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; } .featured-image .caption { position: absolute; bottom: 0; left: 0; right: 0; background-color: var(--color-mask); color: var(--color-text-light); padding: 8px 20px; } .featured-image .caption h3 { font-size: 18px; margin-bottom: 5px; } .featured-image .caption p { font-size: 14px; opacity: 0.9; } .featured-image:hover img { transform: scale(1.05); } /* 工作动态和党建工作区域 */ .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: var(--color-primary); } .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 { position: relative; border: 1px solid #eee; border-radius: 5px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; } .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 { position: absolute; bottom: 0; left: 0; right: 0; background-color: var(--color-mask); color: var(--color-text-light); padding: 15px; z-index: 1; margin-bottom: 0; } /* 公共服务区域 */ .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) { .featured-image { width: 100%; height: 300px; } .featured-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 768px) { .nav-list { flex-wrap: wrap; } .nav-item a { padding: 10px 15px; } .services-grid { grid-template-columns: 1fr; } } @media (max-width: 576px) { header nav { position: absolute; top: 0; opacity: 0; left: 0; right: 0; padding: 20px; background-color: var(--color-box); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); transition: all 0.3s; transform: translateY(-100%); z-index: 100; } header nav.show { display: block; opacity: 1; transform: translateY(0%); } .nav-list { flex-direction: column; } .nav-item { margin-bottom: 10px; } header .inner { padding: 0 20px; } header .mobile-menu-toggle { display: unset; width: 40px; height: 40px; } .search-bar button { width: 40px; height: 40px; } header .logo { font-size: 18px; } .featured-grid { grid-template-columns: 1fr; } .main-box { padding: 15px; } .services-section { align-items: flex-start; } .services-grid { padding: 210px 30px 40px 30px; } }