/* 首页专用样式 */

/* 页面容器 */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.home-page,
.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: 60px;
    background-color: #f5f5f5;
}

/* 移动端样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 搜索栏样式 */
.search-section {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 20px;
    padding: 8px 15px;
}

.search-icon {
    color: #6c757d;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background-color: transparent;
    outline: none;
    font-size: 14px;
}

/* 服务分类样式 */
.services-section {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.service-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.service-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.service-name {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 移动端服务项目样式 */
.card {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    position: relative;
    max-width: 100%;
    min-width: 0;
}

.service-scroll-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.service-items-mobile {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    font-size: 0;
}

.service-items-mobile::-webkit-scrollbar {
    display: none;
}

.service-item-mobile {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0 8px;
    width: 72px;
    font-size: 12px;
    text-align: center;
}

.service-item-icon-mobile {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #E20413;
    margin-bottom: 5px;
}

.service-item-title-mobile {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 推荐护工样式 */
.recommended-section {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.view-more {
    font-size: 14px;
    color: #E20413;
    text-decoration: none;
}

/* 底部操作栏 */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
    display: flex;
    justify-content: space-around;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    font-size: 12px;
}

.action-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.action-button.active {
    color: #E20413;
}

.recommended-list {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.recommended-item {
    flex: 0 0 auto;
    width: 120px;
    text-align: center;
}

.recommended-avatar {
    width: 100%;
    padding-top: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    background-color: #f5f5f5;
}

.recommended-avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.recommended-level {
    font-size: 12px;
    color: #666;
}

/* 移动端家政推荐样式 */
.section-mobile {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title-mobile {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.section-more-mobile {
    font-size: 14px;
    color: #E20413;
    text-decoration: none;
}

.experts-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.expert-item-mobile {
    display: flex;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background-color: #fff;
}

.expert-avatar-mobile {
    position: relative;
    width: 70px;
    height: 75px;
    margin-right: 12px;
    top:10px;
}

.avatar-mobile {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.expert-badge-mobile {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.expert-info-mobile {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
}

.expert-name-mobile {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
}

.expert-stats-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.expert-rating-mobile,
.expert-orders-mobile,
.expert-exp-mobile {
    font-size: 12px;
    color: #666;
}

.expert-exp-name {
    font-size: 13px;
    color: #666;
    display: flex;
}

.expert-skills-mobile {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
}

.expert-price-mobile {
    font-size: 18px;
    font-weight: bold;
    color: #E20413;
}

.price-unit-mobile {
    font-size: 12px;
    font-weight: normal;
}

.book-now-btn-mobile {
    background-color: #E20413;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    align-self: center;
}

/* 底部导航栏样式 */
.footer-nav-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.footer-nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
}

.footer-nav-item-mobile i {
    font-size: 20px;
    margin-bottom: 4px;
}

.footer-nav-item-mobile.active {
    color: #E20413;
}

/* 轮播图样式 */
.banner-swiper {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    max-width: 100vw;
    min-width: 0;
}

.swiper-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    max-width: 100vw;
    min-width: 0;
}

.swiper-slides {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.swiper-slide {
    flex: 0 0 auto;
    height: 100%;
}

/* 保持原有banner图片样式 */
.banner-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* 保证图片比例，不拉伸 */
}

/* 轮播指示器样式 */
.swiper-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.swiper-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.swiper-dot.active {
    width: 20px;
    border-radius: 4px;
    background-color: #fff;
}

.service-item-img {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: cover; /* 保证图片比例，不拉伸 */
}

/* 最新动态样式 */
.news-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item-mobile {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background-color: #fff;
}

.news-image-mobile {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.news-img-mobile {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content-mobile {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
}

.news-title-mobile {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.news-desc-mobile {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-meta-mobile {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.news-date-mobile,
.news-views-mobile {
    flex: 1;
}

.news-views-mobile {
    text-align: right;
}