/* ===== Knowledge Base 列表页 ===== */

.kb-page *,
.kb-page *::before,
.kb-page *::after {
  box-sizing: border-box;
}

.kb-page {
  padding-top: 120px;
  position: relative;
  background: #fff;
}

/* ===== 背景装饰 ===== */
.kb-bg-decoration {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-20px);
  width: 778px;
  height: 716px;
  pointer-events: none;
  z-index: 0;
}

.kb-bg-ellipse {
  position: absolute;
  border-radius: 50%;
}

/* 右上角小椭圆 */
.kb-bg-ellipse-1 {
  width: 357px;
  height: 357px;
  top: 0;
  left: 0;
  background: radial-gradient(
    367.31% 367.31% at 50% 50%,
    rgba(255, 0, 183, 0.2) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  filter: blur(205px);
}

/* 右上角大椭圆 */
.kb-bg-ellipse-2 {
  width: 557px;
  height: 557px;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    367.31% 367.31% at 50% 50%,
    rgba(0, 168, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  filter: blur(205px);
}

/* ===== Hero 区 ===== */
.kb-hero {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 星形装饰图标 - 绝对定位在标题右上方 */
.kb-hero-star {
  position: absolute;
  top: -50px;
  left: 50%;
  width: 31px;
  height: 30px;
  transform: translateX(420px);
}

.kb-hero-label {
  font-family: "Roboto", sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 27px;
  text-align: center;
  background: linear-gradient(176deg, #26b5ff 19.75%, #c04cff 99.25%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}

.kb-hero-title {
  font-family: "Roboto", sans-serif;
  font-size: 56px;
  font-weight: 400;
  color: #000;
  line-height: 67px;
  letter-spacing: -1.68px;
  margin: 0 0 24px;
  max-width: 960px;
}

.kb-hero-title-gradient {
  background: linear-gradient(176deg, #26b5ff 19.75%, #c04cff 99.25%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kb-hero-desc {
  font-family: "Roboto", sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #333;
  line-height: 27px;
  margin: 0 0 40px;
  max-width: 960px;
}

/* ===== 搜索栏 ===== */
.kb-search {
  display: flex;
  align-items: center;
  width: 800px;
  max-width: 100%;
  height: 70px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 35px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 17px 21px;
  gap: 12px;
}

.kb-search-icon {
  flex-shrink: 0;
}

.kb-search-input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  color: #333;
  background: transparent;
}

.kb-search-input::placeholder {
  color: #999;
}

.kb-search-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 20px;
  background: linear-gradient(135deg, #26b5ff, #00c6ff);
  color: #fff;
  border: none;
  border-radius: 18px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.kb-search-btn:hover {
  opacity: 0.85;
}

/* ===== 筛选区 ===== */
.kb-filter {
  position: relative;
  z-index: 1;
  margin-top: 110px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.kb-filter-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kb-filter-label {
  font-family: "Roboto", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #020826;
}

.kb-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-tag {
  height: 42px;
  padding: 11px 17px;
  border: 1px solid #e5e7eb;
  border-radius: 21px;
  background: transparent;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.kb-tag:hover {
  border-color: #26b5ff;
  color: #26b5ff;
}

.kb-tag.active {
  background: linear-gradient(135deg, #26b5ff, #00c6ff);
  border-color: transparent;
  color: #fff;
}

/* ===== 文章卡片网格 ===== */
.kb-list {
  position: relative;
  z-index: 1;
  padding: 68px 0 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.kb-card {
  display: flex;
  flex-direction: column;
  padding: 25px;
  background: #fff;
  border: none;
  border-radius: 24px;
  color: inherit;
  box-shadow: 0 0 40px 0 rgba(0, 97, 171, 0.08);
  transition: box-shadow 0.2s;
  white-space: normal;
}

.kb-card:hover {
  box-shadow: 0 0 40px 0 rgba(0, 97, 171, 0.14);
}

/* 卡片 - 分类标签 */
.kb-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-card-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  border-radius: 28px;
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  background: #e0f4ff;
  color: #020826;
  white-space: nowrap;
}

/* 卡片 - 标题 */
.kb-card-title {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 22px;
  margin: 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片 - 描述 */
.kb-card-desc {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
  line-height: 22.75px;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片 - 关联关键词 */
.kb-card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.kb-card-keywords span {
  display: inline-flex;
  height: 20px;
  padding: 0 8px;
  background: #f4f5fa;
  border-radius: 6px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

/* 卡片 - 底部 Read more */
.kb-card-footer {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.kb-card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #26b5ff;
  text-decoration: none;
  cursor: pointer;
}

.kb-card-readmore svg {
  width: 14px;
  height: 14px;
}

/* ===== 分页按钮 ===== */
.kb-pagination {
  padding-bottom: 30px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.kb-view-all {
  display: flex;
  width: 180px;
  padding: 14px 32px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 60px;
  background: #fff;
  box-shadow: 0 4px 24px 0 rgba(232, 236, 255, 0.80);
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}

.kb-view-all:hover {
  box-shadow: 0 6px 32px 0 rgba(232, 236, 255, 1);
}

/* ===== 响应式 ===== */

/* 平板横屏/小桌面 */
@media (max-width: 1320px) {
  .kb-hero-star {
    top: -50px;
    left: 50%;
    transform: translateX(320px);
  }

  .kb-hero-title {
    font-size: 48px;
    line-height: 58px;
  }

  .kb-search {
    width: 700px;
  }

  .kb-filter {
    margin-top: 80px;
  }
}

@media (max-width: 1200px) {
  .kb-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 平板竖屏 */
@media (max-width: 990px) {
  .kb-hero-star {
    top: -30px;
    right: 10%;
    left: auto;
    transform: none;
  }

  .kb-hero-title {
    font-size: 40px;
    line-height: 50px;
  }

  .kb-hero-label {
    font-size: 16px;
  }

  .kb-hero-desc {
    font-size: 18px;
  }

  .kb-search {
    width: 100%;
  }

  .kb-filter {
    margin-top: 60px;
    gap: 20px;
  }

  .kb-filter-label {
    font-size: 18px;
  }

  .kb-tag {
    height: 38px;
    padding: 10px 14px;
  }
}

/* 手机端 */
@media (max-width: 800px) {
  .blog-blog {
    padding: 0 10px;
    width: calc(100% - 20px);
    max-width: 353px;
    margin: 0 auto;
  }

  .kb-page {
    padding-top: 66px;
  }

  .kb-page .container {
    width: 100%;
  }

  .kb-hero {
    padding: 40px 0 30px;
  }

  .kb-hero-star {
    top: 20px;
    right: 20px;
    left: auto;
    transform: none;
    height: 20px;
  }

  .kb-hero-title {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -0.5px;
  }

  .kb-hero-title br {
    display: none;
  }

  .kb-hero-label {
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 16px;
  }

  .kb-hero-desc {
    font-size: 16px;
    line-height: 22px;
    margin-bottom: 24px;
  }

  .kb-hero-desc br {
    display: none;
  }

  .kb-search {
    height: 56px;
    border-radius: 28px;
    padding: 12px 16px;
  }

  .kb-search-btn {
    padding: 0 10px;
  }

  .kb-filter {
    margin-top: 40px;
    gap: 16px;
  }

  .kb-filter-group {
    gap: 12px;
  }

  .kb-filter-label {
    font-size: 16px;
  }

  .kb-tag {
    height: 36px;
    padding: 9px 14px;
    font-size: 13px;
  }

  .kb-list {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 0 32px;
  }

  .kb-card {
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 10px 6px rgba(232, 236, 255, 0.8);
  }

  .kb-pagination {
    padding: 16px 0 50px;
  }

  .kb-bg-decoration {
    display: none;
  }
}

/* ===== Knowledge Base All 页面 ===== */

.kb-page-all {
  padding-top: 100px;
}

.kb-all-header {
  margin-bottom: 30px;
}

.kb-all-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kb-all-title-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Roboto", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #1A1A2E;
}

.kb-all-title-icon img {
  width: 24px;
  height: 24px;
}

.kb-all-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  transition: border-color 0.2s;
}

.kb-all-filter-btn:hover,
.kb-all-filter-btn.active {
  border-color: #26B5FF;
}

.kb-all-filter-btn img {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.kb-all-filter-btn.active img {
  transform: rotate(180deg);
}

.kb-all-filter-panel {
  display: block;
  margin-top: 20px;
  padding: 24px;
  border-radius: 16px;
  background: #F9FAFB;
}

.kb-all-filter-panel .kb-search {
  margin-bottom: 20px;
}

.kb-all-filter-panel .kb-filter-group {
  margin-top: 16px;
}

/* All 页面中 kb-list 不需要额外顶部间距 */
.kb-page-all .kb-list {
  padding-top: 0;
}

/* 非移动端隐藏 Filter 按钮 */
.kb-all-filter-btn {
  display: none;
}

@media (max-width: 800px) {
  .kb-page-all {
    padding-top: 80px;
  }

  .kb-all-title-icon {
    font-size: 18px;
  }

  .kb-all-filter-btn {
    display: flex;
  }

  .kb-all-filter-panel {
    display: none;
    padding: 16px;
  }

  .kb-all-filter-panel.active {
    display: block;
  }
}

/* ===== 骨架屏 ===== */

@keyframes kb-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.kb-tag-skeleton {
  display: inline-block;
  width: 80px;
  height: 36px;
  background: #f0f0f0;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.kb-tag-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: kb-shimmer 1.5s infinite;
}

.kb-card-skeleton {
  height: 310px;
  background: #f0f0f0;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.kb-empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

.kb-card-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: kb-shimmer 1.5s infinite;
}
