/* =========================================================
   shell.css — 课程/章节页壳层
   三栏：全站大纲 | 正文 | 知识点·扩展·交互窗
   ========================================================= */

:root {
  --sh-bg: #FAF5EC;
  --sh-paper: #FFFDF8;
  --sh-paper-2: #FDF8EF;
  --sh-ink: #2B251D;
  --sh-ink-2: #574D40;
  --sh-ink-3: #8B7E6C;
  --sh-line: #EAE0CD;
  --sh-line-2: #DFD2BA;
  --sh-accent: #B8552F;
  --sh-accent-deep: #9A4423;
  --sh-accent-soft: rgba(184, 85, 47, 0.08);
  --sh-teal: #1F6F5C;
  --sh-teal-soft: rgba(31, 111, 92, 0.1);
  --sh-gold: #C9A22E;
  --sh-gold-soft: rgba(201, 162, 46, 0.12);
  --sh-violet: #6B4F8A;
  --sh-violet-soft: rgba(107, 79, 138, 0.1);
  --sh-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sh-nav-h: 58px;
  --sh-left: 260px;
  --sh-right: 280px;
}

* { box-sizing: border-box; }

html.sh-ready body {
  overflow-x: clip;
}

/* ---------- 模板顶栏（覆盖 learn.js 旧栏） ---------- */
.sh-top {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--sh-nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--sh-line);
  box-shadow: 0 8px 28px rgba(122, 88, 48, 0.06);
}

.sh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--sh-ink);
  flex: none;
}

.sh-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #FFF7EF;
  background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-deep));
  box-shadow: 0 6px 16px rgba(154, 68, 35, 0.28);
}

.sh-brand-text {
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
}

.sh-brand-text small {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--sh-ink-3);
  font-weight: 500;
}

.sh-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--sh-ink-3);
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sh-crumb a {
  color: var(--sh-ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.sh-crumb a:hover { color: var(--sh-accent); }
.sh-crumb .sep { opacity: 0.5; }
.sh-crumb .here {
  color: var(--sh-accent-deep);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.sh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--sh-line-2);
  background: var(--sh-paper);
  color: var(--sh-ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.28s var(--sh-ease);
}

.sh-btn:hover {
  border-color: var(--sh-accent);
  color: var(--sh-accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(122, 88, 48, 0.1);
}

.sh-btn.primary {
  color: #FFF7EF;
  background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-deep));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(154, 68, 35, 0.25);
}

.sh-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(154, 68, 35, 0.35);
}

.sh-btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}

/* ---------- 布局：内容全宽，侧栏浮层 ---------- */
.sh-layout {
  display: block;
  min-height: calc(100vh - var(--sh-nav-h));
  max-width: 1100px;
  margin: 0 auto;
}

.sh-side {
  position: fixed;
  top: var(--sh-nav-h);
  bottom: 0;
  width: min(320px, 86vw);
  z-index: 160;
  overflow: auto;
  padding: 16px 14px 28px;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--sh-line);
  box-shadow: 0 20px 60px rgba(43, 37, 29, 0.14);
  transform: translateX(-110%);
  transition: transform 0.38s var(--sh-ease);
  scrollbar-width: thin;
}

.sh-side.right {
  right: 0;
  left: auto;
  transform: translateX(110%);
  border-radius: 16px 0 0 16px;
  box-shadow: -16px 0 50px rgba(43, 37, 29, 0.12);
}

.sh-side.left {
  left: 0;
  border-radius: 0 16px 16px 0;
}

.sh-side.open { transform: none; }

.sh-main {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 36px) 64px;
}

.sh-backdrop {
  display: none;
  position: fixed;
  inset: var(--sh-nav-h) 0 0 0;
  background: rgba(43, 37, 29, 0.22);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.sh-backdrop.show { display: block; }

/* 顶栏上的侧栏开关 */
.sh-side-toggle {
  position: relative;
}

.sh-side-toggle .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sh-accent);
  border: 1.5px solid var(--sh-paper);
}

