.sn-main {
  max-width: 1280px;
  transition: max-width 0.18s ease;
}

body.sn-split-active .sn-main {
  max-width: min(1620px, calc(100vw - 32px));
}

.sn-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sn-mobile-only {
  display: none;
}

.sn-btn-xs {
  padding: 4px 10px;
  font-size: 13px;
  min-height: 30px;
}

/* 顶部 Hero 与阅读极简工具条 */
.sn-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px;
  background: var(--hero-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: padding 0.16s ease, margin-bottom 0.16s ease;
}

.sn-hero.is-compact {
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
}

.sn-hero.is-compact .sn-hero-copy {
  display: none;
}

.sn-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.sn-hero h1 {
  margin: 0 0 6px;
}

.sn-hero p {
  margin: 0;
  max-width: 72ch;
}

.sn-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sn-hero:not(.is-compact) .sn-hero-actions {
  width: auto;
}

.sn-action-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 2px;
}

.sn-toggle-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}

.sn-icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 6px 0;
  font-weight: 700;
  border-radius: 999px;
}

/* 主布局：左侧目录 + 右侧阅读区 */
.sn-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (width > 920px) {
  body.sn-wide-mode .sn-main {
    max-width: min(1680px, calc(100vw - 32px));
  }

  body.sn-wide-mode .sn-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sn-wide-mode .sn-sidebar {
    display: none;
  }
}

.sn-sidebar {
  position: sticky;
  top: 76px;
  padding: 14px;
  max-height: calc(100vh - 94px);
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
}

.sn-sidebar-head {
  flex: none;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}

.sn-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.sn-search-label {
  display: block;
  margin: 0 0 8px;
}

.sn-sidebar-head input {
  margin-top: 0;
  font-size: 13.5px;
  padding: 7px 10px;
}

.sn-side-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.sn-side-tier {
  padding: 4px 6px;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.sn-side-tier.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.sn-side-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 8px;
}

.sn-side-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 7px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.sn-side-pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.sn-side-pill[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

#sn-side-review[aria-pressed="true"] {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.sn-pill-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
}

#sn-count {
  margin: 0;
  font-size: 12px;
}

.sn-mastery-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.sn-mastery-stats {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sn-mastery-io {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.sn-link-btn {
  padding: 1px 4px;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.sn-link-btn:hover {
  text-decoration: underline;
  background: transparent;
}

.sn-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-flow: column nowrap;
  min-height: 0;
  overflow-x: hidden;
  gap: 6px;
  padding-right: 2px;
}

.sn-list > * { flex: none; min-width: 0; }

/* 按章折叠树与核心章分层 */
.sn-ch-group {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.sn-ch-group.is-core {
  border-left: 3px solid var(--accent);
}

.sn-ch-group.is-ref > .sn-ch-summary {
  color: var(--ink-soft);
}

.sn-ch-group[open] {
  background: var(--surface);
  border-color: var(--line);
}

.sn-ch-group.is-core[open] {
  border-left-color: var(--accent);
}

.sn-ch-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 1.55;
  flex: none;
}

.sn-ch-badge.is-core {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  font-weight: 700;
}

.sn-ch-badge.is-ref {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 500;
}

.sn-ch-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}

.sn-ch-summary::-webkit-details-marker {
  display: none;
}

.sn-ch-summary::before {
  content: '▸';
  display: inline-block;
  width: 12px;
  color: var(--muted);
  transition: transform 0.14s ease;
  margin-right: 4px;
}

.sn-ch-group[open] > .sn-ch-summary::before {
  transform: rotate(90deg);
  color: var(--accent);
}

.sn-ch-title-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.sn-ch-meta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.sn-ch-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px 6px;
}

.sn-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.sn-item.is-catalog-pin {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.sn-item:hover {
  border-color: var(--accent);
  background: var(--surface-subtle);
}

.sn-item[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.sn-item-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  font-size: 11px;
}

.sn-m-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex: none;
}

.sn-m-dot.is-mastered {
  background: var(--pos);
}

.sn-m-dot.is-fuzzy {
  background: var(--amber);
}

.sn-m-dot.is-mistake {
  background: var(--neg);
}

.sn-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 600;
}

.sn-chip.is-p0 {
  background: var(--neg-soft);
  border-color: rgba(185, 56, 44, 0.35);
  color: var(--neg);
}

:root[data-theme="dark"] .sn-chip.is-p0 {
  border-color: rgba(239, 83, 80, 0.45);
}

.sn-item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.38;
}

/* 阅读正文区与舒适行宽 */
.sn-reader {
  padding: 26px 32px;
  min-width: 0;
  border-radius: var(--radius-lg);
}

