/* services.css - 南康家具网服务页面样式 */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #f4f4f4;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: #333;
}

ul {
    list-style: none;
}

/* ===== 头部区域 ===== */
.top-header {
    background-color: #f5f5f5;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.top-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left .favorite-link {
    font-weight: bold;
    color: #5bc0de;
}

.header-right a {
    margin-left: 30px;
    font-weight: bold;
    color: #000000;
    transition: color 0.3s;
}

.header-right a:hover {
    color: #5bc0de;
}

/* ===== 搜索区域 ===== */
.search-area {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.search-area .container {
    display: flex;
    align-items: center;
}

/* 汉堡菜单 */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

.hamburger-menu span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #333;
    transition: all 0.3s ease;
}

/* 搜索框容器 */
.search-box {
    flex: 1;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    position: relative;
    display: flex;
    align-items: center;
}

/* 搜索输入框 */
.search-input input {
    width: 100%;
    padding: 12px 120px 12px 20px;
    border: 2px solid #5bc0de;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: white;
    line-height: 1.5;
    color: #333;
}

.search-input input::placeholder {
    color: #999;
}

/* 搜索按钮 - 矩形带文字 */
.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 40px;
    background: linear-gradient(135deg, #5bc0de, #31b0d5);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-button:hover {
    background: linear-gradient(135deg, #31b0d5, #5bc0de);
    transform: translateY(-50%) scale(1.02);
}

.search-button:active {
    transform: translateY(-50%) scale(0.98);
}

.search-button i {
    margin-right: 5px;
}

/* ===== 导航栏 ===== */
.main-nav {
    background-color: #5bc0de;
    color: white;
}

.nav-list {
    display: flex;
    align-items: center;
}

.nav-list > li > a {
    display: block;
    padding: 12px 15px;
    color: white;
    font-weight: bold;
    transition: background-color 0.3s;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
    background-color: #31b0d5;
}

/* 下拉菜单 */
.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 999;
    padding: 20px;
    min-width: 200px;
    border-radius: 0 0 8px 8px;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 15px;
    color: #666;
    font-size: 14px;
    transition: all 0.3s;
}

.dropdown-item:hover {
    color: #5bc0de;
    background-color: #f9f9f9;
}

/* ===== 移动端导航 ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: -140px;
    width: 140px;
    height: 100%;
    background-color: white;
    z-index: 1999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #5bc0de;
    color: white;
}

.mobile-nav-title {
    font-size: 16px;
    font-weight: bold;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-content {
    padding: 0;
}

.mobile-nav-list {
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: #f9f9f9;
    color: #5bc0de;
}

.mobile-dropdown {
    display: none;
    background-color: #f9f9f9;
    padding: 0;
}

.mobile-dropdown.active {
    display: block;
}

.mobile-dropdown-link {
    display: block;
    padding: 10px 15px 10px 25px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.mobile-dropdown-link:hover {
    background-color: #fff5f0;
    color: #5bc0de;
}

/* 自定义滚动条样式 */
.mobile-nav::-webkit-scrollbar {
    width: 4px;
}

.mobile-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-nav::-webkit-scrollbar-thumb {
    background: #5bc0de;
    border-radius: 2px;
}

.mobile-nav::-webkit-scrollbar-thumb:hover {
    background: #31b0d5;
}

/* ===== 内容区域 ===== */
.content-section {
    padding: 20px;
    margin-bottom: 40px;
    min-height: 500px;
}

/* 从store-rental-public.html提取的卡片样式 */
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.service-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.service-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-content {
    display: flex;
    flex: 1;
    padding: 15px;
    gap: 15px;
    flex-direction: column;
}

.card-image {
    flex-shrink: 0;
    width: 100%;
    height: 160px;
    position: relative;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-card:hover .card-image img {
    transform: scale(1.05);
}

.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    color: #6b7280;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* 联系人信息容器 - 桌面端显示 */
.card-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
}

.contact-item i {
    color: #5bc0de;
    width: 14px;
    flex-shrink: 0;
}

/* 首页样式 */
.module-section {
    margin: 20px 0;
}

.module-section:first-child {
    margin-top: 15px;
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #5bc0de;
}

