/* ===== AI Awing 知识库样式 ===== */

/* 知识库头部 */
.kb-hero { padding: 70px 0 46px; text-align: center; position: relative; overflow: hidden; }
.kb-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 50% 0%, rgba(99, 102, 241, .22), transparent 65%);
  pointer-events: none;
}
.kb-hero-inner { position: relative; }
.kb-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 14px; }
.kb-hero p { color: var(--text-dim); font-size: 16px; max-width: 620px; margin: 0 auto 30px; }
.kb-search {
  max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 22px; color: var(--text-dim); transition: border-color .2s;
}
.kb-search:focus-within { border-color: rgba(99, 102, 241, .6); }
.kb-search input {
  flex: 1; background: none; border: 0; outline: none; color: var(--text);
  font-size: 15px; font-family: inherit;
}
.kb-search input::placeholder { color: rgba(148, 163, 184, .6); }
.kb-stats { margin-top: 20px; font-size: 13px; color: var(--text-dim); }

/* 主体布局 */
.kb-main { display: grid; grid-template-columns: 240px 1fr; gap: 34px; padding: 20px 24px 80px; max-width: 1160px; margin: 0 auto; }

/* 侧边分类 */
.kb-side-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 14px; }
.kb-cats { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
.kb-cat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; border-radius: 10px; font-size: 14px; color: var(--text-dim);
  cursor: pointer; border: 1px solid transparent; transition: all .15s; background: none; text-align: left;
  font-family: inherit;
}
.kb-cat:hover { color: var(--text); background: rgba(148, 163, 184, .08); }
.kb-cat.active { color: var(--text); background: rgba(99, 102, 241, .14); border-color: rgba(99, 102, 241, .3); font-weight: 600; }
.kb-cat em { font-style: normal; font-size: 12px; color: rgba(148, 163, 184, .6); }
.kb-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px 12px; }
.kb-sub {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-dim); background: none; font-family: inherit;
  transition: all .15s;
}
.kb-sub:hover { color: var(--text); border-color: rgba(148, 163, 184, .4); }
.kb-sub.active { color: var(--text); background: rgba(99, 102, 241, .14); border-color: rgba(99, 102, 241, .4); }

/* 列表 */
.kb-list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.kb-list-head span:first-child { font-size: 18px; font-weight: 700; }
.kb-count { font-size: 13px; color: var(--text-dim); }
.kb-list { display: flex; flex-direction: column; gap: 14px; }
.kb-item {
  display: block; padding: 20px 22px; border-radius: 14px; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); cursor: pointer;
  transition: transform .18s, border-color .18s; text-align: left; width: 100%;
  font-family: inherit; color: inherit;
}
.kb-item:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, .45); }
.kb-item-title { font-size: 16px; font-weight: 700; margin-bottom: 7px; color: var(--text); }
.kb-item-summary {
  font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.kb-tag {
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  background: rgba(99, 102, 241, .12); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, .25);
}
.kb-tag.sub { background: rgba(148, 163, 184, .1); color: var(--text-dim); border-color: var(--border); }
.kb-tag.size { background: none; color: rgba(148, 163, 184, .6); border: 0; padding: 0; font-size: 12px; }
.kb-empty { text-align: center; padding: 60px 0; color: var(--text-dim); }

/* 详情 */
.kb-detail-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; }
.kb-detail-nav.bottom { margin-top: 26px; }
.kb-back, .kb-detail-pager button {
  background: var(--card); border: 1px solid var(--border); color: var(--text-dim);
  padding: 8px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.kb-back:hover, .kb-detail-pager button:hover { color: var(--text); border-color: rgba(148, 163, 184, .4); }
.kb-detail-pager { display: flex; gap: 8px; }
.kb-article {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 46px; line-height: 1.8; color: var(--text); overflow-wrap: break-word;
}
.kb-article h1 { font-size: 28px; margin: 0 0 20px; line-height: 1.4; }
.kb-article h2 { font-size: 21px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.kb-article h3 { font-size: 17px; margin: 26px 0 10px; }
.kb-article h4 { font-size: 15px; margin: 20px 0 8px; }
.kb-article p { margin: 12px 0; font-size: 15px; }
.kb-article ul, .kb-article ol { margin: 12px 0; padding-left: 24px; font-size: 15px; }
.kb-article li { margin: 6px 0; }
.kb-article blockquote {
  border-left: 3px solid var(--primary); background: rgba(99, 102, 241, .07);
  padding: 12px 18px; margin: 16px 0; border-radius: 0 10px 10px 0; color: var(--text-dim);
}
.kb-article code {
  background: rgba(148, 163, 184, .14); padding: 2px 7px; border-radius: 6px;
  font-size: 13.5px; font-family: "SF Mono", Consolas, monospace;
}
.kb-article pre {
  background: #0a0f1e; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin: 16px 0;
}
.kb-article pre code { background: none; padding: 0; font-size: 13px; line-height: 1.7; }
.kb-article table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.kb-article th, .kb-article td { border: 1px solid var(--border); padding: 9px 14px; text-align: left; }
.kb-article th { background: rgba(99, 102, 241, .1); font-weight: 600; }
.kb-article tr:nth-child(even) td { background: rgba(148, 163, 184, .04); }
.kb-article img { max-width: 100%; border-radius: 10px; }
.kb-article hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
.kb-article a { color: #a5b4fc; }
.kb-article strong { color: #fff; }

/* 响应式 */
@media (max-width: 860px) {
  .kb-main { grid-template-columns: 1fr; padding: 16px 16px 60px; }
  .kb-cats { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .kb-cat { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); }
  .kb-article { padding: 26px 22px; }
  .kb-detail-nav { flex-wrap: wrap; }
}
