/* 3.1: reviewed teacher practice library and Obsidian archive */
.knowledge-hero-panel {
  border-top: 3px solid #327f76;
}

.knowledge-head {
  align-items: flex-start;
}

.knowledge-workspace,
.knowledge-insight-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.knowledge-workspace {
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
}

.knowledge-insight-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.knowledge-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.6fr) minmax(130px, 0.54fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.knowledge-entry-list {
  display: grid;
  gap: 9px;
  min-height: 380px;
  max-height: 738px;
  overflow: auto;
  padding: 0 14px 14px;
}

.knowledge-entry-card {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  background: #fbfcfc;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  cursor: pointer;
}

.knowledge-entry-card:hover,
.knowledge-entry-card.selected {
  border-color: #77b7aa;
  background: #f2faf7;
}

.knowledge-entry-card.selected {
  box-shadow: inset 3px 0 0 #2c8377;
}

.knowledge-entry-top,
.knowledge-entry-meta,
.knowledge-entry-tags,
.knowledge-form-actions,
.knowledge-obsidian-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.knowledge-entry-top {
  justify-content: space-between;
}

.knowledge-entry-title {
  min-width: 0;
  overflow: hidden;
  color: #20303a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-entry-summary {
  display: -webkit-box;
  overflow: hidden;
  color: #5a6b74;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-entry-meta {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-tag,
.knowledge-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.knowledge-tag {
  color: #4a6b68;
  background: #eaf5f2;
}

.knowledge-status.pending {
  color: #8c6518;
  background: #fff3d5;
}

.knowledge-status.published {
  color: #1d6d61;
  background: #ddf2eb;
}

.knowledge-status.revision {
  color: #9b493f;
  background: #fff0ed;
}

.knowledge-status.archived {
  color: #5a6872;
  background: #edf1f3;
}

.knowledge-editor-panel {
  min-width: 0;
}

.knowledge-entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 0 14px 14px;
}

.knowledge-entry-form .full-row,
.knowledge-obsidian-form .full-row {
  grid-column: 1 / -1;
}

.knowledge-entry-form textarea {
  min-height: 74px;
  resize: vertical;
}

.knowledge-entry-form #knowledgeMethod,
.knowledge-entry-form #knowledgeSteps {
  min-height: 108px;
}

.knowledge-form-actions {
  padding-top: 2px;
}

.knowledge-ranking-table td:nth-child(1),
.knowledge-ranking-table th:nth-child(1),
.knowledge-ranking-table td:nth-child(4),
.knowledge-ranking-table th:nth-child(4),
.knowledge-ranking-table td:nth-child(5),
.knowledge-ranking-table th:nth-child(5) {
  text-align: center;
}

.knowledge-ranking-name strong,
.knowledge-ranking-name small {
  display: block;
}

.knowledge-ranking-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.knowledge-obsidian-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

.knowledge-obsidian-actions {
  align-items: end;
}

.knowledge-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #cbd7dc;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1160px) {
  .knowledge-workspace,
  .knowledge-insight-grid { grid-template-columns: 1fr; }
  .knowledge-entry-list { max-height: 440px; }
}

@media (max-width: 700px) {
  .knowledge-filter-row,
  .knowledge-entry-form { grid-template-columns: 1fr; }
  .knowledge-entry-form .full-row,
  .knowledge-obsidian-form .full-row { grid-column: auto; }
  .knowledge-head .primary-btn { width: 100%; }
  .knowledge-form-actions .primary-btn { flex: 1 1 100%; }
}

@media print {
  #knowledgeModule .knowledge-form-actions,
  #knowledgeModule .knowledge-obsidian-actions,
  #knowledgeModule .knowledge-filter-row,
  #knowledgeModule #knowledgeNew { display: none !important; }
}

/* 经验共创库附件 */
.knowledge-attachment-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.knowledge-attachment-hint { font-size: 12px; color: var(--muted); }
.knowledge-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.knowledge-attachment-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #e0e8e4; border-radius: 8px; background: #f7faf9; max-width: 100%; }
.knowledge-attachment-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; cursor: zoom-in; transition: transform .12s; }
.knowledge-attachment-file { font-size: 12px; color: var(--muted); }
.knowledge-attachment-name { font-size: 12px; color: var(--text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-attachment-remove { border: 0; background: transparent; color: #b64035; cursor: pointer; font-size: 13px; padding: 2px 4px; }
.knowledge-attachment-empty { font-size: 12px; color: var(--muted); }
.knowledge-entry-attach { font-size: 12px; color: var(--muted); margin-top: 6px; }
.knowledge-attachment-item:hover .knowledge-attachment-thumb { transform: scale(1.05); }

#knowledge-attachment-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483400;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .86);
  cursor: zoom-out;
}
#knowledge-attachment-lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.knowledge-lightbox-close { position: absolute; top: 14px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; cursor: pointer; }
