/* ============================================================
   note-card.css —— 积木块：笔记卡片列表（核心块）
   只作用于 .note-head / .note-filter / .note-card / .note-list
   ============================================================ */

/* —— 板块标题（文字可被「页面设置」改掉） —— */
.note-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 2px 2px 14px;
}

.note-head__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--c-text);
}

.note-head__count {
  font-size: 12.5px;
  color: var(--c-text-3);
  font-variant-numeric: tabular-nums;
}

/* —— 当前筛选条：关键词与标签各自可清除，状态永远看得见 —— */
.note-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-card);
  box-shadow: var(--shadow-1);
  font-size: 12.5px;
}

.note-filter[hidden] {
  display: none;
}

.note-filter__lead {
  color: var(--c-text-3);
}

.note-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease);
}

.note-filter__chip:hover {
  background: rgba(20, 177, 239, 0.2);
}

.note-filter__chip svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  opacity: 0.75;
}

.note-filter__result {
  color: var(--c-text-3);
  font-variant-numeric: tabular-nums;
}

.note-filter__clear {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-surface-soft);
  color: var(--c-text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.note-filter__clear:hover {
  color: var(--c-text);
  border-color: var(--c-line-strong);
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* —— 卡片本体 —— */
.note-card {
  display: block;
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-card);
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.note-card:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--shadow-2);
}

/* 顶部一行：课程标签 + 章节 + 日期 */
.note-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
  min-width: 0;
}

.note-card__tag {
  flex: none;
  padding: 5px 13px;
  border-radius: var(--radius-s);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.6;
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
}

/* 标签配色由数据里的 color 键驱动，只改这里就能加新配色 */
.note-card--blue .note-card__tag {
  background: var(--tag-blue-bg);
  color: var(--tag-blue);
}
.note-card--green .note-card__tag {
  background: var(--tag-green-bg);
  color: var(--tag-green);
}
.note-card--purple .note-card__tag {
  background: var(--tag-purple-bg);
  color: var(--tag-purple);
}
.note-card--orange .note-card__tag {
  background: var(--tag-orange-bg);
  color: var(--tag-orange);
}
.note-card--pink .note-card__tag {
  background: var(--tag-pink-bg);
  color: var(--tag-pink);
}

/* 第二、第三个标签用中性色，避免一张卡片上颜色过杂 */
.note-card__tag--plain {
  background: var(--c-plain-tag-bg);
  color: var(--c-text-2);
}

.note-card__chapter {
  min-width: 0;
  font-size: 14.5px;
  color: var(--c-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左上角「编辑」入口：醒目的黄色（与侧栏「快捷发布」按钮同款），
   点它打开综合编辑弹层，不打开详情页 */
.note-card__edit {
  flex: none;
  height: 26px;
  padding: 0 12px;
  border: 1px solid #f2c53f;
  border-radius: var(--radius-pill);
  background: #f8d05a;
  color: #4a3a06;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 195, 63, 0.28);
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.note-card__edit:hover {
  background: #f6c93f;
  border-color: #eab92c;
  transform: translateY(-1px);
}

/* 日期：按要求放大到原来的 2 倍（12.5px → 25px），并加重、改为正文色 */
.note-card__date {
  flex: none;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.16;
  font-variant-numeric: tabular-nums;
}

.note-card__dateval {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--c-text-2);
}

/* 时间（可在编辑里自定义，留空则不显示） */
.note-card__time {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--c-text-3);
}

/* 标题 */
.note-card__title {
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--c-text);
  transition: color 0.18s var(--ease);
}

.note-card:hover .note-card__title {
  color: var(--c-accent-strong);
}

/* 封面：正文里第一张图，固定 16:9 裁切，不拉伸 */
.note-card__cover {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  background: var(--c-card-soft);
}

.note-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s var(--ease);
}

.note-card:hover .note-card__cover img {
  transform: scale(1.025);
}

/* 摘要：两行截断 */
.note-card__excerpt {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--c-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部一行：阅读全文（右对齐） */
.note-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--c-line);
  font-size: 12.5px;
  color: var(--c-text-3);
}

.note-card__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-text-3);
  transition: color 0.18s var(--ease);
}

.note-card__more svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform 0.18s var(--ease);
}

.note-card:hover .note-card__more {
  color: var(--c-accent-strong);
}

.note-card:hover .note-card__more svg {
  transform: translateX(3px);
}

/* —— 折叠条：超过 10 篇时先只显示最新的 10 篇 —— */
.note-card__expand {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 13px 16px;
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--radius-m);
  background: var(--c-card);
  color: var(--c-text-2);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.note-card__expand:hover {
  color: var(--c-accent-strong);
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
}

/* —— 空态 / 出错态（同属本块，样式也放这里） —— */
.note-empty {
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--c-line);
  border-radius: var(--radius-m);
  background: var(--c-card);
  color: var(--c-text-3);
  font-size: 13.5px;
}

@media (max-width: 600px) {
  .note-card {
    padding: 15px 16px 13px;
  }

  .note-card__title {
    font-size: 16px;
  }

  .note-card__chapter {
    display: none;
  }
}
