.knowledge-page {
  grid-template-columns: minmax(0, 1fr);
}

.knowledge-page > *,
.knowledge-card > .ant-card-body {
  min-width: 0;
}

.pk-shell {
  margin: 0 0 20px;
  border: 1px solid #dce4ef;
  border-radius: 18px;
  background:
    radial-gradient(circle at 96% 0%, rgba(76, 118, 175, 0.12), transparent 34%),
    linear-gradient(145deg, #fbfdff 0%, #f4f7fb 100%);
  box-shadow: 0 14px 36px rgba(37, 62, 99, 0.08);
  overflow: hidden;
  color: #17243a;
}

.pk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(190, 203, 221, 0.62);
}

.pk-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.pk-title-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: #1d456f;
  color: #fff;
  font-family: "方正小标宋简体", "Noto Serif CJK SC", serif;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.pk-title h2 {
  margin: 0 0 4px;
  font: 600 20px/1.35 "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0.01em;
}

.pk-title p {
  margin: 0;
  color: #68788e;
  font-size: 13px;
  line-height: 1.6;
}

.pk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pk-btn {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid #c9d5e4;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #263a55;
  font: 500 13px/1.4 "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.pk-btn:hover {
  border-color: #7f9cbe;
  background: #fff;
  transform: translateY(-1px);
}

.pk-btn[data-primary="true"] {
  border-color: #1d456f;
  background: #1d456f;
  color: #fff;
}

.pk-btn:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.pk-more {
  position: relative;
}

.pk-more > summary {
  display: flex;
  align-items: center;
  list-style: none;
}

.pk-more-actions {
  position: absolute;
  z-index: 2;
  top: calc(100% + 4px);
  right: 0;
  width: max-content;
  padding: 8px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 6px;
  background: var(--sg-surface);
}

.pk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(196, 208, 224, 0.6);
}

.pk-stat {
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.72);
}

.pk-stat span {
  display: block;
  margin-bottom: 6px;
  color: #718096;
  font-size: 12px;
}

.pk-stat strong {
  font: 600 22px/1.15 "Microsoft YaHei", sans-serif;
  color: #203c61;
}

.pk-stat small {
  margin-left: 4px;
  color: #738199;
  font-size: 12px;
}

.pk-rule {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid rgba(208, 218, 232, 0.7);
  border-bottom: 1px solid rgba(208, 218, 232, 0.7);
  background: rgba(244, 248, 253, 0.82);
  color: #52657d;
  font-size: 12px;
  line-height: 1.6;
}

.pk-rule b {
  flex: 0 0 auto;
  color: #263e5d;
}

.pk-body {
  padding: 16px 20px 20px;
}

.pk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.pk-toolbar h3 {
  margin: 0;
  font: 600 15px/1.4 "Microsoft YaHei", sans-serif;
}

.pk-search {
  width: min(340px, 100%);
  height: 34px;
  padding: 6px 12px;
  border: 1px solid #cdd8e6;
  border-radius: 9px;
  background: #fff;
  color: #24354b;
  outline: none;
}

.pk-search:focus {
  border-color: #6586ad;
  box-shadow: 0 0 0 3px rgba(77, 116, 165, 0.12);
}

.pk-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 3px;
}

.pk-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid #e0e7f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.pk-policy h4 {
  margin: 0 0 7px;
  color: #172b46;
  font: 600 14px/1.55 "Microsoft YaHei", sans-serif;
}

.pk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #6b7b90;
  font-size: 12px;
  line-height: 1.6;
}

.pk-meta b {
  color: #4e6078;
  font-weight: 500;
}

.pk-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f3ec;
  color: #2f6b46;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.pk-tag[data-upload="true"] {
  background: #edf1f8;
  color: #4e6382;
}

.pk-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.pk-link {
  padding: 0;
  border: 0;
  background: none;
  color: #315f92;
  font-size: 12px;
  cursor: pointer;
}

.pk-link.is-danger {
  color: #a64a4a;
}

.pk-empty {
  padding: 34px 20px;
  border: 1px dashed #cbd6e3;
  border-radius: 12px;
  color: #6e8095;
  text-align: center;
}

.pk-status {
  min-height: 20px;
  margin-top: 10px;
  color: #64758a;
  font-size: 12px;
}

.pk-status[data-error="true"] {
  color: #a33c3c;
}

.pk-modal-backdrop {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 31, 48, 0.52);
  backdrop-filter: blur(5px);
}

.pk-modal {
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 37, 60, 0.28);
}

.pk-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px 16px;
  border-bottom: 1px solid #e5ebf3;
}

.pk-modal header h3 {
  margin: 0 0 5px;
  font: 600 18px/1.4 "Microsoft YaHei", sans-serif;
}

.pk-modal header p {
  margin: 0;
  color: #708096;
  font-size: 12px;
}

.pk-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d8e0ea;
  border-radius: 9px;
  background: #f8fafc;
  color: #506177;
  font-size: 19px;
  cursor: pointer;
}

.pk-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  padding: 20px 24px;
}

.pk-field {
  display: grid;
  gap: 6px;
}

.pk-field.is-wide {
  grid-column: 1 / -1;
}

.pk-field label {
  color: #506077;
  font-size: 12px;
}

.pk-field input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #fff;
  color: #1e2d43;
  outline: none;
}

.pk-field input:focus {
  border-color: #6485ae;
  box-shadow: 0 0 0 3px rgba(72, 113, 162, 0.1);
}

.pk-modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 24px 20px;
  border-top: 1px solid #e5ebf3;
}

.pk-import-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #65768b;
  font-size: 12px;
}

.pk-import-status[data-error="true"] {
  color: #a33c3c;
}

.pk-md-preview {
  max-height: 68vh;
  margin: 0;
  padding: 20px 24px 26px;
  overflow: auto;
  background: #fbfcfe;
  color: #25354a;
  font: 12.5px/1.75 "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .pk-head {
    flex-direction: column;
  }

  .pk-actions {
    justify-content: flex-start;
  }

  .pk-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pk-form {
    grid-template-columns: 1fr;
  }

  .pk-field.is-wide {
    grid-column: auto;
  }

  .pk-policy {
    grid-template-columns: 1fr;
  }

  .pk-row-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }
}
