@charset "UTF-8";
/* ==========================================================================
   知识库页面样式（复用 style.css 设计令牌）
   ========================================================================== */

/* ---------- 检索头部 ---------- */
.kb-hero {
  position: relative;
  padding-block: 64px 56px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(120% 150% at 80% 0%, var(--navy) 0%, var(--ink) 65%);
}
.kb-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;            /* 点阵网格置于分子画布之下 */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(255,255,255,.14)'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.kb-hero__inner { position: relative; z-index: 2; }   /* 文字内容置于分子画布之上 */
.kb-hero__title {
  font-size: clamp(28px, 4vw, 42px);
  color: #fff;
  margin-bottom: 14px;
}
.kb-hero__desc {
  max-width: 680px;
  font-size: 16.5px;
  color: rgba(255, 255, 255, .72);
  margin-bottom: 30px;
}

/* 动态效果：与内页 .page-banner 横幅保持视觉一致（分子背景 / 聚光 / 入场 / 视差，均零服务端开销） */
.kb-hero:hover .page-banner__glow { opacity: 1; }
.kb-hero__inner > * { animation: bannerIn .85s var(--ease) both; }
.kb-hero__inner > *:nth-child(1) { animation-delay: .05s; }
.kb-hero__inner > *:nth-child(2) { animation-delay: .12s; }
.kb-hero__inner > *:nth-child(3) { animation-delay: .2s; }
.kb-hero__inner > *:nth-child(4) { animation-delay: .28s; }
.kb-hero__inner > *:nth-child(5) { animation-delay: .34s; }
.kb-hero__inner > *:nth-child(6) { animation-delay: .4s; }

/* ---------- 搜索框 ---------- */
.kb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 660px;
  padding: 7px 7px 7px 20px;
  background: #fff;
  border-radius: var(--radius-pill);
  box-shadow: 0 16px 40px rgba(8, 23, 43, .28);
}
.kb-search__icon { color: var(--muted); flex: none; }
.kb-search__icon svg { width: 20px; height: 20px; }
.kb-search__input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.kb-search__input::placeholder { color: #9aa8bd; }
.kb-search__input::-webkit-search-cancel-button { cursor: pointer; }
.kb-search__btn { flex: none; padding: 13px 30px; }

/* ---------- 热门标签 ---------- */
.kb-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin-top: 22px;
}
.kb-tags__label {
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  margin-right: 2px;
}
.kb-tag {
  padding: 5px 14px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-pill);
  transition: all .25s var(--ease);
}
.kb-tag:hover {
  color: #fff;
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .4);
}

/* ---------- 分类导航 ---------- */
.kb-main { padding-top: 48px; }
.kb-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.kb-cat {
  padding: 9px 20px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.kb-cat:hover { color: var(--brand); border-color: var(--brand); }
.kb-cat.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.kb-cat span { opacity: .75; font-size: 13px; margin-left: 5px; }

/* ---------- 结果条 ---------- */
.kb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.kb-bar__info { font-size: 14.5px; color: var(--muted); }
.kb-bar__sort { display: flex; gap: 6px; }
.kb-sort {
  padding: 6px 14px;
  font-size: 13.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all .25s var(--ease);
}
.kb-sort:hover { color: var(--brand); border-color: var(--brand); }
.kb-sort.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }

