/**
 * Oncex 文章页增强样式（P4）：灯箱 + TOC
 *
 * @package Oncex
 */

/* ===== 灯箱 ===== */
.oncex-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 24px;
  cursor: zoom-out;
}
.oncex-lb-stage {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oncex-lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
  background: #fff;
}
.oncex-lb-prev,
.oncex-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.oncex-lb-prev:hover,
.oncex-lb-next:hover {
  background: rgba(255, 255, 255, 0.35);
}
.oncex-lb-prev { left: -64px; }
.oncex-lb-next { right: -64px; }
.oncex-lb-close {
  position: absolute;
  top: 16px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.oncex-lb-close:hover { background: rgba(255, 255, 255, 0.35); }
.oncex-lb-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
}
@media (max-width: 767.98px) {
  .oncex-lb-prev { left: 4px; }
  .oncex-lb-next { right: 4px; }
}

/* ===== TOC ===== */
.oncex-toc {
  position: relative;
  margin: 0 0 24px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-color, #fff);
  overflow: hidden;
}
.oncex-toc-title {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #334155);
  background: var(--surface-hover, #f1f5f9);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.oncex-toc-body {
  padding: 8px 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.oncex-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.oncex-toc-item {
  margin: 0;
}
.oncex-toc-item a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 4px;
  transition: all 0.15s;
  word-break: break-all;
}
.oncex-toc-item a:hover {
  color: var(--primary-color, #4a90d9);
  background: var(--surface-hover, #f1f5f9);
}
.oncex-toc-item.active a {
  color: var(--primary-color, #4a90d9);
  border-left-color: var(--primary-color, #4a90d9);
  font-weight: 600;
}
.oncex-toc-item.nested a {
  padding-left: 26px;
  font-size: 13px;
}
.oncex-toc-toggle {
  display: none;
}
/* 移动端：默认折叠为一行按钮。 */
@media (max-width: 991.98px) {
  .oncex-toc {
    border: none;
    box-shadow: none;
    margin-bottom: 8px;
  }
  .oncex-toc-toggle {
    display: inline-block;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--surface-color, #fff);
    color: var(--text-primary, #334155);
    font-size: 14px;
    cursor: pointer;
  }
  .oncex-toc-body { display: none; }
  .oncex-toc.open .oncex-toc-body { display: block; }
  .oncex-toc .oncex-toc-title { display: none; }
}
