/* =========================================================
   小红书笔记预览组件 —— editor / viewer 共用
   还原小红书笔记详情页结构：
   顶部作者栏 → 图片轮播(含右侧互动栏) → 标题正文话题 → 评论区 → 底部互动条
   ========================================================= */

.note {
  --red: #ff2442;
  --ink: #17181a;
  --ink-2: #6d6d75;
  --ink-3: #9c9ca4;
  --line: #f0f0f3;
  --chip: #f5f5f8;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  overflow: hidden;
}

/* ---------- 顶部作者栏 ---------- */
.note--nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #fff;
  z-index: 3;
}
.note--nav .back {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  flex: none;
}
.note--nav .who {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.note-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--chip);
  object-fit: cover;
  flex: none;
  display: block;
}
.note-avatar--lg { width: 36px; height: 36px; }
.note--nav .nick {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-follow {
  flex: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 12px;
  line-height: 1;
  padding: 5px 13px;
  border-radius: 999px;
  font-weight: 500;
}
.note-follow.is-on {
  border-color: #e6e6ea;
  color: var(--ink-3);
}
.note--nav .share {
  flex: none;
  color: var(--ink);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 滚动区 ---------- */
.note--scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.note--scroll::-webkit-scrollbar { display: none; }

/* ---------- 图片 / 视频区 ---------- */
.note-media {
  position: relative;
  background: #f2f2f5;
}
.note-media--track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  aspect-ratio: 3 / 4;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.note-media--track::-webkit-scrollbar { display: none; }
.note-media--track > .slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  background: #f2f2f5;
}
.note-media--track img,
.note-media--track video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 页码 */
.note-counter {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

/* 图片右下角竖排互动栏 */
.note-media--actions {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-items: center;
}
.note-media--actions .act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-variant-numeric: tabular-nums;
}
.note-media--actions .act svg {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
  width: 26px;
  height: 26px;
}

/* ---------- 正文区 ---------- */
.note-body {
  padding: 13px 14px 4px;
}
.note-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.42;
  margin: 0 0 8px;
  word-break: break-word;
}
.note-title:empty { display: none; }

.note-text {
  font-size: 15px;
  line-height: 1.66;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.note-text .hash {
  color: #13386c;
  font-weight: 500;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
}
.note-tags .tag {
  color: #13386c;
  font-size: 14px;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
}
.note-meta .dot {
  width: 1px; height: 10px;
  background: #dcdce0;
}

/* ---------- 评论区 ---------- */
.note-comments {
  padding: 14px 14px 20px;
  border-top: 8px solid #f7f7f9;
}
.note-comments .sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.cmt {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.cmt .cmt-body { flex: 1; min-width: 0; }
.cmt .cmt-name {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 3px;
}
.cmt .cmt-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.cmt .cmt-foot {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 5px;
  display: flex;
  gap: 14px;
}

/* ---------- 底部固定互动条 ---------- */
.note--foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.note--foot .say {
  flex: 1;
  height: 32px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.note--foot .fitem {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.note--foot .fitem svg { width: 22px; height: 22px; }
.note--foot .fitem.is-liked { color: var(--red); }

/* ---------- 空状态 ---------- */
.note--empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 13px;
  padding: 40px 24px;
  text-align: center;
}
.note--empty .ph {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: var(--chip);
  display: flex; align-items: center; justify-content: center;
  color: #c9c9d1;
}