/* ---------- 未登录提示 ---------- */
.kb-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 14.5px;
  color: #8a5a00;
  background: #fff8e6;
  border: 1px solid #ffe4a3;
  border-radius: var(--radius);
}
.kb-notice p { flex: 1; }
.kb-notice__icon { flex: none; color: #d99b00; }
.kb-notice__icon svg { width: 20px; height: 20px; }

/* ---------- 文章卡片 ---------- */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.kb-card {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform .32s var(--ease), box-shadow .32s var(--ease), border-color .32s var(--ease);
}
.kb-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.kb-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.kb-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.kb-badge--case     { color: #0b6bcb; background: #e3f0ff; }
.kb-badge--term     { color: #7a4bd0; background: #efe6ff; }
.kb-badge--purpose  { color: #00796f; background: #e2f7f5; }
.kb-badge--basic    { color: #8a5a00; background: #fff3d6; }
.kb-badge--analysis { color: #b03a6b; background: #ffe6f0; }

.kb-card__time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.kb-card__title {
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 10px;
  transition: color .25s var(--ease);
}
.kb-card:hover .kb-card__title { color: var(--brand); }
.kb-card__text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.kb-card__tag {
  padding: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
}
.kb-card__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.kb-card__foot span { display: inline-flex; align-items: center; gap: 5px; }
.kb-card__foot svg { width: 14px; height: 14px; }

/* 命中高亮 */
mark {
  padding: 0 2px;
  color: inherit;
  background: #ffe9a8;
  border-radius: 3px;
}

/* ---------- 文章正文 ---------- */
.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.art-summary {
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.art-content { font-size: 15.5px; line-height: 1.95; color: var(--text); }
.art-content h4 {
  margin: 26px 0 12px;
  font-size: 17px;
  color: var(--ink);
}
.art-content h4:first-child { margin-top: 0; }
.art-content p { margin-bottom: 14px; }
.art-content ul,
.art-content ol { margin: 0 0 16px; padding-left: 22px; }
.art-content ul li { list-style: disc; margin-bottom: 7px; }
.art-content ol li { list-style: decimal; margin-bottom: 7px; }
.art-content strong { font-weight: 600; color: var(--ink); }

.art-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.art-tags .kb-card__tag { font-size: 12.5px; padding: 4px 12px; }

.art-h4 {
  margin: 34px 0 16px;
  padding-top: 22px;
  font-size: 17px;
  border-top: 1px solid var(--line);
}
.art-related div {
  display: grid;
  gap: 10px;
}
.art-related__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.art-related__item:hover { background: var(--brand-soft); }
.art-related__item span { font-size: 14.5px; }

/* ---------- 评论 ---------- */
.cmt-form { margin-bottom: 24px; }
.cmt-form textarea {
  width: 100%;
  min-height: 92px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.cmt-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(26, 86, 219, .12);
}
.cmt-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}
.cmt-form__hint { font-size: 13px; color: var(--muted); }
.cmt-login {
  padding: 18px 20px;
  margin-bottom: 22px;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center;
  background: var(--bg-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.cmt-login a { color: var(--brand); font-weight: 600; }

.cmt-list { display: grid; gap: 16px; }
.cmt {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.cmt:last-child { border-bottom: none; padding-bottom: 0; }
.cmt__avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--brand) 0%, #3f7bff 100%);
  border-radius: 50%;
}
.cmt__avatar--admin { background: linear-gradient(140deg, #7a4bd0 0%, #a78bfa 100%); }
.cmt__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.cmt__name { font-size: 14.5px; font-weight: 600; }
.cmt__org { font-size: 12.5px; color: var(--muted); }
.cmt__time { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.cmt__content { font-size: 14.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cmt__del {
  margin-left: auto;
  padding: 0;
  font-size: 12.5px;
  color: var(--muted);
  background: none;
  border: 0;
}
.cmt__del:hover { color: #c22a2a; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .kb-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .kb-hero { padding-block: 48px 42px; }
  .kb-search { flex-wrap: wrap; padding: 12px; border-radius: var(--radius); }
  .kb-search__input { flex: 1 1 60%; }
  .kb-search__btn { flex: 1 1 100%; }
  .kb-grid { grid-template-columns: 1fr; }
  .kb-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
  .kb-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cmt__time { margin-left: 0; }
}

/* ---------- 文章专属页 article.html ---------- */
.art-hero {
  padding-block: 44px 38px;
  background: linear-gradient(180deg, #eef5ff 0%, #f7faff 100%);
  border-bottom: 1px solid var(--line);
}
.art-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--muted);
}
.art-crumbs svg { width: 14px; height: 14px; flex: none; }
.art-crumbs a { color: var(--muted); text-decoration: none; }
.art-crumbs a:hover { color: var(--brand); }
.art-crumbs__current {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.art-hero__title {
  margin: 12px 0 14px;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}
.art-hero .art-meta { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.art-page__empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
.art-page__empty h2 { margin-bottom: 10px; font-size: 20px; color: var(--ink); }
@media (max-width: 768px) {
  .art-crumbs__current { display: none; }
  .art-hero { padding-block: 32px 28px; }
}

/* 文章正文插图 */
.art-fig {
  margin: 22px auto;
  max-width: 720px;
  text-align: center;
}
.art-fig img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(20, 60, 110, 0.12);
  background: #fff;
  box-shadow: 0 4px 18px rgba(10, 40, 90, 0.08);
}
.art-fig figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ===================== 投稿入口 ===================== */
.kb-publish {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.kb-publish__hint {
  font-size: 13px;
  color: rgba(226, 238, 255, 0.74);
}
.kb-submit-tip {
  margin: 0 0 18px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #4a5b70;
  background: #f4f7fb;
  border: 1px solid rgba(20, 60, 110, 0.1);
  border-radius: 8px;
}
.kb-submit-tip strong { color: var(--brand, #1a56db); }

@media (max-width: 520px) {
  .kb-publish { gap: 8px; }
  .kb-publish__hint { font-size: 12px; }
}
