/* EasyShortCode 默认样式 - 主题可覆盖 */

.esc-btn {
  display: inline-block;
  padding: 0.4em 0.9em;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.2s;
}

.esc-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.esc-btn-primary {
  background: #0d6efd;
  color: #fff;
}

.esc-btn-success {
  background: #198754;
  color: #fff;
}

.esc-btn-warning {
  background: #ffc107;
  color: #212529;
}

.esc-btn-danger {
  background: #dc3545;
  color: #fff;
}

.esc-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.esc-alert,
.esc-tip {
  padding: 0.4rem 0.6rem;
  margin: 0.8em 0;
  border-radius: 6px;
  border: 1px solid transparent;
}

.esc-alert-info,
.esc-tip-info {
  background: #cff4fc;
  border-color: #9eeaf9;
  color: #055160;
}

.esc-alert-success,
.esc-tip-success {
  background: #d1e7dd;
  border-color: #a3cfbb;
  color: #0f5132;
}

.esc-alert-warning,
.esc-tip-warning {
  background: #fff3cd;
  border-color: #ffecb5;
  color: #664d03;
}

.esc-alert-error,
.esc-tip-error {
  background: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}

.esc-hide {
  margin: 0.8em 0;
}

.esc-hide-spoiler details {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.esc-hide-spoiler .esc-hide-summary {
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  background: #f8f9fa;
  list-style: none;
  user-select: none;
}

.esc-hide-spoiler .esc-hide-summary::-webkit-details-marker {
  display: none;
}

.esc-hide-spoiler .esc-hide-summary::before {
  content: "▶ ";
  font-size: 0.85em;
}

.esc-hide-spoiler details[open] .esc-hide-summary::before {
  content: "▼ ";
}

.esc-hide-spoiler .esc-hide-body {
  padding: 0.6rem 1.2rem;
  border-top: 1px solid #dee2e6;
}

.dark .esc-hide-spoiler details {
  border-color: #4b5563;
}

.dark .esc-hide-spoiler .esc-hide-summary {
  background: #1f2937;
  color: #e5e7eb;
}

.dark .esc-hide-spoiler .esc-hide-body {
  border-top-color: #4b5563;
}

.esc-hide-blur {
  cursor: pointer;
}

.esc-hide-blur-inner {
  filter: blur(6px);
  transition: filter 0.2s;
  user-select: none;
}

.esc-hide-blur:hover .esc-hide-blur-inner {
  filter: none;
}

/* 短代码-单图片 */
.post-content .imgdiv {
  position: relative;
  display: table;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0.25rem;
  text-align: center;
}

.post-content .imgdiv img {
  display: block;
  max-width: 100%;
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease-in-out, filter 0.8s ease-in-out;
}

.post-content .imgdiv:hover img {
  transform-origin: center center;
  transform: scale(1.08);
}

.imgtitle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  padding: 1.5rem 0.4rem 0.25rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.imgdiv:hover .imgtitle {
  opacity: 1;
}

.imgtitle>span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-height: 1.5rem;
}

/* 短代码-横向滚动相册 */
.album-hscroll {
  overflow: hidden;
  margin: 1rem 0;
}

.album-hscroll-row {
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.album-hscroll-row:last-child {
  margin-bottom: 0;
}

.album-hscroll-track {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
  width: max-content;
  will-change: transform;
}

.album-hscroll-item {
  flex-shrink: 0;
  height: 160px;
  border-radius: 0.375rem;
  overflow: hidden;
}

.album-hscroll-item img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

.album-hscroll-item .imgdiv {
  width: auto;
  height: 100%;
}

.album-hscroll-item .imgdiv img {
  height: 160px;
  width: auto;
}

/* hover 暂停 */
.album-hscroll-row.paused .album-hscroll-track {
  animation-play-state: paused !important;
}

@media (max-width: 768px) {
  .album-hscroll-item,
  .album-hscroll-item img,
  .album-hscroll-item .imgdiv img {
    height: 120px;
  }
}

/* 短代码-自适应相册 */
.album-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.25rem;
  margin: 1rem 0;
}