/* ---------- 侧栏模块 ---------- */
.sh-panel {
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid var(--sh-line);
  background: var(--sh-paper);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(122, 88, 48, 0.05);
}

.sh-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--sh-line);
  background: var(--sh-paper-2);
  cursor: pointer;
  user-select: none;
}

.sh-panel-head h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--sh-ink);
  flex: 1;
}

.sh-panel-head .tag {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--sh-accent);
  background: var(--sh-accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.sh-panel-body {
  padding: 10px;
}

.sh-panel.collapsed .sh-panel-body { display: none; }
.sh-panel.collapsed .sh-panel-head .chev { transform: rotate(-90deg); }
.sh-panel-head .chev {
  font-size: 10px;
  color: var(--sh-ink-3);
  transition: transform 0.25s var(--sh-ease);
}

/* 课程大纲树 */
.sh-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sh-ch {
  border-radius: 10px;
  overflow: hidden;
}

.sh-ch > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--sh-ink-2);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.22s;
}

.sh-ch > button:hover {
  background: var(--sh-accent-soft);
  color: var(--sh-accent-deep);
}

.sh-ch > button .n {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sh-accent);
  width: 22px;
  flex: none;
}

.sh-ch > button .t { flex: 1; min-width: 0; }
.sh-ch > button .c {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px;
  color: var(--sh-ink-3);
}

.sh-ch.open > button {
  background: var(--sh-accent-soft);
  color: var(--sh-accent-deep);
}

.sh-ch-items {
  display: none;
  padding: 2px 0 6px 12px;
  flex-direction: column;
  gap: 2px;
}

.sh-ch.open .sh-ch-items { display: flex; }

.sh-ch-items a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  font-size: 11.5px;
  color: var(--sh-ink-2);
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.2s;
}

.sh-ch-items a:hover {
  background: rgba(31, 111, 92, 0.08);
  color: var(--sh-teal);
  border-left-color: var(--sh-teal);
}

.sh-ch-items a.on {
  background: var(--sh-accent-soft);
  color: var(--sh-accent-deep);
  border-left-color: var(--sh-accent);
  font-weight: 700;
}

/* 知识点锚点 —— 铺满侧栏，不套小框 */
.sh-rpane[data-rpane="sum"] .sh-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.sh-rpane[data-rpane="sum"] .sh-panel-head {
  border-bottom: 1px solid var(--sh-line);
  border-radius: 0;
  padding: 4px 8px 12px;
  margin-bottom: 8px;
}

.sh-rpane[data-rpane="sum"] .sh-panel-body {
  padding: 0;
}

.sh-points {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sh-points a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--sh-ink-2);
  text-decoration: none;
  line-height: 1.5;
  transition: all 0.22s;
  border: 1px solid transparent;
}

.sh-points a:hover {
  background: var(--sh-teal-soft);
  color: var(--sh-teal);
  border-color: rgba(31, 111, 92, 0.15);
  transform: translateX(2px);
}

.sh-points a.on {
  background: var(--sh-accent-soft);
  color: var(--sh-accent-deep);
  border-color: rgba(184, 85, 47, 0.18);
  font-weight: 700;
}

.sh-points .idx {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sh-ink-3);
  width: 20px;
  flex: none;
  padding-top: 2px;
}

/* 扩展网站 */
.sh-ext {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sh-ext a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--sh-line);
  background: var(--sh-paper);
  text-decoration: none;
  transition: all 0.28s var(--sh-ease);
}

.sh-ext a:hover {
  border-color: var(--sh-accent);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 24px rgba(122, 88, 48, 0.12);
}

.sh-ext .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  flex: none;
  color: #FFF7EF;
}

