/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 60px; /* 根据导航高度调整 */
}
a{text-decoration: none;color:#333}
/* 头部样式 */
.index-header {
    display: flex;
    padding: 10px 15px;
    background-color: #ebf3fe;
    align-items: center;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 90;
    height: 60px; /* 固定头部高度 */
}
.header {
    /*display: flex;*/
    padding: 10px 15px;
    background-color: #ebf3fe;
    align-items: center;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 90;
    height: 60px; /* 固定头部高度 */
}

.city-selector {
    display: flex;
    align-items: center;
    margin-right: 10px;
    color: #666;
    white-space: nowrap; /* 防止城市名换行 */
    padding: 5px 0;
}

.city-arrow {
    font-size: 12px;
    margin-left: 3px;
}

.search-box {
    flex: 1;
    position: relative;
    min-width: 0; /* 关键：允许搜索框缩小到内容尺寸 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input {
    width: 100%; /* 确保搜索框占满可用空间 */
    padding: 12px 15px 12px 40px;
    font-size: 14px;
    border: none;
    border-radius: 20px; /* 添加圆角更美观 */
    background-color: rgba(255, 255, 255, 0.8);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0 1px transparent;
}
.search-input:focus {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 1px #007aff, 0 0 0 3px rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}
.search-input:active {
    transform: translateY(0);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
}

.search-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 服务统计样式 */
.service-stats {
    padding: 12px 15px;
    background-color: #ebf3fe;
    padding-top: 5px; /* 减少顶部间距 */
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 13px;
    color: #666;
    letter-spacing: 0.08rem; 
}

.stat-num span {
    color: #007aff; /* 使用现有蓝色主题色 */
    font-weight: 600; /* 略微加粗 */
}

/* 图片网格样式 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 明确设置为2列布局 */
    gap: 10px;
    padding: 10px 15px;
    background-image: linear-gradient(180deg, #ebf3fe, #fff);
}
.grid-image {
    width: 100%;
    height: 80px;
    object-fit: cover; /* 使用cover而不是contain，确保填充且不变形 */
    border-radius: 6px;
    display: block; /* 移除图片下方可能的空白 */
}

/* 律师列表样式 */
.lawyer-list {
    background-color: #fff;
    margin-bottom: 10px;
    padding-bottom: 10px;
    position: relative;
}

.list-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 500;
}

.more-btn {
    display: flex;
    align-items: center;
    color: #999;
    font-size: 13px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.more-btn img {
    width: 12px;
    height: 12px;
    margin-left: 3px;
}

/* 律师轮播容器 */
.lawyer-rows-container {
    padding: 0 15px;
}

.lawyer-row {
    overflow: hidden;
    margin-bottom: 12px;
    height: 110px; /* 固定行高，确保对齐 */
}

.lawyer-scroll-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-out;
    will-change: transform;
}

/* 优化的律师卡片样式 */
.lawyer-item {
    min-width: 100%;
    margin: 0 8px 16px; /* 增加底部间距避免重叠 */
    background-color: #f9f9f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 12px 10px; /* 左右内边距与容器呼应 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
    border: 1px solid #e0e0e0; /* 稍微加深边框便于对齐观察 */
    justify-content: space-between;
    box-sizing: border-box; /* 确保边框和内边距不影响宽度计算 */
}
.lawyer-avatar {
    width: 70px;
    height: 70px;
    border-radius: 10%;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    border: 2px solid #e6b04e;
}
.lawyer-actions {
    /* 右侧区域的布局 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    width: 35%; /* 限制最大宽度，避免挤压左侧内容 */
}
.lawyer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lawyer-info {
    flex: 1;
    min-width: 0;
    padding-right: 10px; /* 增加右侧内边距避免与按钮重叠 */
}

.lawyer-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.lawyer-firm {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lawyer-tags {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tag-item {
    font-size: 12px;
    padding: 3px 4px;
    background-color: #e8f4fd;
    color: #007aff;
    border-radius: 12px;
    white-space: nowrap;
}

.consult-btn {
    background-color: #007aff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    width: 100%;
}

.consult-btn:active {
    transform: scale(0.96);
    background-color: #0066cc;
}

/* 轮播控制按钮 */
.carousel-controls {
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    display: none;
}

.carousel-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #eee;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.carousel-btn:active {
    transform: scale(0.95);
    background-color: #f5f5f5;
}

/* 滚动指示器 */
.scroll-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
    transition: background-color 0.3s ease;
}

.scroll-dot.active {
    background-color: #007aff;
    width: 24px;
    border-radius: 4px;
}

/* 优化文章列表样式 */
.article-list {
    background-color: #fff;
    margin-bottom: 10px;
    padding-bottom: 15px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 15px;
}

.article-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transform: translateZ(0); /* 启用GPU加速 */
    will-change: transform; /* 提示浏览器优化 */
}

