/*! laoguanTX bundle: article-enhancements-post-no-code */
/* source: components/gfm-alerts.css */
/* ========================================
 * GFM Alert Blocks — [!NOTE] / [!WARNING] / etc.
 * 配对: js/gfm-alerts.js
 * 样式规范仿 GitHub 风格：左侧色条 + 氛围背景 + 图标
 * ======================================== */

.gfm-alert {
  position: relative;
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + 16px);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--color-text-secondary);
}

.gfm-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

/* --- Header --- */
.gfm-alert-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gfm-alert-icon {
  font-size: 1.15em;
  flex-shrink: 0;
}

.gfm-alert-title {
  font-size: 1em;
  font-weight: var(--font-semibold);
}

/* --- Content --- */
.gfm-alert p {
  margin: 0;
}
.gfm-alert p + p {
  margin-top: var(--space-3);
}

/* --- Type Colors --- */
.gfm-alert--note {
  background: color-mix(in srgb, var(--color-bg) 92%, #0969da 8%);
}
.gfm-alert--note::before { background: #0969da; }
.gfm-alert--note .gfm-alert-icon,
.gfm-alert--note .gfm-alert-title { color: #0969da; }

.gfm-alert--tip {
  background: color-mix(in srgb, var(--color-bg) 92%, #1a7f37 8%);
}
.gfm-alert--tip::before { background: #1a7f37; }
.gfm-alert--tip .gfm-alert-icon,
.gfm-alert--tip .gfm-alert-title { color: #1a7f37; }

.gfm-alert--important {
  background: color-mix(in srgb, var(--color-bg) 92%, #8250df 8%);
}
.gfm-alert--important::before { background: #8250df; }
.gfm-alert--important .gfm-alert-icon,
.gfm-alert--important .gfm-alert-title { color: #8250df; }

.gfm-alert--warning {
  background: color-mix(in srgb, var(--color-bg) 92%, #9a6700 8%);
}
.gfm-alert--warning::before { background: #9a6700; }
.gfm-alert--warning .gfm-alert-icon,
.gfm-alert--warning .gfm-alert-title { color: #9a6700; }

.gfm-alert--caution {
  background: color-mix(in srgb, var(--color-bg) 92%, #cf222e 8%);
}
.gfm-alert--caution::before { background: #cf222e; }
.gfm-alert--caution .gfm-alert-icon,
.gfm-alert--caution .gfm-alert-title { color: #cf222e; }

/* --- Dark Mode --- */
[data-theme="dark"] .gfm-alert--note {
  background: color-mix(in srgb, var(--color-bg) 92%, #58a6ff 8%);
}
[data-theme="dark"] .gfm-alert--note::before { background: #58a6ff; }
[data-theme="dark"] .gfm-alert--note .gfm-alert-icon,
[data-theme="dark"] .gfm-alert--note .gfm-alert-title { color: #58a6ff; }

[data-theme="dark"] .gfm-alert--tip {
  background: color-mix(in srgb, var(--color-bg) 92%, #3fb950 8%);
}
[data-theme="dark"] .gfm-alert--tip::before { background: #3fb950; }
[data-theme="dark"] .gfm-alert--tip .gfm-alert-icon,
[data-theme="dark"] .gfm-alert--tip .gfm-alert-title { color: #3fb950; }

[data-theme="dark"] .gfm-alert--important {
  background: color-mix(in srgb, var(--color-bg) 92%, #bc8cff 8%);
}
[data-theme="dark"] .gfm-alert--important::before { background: #bc8cff; }
[data-theme="dark"] .gfm-alert--important .gfm-alert-icon,
[data-theme="dark"] .gfm-alert--important .gfm-alert-title { color: #bc8cff; }

[data-theme="dark"] .gfm-alert--warning {
  background: color-mix(in srgb, var(--color-bg) 92%, #d29922 8%);
}
[data-theme="dark"] .gfm-alert--warning::before { background: #d29922; }
[data-theme="dark"] .gfm-alert--warning .gfm-alert-icon,
[data-theme="dark"] .gfm-alert--warning .gfm-alert-title { color: #d29922; }

[data-theme="dark"] .gfm-alert--caution {
  background: color-mix(in srgb, var(--color-bg) 92%, #f85149 8%);
}
[data-theme="dark"] .gfm-alert--caution::before { background: #f85149; }
[data-theme="dark"] .gfm-alert--caution .gfm-alert-icon,
[data-theme="dark"] .gfm-alert--caution .gfm-alert-title { color: #f85149; }

/* source: components/view-image.css */
/* ========================================
 * ViewImage — 图片灯箱主题样式覆盖
 * 配对: js/view-image.min.js + js/view-image-init.js
 *
 * 亮色模式：白色毛玻璃工具栏 + 暗色图标/文字
 * 暗色模式：暗色毛玻璃工具栏 + 白色图标/文字
 * ======================================== */

/* ========================================
 * Overlay
 * ======================================== */
.view-image.view-image {
  z-index: 1001 !important;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* 暗色模式 */
[data-theme="dark"] .view-image.view-image {
  background-color: rgba(0, 0, 0, 0.82);
}

/* ========================================
 * Toolbar — 底部工具栏
 * ======================================== */

/* 亮色（默认）：白色毛玻璃 + 暗色文字 */
.view-image .view-image-tools {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 8px var(--space-4);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  max-width: 520px;
  color: var(--color-text-secondary);
}

/* 暗色：暗色毛玻璃 + 白色文字 */
[data-theme="dark"] .view-image .view-image-tools {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
}

/* ========================================
 * 按钮
 * ======================================== */

/* 亮色（默认） */
.view-image .view-image-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.07);
  transition: background var(--transition-fast) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-in-out),
              box-shadow var(--transition-fast) var(--ease-in-out);
}

.view-image .view-image-btn:hover {
  background: var(--color-primary);
  transform: scale(1.08);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

/* 亮色 SVG 图标：白色源 → 深灰（约 #333） */
.view-image .view-image-btn svg {
  filter: brightness(0.2);
  transition: filter var(--transition-fast);
}

.view-image .view-image-btn:hover svg {
  filter: brightness(10);
}

/* 暗色 */
[data-theme="dark"] .view-image .view-image-btn {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .view-image .view-image-btn svg {
  filter: none;
}
[data-theme="dark"] .view-image .view-image-btn:hover {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
[data-theme="dark"] .view-image .view-image-btn:hover svg {
  filter: brightness(10);
}

/* ========================================
 * 计数文字
 * ======================================== */
.view-image .view-image-tools__count {
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: inherit;
}

/* ========================================
 * 图片容器
 * ======================================== */
.view-image .view-image-lead img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* ========================================
 * 加载动画
 * ======================================== */
.view-image .view-image-loading::after {
  background: var(--color-primary);
}

/* ========================================
 * 关闭全屏区域
 * ======================================== */
.view-image .view-image-close__full {
  background-color: transparent;
}

/* ========================================
 * 动画
 * ======================================== */
.view-image.view-image {
  animation: view-image-in var(--transition-slow) var(--ease-out);
}

.view-image__out.view-image__out {
  animation: view-image-out var(--transition-base) var(--ease-in-out) forwards;
}

/* ========================================
 * 响应式：移动端
 * ======================================== */
@media (max-width: 767px) {
  .view-image .view-image-tools {
    left: var(--space-4);
    right: var(--space-4);
    bottom: 3%;
    border-radius: var(--radius-md);
    padding: 6px var(--space-3);
  }

  .view-image .view-image-btn {
    width: 34px;
    height: 34px;
  }

  .view-image.view-image {
    padding: 0.5rem;
  }
}