.sh-ext .ico.md { background: linear-gradient(135deg, #B8552F, #9A4423); }
.sh-ext .ico.w3 { background: linear-gradient(135deg, #1F6F5C, #145245); }
.sh-ext .ico.rb { background: linear-gradient(135deg, #C9A22E, #A8841E); }
.sh-ext .ico.gh { background: linear-gradient(135deg, #6B4F8A, #523A6B); }
.sh-ext .ico.cu { background: linear-gradient(135deg, #2B251D, #574D40); }
.sh-ext .ico.wd { background: linear-gradient(135deg, #C96B8A, #A84E6C); }

.sh-ext b {
  display: block;
  font-size: 11.5px;
  color: var(--sh-ink);
  line-height: 1.3;
}

.sh-ext span {
  display: block;
  font-size: 10px;
  color: var(--sh-ink-3);
  line-height: 1.3;
}

/* 交互窗口 */
.sh-demo {
  border: 1px solid var(--sh-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sh-paper);
}

.sh-demo-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(184, 85, 47, 0.08), rgba(31, 111, 92, 0.06));
  border-bottom: 1px solid var(--sh-line);
}

.sh-demo-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sh-line-2);
}

.sh-demo-bar i:first-child { background: var(--sh-accent); }
.sh-demo-bar i:nth-child(2) { background: var(--sh-gold); }
.sh-demo-bar i:nth-child(3) { background: var(--sh-teal); }

.sh-demo-bar span {
  margin-left: 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sh-ink-3);
}

.sh-demo-body {
  padding: 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sh-demo-body textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--sh-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  color: var(--sh-ink);
  background: var(--sh-paper-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sh-demo-body textarea:focus {
  border-color: var(--sh-accent);
  box-shadow: 0 0 0 3px var(--sh-accent-soft);
}

.sh-demo-preview {
  min-height: 64px;
  border: 1px dashed var(--sh-line-2);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--sh-ink);
}

.sh-demo-hint {
  font-size: 10px;
  color: var(--sh-ink-3);
  line-height: 1.45;
}

/* 色彩条 / 交互美学强调 */
.sh-chroma {
  display: flex;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.sh-chroma i { flex: 1; }
.sh-chroma i:nth-child(1) { background: #B8552F; }
.sh-chroma i:nth-child(2) { background: #E8A87C; }
.sh-chroma i:nth-child(3) { background: #1F6F5C; }
.sh-chroma i:nth-child(4) { background: #C9A22E; }
.sh-chroma i:nth-child(5) { background: #6B4F8A; }

/* ---------- 主内容标题 ---------- */
.sh-title-wrap {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sh-line);
}

.sh-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--sh-accent);
  margin-bottom: 10px;
}

.sh-kicker::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--sh-accent);
}

.sh-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--sh-ink);
  margin-bottom: 10px;
}

.sh-title .hl {
  background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sh-lead {
  font-size: 14.5px;
  color: var(--sh-ink-2);
  line-height: 1.85;
  max-width: 58ch;
}

.sh-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sh-chip {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--sh-accent-deep);
  background: var(--sh-accent-soft);
  border: 1px solid rgba(184, 85, 47, 0.14);
}

.sh-chip.teal {
  color: var(--sh-teal);
  background: var(--sh-teal-soft);
  border-color: rgba(31, 111, 92, 0.16);
}

.sh-chip.gold {
  color: #8A6D12;
  background: var(--sh-gold-soft);
  border-color: rgba(201, 162, 46, 0.22);
}

/* ---------- 课时卡（章节页） ---------- */
.sh-lessons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sh-lesson {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 18px;
  border-radius: 16px;
  border: 1px solid var(--sh-line);
  background: var(--sh-paper);
  text-decoration: none;
  transition: all 0.35s var(--sh-ease);
  position: relative;
  overflow: hidden;
}

.sh-lesson::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(184, 85, 47, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}

.sh-lesson:hover {
  border-color: rgba(184, 85, 47, 0.4);
  transform: translateY(-3px) translateX(3px);
  box-shadow: 0 18px 40px rgba(122, 88, 48, 0.14);
}

.sh-lesson:hover::before { opacity: 1; }

.sh-lesson-no {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  color: #FFF7EF;
  background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-deep));
  box-shadow: 0 6px 16px rgba(154, 68, 35, 0.22);
}

.sh-lesson h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--sh-ink);
  margin-bottom: 4px;
}

.sh-lesson p {
  font-size: 12.5px;
  color: var(--sh-ink-2);
  line-height: 1.65;
}

.sh-lesson .go {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--sh-accent);
  font-size: 18px;
  transition: transform 0.3s var(--sh-ease);
}

.sh-lesson:hover .go { transform: translateX(4px); }

.sh-lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.sh-lesson-tags i {
  font-style: normal;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sh-paper-2);
  border: 1px solid var(--sh-line);
  color: var(--sh-ink-2);
}

/* ---------- 底部导航（清晰层级） ---------- */
.sh-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--sh-line);
}

