/* 员工端知识库 — 飞书/钉钉文档风 */
#view-kb:not(.hidden) {
  max-width: var(--app-shell-max, 520px);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f5f6f8;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

#view-kb .site-icp--page {
  padding: 12px;
}

.kb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.kb-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: #e60012;
  font-size: 15px;
  padding: 6px 4px;
  cursor: pointer;
  min-width: 64px;
  flex-shrink: 0;
}

.kb-header-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}

.kb-header-spacer {
  width: 64px;
  flex-shrink: 0;
}

.kb-hero {
  margin: 12px 12px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff7ed 0%, #fff 55%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
}

.kb-hero-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.kb-main {
  margin: 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.kb-toolbar {
  margin-bottom: 10px;
}

.kb-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.kb-search-wrap::before {
  content: '⌕';
  color: #94a3b8;
  font-size: 16px;
  flex-shrink: 0;
}

.kb-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  min-width: 0;
}

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

.kb-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kb-cat {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #475569;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.kb-cat.active {
  background: #e60012;
  border-color: #e60012;
  color: #fff;
}

.kb-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.kb-count {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}

.kb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s, transform 0.1s;
}

.kb-card:active {
  transform: scale(0.99);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.kb-card-ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: #eff6ff;
}

.kb-card-ico--process {
  background: #ecfdf5;
}

.kb-card-ico--guide {
  background: #fff7ed;
}

.kb-card-ico--policy {
  background: #fef2f2;
}

.kb-card-body {
  flex: 1;
  min-width: 0;
}

.kb-card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 4px;
}

.kb-card-excerpt {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.kb-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}

.kb-card-arrow {
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
}

.kb-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: 14px;
  background: #fff;
  border-radius: 12px;
}

.kb-empty-ico {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 详情 */
.kb-detail {
  margin: 0 12px 12px;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.kb-detail-top {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.kb-detail-back {
  border: none;
  background: transparent;
  color: #e60012;
  font-size: 14px;
  padding: 6px 8px 6px 0;
  cursor: pointer;
}

.kb-detail-inner {
  padding: 16px 16px 24px;
}

.kb-detail-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.kb-detail-meta {
  margin: 0 0 16px;
  font-size: 12px;
  color: #94a3b8;
}

.kb-detail-body {
  font-size: 15px;
  line-height: 1.75;
  color: #334155;
  word-break: break-word;
}

.kb-detail-body p {
  margin: 0 0 12px;
}

.kb-loading {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}
