.kb-article-page {
  padding-bottom: 2rem;

  .kb-article-wrap {
    max-width: 900px;
  }

  .kb-article-card {
    border-radius: 12px;
    border: none;
  }

  .kb-article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
  }

  .kb-article-header-content {
    flex: 1;
    min-width: 0;
  }

  .kb-article-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
  }

  .kb-article-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .kb-badge-group {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.12);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-weight: 500;
  }

  .kb-badge-internal {
    font-size: 0.75rem;
  }

  .kb-back-btn {
    border-radius: 8px;
  }

  .kb-article-content {
    min-height: 80px;
    line-height: 1.75;
    color: #4a5568;
    font-size: 1rem;

    img {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
    }

    h1,
    h2,
    h3 {
      color: #2d3748;
      margin-top: 1.25em;
      margin-bottom: 0.5em;
    }

    p {
      margin-bottom: 0.75em;
    }

    ul,
    ol {
      padding-left: 1.5em;
      margin-bottom: 0.75em;
    }

    a {
      color: #667eea;
    }

    blockquote {
      border-left: 4px solid #667eea;
      padding-left: 1rem;
      margin: 1rem 0;
      color: #718096;
    }
  }

  .kb-feedback-box {
    margin-top: 2rem;
    padding: 1.25rem;
    background: #f8f9fc;
    border-radius: 12px;
    border: 1px solid #eef1f6;
  }

  .kb-feedback-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
  }

  .kb-feedback-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .kb-feedback-btn {
    border-radius: 8px;
  }

  .kb-feedback-thanks {
    margin-left: 0.5rem;
    color: #48bb78;
    font-size: 0.9rem;
  }

  .kb-feedback-stats {
    margin-top: 0.75rem;
    font-size: 0.85rem;
  }
}

.kb-page {
  padding-bottom: 2rem;

  &.kb-article-form-page,
  &.kb-group-form-page {
    min-height: 400px;

    .kb-card .card-body {
      padding: 1.5rem;
    }
  }

  .kb-card {
    border-radius: 12px;
    border: none;
  }

  .kb-form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
  }

  .kb-form-title {
    margin: 0;
    font-weight: 600;
    color: #2d3748;
  }

  .kb-input {
    border-radius: 8px;
  }

  .kb-input-sort {
    max-width: 120px;
  }

  .kb-editor-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ced4da;

    .ql-toolbar {
      border-radius: 8px 8px 0 0;
      background: #f8f9fa;
    }

    .ql-container {
      border-radius: 0 0 8px 8px;
      min-height: 220px;
    }
  }

  .kb-checkbox label {
    font-weight: 500;
    color: #4a5568;
  }

  .kb-form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .kb-btn-primary {
    border-radius: 8px;
  }

  .kb-toolbar {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .kb-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  .kb-search-input {
    max-width: 260px;

    .input-group-text {
      border-radius: 8px 0 0 8px;
      background: #f8f9fa;
    }
  }

  &.kb-list-page .kb-search-input {
    max-width: 320px;
    flex: 1 1 200px;
  }

  &.kb-groups-page .kb-search-input {
    max-width: 280px;
  }

  .kb-group-select {
    max-width: 200px;
    border-radius: 8px;
  }

  &.kb-list-page .kb-group-select {
    max-width: 220px;
  }

  .kb-search-btn {
    border-radius: 8px;
  }

  .kb-actions {
    display: flex;
    gap: 0.5rem;
  }

  .kb-articles-list {
    border-top: 1px solid #eee;
  }

  .kb-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 1rem;

    &:last-child {
      border-bottom: none;
    }
  }

  .kb-article-item-body {
    flex: 1;
    min-width: 0;
  }

  .kb-article-title-text {
    font-weight: 600;
    color: #2d3748;
    display: block;
    margin-bottom: 0.25rem;
  }

  .kb-article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .kb-article-group {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
  }

  .kb-badge-internal {
    font-size: 0.7rem;
  }

  .kb-article-item-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .kb-empty {
    text-align: center;
    padding: 3rem 1.5rem;
  }

  .kb-empty-icon {
    font-size: 2.5rem;
    color: #dee2e6;
    margin-bottom: 1rem;
  }

  .kb-empty-title {
    font-weight: 600;
    margin-bottom: 1rem;
  }

  &.kb-list-page {
    .kb-hero {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 12px;
      padding: 1.75rem 1.5rem;
      color: #fff;
    }

    .kb-hero-inner {
      max-width: 600px;
    }

    .kb-hero-icon {
      width: 56px;
      height: 56px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 1rem;

      i {
        font-size: 1.75rem;
      }
    }

    .kb-hero-title {
      font-size: 1.5rem;
      font-weight: 700;
      margin: 0 0 0.25rem 0;
    }

    .kb-hero-subtitle {
      margin: 0;
      opacity: 0.9;
      font-size: 0.95rem;
    }

    .kb-article-title {
      font-weight: 600;
      color: #333;
      display: block;
      margin-bottom: 0.25rem;
      text-decoration: none;
      transition: color 0.2s;

      &:hover {
        color: #667eea;
      }
    }

    .kb-empty-icon {
      font-size: 3rem;
    }

    .kb-empty-title {
      margin-bottom: 0.25rem;
    }

    .kb-empty-text {
      font-size: 0.9rem;
      margin-bottom: 1rem;
    }

    .kb-pagination {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 1.5rem;
      padding-top: 1rem;
      border-top: 1px solid #eee;
    }
  }

  &.kb-groups-page {
    .kb-groups-list {
      border-top: 1px solid #eee;
    }

    .kb-group-item {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem 0;
      border-bottom: 1px solid #f0f0f0;

      &:last-child {
        border-bottom: none;
      }
    }

    .kb-group-order {
      width: 36px;
      text-align: center;
      color: #adb5bd;
      font-size: 0.85rem;
    }

    .kb-group-icon {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      background: rgba(102, 126, 234, 0.1);
      color: #667eea;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .kb-group-body {
      flex: 1;
      min-width: 0;
    }

    .kb-group-name {
      font-weight: 600;
      color: #2d3748;
      margin-bottom: 0.15rem;
    }

    .kb-group-desc {
      max-width: 400px;
      margin-bottom: 0.25rem;
    }

    .kb-group-slug {
      font-size: 0.75rem;
      color: #718096;
      background: #f1f3f5;
      padding: 0.15rem 0.4rem;
      border-radius: 4px;
    }

    .kb-group-count {
      text-align: center;
      min-width: 70px;

      .badge {
        font-size: 0.9rem;
      }
    }

    .kb-group-actions {
      display: flex;
      gap: 0.35rem;
      flex-shrink: 0;
    }
  }
}
