/* 笔记洞察共用样式（千瓜风格） */

.ni-card {
  background: #fff;
  border: 1px solid #eceef4;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ni-card + .ni-card,
.kmd-module-card.ni-card,
.ks-bcard-section.ni-card {
  margin-bottom: 12px;
}

.ni-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  padding-left: 10px;
  border-left: 3px solid #8b5cf6;
  line-height: 1.2;
}

.ni-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ni-head .ni-title {
  margin-bottom: 0;
}

.ni-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ni-dual-col {
  grid-template-columns: 1fr;
}

.ni-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.ni-empty {
  font-size: 12px;
  color: #94a3b8;
  padding: 24px 12px;
  text-align: center;
  background: #fafbfc;
  border-radius: 10px;
  border: 1px dashed #e2e8f0;
}

.ni-wc-canvas {
  position: relative;
  width: 100%;
  height: 240px;
  min-height: 240px;
  background: linear-gradient(180deg, #fcfcff 0%, #f8fafc 100%);
  border: 1px solid #eef1f6;
  border-radius: 10px;
  overflow: hidden;
}

.ni-wc-word {
  position: absolute;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}

.ni-wc-word.is-clickable {
  cursor: pointer;
}

.ni-wc-word.is-clickable:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.ni-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #fff;
}

.ni-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ni-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
}

.ni-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.ni-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.ni-td-rank { color: #94a3b8; width: 36px; }
.ni-td-word { font-weight: 500; color: #1e293b; }
.ni-td-num, .ni-td-pct { text-align: right; white-space: nowrap; }

.ni-bar-wrap { width: 100%; overflow-x: auto; }
.ni-bar-svg { width: 100%; min-width: 280px; height: auto; display: block; }
.ni-grid { stroke: #f1f5f9; stroke-width: 1; }
.ni-base { stroke: #e2e8f0; stroke-width: 1; }
.ni-axis { fill: #94a3b8; font-size: 10px; }
.ni-bar { opacity: 0.92; }
.ni-bar:hover { opacity: 1; }

.ni-donut {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 150px;
}

.ni-donut-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ni-donut-ring.is-empty { background: #eef2f7; }

.ni-donut-hole {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px #f1f5f9;
  text-align: center;
  padding: 4px;
}

.ni-donut-hole span {
  font-size: 18px;
  font-weight: 700;
  color: #7c3aed;
  line-height: 1.1;
}

.ni-donut-hole em {
  font-style: normal;
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ni-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ni-donut-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.ni-donut-leg i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ni-donut-leg strong {
  margin-left: auto;
  color: #1e293b;
  font-weight: 600;
}

.ni-donut-empty {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ni-sent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.ni-sent-tab {
  border: 1px solid #e8ecf3;
  background: #fff;
  color: #475569;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.ni-sent-tab.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.ni-sent-n { font-weight: 600; }
.ni-sub { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 8px; }

.ni-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
}

.ni-check input { accent-color: #7c3aed; }

@media (max-width: 960px) {
  .ni-dual, .ni-split { grid-template-columns: 1fr; }
}

.ks-bcard-section.ni-card {
  background: #fff;
  border: 1px solid #eceef4;
  border-radius: 12px;
  padding: 14px 16px;
}

.ks-bcard-section .ni-wc-canvas { min-height: 160px; }
.ks-bcard-section .ni-table-wrap { max-height: 180px; }
.ks-bcard-section .ni-donut-ring { width: 96px; height: 96px; }
.ks-bcard-section .ni-donut-hole { width: 54px; height: 54px; }
.ks-bcard-section .ni-donut-hole span { font-size: 14px; }

.kmd-module-card.ni-card,
.kmd-dual-grid .kmd-module-card {
  background: #fff;
  border: 1px solid #eceef4;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 16px 18px;
}