.sh-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--sh-line);
  background: var(--sh-paper);
  text-decoration: none;
  transition: all 0.3s var(--sh-ease);
}

.sh-pager a:hover {
  border-color: var(--sh-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(122, 88, 48, 0.1);
}

.sh-pager a.next { text-align: right; }
.sh-pager .lbl {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--sh-ink-3);
}

.sh-pager .ttl {
  font-size: 14px;
  font-weight: 800;
  color: var(--sh-ink);
}

/* ---------- 移动端 ---------- */
.sh-toggle {
  display: inline-flex;
}

@media (max-width: 640px) {
  .sh-side {
    width: min(88vw, 320px);
    top: calc(var(--sh-nav-h) + 4px);
    bottom: 8px;
    border-radius: 18px;
    margin: 0 8px;
    height: auto;
    transform: translateY(110%) scale(0.96);
    opacity: 0;
  }
  .sh-side.left,
  .sh-side.right {
    left: 8px;
    right: 8px;
    width: auto;
  }
  .sh-side.open {
    transform: none;
    opacity: 1;
  }
  .sh-pager { grid-template-columns: 1fr; }
  .sh-lesson { grid-template-columns: 44px 1fr; }
  .sh-lesson .go { display: none; }
  .sh-crumb .hide-sm { display: none; }
  .hide-xs { display: none !important; }
}

@media (max-width: 640px) {
  .sh-pager { grid-template-columns: 1fr; }
  .sh-lesson { grid-template-columns: 44px 1fr; }
  .sh-lesson .go { display: none; }
  .sh-crumb .hide-sm { display: none; }
}

/* 课时正文：保持 learn 样式，仅收紧标题 */
.sh-main .lx-article h1 {
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.03em;
}

.sh-main .lx-article h2 {
  scroll-margin-top: calc(var(--sh-nav-h) + 16px);
}

/* 隐藏 learn.js 顶栏与 landing 顶栏，统一用 sh-top */
.lx-nav, .tpl-nav, .site-nav { display: none !important; }


/* ---------- 搜索浮层 ---------- */
.sh-search { position: relative; }
.sh-search-box {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 86vw);
  background: var(--sh-paper);
  border: 1px solid var(--sh-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(43, 37, 29, 0.16);
  padding: 10px 12px;
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 220;
}
.sh-search-box.open { display: flex; animation: sh-pop .28s var(--sh-ease); }
@keyframes sh-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.sh-search-box svg { color: var(--sh-ink-3); flex: none; }
.sh-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--sh-ink);
  font-family: var(--sh-font, inherit);
}
.sh-search-box kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sh-ink-3);
  border: 1px solid var(--sh-line-2);
  border-radius: 6px;
  padding: 2px 6px;
}
.sh-search-result {
  width: 100%;
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--sh-line);
  margin-top: 8px;
  padding-top: 8px;
}
.sh-search-result a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .2s;
}
.sh-search-result a:hover { background: var(--sh-accent-soft); }
.sh-search-result b { font-size: 13px; color: var(--sh-ink); }
.sh-search-result span { font-size: 11px; color: var(--sh-ink-3); }

