<ion-header [translucent]="true">
  <ion-toolbar color="primary">
    <!-- 搜索和筛选区域 -->
    <ion-buttons slot="start">
      <ion-button>
        <ion-icon slot="icon-only" name="search-outline"></ion-icon>
      </ion-button>
    </ion-buttons>
    
    <ion-searchbar 
      placeholder="搜索健康资讯、互助话题等" 
      class="custom-searchbar"
      mode="ios"
      style="--background: #f5f5f5; --border-radius: 10px">
    </ion-searchbar>

    <ion-buttons slot="end">
      <ion-button>
        <ion-icon slot="icon-only" name="filter-outline"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
  
<!--对话智能体-->
  <ion-card class="doctor-card">
  <div class="card-content">
    <div class="doctor-avatar">
      <img src="/assets/images/doc.jpeg" alt="慢性病医师头像" class="avatar-image">
    </div>
    
    <div class="doctor-info">
      <h2 class="doctor-name">丁医生</h2>
      <p class="doctor-title">慢性病管理主任医师</p>
      <div class="doctor-specialty">
        <ion-badge color="primary">糖尿病</ion-badge>
        <ion-badge color="primary">高血压</ion-badge>
        <ion-badge color="primary">冠心病</ion-badge>
      </div>
      <p class="doctor-desc">10年慢性病管理经验。擅长个性化治疗方案制定和长期健康管理。</p>
    </div>
  </div>
  
  <ion-button (click)="openConsult()" expand="block" color="success" class="consult-btn">
    <ion-icon name="medical" slot="start"></ion-icon>
    立即咨询
  </ion-button>
  <ion-card-content>
  @if(consultList?.length){
    <ul>
      @for(consult of consultList;track consult){
        <li (click)="openConsult(consult.get('chatId'))">
          @if(consult.get("avatar")){
            <img [src]="consult.get('avatar')"alt="" srcset="">
          }
          <span>{{consult.get("name")||'无名氏'}}</span>
          {{consult.updatedAt}}
        </li>
      }
    </ul>
  }
  </ion-card-content>
<ion-button (click)="loadConsult()">历史咨询记录</ion-button>
</ion-card>