/* 笔记详情弹窗 · 左栏 + 六 Tab */

body.ndm-open {
  overflow: hidden;
}

.ndm-modal[hidden] {
  display: none !important;
}

.ndm-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.ndm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.ndm-panel {
  position: relative;
  width: min(1260px, 100%);
  height: min(900px, 94vh);
  background: #f5f6fb;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ndm-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
}

.ndm-close:hover {
  color: #111827;
}

.ndm-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.ndm-loading-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.ndm-left {
  width: 292px;
  min-width: 292px;
  max-width: 292px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  background: #f3f4f6;
}

.ndm-note-card,
.ndm-kol-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #eceff5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ndm-cover-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7eb;
  aspect-ratio: 3 / 4;
  margin-bottom: 12px;
}

.ndm-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ndm-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  color: #9ca3af;
  font-size: 13px;
  background: #f3f4f6;
  border-radius: 8px;
}

.ndm-cover-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.ndm-note-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  color: #111827;
}

.ndm-note-meta {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.ndm-meta-k {
  color: #9ca3af;
  margin-right: 6px;
}

.ndm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ndm-note-content {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #4b5563;
  white-space: pre-wrap;
  word-break: break-word;
}

.ndm-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
}

.ndm-note-actions {
  display: flex;
  gap: 8px;
}

.ndm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.ndm-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.ndm-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ndm-btn-primary {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
}

.ndm-btn-primary:hover {
  background: #6d28d9;
  color: #fff;
}

.ndm-kol-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.ndm-kol-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.ndm-kol-avatar-ph {
  display: inline-block;
  background: #e5e7eb;
}

.ndm-kol-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.ndm-kol-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.ndm-kol-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
  margin-bottom: 10px;
}

.ndm-kol-stats strong {
  display: block;
  font-size: 20px;
  color: #111827;
}

.ndm-kol-stats span {
  font-size: 12px;
  color: #9ca3af;
}

.ndm-kol-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #7c3aed;
  text-decoration: none;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

.ndm-right {
  flex: 1;
  min-width: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #eceff5;
}

.ndm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid #eceff5;
  flex-shrink: 0;
  background: #fff;
}

.ndm-tab {
  border: none;
  background: transparent;
  padding: 16px 14px 14px;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.ndm-tab.is-active {
  color: #7c3aed;
  font-weight: 600;
  border-bottom-color: #7c3aed;
}

.ndm-right-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 24px;
  background: #fff;
}

.ndm-section {
  margin-bottom: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eceff5;
  padding: 14px 16px;
}

.ndm-section h4 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.ndm-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ndm-metric {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
}

.ndm-metric-val {
  font-size: 18px;
  font-weight: 700;
  color: #7c3aed;
}

.ndm-metric-label {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.ndm-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ndm-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
}

.ndm-pill-brand {
  background: #f5f3ff;
  color: #5b21b6;
}

.ndm-empty {
  padding: 28px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  background: #fafbff;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
}

.ndm-empty.is-error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.ndm-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

.ndm-sub-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

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

.ndm-cmt-toolbar .ndm-section-title {
  margin: 0;
}

.ndm-cmt-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ndm-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  min-width: 180px;
}

.ndm-input:focus {
  outline: none;
  border-color: #7c3aed;
}

.ndm-sent-filter {
  margin: 0 0 12px;
}

.ndm-sent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ndm-sent-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.ndm-sent-tab.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.ndm-cmt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  background: #fff;
}

.ndm-cmt-row {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.ndm-cmt-row:last-child {
  border-bottom: none;
}

.ndm-cmt-row-main {
  min-width: 0;
}

.ndm-cmt-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.ndm-cmt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ndm-cmt-avatar-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 600;
}

.ndm-cmt-meta {
  flex: 1;
  min-width: 0;
}

.ndm-cmt-user {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.ndm-cmt-time {
  font-size: 12px;
  color: #9ca3af;
}

.ndm-cmt-like {
  font-size: 12px;
  color: #6b7280;
  flex-shrink: 0;
}

.ndm-cmt-body {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 40px;
}

.ndm-cmt-foot {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.ndm-toolbar-hint {
  margin-top: 0;
}

.ndm-hot-table-wrap {
  overflow: auto;
  border: 1px solid #eef1f6;
  border-radius: 12px;
}

.ndm-hot-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.ndm-hot-table th,
.ndm-hot-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  font-size: 13px;
  color: #374151;
}

.ndm-hot-table th {
  background: #fafbff;
  color: #6b7280;
  font-weight: 600;
}

.ndm-hot-table tbody tr:last-child td {
  border-bottom: none;
}

.ndm-hotword-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: #7c3aed;
  font-size: 13px;
  cursor: pointer;
}

.ndm-hotword-btn:hover {
  text-decoration: underline;
}

.ndm-brand-card {
  border: 1px solid #e9e0ff;
  background: #faf5ff;
  border-radius: 8px;
  padding: 16px 18px;
}

.ndm-brand-name {
  font-size: 16px;
  font-weight: 600;
  color: #5b21b6;
}

.ndm-brand-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #7c3aed;
}

.ndm-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ndm-topic {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.ndm-full {
  display: grid;
  grid-template-columns: minmax(200px, 36%) 1fr;
  gap: 18px;
}

.ndm-full-cover {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  max-height: 420px;
  background: #f3f4f6;
}

.ndm-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ndm-thumb {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.ndm-thumb.is-active {
  border-color: #7c3aed;
}

.ndm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ndm-full-body h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.ndm-full-content {
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .ndm-panel {
    height: 94vh;
  }

  .ndm-layout {
    flex-direction: column;
  }

  .ndm-left {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 42%;
  }

  .ndm-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .ndm-full {
    grid-template-columns: 1fr;
  }
}

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

.ndm-similar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.ndm-similar-row:hover {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.ndm-similar-cover {
  width: 56px;
  height: 74px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.ndm-similar-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ndm-similar-cover.is-empty {
  background: #e5e7eb;
}

.ndm-similar-body {
  flex: 1;
  min-width: 0;
}

.ndm-similar-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ndm-similar-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}