/* ---------- 边界热区 ---------- */
.sh-edge {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 120px;
  z-index: 140;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(184,85,47,.08), rgba(184,85,47,.02));
  border: 1px dashed rgba(184,85,47,.25);
  display: grid;
  place-items: center;
  opacity: .45;
  transition: opacity .3s, transform .35s var(--sh-ease), background .3s;
  cursor: pointer;
}
.sh-edge.left { left: 0; }
.sh-edge.right { right: 0; }
.sh-edge span {
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--sh-accent-deep);
  font-weight: 700;
}
.sh-edge:hover {
  opacity: 1;
  background: rgba(184,85,47,.12);
}
.sh-edge.left:hover { transform: translate(4px, -50%); }
.sh-edge.right:hover { transform: translate(-4px, -50%); }

/* ---------- 我的站点 CRUD ---------- */
.sh-mini {
  margin-left: auto;
  border: 1px solid var(--sh-line-2);
  background: var(--sh-paper);
  color: var(--sh-accent-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.sh-mini:hover {
  background: var(--sh-accent);
  color: #fff;
  border-color: var(--sh-accent);
}
.sh-site-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--sh-line);
  background: var(--sh-paper-2);
}
.sh-site-form.open { display: flex; animation: sh-pop .25s var(--sh-ease); }
.sh-site-form h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--sh-ink);
}
.sh-site-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--sh-ink-3);
  font-weight: 600;
}
.sh-site-form input,
.sh-site-form select {
  border: 1px solid var(--sh-line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--sh-ink);
  background: var(--sh-paper);
  outline: none;
}
.sh-site-form input:focus,
.sh-site-form select:focus {
  border-color: var(--sh-accent);
  box-shadow: 0 0 0 3px var(--sh-accent-soft);
}
.sh-form-row { display: flex; gap: 8px; margin-top: 4px; }
.sh-form-row .sh-btn { flex: 1; justify-content: center; }

.sh-site-list { display: flex; flex-direction: column; gap: 6px; }
.sh-ext-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  transition: background .2s;
}
.sh-ext-item:hover { background: var(--sh-accent-softer, rgba(184,85,47,.04)); }
.sh-ext-item .sh-ext-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-decoration: none;
  min-width: 0;
}
.sh-ext-item .ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.sh-ext-item b { display: block; font-size: 12px; color: var(--sh-ink); }
.sh-ext-item span { display: block; font-size: 10px; color: var(--sh-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-ext-ops {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 6px;
}
.sh-ext-ops button {
  border: none;
  background: transparent;
  color: var(--sh-ink-3);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.sh-ext-ops button:hover { color: var(--sh-accent); background: var(--sh-accent-soft); }

.sh-empty {
  font-size: 11.5px;
  color: var(--sh-ink-3);
  text-align: center;
  padding: 14px 8px;
  line-height: 1.6;
}

/* 大纲课时项 */
.sh-les {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  font-size: 11.5px;
  color: var(--sh-ink-2);
  text-decoration: none;
  line-height: 1.45;
  transition: all .22s;
}
.sh-les i {
  font-style: normal;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px;
  color: var(--sh-ink-3);
  padding-top: 2px;
  flex: none;
}
.sh-les:hover {
  background: rgba(31, 111, 92, .08);
  color: var(--sh-teal);
  border-left-color: var(--sh-teal);
}
.sh-les.on {
  background: var(--sh-accent-soft);
  color: var(--sh-accent-deep);
  border-left-color: var(--sh-accent);
  font-weight: 700;
}

.sh-tree {
  max-height: 48vh;
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

@media (max-width: 640px) {
  .sh-search-box { right: auto; left: 0; }
  .sh-edge { display: none; }
}