.result-count {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e8e8e8;
    border-top: 3px solid #5bc0de;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 关注公众号模态框 ===== */
.mini-program-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.mini-program-modal .modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 300px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.mini-program-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mini-program-modal .modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #5bc0de;
}

.mini-program-modal .close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.mini-program-modal .close-modal:hover {
    color: #5bc0de;
}

.qrcode-container {
    padding: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.qrcode-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.qrcode-tip {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* ===== 响应式设计 ===== */
/* 平板端 */
@media (max-width: 1024px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}
/* 手机端 */
@media (max-width: 768px) {
    /* 1. 卡片与卡片上下间距调整为1-2px */
    .service-grid {
        grid-template-columns: 1fr;
        gap: 2px;
        margin: 0;
    }
    
    /* 1. 移除移动端卡片的内外边框 */
    .service-card {
        flex-direction: row;
        align-items: stretch;
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background-color: #fff;
    }
    
    /* 1. 移除内容区域的所有内外边框 */
    .content-section {
        padding: 1px 0 20px 0; /* 上边距改为1px，与标题下横线间距一致 */
        margin-bottom: 20px;
    }
    
    .content-section .container {
        padding-left: 0;
        padding-right: 0;
        margin: 0;
    }
    
    /* 1. 移除首页模块的内外边框 */
    .module-section {
        margin: 15px 0;
        padding: 0;
        background: none;
        border: none;
    }
    
    .module-section:first-child {
        margin-top: 2px;
    }
    
    /* 1. 移除标题和计数器的边框 */
    .section-title {
        font-size: 18px;
        margin-bottom: 0 !important; /* 与下方计数器的间距设为0 */
        padding: 0 15px 8px 15px;
        border-bottom: 1px solid #e0e0e0;
        background: none;
    }
    
    .result-count {
        font-size: 13px;
        margin-top: 0px !important; /* 负边距上移，紧贴横线 */
        margin-bottom: 0 !important; /* 下边距设为0 */
        padding: 0 15px; /* 只在左右添加15px内边距 */
    }

    
    /* 2. 图片(上下左右)加大1px，图片左侧留5px */
    .card-content {
        flex-direction: row;
        padding: 0;
        gap: 10px;
        width: 100%;
        margin: 0;
    }
    
    .card-image {
        flex-shrink: 0;
        /* 修改：宽度增加30%，从98px增加到约127px */
        width: 127px; /* 原98px * 1.3 = 127.4px，取127px */
        height: 98px; /* 高度保持不变，保持原有比例 */
        min-width: 127px;
        margin: 0;
        padding: 0;
        border-radius: 0;
        overflow: hidden;
        margin-left: 5px; /* 图片左侧留5px */
    }
    
    .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        margin: -1px; /* 图片上下左右加大1px */
        /* 修改：确保图片填充整个容器 */
        object-position: center;
    }
    
     .card-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* 修改：右侧内边距适当减少，为更宽的图片腾出空间 */
        padding: 10px 8px 10px 0; /* 从12px减少到8px */
        margin: 0;
    }
    
    .card-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
        padding: 0;
    }
    
    .card-description {
        font-size: 12px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        margin-bottom: 6px;
        flex: 1;
        padding: 0;
        color: #666;
    }
    
    /* 手机端隐藏桌面端的联系人信息 */
    .card-contact {
        display: none !important;
    }
    
    /* 汉堡菜单显示 */
    .hamburger-menu {
        display: flex;
    }
    
    .main-nav {
        display: none;
    }
    
      .search-area {
        background-color: transparent;
        box-shadow: none;
        padding: 0 0 0 0;
        position: relative;
    }
    
    .search-area .container {
        padding: 0 10px;
    }
    
    /* 修改：移除搜索框外部包裹样式 */
    .search-box {
        margin: 0;
        /* 移除边框和阴影 */
        border: none;
        box-shadow: none;
        border-radius: 0;
        background-color: transparent;
    }
    
    /* 保持输入框样式不变 */
    .search-input input {
        padding: 10px 110px 10px 15px;
        font-size: 14px;
        /* 输入框保留原有样式 */
        border: 2px solid #5bc0de;
        border-radius: 25px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background-color: white;
    }
    
    /* 保持按钮样式不变 */
    .search-button {
        width: 80px;
        height: 36px;
        right: 3px;
        font-size: 14px;
    }
    
  
    .header-right a {
        margin-left: 0;
        white-space: nowrap;
        font-size: 13px;
    }
    
    /* 移动端展开按钮 - 只对租售信息卡片显示 */
    .mobile-expand-btn {
        display: block;
        padding: 6px 12px;
        background-color: #5bc0de;
        color: white;
        border-radius: 4px;
        font-size: 12px;
        text-align: center;
        cursor: pointer;
        margin-top: 8px;
        transition: background-color 0.3s;
        align-self: flex-start;
    }
    
    .mobile-expand-btn:hover {
        background-color: #31b0d5;
    }
    
    /* 移动端展开内容 */
    .mobile-expand-content {
        display: none;
        padding: 15px;
        background-color: #f9f9f9;
        border-top: 1px solid #e8e8e8;
    }
    
    .mobile-expand-content.expanded {
        display: block;
    }
    
    .mobile-contact-info h4 {
        font-size: 14px;
        margin-bottom: 10px;
        color: #333;
    }
    
    .mobile-contact-info .contact-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #333;
        margin-bottom: 8px;
    }
    
    .mobile-contact-info .contact-item i {
        color: #5bc0de;
        width: 16px;
    }
}

