/* ============================================
   Coverflow - Stellar 标签插件样式
   适配暗色主题，自包含
   ============================================ */

.post-content .tag-plugin {
  margin: 1.2em 0;
}

/* ---------- note 提示块 ---------- */
.tag-plugin.colorful.note {
  padding: 14px 18px;
  border-radius: 10px;
  border-left: 4px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.tag-plugin.colorful.note .title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
}
.tag-plugin.colorful.note .body {
  color: var(--text-dim);
  font-size: 15px;
}
.tag-plugin.colorful.note .body > :last-child { margin-bottom: 0; }

.tag-plugin.colorful.note[color="primary"]   { border-left-color: #6aa9ff; }
.tag-plugin.colorful.note[color="primary"] .title { color: #6aa9ff; }
.tag-plugin.colorful.note[color="success"]  { border-left-color: #4ade80; }
.tag-plugin.colorful.note[color="success"] .title { color: #4ade80; }
.tag-plugin.colorful.note[color="warning"]   { border-left-color: #fbbf24; background: rgba(251,191,36,0.1); }
.tag-plugin.colorful.note[color="warning"] .title { color: #fbbf24; }
.tag-plugin.colorful.note[color="danger"]    { border-left-color: #f87171; }
.tag-plugin.colorful.note[color="danger"] .title { color: #f87171; }
.tag-plugin.colorful.note[color="cyan"]      { border-left-color: #22d3ee; background: rgba(34,211,238,0.1); }
.tag-plugin.colorful.note[color="cyan"] .title { color: #22d3ee; }
.tag-plugin.colorful.note .body p { margin: 0; }

/* ---------- checkbox / radio ---------- */
.tag-plugin.colorful.checkbox,
.tag-plugin.colorful.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  margin: 4px 0;
  background: none;
  border: none;
}
.tag-plugin.colorful.checkbox::before,
.tag-plugin.colorful.radio::before {
  content: "";
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 3px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}
.tag-plugin.colorful.radio::before { border-radius: 50%; }
.tag-plugin.colorful.checkbox[checked]::before,
.tag-plugin.colorful.radio[checked]::before {
  background: #4ade80;
  border-color: #4ade80;
  box-shadow: inset 0 0 0 3px rgba(15,22,32,0.9);
}

/* ---------- mark 标记 ---------- */
.post-content mark,
.tag-plugin.mark {
  background: rgba(250, 204, 21, 0.25);
  color: #fde68a;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- kbd 按键 ---------- */
.tag-plugin.kbd,
.post-content kbd {
  display: inline-block;
  padding: 2px 8px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--text);
}

/* ---------- button ---------- */
.tag-plugin.button {
  display: inline-block;
  padding: 9px 22px;
  margin: 6px 8px 6px 0;
  background: var(--accent);
  color: #fff !important;
  border-radius: 999px;
  font-size: 14px;
  transition: opacity 0.2s, transform 0.15s;
}
.tag-plugin.button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ---------- image ---------- */
.tag-plugin.image {
  margin: 1.4em 0;
  text-align: center;
}
.tag-plugin.image img {
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.tag-plugin.image .caption,
.tag-plugin.image figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- link 链接卡片 ---------- */
.tag-plugin.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin: 1.2em 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.tag-plugin.link:hover {
  border-color: var(--accent);
  background: rgba(255,255,255,0.09);
  text-decoration: none;
}
.tag-plugin.link .link-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}
.tag-plugin.link .link-title {
  font-weight: 600;
  color: var(--text);
}
.tag-plugin.link .link-desc {
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- tip 悬浮注解 ---------- */
.tag-plugin.tip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dashed var(--accent);
  cursor: help;
}
.tag-plugin.tip .tip-bubble {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,28,40,0.96);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
}
.tag-plugin.tip:hover .tip-bubble { opacity: 1; }

/* ---------- folding 折叠 ---------- */
.tag-plugin.folding,
.tag-plugin.box {
  margin: 1.2em 0;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}
.tag-plugin.folding summary,
.tag-plugin.box .title {
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.tag-plugin.folding .content,
.tag-plugin.box .body {
  padding: 14px 18px;
}

/* ---------- grid 网格 ---------- */
.tag-plugin.grid {
  display: grid;
  gap: 14px;
  margin: 1.2em 0;
}

/* ---------- tabs ---------- */
.tag-plugin.tabs {
  margin: 1.2em 0;
}
.tag-plugin.tabs .nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 12px;
}
.tag-plugin.tabs .nav button {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tag-plugin.tabs .nav button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- gallery 图片墙 ---------- */
.tag-plugin.gallery {
  margin: 1.6em 0;
}
.tag-plugin.gallery .grid-box,
.tag-plugin.gallery.grid-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.tag-plugin.gallery .grid-cell,
.tag-plugin.gallery.grid-box .grid-cell {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: rgba(255,255,255,0.05);
}
.tag-plugin.gallery .grid-cell img,
.tag-plugin.gallery.grid-box .grid-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.tag-plugin.gallery .grid-cell:hover img {
  transform: scale(1.05);
}
.tag-plugin.gallery .image-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 12px;
  color: #fff;
}

/* ---------- swiper 轮播 ---------- */
.tag-plugin.swiper {
  margin: 1.6em 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
}
.tag-plugin.swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
}
.tag-plugin.swiper .swiper-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.tag-plugin.swiper.swiper-cards .swiper-slide {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.tag-plugin.swiper .swiper-pagination-bullet {
  background: rgba(255,255,255,0.6);
}
.tag-plugin.swiper .swiper-pagination-bullet-active {
  background: #fff;
}
.tag-plugin.swiper .swiper-button-prev,
.tag-plugin.swiper .swiper-button-next {
  color: #fff;
  background: rgba(0,0,0,0.3);
  width: 36px; height: 36px;
  border-radius: 50%;
  backdrop-filter: blur(6px);
}
.tag-plugin.swiper .swiper-button-prev::after,
.tag-plugin.swiper .swiper-button-next::after {
  font-size: 16px;
}

/* ---------- inline-labels: u / emp / wavy / del ---------- */
.tag-plugin.u { text-decoration: underline; }
.tag-plugin.emp { font-style: italic; }
.tag-plugin.wavy { text-decoration: underline wavy var(--accent); }
.tag-plugin.del { text-decoration: line-through; opacity: 0.6; }
.tag-plugin.sup, .tag-plugin.sub {
  font-size: 0.75em;
  color: var(--accent);
}

/* ---------- image 图片标签 ---------- */
.tag-plugin.image {
  margin: 1.5em 0;
}
.tag-plugin.image .image-bg {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}
.tag-plugin.image .image-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tag-plugin.image .image-meta {
  margin-top: 0.6em;
  font-size: 0.88em;
  color: rgba(255,255,255,0.55);
}
.tag-plugin.image .image-meta .center { text-align: center; display: block; }

/* ---------- blockquote 引用块 ---------- */
.post-content .tag-plugin.blockquote {
  margin: 1.4em 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(255,255,255,0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
  font-style: italic;
}
.post-content .tag-plugin.blockquote p { margin: 0; }

/* ---------- 上下标 ---------- */
.post-content sub,
.post-content sup {
  font-size: 0.7em;
  color: var(--accent);
}
.post-content sub { vertical-align: sub; }
.post-content sup { vertical-align: super; }

/* ---------- audio 音频 ---------- */
.tag-plugin.audio {
  margin: 1.2em 0;
  border-radius: 12px;
  overflow: hidden;
}
.tag-plugin.audio iframe,
.tag-plugin.audio audio {
  width: 100%;
  border: none;
}

/* ---------- video 视频 ---------- */
.tag-plugin.video {
  margin: 1.2em 0;
  border-radius: 12px;
  overflow: hidden;
}
.tag-plugin.video iframe,
.tag-plugin.video video {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

/* ---------- frame 嵌入 ---------- */
.tag-plugin.frame {
  margin: 1.2em 0;
  border-radius: 12px;
  overflow: hidden;
}
.tag-plugin.frame iframe {
  width: 100%;
  border: none;
  display: block;
}

/* ---------- chat 对话 ---------- */
.tag-plugin.chat {
  margin: 1.2em 0;
}

/* ---------- copy 代码块 ---------- */
.tag-plugin.copy {
  margin: 1.2em 0;
}

/* ---------- icon 图标 ---------- */
.tag-plugin.icon {
  display: inline-block;
  vertical-align: middle;
}
.tag-plugin.icon svg,
.tag-plugin.icon img {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

/* ---------- note 提示（通用兜底） ---------- */
.tag-plugin.note {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid var(--accent);
}

/* ---------- toc 目录 ---------- */
.tag-plugin.toc {
  margin: 1.2em 0;
  padding: 16px 20px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}

/* ---------- timeline 时间线 ---------- */
.tag-plugin.timeline {
  margin: 1.2em 0;
}

/* ---------- poetry 诗歌 ---------- */
.tag-plugin.poetry {
  margin: 1.2em 0;
  text-align: center;
  line-height: 2;
  color: var(--text-dim);
}

/* ============ banner 标签 ============ */
.tag-plugin.banner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  height: 220px;
  margin: 1.5em 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  background-color: var(--card-bg);
  background-image: var(--bg-url);
  background-size: cover;
  background-position: center;
}
.tag-plugin.banner img {
  object-fit: cover;
  margin: 0;
  width: 100%;
}
.tag-plugin.banner img.bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100%;
  z-index: 0;
}
.tag-plugin.banner .content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tag-plugin.banner .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1;
  margin: 1rem;
}
.tag-plugin.banner .bottom {
  z-index: 1;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.tag-plugin.banner img.avatar {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.tag-plugin.banner .text-area .text { line-height: 1.2; margin: 0.25rem 0; }
.tag-plugin.banner .title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.tag-plugin.banner .subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.tag-plugin.banner .back {
  background: none;
  border: none;
  padding: 0;
  line-height: 0;
  visibility: hidden;
}
.tag-plugin.banner .back svg { width: 20px; height: 20px; fill: #fff; }
.tag-plugin.banner .banner-link {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 2;
}
.tag-plugin.banner .avatar + .text-area { margin-left: 0.75rem; }
.tag-plugin.banner .avatar + .text-area .title { font-size: 1.2rem; }
.tag-plugin.banner .avatar { border: 1px solid #fff; }

/* 无背景图时 */
.tag-plugin.banner.no-bg {
  background-image: none;
  border: 1px solid var(--card-border);
}
.tag-plugin.banner.no-bg .title {
  color: #fff;
  text-shadow: none;
}
.tag-plugin.banner.no-bg .subtitle {
  color: var(--text-dim);
}
.tag-plugin.banner.no-bg .avatar { border-color: var(--text-dim); }

@media screen and (max-width: 768px) {
  .tag-plugin.banner { height: 180px; }
  .tag-plugin.banner .back { visibility: visible; }
}
