/* 头部标题 */
.custom-header {
  --background: linear-gradient(135deg, #3A5FE5 0%, #6A8EFF 100%);
  --border-width: 0;
  --box-shadow: 0 2px 10px rgba(58, 95, 229, 0.3);
  padding: 0 16px;
  
  .header-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 0 12px;
  }
  
  .search-button {
    --color: white;
    --background-hover: rgba(255, 255, 255, 0.1);
    --background-activated: rgba(255, 255, 255, 0.2);
    --border-radius: 50%;
    --padding-start: 8px;
    --padding-end: 8px;
    
    ion-icon {
      font-size: 1.4rem;
    }
  }
  
  /* 添加底部细线 */
  &:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
  }
}

/* 全局变量 */
:root {
  --primary: #3A5FE5;
  --secondary: #00C4A1;
  --danger: #FF4D4F;
  --light: #F5F7FA;
  --dark: #2D3748;
  --medium: #A0AEC0;
  --card-bg: #FFFFFF;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 搜索栏样式 */
.custom-searchbar {
  padding: 8px 0;
  --background: var(--light);
  --border-radius: 12px;
  --box-shadow: none;
}

/* 分类卡片样式 */
.category-list {
  background: transparent;
  
  ion-list-header {
    padding-left: 0;
    
    ion-label {
      font-size: 1.2rem;
      font-weight: 600;
      color: #2D3748;
    }
    
    ion-button {
      --color: #3A5FE5;
      font-size: 0.9rem;
    }
  }
}

.category-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow:  0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 0;
  overflow: visible;
  
  &:active {
    transform: translateY(2px);
  }
  
  .card-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin: 16px auto 8px;
    border-radius: 50%;
    background: rgba(var(--card-color-rgb), 0.1);
  }
  
  .category-icon {
    font-size: 2rem;
    color: var(--card-color);
  }
  
  ion-card-header {
    padding-bottom: 0;
    
    ion-card-title {
      font-size: 1rem;
      font-weight: 600;
      color: #2D3748;
      text-align: center;
    }
  }
  
  ion-card-content {
    flex-grow: 1;
    padding-top: 0;
    font-size: 0.85rem;
    color: var(--medium);
    text-align: center;
  }
}

/* 精选法律文书样式 */
.featured-list {
  background: transparent;
  
  ion-list-header {
    padding-left: 0;
    
    ion-label {
      font-size: 1.2rem;
      font-weight: 600;
      color: #2D3748;
    }
    
    ion-button {
      --color: #3A5FE5;
      font-size: 0.9rem;
    }
  }
}

.document-card {
  height: 100%;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow:  0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 0;
  
  ion-card-header {
    padding-bottom: 0;
    
    ion-card-title {
      font-size: 1rem;
      font-weight: 600;
      color: #000000;
    }
    
    ion-card-subtitle {
      padding-top: 8px;
      
      ion-badge {
        font-weight: 500;
        font-size: 0.7rem;
      }
    }
  }
  
  ion-card-content {
    padding-top: 0;
    font-size: 0.85rem;
    color: var(--medium);
    
    .meta-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 12px;
      font-size: 0.8rem;
      color: var(--medium);
      
      ion-button {
        --padding-start: 0;
        --padding-end: 0;
        --color: #3A5FE5;
        font-size: 0.8rem;
      }
    }
  }
}

/* 法律知识样式 */
.knowledge-list {
  background: transparent;
  
  ion-list-header {
    padding-left: 0;
    
    ion-label {
      font-size: 1.2rem;
      font-weight: 600;
      color: #2D3748;
    }
    
    ion-button {
      --color: #3A5FE5;
      font-size: 0.9rem;
    }
  }
}

.knowledge-item {
  --padding-start: 0;
  --inner-padding-end: 0;
  --border-radius: 12px;
  --background: #FFFFFF;
  margin-bottom: 12px;
  border-radius: 12px;
  box-shadow:  0 4px 12px rgba(0, 0, 0, 0.08);
  
  .knowledge-icon {
    color: var(--secondary);
    font-size: 1.5rem;
    margin-right: 12px;
  }
  
  ion-label {
    h3 {
      font-weight: 600;
      color: #2D3748;
      margin-bottom: 6px;
    }
    
    p {
      font-size: 0.9rem;
      color: var(--medium);
      margin-bottom: 8px;
    }
    
    .meta-info {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.8rem;
      color: var(--medium);
      
      ion-badge {
        font-weight: 500;
      }
    }
  }
}

/* FAB按钮样式 */
ion-fab-button {
  --box-shadow: 0 4px 12px rgba(58, 95, 229, 0.3);
}

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

.category-card, .document-card, .knowledge-item {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
  
  @for $i from 1 through 20 {
    &:nth-child(#{$i}) {
      animation-delay: $i * 0.1s;
    }
  }
}