:host {
  --knowledge-card-width: calc(100% - 20px);
}

/* 大字体模式 */
ion-content.large-font {
  font-size: 1.2rem;

  ion-card-title {
    font-size: 1.4rem;
  }
}

/* 搜索工具栏 */
.search-toolbar {
  --background: var(--ion-color-light);
  padding: 0 10px;

  ion-searchbar {
    padding: 0;
    --background: var(--ion-color-light-shade);
    --border-radius: 20px;
  }
}

/* 分类导航 */
.category-container {
  display: flex;
  padding: 10px;
  background: var(--ion-color-light);
  overflow-x: auto;

  ion-segment {
    flex: 1;
    min-width: max-content;

    ion-segment-button {
      --padding-top: 8px;
      --padding-bottom: 8px;
      min-width: 80px;

      ion-icon {
        font-size: 1.8rem;
        margin-bottom: 5px;
      }
    }
  }
}

/* 专家卡片头部 */
.expert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  
  .expert-card-actions {
    display: flex;
    gap: 8px;
    
    ion-button {
      --padding-start: 12px;
      --padding-end: 12px;
      height: 32px;
      font-size: 0.8rem;
      
      ion-icon {
        font-size: 1rem;
        margin-right: 4px;
      }
    }
  }
}

/* 历史咨询记录 */
ion-list {
  margin-bottom: 20px;
  
  ion-item {
    --padding-start: 10px;
    --inner-padding-end: 10px;
    
    ion-label {
      margin: 10px 0;
      
      h2 {
        font-weight: 600;
      }
      
      p {
        color: var(--ion-color-medium);
        font-size: 0.8em;
      }
    }
  }
}

/* 专家卡片 */
.expert-card {
  margin: 10px;

  .expert-list {
    .expert-item {
      display: flex;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--ion-color-light-shade);

      ion-avatar {
        width: 50px;
        height: 50px;
        margin-right: 12px;
      }

      .expert-info {
        flex: 1;
        
        h3 {
          margin: 0 0 4px;
          font-weight: 500;
        }
        
        p {
          margin: 0;
          font-size: 0.8rem;
          color: var(--ion-color-medium);
        }
      }
      
      &:last-child {
        border-bottom: none;
      }
    }
  }
}

/* 知识网格布局 */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--knowledge-card-width), 1fr));
  gap: 15px;
  padding: 10px;

  @media (min-width: 576px) {
    --knowledge-card-width: calc(50% - 15px);
  }

  @media (min-width: 992px) {
    --knowledge-card-width: calc(33.33% - 15px);
  }
}

/* 知识卡片 */
ion-card {
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;

  &:active {
    transform: scale(0.98);
  }

  &.emergency {
    border-left: 4px solid var(--ion-color-danger);
  }

  ion-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
  }

  ion-img {
    height: 120px;
    object-fit: cover;
  }

  ion-card-header {
    padding: 16px 16px 0;
  }

  ion-card-content {
    padding: 0 16px 16px;
    font-size: 0.9rem;
    color: var(--ion-color-medium-shade);
  }

  ion-footer {
    padding: 0 16px 16px;
  }
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  text-align: center;
  padding: 20px;
  color: var(--ion-color-medium);

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

  h3 {
    margin: 0 0 10px;
    font-weight: bold;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

ion-card {
  animation: fadeIn 0.5s ease forwards;
  @for $i from 1 through 10 {
    &:nth-child(#{$i}) {
      animation-delay: $i * 0.1s;
    }
  }
}