.sn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sn-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sn-meta-rules {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* 掌握度三态打卡条 */
.sn-mastery-bar {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.sn-mastery-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.sn-mastery-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sn-m-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.sn-m-btn kbd {
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.sn-m-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.sn-m-btn.is-mastered[aria-pressed="true"] {
  background: var(--pos-soft);
  border-color: var(--pos);
  color: var(--pos);
  font-weight: 700;
}

.sn-m-btn.is-fuzzy[aria-pressed="true"] {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 700;
}

.sn-m-btn.is-mistake[aria-pressed="true"] {
  background: var(--neg-soft);
  border-color: var(--neg);
  color: var(--neg);
  font-weight: 700;
}

.sn-meta-rules ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.sn-meta-rules li {
  margin: 2px 0;
  line-height: 1.5;
}

.sn-material-local {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.92em;
}

.sn-meta-file {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.sn-meta-sources {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  line-height: 1.6;
}

/* 正文文字限制舒适阅读宽度，图表与表格撑满容器 */
.sn-body > p,
.sn-body > ul,
.sn-body > ol,
.sn-body > blockquote,
.sn-body > h1,
.sn-body > h2,
.sn-body > h3,
.sn-body > h4,
.sn-blind-analysis > p,
.sn-blind-analysis > ul,
.sn-blind-analysis > ol {
  max-width: 74ch;
}

.sn-body h1 {
  font-size: 24px;
  margin: 0 0 14px;
}

.sn-body h2 {
  font-size: 19px;
  margin: 26px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--accent-strong);
}

.sn-body h3 {
  font-size: 16.5px;
  margin: 20px 0 10px;
  line-height: 1.48;
}

.sn-body h4 {
  font-size: 15px;
  margin: 14px 0 6px;
}

.sn-body p {
  margin: 8px 0 12px;
  line-height: 1.75;
}

.sn-body ul,
.sn-body ol {
  margin: 8px 0 14px;
  padding-left: 22px;
}

.sn-body li {
  margin: 6px 0;
  line-height: 1.7;
}

.sn-body li > ul {
  margin: 5px 0 8px;
}

.sn-body blockquote.sn-quote {
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}

.sn-body blockquote.sn-quote p {
  margin: 4px 0;
}

.sn-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.sn-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.sn-body pre {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow: auto;
}

.sn-body pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

.sn-details {
  margin: 14px 0 18px;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
}

.sn-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
  padding: 2px 0;
}

.sn-details[open] summary {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

/* 盲测训练模式 */
.sn-blind-wrap {
  margin: 12px 0 16px;
}

.sn-blind-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: var(--amber-soft);
  border: 1px dashed var(--amber);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.sn-blind-bar.is-revealed {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* 正例 vs 反例左右分屏对比 */
.sn-split-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  margin: 12px 0 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
}

.sn-split-toolbar[hidden] {
  display: none;
}

.sn-split-pair:not(.is-split) .sn-split-col + .sn-split-col {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sn-split-pair.is-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 10px 0 22px;
}

.sn-split-pair.is-split .sn-split-col {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.sn-split-pair.is-split .sn-split-col.is-pos {
  border-top: 3px solid var(--pos);
}

.sn-split-pair.is-split .sn-split-col.is-neg {
  border-top: 3px solid var(--neg);
}

.sn-split-pair.is-split .sn-split-col > h3:first-child {
  margin-top: 0;
}

.sn-split-pair.is-split .sn-split-col > p,
.sn-split-pair.is-split .sn-split-col > ul,
.sn-split-pair.is-split .sn-split-col > ol,
.sn-split-pair.is-split .sn-split-col .sn-blind-analysis > p,
.sn-split-pair.is-split .sn-split-col .sn-blind-analysis > ul,
.sn-split-pair.is-split .sn-split-col .sn-blind-analysis > ol {
  max-width: none;
}

.sn-split-pair.is-split .sn-figure {
  padding: 8px;
  background: var(--surface);
}

@media (max-width: 1080px) {
  #sn-btn-split {
    display: none;
  }

  .sn-split-pair.is-split {
    grid-template-columns: 1fr;
  }
}

.sn-blind-prompt {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}

.sn-blind-analysis[data-blind-state="hidden"] {
  display: none;
}

/* 图表卡片 */
.sn-figure {
  margin: 14px 0 18px;
  padding: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.sn-zoom-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.sn-zoom-btn img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.sn-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.sn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sn-table th {
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.sn-table th,
.sn-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.sn-table tbody tr:hover {
  background: var(--surface-hover);
}

.sn-table tbody tr.is-hidden {
  display: none;
}

.sn-tier-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.sn-tier-btn {
  font-size: 13.5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.sn-tier-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.sn-tier-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* 无级缩放与拖拽灯箱 */
.sn-lightbox {
  width: min(1520px, calc(100vw - 16px));
  max-width: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}

.sn-lightbox::backdrop {
  background: rgba(16, 32, 30, 0.72);
}

.sn-lightbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.sn-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sn-lb-pct {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.sn-lightbox-hint {
  margin: 0 0 8px;
}

.sn-lightbox-wrap {
  position: relative;
  height: 78vh;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-subtle);
  touch-action: none;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sn-lightbox-wrap.is-dragging {
  cursor: grabbing;
}

.sn-lightbox-stage {
  transform-origin: center center;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.sn-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.sn-lightbox-wrap.is-actual .sn-lightbox-stage {
  max-width: none;
  max-height: none;
}

.sn-lightbox-wrap.is-actual .sn-lightbox-stage img {
  max-width: none;
  max-height: none;
}
.sn-lightbox-wrap.is-actual .sn-lb-img-box { max-width: none; }

/* 灯箱逐 K 回放模式（K+1 / K-1） */
.sn-lb-replay-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

.sn-lb-replay-bar[hidden] {
  display: none;
}

.sn-lb-replay-nav,
.sn-lb-replay-extra {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sn-lb-k-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
}

.sn-lb-img-box {
  position: relative;
  max-width: 100%;
  display: inline-block;
  line-height: 0;
}

.sn-lb-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  background: var(--surface-subtle);
  border-left: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.sn-lb-mask[hidden] {
  display: none;
}

:root[data-theme="dark"] .sn-lb-mask {
  background: var(--surface-subtle);
  border-left-color: var(--accent);
}

.sn-lb-mask-label {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* 高频核心术语下划线与悬停/点击浮窗 */
.sn-term {
  border-bottom: 1.5px dashed var(--accent);
  padding-bottom: 1px;
  cursor: help;
  border-radius: 2px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sn-term:hover,
.sn-term:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.sn-term-popover {
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  position: fixed;
  z-index: 95;
  width: min(350px, calc(100vw - 20px));
  padding: 13px 15px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  font-size: 13.5px;
  line-height: 1.55;
}

.sn-term-popover[hidden] {
  display: none;
}

.sn-tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sn-tp-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-strong);
}

.sn-tp-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  min-height: auto;
  cursor: pointer;
}

.sn-tp-close:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.sn-tp-def {
  margin: 0 0 8px;
  color: var(--ink);
}

.sn-tp-redline {
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--neg-soft);
  border-left: 3px solid var(--neg);
  color: var(--ink);
  font-size: 12.5px;
}

.sn-tp-redline strong {
  color: var(--neg);
}

.sn-tp-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.sn-tp-jump {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  min-height: 28px;
}

/* 快捷键提示弹窗 */
.sn-keys-dialog {
  width: min(500px, calc(100vw - 24px));
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.sn-keys-dialog::backdrop {
  background: rgba(15, 29, 31, 0.5);
}

.sn-keys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sn-keys-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.sn-keys-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.sn-keys-list li:last-child {
  border-bottom: 0;
}

.sn-keys-dialog kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 12.5px;
  font-family: Consolas, "Courier New", monospace;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink);
}

/* 手机端抽屉目录与遮罩 */
.sn-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(16, 32, 30, 0.45);
}

@media (max-width: 920px) {
  body.sn-drawer-open { overflow: hidden; }
  .sn-mobile-only {
    display: inline-flex;
  }

  .sn-desktop-only {
    display: none;
  }

  .sn-layout {
    grid-template-columns: 1fr;
  }

  .sn-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(330px, 86vw);
    max-height: 100vh;
    z-index: 60;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line);
    box-shadow: 0 12px 36px rgba(16, 32, 30, 0.25);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.sn-drawer-open .sn-sidebar {
    transform: translateX(0);
  }

  .sn-reader {
    padding: 18px 16px;
  }

  .sn-hero {
    padding: 14px 16px;
  }

  .sn-hero-actions {
    gap: 6px;
  }

  .sn-action-sep {
    display: none;
  }

  .sn-lightbox-wrap {
    height: 70vh;
  }
}

/* 课程原视频按需播放弹窗（适配日间与 TradingView 暗黑双主题） */
.sn-video-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.sn-video-dialog {
  width: min(1040px, calc(100vw - 24px));
  max-width: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.35);
}

.sn-video-dialog::backdrop {
  background: rgba(12, 16, 24, 0.72);
}

.sn-video-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sn-video-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sn-video-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sn-video-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sn-video-tabs:empty {
  display: none;
}

.sn-video-tab {
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink-soft);
  cursor: pointer;
}

.sn-video-tab:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.sn-video-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.sn-video-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d111a;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sn-video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sn-video-hint {
  margin: 8px 0 0;
}