.article-cover {
    height: 100px;
    overflow: hidden;
}

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

.article-item:hover .article-cover img {
    transform: scale(1.05);
}

.article-info {
    padding: 10px;
}

.article-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
}

/* 底部横幅 */
.bottom-banner {
    background-color: #007aff;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 0 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px; 
    box-sizing: border-box; /* 确保内边距不影响整体尺寸 */
}

.banner-title {
    font-size: 15px;
    font-weight: 500;
}

.banner-btn {
    background-color: white;
    color: #007aff;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.banner-btn:active {
    transform: scale(0.96);
}
.message-badge {
    position: absolute;
    top: -3px;
    right: 30%;
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
}
/* 底部导航容器 - 增强版 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
    z-index: 999;
    padding: 8px 0 4px; /* 调整上下内边距，给图标更多呼吸空间 */
  }
  
  /* 导航项样式 - 增强视觉层次 */
  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a8a8a;
    text-decoration: none;
    font-size: 11px;
    padding: 6px 0;
    position: relative; /* 为动画效果做准备 */
    transition: all 0.2s ease; /* 平滑过渡效果 */
    -webkit-tap-highlight-color: transparent;
  }
  
  /* 图标增强样式 */
  .nav-item i {
    font-size: 22px;
    margin-bottom: 5px;
    position: relative;
    transition: all 0.2s ease;
  }
  
  /* 激活状态 - 更丰富的视觉反馈 */
  .nav-item.active {
    color: #1677ff;
  }
  
  .nav-item.active i {
    /* 激活时图标轻微上浮 */
    transform: translateY(-2px);
    
  }
  
  /* 激活状态下的图标底部装饰 */
  .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #1677ff;
    margin-top: 4px;
    display: none; /* 隐藏原有圆点 */
  }
  
  /* 点击反馈效果 */
  .nav-item:active {
    background-color: rgba(22, 119, 255, 0.05);
  }
  .nav-item:nth-child(3) i {
    position: relative;
    animation: pulse 2s infinite; /* 呼吸动画 */
    font-size: 24px; /* 比其他图标大2-4px，更醒目 */
    margin-bottom: 2px; /* 微调与文字间距，保持整体平衡 */
  }
  /* 保持呼吸动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
  
  /* 激活状态进一步强化 */
  .nav-item.active:nth-child(3) i {
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74, 222, 128, 0.6); /* 增强发光效果 */
  }

  
  /* 适配安全区域 */
  @media (max-width: 767px) {
    .bottom-nav {
      padding-bottom: calc(8px + env(safe-area-inset-bottom));
      padding-top: 10px;
    }
    
    body {
      padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
  }
  
  /* 可选：添加图标背景光晕效果 */
  .nav-item.active i::before {
    text-shadow: 0 0 8px rgba(22, 119, 255, 0.3);
  }
/* 城市选择器弹窗 */
.city-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.city-modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.city-selectors {
    display: flex;
    gap: 10px;
}

.city-select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.modal-footer {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cancel-btn, .confirm-btn {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.confirm-btn {
    background-color: #007aff;
    color: white;
    border: none;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}


 /* 律师详情页特有样式 */
        .lawyer-detail-header {
            background-color: #ebf3fe;
            padding: 20px 15px;
            display: flex;
            align-items: flex-start;
            gap: 15px;
            /* 关键：防止父元素跟随滚动 */
            overflow: hidden;
        }
        
        .lawyer-detail-avatar {
            width: 90px;
            height: 90px;
            border-radius: 10%;
            overflow: hidden;
            border: 3px solid #e6b04e;
            flex-shrink: 0;
        }
        
        .lawyer-detail-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .lawyer-detail-info {
            flex: 1;
            /* 防止内容撑开父元素 */
            min-width: 0;
        }
        
        .lawyer-detail-name {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .verify-badge {
            color: #007aff;
            font-size: 14px;
        }
        
        .lawyer-detail-firm {
            color: #666;
            margin-bottom: 8px;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        /* 优化的标签样式 - 核心改进部分 */
        .detail-tags-container {
            margin-bottom: 10px;
            overflow: hidden;
            /* 增加触摸区域高度 */
            padding: 5px 0;
        }
        
        .detail-tags {
            display: flex;
            gap: 8px;
            padding-bottom: 5px;
            overflow-x: auto;
            scrollbar-width: none;
            -webkit-overflow-scrolling: touch;
            /* 增加滚动阻力，提升体验 */
            scroll-snap-type: x mandatory;
        }
        
        .detail-tags::-webkit-scrollbar {
            display: none;
        }
        
        .detail-tag {
            font-size: 13px;
            padding: 5px 12px;
            background-color: #e8f4fd;
            color: #007aff;
            border-radius: 15px;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.2s ease;
            /* 滚动吸附效果 */
            scroll-snap-align: start;
        }
        
        .detail-tag:active {
            background-color: #d0e8fc;
            transform: scale(0.95);
        }
        
        .lawyer-stats {
            display: flex;
            gap: 12px;
            margin-bottom: 12px;
            font-size: 13px;
            color: #666;
            flex-wrap: wrap;
        }
        
        .contact-btn {
            display: block;
            background-color: #007aff;
            color: white;
            border: none;
            border-radius: 20px;
            padding: 8px 20px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            width: calc(100% - 16px);
            margin: 10px auto;
            margin-top: 10px;
            transition: all 0.2s ease;
        }
        
        .contact-btn:active {
            transform: scale(0.98);
            background-color: #0066cc;
        }
        
        .detail-section {
            background-color: white;
            margin-bottom: 10px;
            padding: 15px;
        }
        
        .section-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #eee;
        }
        
        .lawyer-intro {
            line-height: 1.6;
            color: #333;
            font-size: 14px;
        }
        
        .case-item {
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }
        
        .case-item:last-child {
            border-bottom: none;
        }
        
        .case-title {
            font-weight: 500;
            margin-bottom: 5px;
            color: #333;
        }
        
        .case-info {
            font-size: 12px;
            color: #666;
            display: flex;
            justify-content: space-between;
        }
        
        /*.back-btn {*/
        /*    position: absolute;*/
        /*    left: 15px;*/
        /*    top: 50%;*/
        /*    transform: translateY(-50%);*/
        /*    color: #666;*/
        /*    font-size: 20px;*/
        /*}*/
        .back-btn {
            position: absolute;
            left: 15px;
            top: 15px;
            background: none;
            border: none;
            font-size: 20px;
            color: #333;
            cursor: pointer;
        }
        .header-title {
            text-align: center;
            flex: 1;
            font-size: 17px;
            font-weight: 500;
        }

        .tags-hint {
            font-size: 12px;
            color: #999;
            margin-top: 5px;
            margin-left: 2px;
        }
/* 律师详情页特有样式end */

/* 适配不同屏幕尺寸 */
@media screen and (max-width: 320px) {
    html {
        font-size: 55%;
    }
    
    .lawyer-item {
        padding: 10px;
    }
    
    .lawyer-avatar {
        width: 60px;
        height: 60px;
    }
}

@media screen and (min-width: 321px) and (max-width: 375px) {
    html {
        font-size: 60%;
    }
}

@media screen and (min-width: 376px) and (max-width: 414px) {
    html {
        font-size: 62.5%;
    }
}

@media screen and (min-width: 415px) {
    html {
        font-size: 65%;
    }
    
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
}
@media screen and (max-width: 480px) {
    .lawyer-item {
        min-width: calc(100% - 16px); /* 在小屏幕上自动适应宽度 */
    }
    html {
        font-size: 62.5%;
    }
}

/* 触摸反馈样式 */
.consult-btn, .footer-item, .search-icon, .city-selector, .carousel-btn, .banner-btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* 图片加载占位样式 */
.article-cover, .grid-image {
    background: #f1f1f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0 0h20v20H0V0zm10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm20 0a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM10 37a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm10-17h20v20H20V20zm10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14z' fill='%23ddd' fill-opacity='0.4'/%3E%3C/svg%3E") repeat;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI服务项特殊样式 */
.nav-item:nth-child(3) i {
    /* AI图标特殊效果 */
    position: relative;
    animation: pulse 2s infinite;
  }
  
  /* AI指示装饰 */
  .ai-indicator {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    top: 8px;
    right: 12px;
    box-shadow: 0 0 0 rgba(74, 222, 128, 0.4);
    animation: ai-ping 1.5s infinite;
  }
  
  /* 脉冲动画 */
  @keyframes ai-ping {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
  }
  
  /* 激活状态增强 */
  .nav-item.active:nth-child(3) i {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  }