/* 更小的手机屏幕 (<= 480px) */
@media (max-width: 480px) {
    /* 进一步减小卡片尺寸 */
    .card-image {
        /* 修改：宽度增加30%，从82px增加到约107px */
        width: 107px; /* 原82px * 1.3 = 106.6px，取107px */
        height: 82px; /* 高度保持不变 */
        min-width: 107px;
        margin-left: 5px;
    }
    
    .card-image img {
        margin: -1px;
    }
    
    .card-info {
        padding: 8px 6px 8px 0;
    }
    
    .card-title {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .card-description {
        font-size: 11px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 4px;
    }
    
    /* 如果卡片之间需要更小的间距 */
    .service-grid {
        gap: 1px;
    }
    
    /* 卡片没有边框 */
    .service-card {
        border: none;
    }
    
    /* 共找到信息上下间距设为0 */
    .result-count {
        margin-top: -4px !important;
        margin-bottom: 0 !important;
    }
}

/* 特别小的手机屏幕 (<= 375px) */
@media (max-width: 375px) {
    .card-image {
        /* 修改：宽度增加30%，从72px增加到约94px */
        width: 94px; /* 原72px * 1.3 = 93.6px，取94px */
        height: 72px; /* 高度保持不变 */
        min-width: 94px;
        margin-left: 5px;
    }
    
    .card-image img {
        margin: -1px;
    }
    
    .card-info {
        padding: 6px 5px 6px 0;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .card-description {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }
    
    /* 调整模块间距 */
    .module-section {
        margin: 12px 0;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 0 !important;
        padding: 0 12px 6px 12px;
    }
    
    .result-count {
        font-size: 12px;
        margin-top: -4px !important;
        margin-bottom: 0 !important;
        padding: 0 12px;
    }
}

/* 确保桌面端样式不受影响 */
@media (min-width: 769px) {
    .service-card {
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        margin: 0;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .card-image {
        border-radius: 6px;
    }
    
    /* 确保桌面端联系人信息显示 */
    .card-contact {
        display: flex !important;
    }
}

/* 额外优化：悬停效果只对桌面端有效 */
@media (min-width: 769px) {
    .service-card:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }
    
    .service-card:hover .card-image img {
        transform: scale(1.05);
    }
}

/* 移动端不需要悬停效果 */
@media (max-width: 768px) {
    .service-card:hover {
        box-shadow: none;
        transform: none;
    }
    
    .service-card:hover .card-image img {
        transform: none;
    }
    
    /* 移动端点击效果 */
    .service-card:active {
        background-color: #f9f9f9;
    }
}

/* 桌面端样式 - 确保移动端元素不显示 */
@media (min-width: 769px) {
    /* 隐藏移动端展开按钮和内容 */
    .mobile-expand-btn,
    .mobile-expand-content {
        display: none !important;
    }
    
    /* 确保桌面端联系人信息显示 */
    .card-contact {
        display: flex !important;
    }
}