/* 短代码-网格相册 */
.album-grid {
  margin: 1rem 0;
  display: grid;
  gap: 0.15rem;
  border-radius: .25rem;
  overflow: hidden;
  /* grid-template-columns: repeat(3, minmax(0, 1fr)); */
  grid-auto-flow: dense;
  /* 固定隐式行高：使 grid-span 的 grid-row: span N 有确定高度基准，
     避免跨行高度由同行其他图片内容决定导致的异常拉伸/压缩 */
  grid-auto-rows: 160px;
}

.album-auto img,
.album-grid img {
  width: 100%;
  display: block;
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-auto > *:hover img,
.album-grid > *:hover img {
  transform-origin: center center;
  transform: scale(1.08);
}

.album-auto img,
.album-grid img {
  height: 100%;
  object-fit: cover;
}

/* a 标签填满所在容器，内部图片铺满 */
.album-auto a,
.album-grid a {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.album-auto .imgdiv,
.album-grid .imgdiv {
  display: flex;
  position: relative;
  overflow: hidden;
  margin: 0 !important;
}

/* 仅 album-grid 有固定行高，imgdiv 撑满网格项使图片高度确定 */
.album-grid .imgdiv {
  height: 100%;
}

.comment-content .album-grid {
  max-width: 480px;
}

.comment-content .album-grid img {
  object-fit: cover !important;
  max-width: none !important;
}

.comment-content img:not(.inline-block) {
  object-fit: contain;
  /* max-width: 300px; */
}

@media (max-width: 992px) {

  .album-auto,
  .album-grid {
    gap: 0.1rem;
    border-radius: .25rem;
  }

}

.album-auto .imgtitle,
.album-grid .imgtitle {
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  display: flex;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  padding: 1.5rem 0.4rem 0.25rem;
}

/* 网格span */

.grid-span {
  display: flex;
  min-height: 0;
  overflow: hidden;
  height: 100%;
  /* 防御：主题占位样式可能给 .album-grid>* 加 aspect-ratio，
     会让跨行/跨列图的宽度被行高反推，破坏网格布局，显式关闭 */
  aspect-ratio: auto;
}

.grid-span .imgdiv {
  flex: 1;
  min-height: 0;
}

.grid-span-row-2 {
  grid-row: span 2;
}

.grid-span-row-3 {
  grid-row: span 3;
}

.grid-span-row-4 {
  grid-row: span 4;
}

.grid-span-col-2 {
  grid-column: span 2;
}

.grid-span-col-3 {
  grid-column: span 3;
}

.grid-span-col-4 {
  grid-column: span 4;
}

/* 网格行列数量动态响应 */
.row-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.row-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.row-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.row-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (min-width: 576px) {
  .row-cols-sm-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .row-cols-sm-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-cols-sm-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row-cols-sm-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .row-cols-md-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .row-cols-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-cols-md-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row-cols-md-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .row-cols-md-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .row-cols-lg-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .row-cols-lg-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-cols-lg-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row-cols-lg-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .row-cols-lg-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .row-cols-lg-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* 短代码-视频挂载 */

.iframe_div {
  margin-top: 2rem;
  margin-bottom: 2rem;
  position: relative;
  display: block;
  padding: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.iframe_div .iframe_video {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 0;
  /* background-size: cover;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-color: rgba(120, 120, 120, 0.1); */
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.iframe_div:after {
  content: "";
  display: block;
  padding-top: 100%;
}

.iframe_div-16x9:after {
  padding-top: 56.25%;
}

/* 短代码-下载 */
.file {
  display: flex;
  border: 1px solid gainsboro;
  padding: 0.5rem;
  border-radius: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.dark .file {
  border-color: darkslategrey;
}

.file .filetext {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.file .fileimg {
  width: 2.25rem;
  height: 2.25rem;
  background-image: url("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjIiIGhlaWdodD0iMjIiPjxwYXRoIGQ9Ik02NzguNjQgNTE0LjAwN2ExNjguNDQ4IDE2OC40NDggMCAxIDAtMTY4LjQ0NyAxNjcuNzA2QTE2OC4wNyAxNjguMDcgMCAwIDAgNjc4LjY0IDUxNC4wMDd6IiBmaWxsPSIjRjRDQTFDIi8+PHBhdGggZD0iTTk4My4wNCA2MDMuNDEyYTI0Mi40ODggMjQyLjQ4OCAwIDAgMC0yODAuMzkyLTIzOC40MDdBMjUzLjMyMiAyNTMuMzIyIDAgMCAwIDI1Ni4yMiAyODcuMThhMjQ5LjEzNCAyNDkuMTM0IDAgMCAwLTQ4Ljk1NyAxNTMuMzg1QTIwMy4zOTcgMjAzLjM5NyAwIDAgMCAyNDAuMTg5IDg0NC44aDUyNy43NzVhMzEuOTkgMzEuOTkgMCAwIDAgMTQuNzUtMy43MTcgMjQyLjAzOCAyNDIuMDM4IDAgMCAwIDIwMC4zMjYtMjM3LjY3ek03NDAuNjA4IDc4MC43MTNIMjQwLjE4OWExMzkuMzg3IDEzOS4zODcgMCAxIDEgMC0yNzguNzY5IDMxLjk3IDMxLjk3IDAgMCAwIDguNzA0LTEuMzQxIDMxLjk2NCAzMS45NjQgMCAwIDAgMjQuODQ4LTM1Ljk5OSAxODcuODEyIDE4Ny44MTIgMCAwIDEgMTU3Ljc0Mi0yMTQuMDE2IDE4OC40NjIgMTg4LjQ2MiAwIDAgMSAyMDkuNTQxIDEzMi44MzkgMjQxLjYyOCAyNDEuNjI4IDAgMCAwLTE0Mi44NDggMjE5Ljk4NSAzMi4xOCAzMi4xOCAwIDAgMCA2NC4zNTggMCAxNzguMDY4IDE3OC4wNjggMCAxIDEgMTc4LjA3NCAxNzcuMzAxeiIgZmlsbD0iIzU5NUJCMyIvPjwvc3ZnPg==");
  background-size: cover;
}

.file .filedown {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: white;
  border-radius: 50%;
  background-color: cornflowerblue;
}

.file .filedown:hover {
  color: darkslateblue;
}

/* 展示信息：左image，右上title，右下description */

.post_inner {
  border: 1px dashed;
  display: flex;
  align-items: center;
  margin: 1rem 0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: 700ms;
}

.post_inner:hover {
  background-color: rgba(0, 0, 0, 0.15);
}

.post_img_inner {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  margin-right: 0.5rem;
  border-radius: 0.375rem;
  overflow: hidden;
  background-color: #e5e7eb;
}

.dark .post_img_inner {
  background-color: #374151;
}

.post_info_inner {
  flex: 1 1 0;
  display: flex;
  overflow: hidden;
}

.post_info_inner a {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: auto;
  margin-bottom: auto;
  font-size: small;
}

.post_info_inner .post_title_inner,
.post_info_inner .post_description_inner {
  color: rgb(100 116 139);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.post_info_inner .post_title_inner {
  font-weight: 700;
}

.dark .post_info_inner .post_title_inner,
.dark .post_info_inner .post_description_inner {
  color: rgb(148 163 184);
}

@media (min-width: 640px) {
  .post_img_inner {
    width: 3.5rem;
    height: 3.5rem;
  }

  .post_info_inner a {
    font-size: medium;
    line-height: 1.75rem;
  }
}

/* 短代码-聊天气泡 */

.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.message {
  display: flex;
  margin: 1rem 0;
  max-width: 80%;
  position: relative;
  gap: .5rem;
}

@media (max-width: 640px) {
  .message {
    max-width: 100%;
  }
}

.received {
  align-self: flex-start;
}

.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-content {
  padding: 1rem;
  border-radius: 1rem;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.received .message-content {
  background-color: #f0f2f5;
  color: #333;
  border-top-left-radius: 4px;
}

.sent .message-content {
  background-color: #0084ff;
  color: white;
  border-top-right-radius: 4px;
}

/* 接收方三角箭头 */
.received .message-content::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 14px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: #f0f2f5;
  border-left: 0;
}

/* 发送方三角箭头 */
.sent .message-content::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 14px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: #0084ff;
  border-right: 0;
}

.timestamp {
  font-size: 0.75rem;
  color: #999;
  margin-top: 5px;
  text-align: right;
}

.received .timestamp {
  text-align: left;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 8px;
  flex-shrink: 0;
  background-color: #e4e6eb;
  overflow: hidden;
}

.sent .avatar {
  background-color: #0084ff;
  color: white;
}

/* 暗色模式 */

.dark .received .message-content {
  background-color: #374151;
  color: #e5e7eb;
}

.dark .received .message-content::before {
  border-right-color: #374151;
}

.dark .sent .message-content {
  background-color: #3b82f6;
  color: #f9fafb;
}

.dark .sent .message-content::after {
  border-left-color: #3b82f6;
}

.dark .timestamp {
  color: #6b7280;
}

.dark .avatar {
  background-color: #374151;
}

.dark .sent .avatar {
  background-color: #3b82f6;
}

/* ==========================================================================
   短代码-进度条
   ========================================================================== */

.esc-progress {
  margin: 1rem 0;
}

.esc-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 0.85rem;
  line-height: 1.3;
  color: #333;
}

.dark .esc-progress-header {
  color: #e5e7eb;
}

.esc-progress-bar {
  height: 10px;
  border-radius: 5px;
  background: #e5e7eb;
  overflow: hidden;
}

.dark .esc-progress-bar {
  background: #374151;
}

.esc-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
  position: relative;
}

/* 颜色变体 */
.esc-progress-blue .esc-progress-fill     { background: #3b82f6; }
.esc-progress-green .esc-progress-fill    { background: #22c55e; }
.esc-progress-red .esc-progress-fill      { background: #ef4444; }
.esc-progress-yellow .esc-progress-fill   { background: #eab308; }
.esc-progress-purple .esc-progress-fill   { background: #a855f7; }
.esc-progress-orange .esc-progress-fill   { background: #f97316; }

/* 条纹动画（可通过 striped="false" 关闭） */
.esc-progress-striped .esc-progress-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  animation: esc-progress-stripe 1s linear infinite;
  border-radius: 5px;
}

@keyframes esc-progress-stripe {
  0%   { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

/* 加载中脉冲 */
.esc-progress.esc-progress-animate .esc-progress-fill {
  animation: esc-progress-pulse 2s ease-in-out infinite;
}

@keyframes esc-progress-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* hover 微放大 */
.esc-progress-bar:hover .esc-progress-fill {
  filter: brightness(1.1);
  transition: filter 0.2s;
}

.esc-progress-label {
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #666;
}

.dark .esc-progress-label {
  color: #9ca3af;
}

/* ==========================================================================
   短代码-标签页（CSS-only flex 重排）
   ========================================================================== */

.esc-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 1rem 0;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}

.dark .esc-tabs {
  border-color: #4b5563;
}

.esc-tabs input[type="radio"] {
  display: none;
}

/* 所有 label 排在第一行 */
.esc-tab-label {
  order: 1;
  padding: 0.3em 1.2em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: #666;
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
  background: transparent;
}

.dark .esc-tab-label {
  color: #9ca3af;
}

.esc-tab-label:hover {
  color: #333;
}

.dark .esc-tab-label:hover {
  color: #e5e7eb;
}

/* 选中态 label */
.esc-tabs input[type="radio"]:checked + .esc-tab-label {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* 所有 content 排在第二行，默认隐藏 */
.esc-tab-content {
  order: 2;
  width: 100%;
  display: none;
  padding: 0.6rem 1.2rem;
  border-top: 1px solid #dee2e6;
  overflow: hidden;
  contain: layout style;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.dark .esc-tab-content {
  border-top-color: #4b5563;
}

/* 只有紧跟在选中 radio+label 之后的 content 才显示 */
.esc-tabs input[type="radio"]:checked + .esc-tab-label + .esc-tab-content {
  display: block;
}

/* ==========================================================================
   短代码-时间线
   ========================================================================== */

.esc-timeline {
  position: relative;
  margin: 1rem 0;
  padding-left: 2rem;
}

/* 中间竖线 */
.esc-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.dark .esc-timeline::before {
  background: #4b5563;
}

.esc-timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

.esc-timeline-item:last-child {
  margin-bottom: 0;
}

/* 圆点标记 */
.esc-timeline-marker {
  position: absolute;
  left: calc(-2rem + 3px);
  top: 0.235rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #3b82f6;
}

.dark .esc-timeline-marker {
  background: #60a5fa;
  border-color: #1f2937;
  box-shadow: 0 0 0 2px #60a5fa;
}

.esc-timeline-date {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
  line-height: 1.2rem;
}

.esc-timeline-content {
  color: #333;
  line-height: 1.6;
}

.dark .esc-timeline-content {
  color: #e5e7eb;
}

/* ==========================================================================
   短代码-音频播放器
   ========================================================================== */

.esc-audio {
  margin: 1rem 0;
  padding: 1em;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fafafa;
}

.dark .esc-audio {
  border-color: #4b5563;
  background: #1f2937;
}

.esc-audio-title {
  font-weight: 600;
  margin-bottom: 0.5em;
  color: #333;
}

.dark .esc-audio-title {
  color: #e5e7eb;
}

.esc-audio audio {
  width: 100%;
  outline: none;
}

/* ==========================================================================
   短代码-引用块 blockquote
   ========================================================================== */

.esc-blockquote {
  margin: 1rem 0;
  padding: 0.8rem 1rem 0.8rem 1.2rem;
  border-left: 4px solid #0d6efd;
  border-radius: 0 6px 6px 0;
  background: #f8f9fa;
  color: #333;
}

.dark .esc-blockquote {
  background: #1f2937;
  color: #e5e7eb;
}

.esc-blockquote-success { border-left-color: #198754; }
.esc-blockquote-warning { border-left-color: #ffc107; }
.esc-blockquote-info    { border-left-color: #0dcaf0; }

.esc-blockquote-content {
  line-height: 1.7;
}

.esc-blockquote-content p:last-child {
  margin-bottom: 0;
}

.esc-blockquote-footer {
  margin-top: 0.6em;
  font-size: 0.85em;
  color: #6c757d;
}

.dark .esc-blockquote-footer {
  color: #9ca3af;
}

.esc-blockquote-footer cite {
  font-style: normal;
}

.esc-blockquote-footer cite a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.esc-blockquote-footer cite a:hover {
  color: #0d6efd;
}

/* ==========================================================================
   短代码-多栏布局 columns
   ========================================================================== */

.esc-columns {
  display: grid;
  grid-template-columns: repeat(var(--esc-cols, 2), 1fr);
  gap: var(--esc-gap, 1.5rem);
  margin: 1rem 0;
}

@media (max-width: 768px) {
  .esc-columns {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   短代码-分隔线 divider
   ========================================================================== */

.esc-divider {
  border: 0;
  margin: 1.5rem 0;
}

hr.esc-divider {
  border-top: 1px solid #dee2e6;
}

.dark hr.esc-divider {
  border-top-color: #4b5563;
}

hr.esc-divider-dashed { border-top-style: dashed; }
hr.esc-divider-dotted { border-top-style: dotted; }

.esc-divider-align-left   { text-align: left; }
.esc-divider-align-center { text-align: center; }
.esc-divider-align-right  { text-align: right; }

/* 带文字的分隔线：用 flex + 伪元素实现贯穿线 */
.esc-divider:not(hr) {
  display: flex;
  align-items: center;
}

.esc-divider:not(hr)::before,
.esc-divider:not(hr)::after {
  content: '';
  flex: 1;
  border-top: 1px solid #dee2e6;
}

.dark .esc-divider:not(hr)::before,
.dark .esc-divider:not(hr)::after {
  border-top-color: #4b5563;
}

.esc-divider-dashed:not(hr)::before,
.esc-divider-dashed:not(hr)::after { border-top-style: dashed; }
.esc-divider-dotted:not(hr)::before,
.esc-divider-dotted:not(hr)::after { border-top-style: dotted; }

.esc-divider-text {
  padding: 0 1em;
  color: #6c757d;
  font-size: 0.9em;
}

.dark .esc-divider-text {
  color: #9ca3af;
}

/* 左对齐：文字在左，右侧线贯穿 */
.esc-divider-align-left:not(hr)::before { display: none; }
/* 右对齐：文字在右，左侧线贯穿 */
.esc-divider-align-right:not(hr)::after { display: none; }

/* ==========================================================================
   短代码-徽章 badge
   ========================================================================== */

.esc-badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 4px;
  vertical-align: baseline;
  white-space: nowrap;
}

.esc-badge-round {
  border-radius: 999px;
}

.esc-badge-primary   { background: #0d6efd; color: #fff; }
.esc-badge-success   { background: #198754; color: #fff; }
.esc-badge-warning   { background: #ffc107; color: #212529; }
.esc-badge-danger    { background: #dc3545; color: #fff; }
.esc-badge-info      { background: #0dcaf0; color: #212529; }
.esc-badge-secondary { background: #6c757d; color: #fff; }

/* ==========================================================================
   短代码-Bilibili 视频嵌入
   ========================================================================== */

.esc-bilibili {
  position: relative;
  width: 100%;
  height: 0;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.esc-bilibili iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* ==========================================================================
   短代码-通用视频 [video]（HTML5 原生播放器）
   ========================================================================== */

.post-content video,
video.esc-video {
  display: block;
  width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 6px;
  background: #000;
  outline: none;
}

.dark .post-content video,
.dark video.esc-video {
  background: #0f172a;
}

/* 视频 cover 封面层（fit="cover" 时启用）
   容器高度由视频自身按原始比例自适应（width:100%; height:auto），
   aspect-ratio 仅作为视频元数据加载前的占位兜底，避免初始高度塌陷。
   封面层绝对定位铺满容器，随视频实际高度对齐。 */
.esc-video-wrap {
  position: relative;
  display: flex;
  align-items: center;    /* 视频垂直居中：加载前容器按 aspect-ratio 占位，视频比例不符时也能居中不偏移 */
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 9;   /* 加载前的占位比例，可用内联 style 覆盖 */
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.esc-video-wrap video {
  display: block;
  width: 100%;
  height: auto;           /* 按视频原始宽高比自适应，控制条完整、无顶部黑边、无裁剪 */
  flex: 0 0 auto;         /* 不参与 flex 收缩，保证始终占满容器宽度、保持自身高度 */
  border-radius: 6px;
  background: #000;
}

.esc-video-wrap .esc-video-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  pointer-events: none; /* 让点击穿透到视频控件，避免挡住播放按钮 */
  transition: opacity 0.3s ease;
}

/* 视频开始播放后隐藏封面层（由 frontend.js 添加 .esc-video-playing） */
.esc-video-wrap .esc-video-poster.esc-video-playing {
  opacity: 0;
}

/* 封面图居中播放按钮：让用户一眼识别这是视频而非静态图 */
.esc-video-wrap .esc-video-playbtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(48px, 12vw, 72px);   /* 不同屏幕尺寸自适应 */
  height: clamp(48px, 12vw, 72px);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);   /* 半透明圆形背景 */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  pointer-events: auto;             /* 覆盖父层 pointer-events:none，保证可点击 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

/* 播放三角图标（内联 SVG，颜色白，视觉重心稍右移以呈现居中的三角形） */
.esc-video-wrap .esc-video-playicon {
  display: block;
  width: 40%;
  height: 40%;
  background: #fff;
  clip-path: polygon(12% 0, 12% 100%, 100% 50%); /* 右向三角形 */
  margin-left: 6%;                                /* 视觉居中小偏移 */
}

/* 悬停：按钮放大 + 背景变亮 */
.esc-video-wrap .esc-video-playbtn:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translate(-50%, -50%) scale(1.1);
}

/* 按下：更亮 + 轻微缩小，给出明确的点击反馈 */
.esc-video-wrap .esc-video-playbtn:active {
  background: rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%) scale(0.95);
}

/* 无障碍：键盘聚焦时也给出视觉反馈 */
.esc-video-wrap .esc-video-playbtn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

/* 播放后随封面层一起隐藏（继承 opacity 过渡，按钮无需单独处理） */
