/* =========================================================
   shell-premium.css — 侧栏 / 导航 / 边界 / 转场
   暖纸 × 墨色玻璃 × 弹簧物理 × 流体光
   ========================================================= */

/* 全局约束内联 SVG，避免撑爆布局 */
.sx-top svg,
.sx-side svg,
.sx-search-pop svg,
.sx-edge svg {
  width: 1em;
  height: 1em;
  max-width: 18px;
  max-height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.sx-icon svg,
.sx-close svg,
.sx-ch-go svg {
  width: 17px;
  height: 17px;
  max-width: 17px;
  max-height: 17px;
}

:root {
  --sx-bg: #0f0e0c;
  --sx-bg-2: #1a1714;
  --sx-glass: rgba(22, 19, 16, 0.82);
  --sx-glass-2: rgba(32, 27, 22, 0.92);
  --sx-line: rgba(247, 241, 232, 0.08);
  --sx-line-2: rgba(247, 241, 232, 0.14);
  --sx-ink: #f7f1e8;
  --sx-ink-2: rgba(247, 241, 232, 0.62);
  --sx-ink-3: rgba(247, 241, 232, 0.38);
  --sx-accent: #e8a87c;
  --sx-accent-2: #c86035;
  --sx-teal: #5eead4;
  --sx-gold: #f0d9a8;
  --sx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sx-spring: cubic-bezier(0.34, 1.45, 0.44, 1);
  --sx-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --sx-nav-h: 64px;
  --sx-side-w: 340px;
}

/* ---------- Splash ---------- */
.sx-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(200, 96, 53, 0.18), transparent 60%),
    var(--sx-bg);
  transition: opacity 0.7s var(--sx-soft), visibility 0.7s;
}

.sx-splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sx-splash-inner {
  text-align: center;
  color: var(--sx-ink);
}

.sx-splash-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(145deg, var(--sx-accent-2), #9a4423);
  box-shadow: 0 24px 60px rgba(200, 96, 53, 0.35);
  animation: sx-float 2.2s var(--sx-soft) infinite alternate;
}

@keyframes sx-float {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-10px) scale(1.04); }
}

.sx-splash-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.sx-splash-sub {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--sx-ink-3);
  margin-bottom: 28px;
}

.sx-splash-bar {
  width: 160px;
  height: 2px;
  margin: 0 auto;
  background: var(--sx-line-2);
  border-radius: 2px;
  overflow: hidden;
}

.sx-splash-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sx-accent-2), var(--sx-accent));
  border-radius: 2px;
  animation: sx-load 1.15s var(--sx-soft) forwards;
}

@keyframes sx-load {
  to { width: 100%; }
}

/* ---------- 顶栏：纯图标 ---------- */
.sx-top {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--sx-nav-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(250, 245, 236, 0.72);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border-bottom: 1px solid rgba(43, 37, 29, 0.08);
}

.sx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--sx-ink-dark, #2b251d);
  flex: none;
}

.sx-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #fff7ef;
  background: linear-gradient(145deg, var(--sx-accent-2), #9a4423);
  box-shadow: 0 10px 28px rgba(154, 68, 35, 0.28);
}

.sx-brand-text {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  color: #2b251d;
}

.sx-brand-text small {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #8b7e6c;
  font-weight: 500;
}

.sx-crumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8b7e6c;
  min-width: 0;
  overflow: hidden;
}

.sx-crumb a {
  color: #574d40;
  text-decoration: none;
  white-space: nowrap;
}

.sx-crumb a:hover { color: var(--sx-accent-2); }
.sx-crumb .here {
  color: var(--sx-accent-2);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* 纯图标按钮 + 气泡提示 */
.sx-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(43, 37, 29, 0.1);
  background: rgba(255, 253, 248, 0.8);
  color: #574d40;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.45s var(--sx-spring), background 0.25s, color 0.25s,
    border-color 0.25s, box-shadow 0.35s;
  overflow: visible;
}

.sx-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.sx-icon:hover {
  transform: translateY(-2px) scale(1.06);
  background: #fffdf8;
  color: var(--sx-accent-2);
  border-color: rgba(200, 96, 53, 0.35);
  box-shadow: 0 12px 28px rgba(122, 88, 48, 0.12);
}

.sx-icon:active {
  transform: scale(0.95);
  transition-duration: 0.12s;
}

.sx-icon.on {
  background: var(--sx-accent-2);
  border-color: transparent;
  color: #fff7ef;
  box-shadow: 0 10px 26px rgba(200, 96, 53, 0.35);
}

.sx-icon .tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px) scale(0.94);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--sx-bg);
  color: var(--sx-ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--sx-spring);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.sx-icon .tip::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-bottom-color: var(--sx-bg);
  border-top: none;
}

.sx-icon:hover .tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.sx-icon.primary {
  background: linear-gradient(145deg, var(--sx-accent-2), #9a4423);
  border-color: transparent;
  color: #fff7ef;
  box-shadow: 0 10px 26px rgba(200, 96, 53, 0.28);
}

/* ---------- 布局：内容不被挤 ---------- */
.sx-layout {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  min-height: calc(100vh - var(--sx-nav-h));
}

.sx-main {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 36px) 80px;
}

/* ---------- 浮层侧栏（墨色玻璃） ---------- */
.sx-side {
  position: fixed;
  top: 12px;
  bottom: 12px;
  width: min(var(--sx-side-w), 92vw);
  z-index: 220;
  border-radius: 22px;
  background: var(--sx-glass-2);
  border: 1px solid var(--sx-line-2);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform 0.7s var(--sx-spring),
    opacity 0.45s var(--sx-soft),
    visibility 0.45s;
  visibility: hidden;
  opacity: 0;
}

.sx-side.left {
  left: 12px;
  transform: translateX(-120%) rotateY(12deg) scale(0.96);
  transform-origin: left center;
}

.sx-side.right {
  right: 12px;
  transform: translateX(120%) rotateY(-12deg) scale(0.96);
  transform-origin: right center;
}

.sx-side.open {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.sx-side-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 14px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 241, 232, 0.15) transparent;
}

.sx-side-scroll::-webkit-scrollbar { width: 6px; }
.sx-side-scroll::-webkit-scrollbar-thumb {
  background: rgba(247, 241, 232, 0.18);
  border-radius: 8px;
}

.sx-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 8px;
  flex: none;
}

.sx-side-head h2 {
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-ink);
}

.sx-side-head .tag {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--sx-accent);
  background: rgba(232, 168, 124, 0.12);
  border: 1px solid rgba(232, 168, 124, 0.18);
  padding: 3px 8px;
  border-radius: 999px;
}

.sx-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(247, 241, 232, 0.18);
  background: rgba(247, 241, 232, 0.1);
  color: var(--sx-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.35s var(--sx-spring);
}

.sx-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sx-close:hover {
  transform: rotate(90deg) scale(1.06);
  background: rgba(232, 168, 124, 0.22);
  border-color: rgba(232, 168, 124, 0.4);
  color: var(--sx-accent);
}

/* ---------- 课程树：宽敞 · 弹簧 ---------- */
.sx-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.sx-ch {
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(247, 241, 232, 0.03);
  transition:
    background 0.35s var(--sx-soft),
    border-color 0.35s,
    transform 0.5s var(--sx-spring),
    box-shadow 0.45s;
  will-change: transform;
}

.sx-ch:hover {
  background: rgba(247, 241, 232, 0.06);
  border-color: var(--sx-line);
  transform: translateX(3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.sx-ch.open {
  background: rgba(232, 168, 124, 0.1);
  border-color: rgba(232, 168, 124, 0.22);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.sx-ch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  min-height: 52px;
}

.sx-ch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--sx-ink);
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.sx-ch-no {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  color: var(--sx-accent);
  background: rgba(232, 168, 124, 0.1);
  border: 1px solid rgba(232, 168, 124, 0.14);
  flex: none;
  transition: all 0.45s var(--sx-spring);
}

.sx-ch.open .sx-ch-no,
.sx-ch:hover .sx-ch-no {
  background: linear-gradient(145deg, var(--sx-accent-2), #9a4423);
  color: #fff7ef;
  border-color: transparent;
  transform: scale(1.05) rotate(-3deg);
}

.sx-ch-title {
  flex: 1;
  min-width: 0;
}

.sx-ch-title b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-ch-title span {
  display: block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sx-ink-3);
  margin-top: 2px;
}

.sx-ch-go {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--sx-line);
  background: rgba(247, 241, 232, 0.05);
  color: var(--sx-ink-2);
  display: grid;
  place-items: center;
  text-decoration: none;
  opacity: 0;
  transform: translateX(8px) scale(0.9);
  transition: all 0.45s var(--sx-spring);
  pointer-events: none;
}

.sx-ch:hover .sx-ch-go,
.sx-ch:focus-within .sx-ch-go {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.sx-ch-go:hover {
  background: var(--sx-accent-2);
  border-color: transparent;
  color: #fff;
  transform: scale(1.08) rotate(-6deg);
}

.sx-ch-go svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* 子课时 */
.sx-ch-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--sx-soft);
  padding: 0 12px;
}

.sx-ch.open .sx-ch-items {
  grid-template-rows: 1fr;
  padding-bottom: 12px;
}

.sx-ch-items > div {
  overflow: hidden;
  min-height: 0;
}

.sx-les {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 3px;
  border-radius: 11px;
  color: var(--sx-ink-2);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 0.35s var(--sx-soft);
}

.sx-les i {
  font-style: normal;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--sx-ink-3);
  width: 18px;
  flex: none;
}

.sx-les:hover {
  background: rgba(247, 241, 232, 0.06);
  color: var(--sx-ink);
  border-left-color: var(--sx-accent);
  transform: translateX(4px);
}

.sx-les.on {
  background: linear-gradient(90deg, rgba(232, 168, 124, 0.22), rgba(232, 168, 124, 0.1));
  color: var(--sx-ink);
  border-left-color: var(--sx-accent);
  border-left-width: 3px;
  font-weight: 700;
  box-shadow:
    0 0 0 1px rgba(232, 168, 124, 0.18),
    0 8px 24px rgba(232, 168, 124, 0.12);
  transform: translateX(2px);
}

.sx-les.on i {
  color: var(--sx-accent);
  font-weight: 800;
}

.sx-les.on span {
  letter-spacing: 0.01em;
}

/* ---------- 右栏页签 ---------- */
.sx-rtabs {
  display: flex;
  gap: 4px;
  margin: 4px 14px 12px;
  padding: 4px;
  background: rgba(247, 241, 232, 0.05);
  border: 1px solid var(--sx-line);
  border-radius: 14px;
}

.sx-rtab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--sx-ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 9px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.35s var(--sx-spring);
}

.sx-rtab:hover {
  color: var(--sx-ink);
  background: rgba(247, 241, 232, 0.05);
}

.sx-rtab.on {
  background: rgba(247, 241, 232, 0.1);
  color: var(--sx-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sx-rpane {
  display: none;
  animation: sx-pane 0.45s var(--sx-soft);
}

.sx-rpane.on { display: block; }

@keyframes sx-pane {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.sx-card {
  background: rgba(247, 241, 232, 0.04);
  border: 1px solid var(--sx-line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}

.sx-card h3 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sx-ink-3);
  margin-bottom: 10px;
  padding: 0 4px;
}

/* 摘要面板：铺满侧栏，去掉内嵌小框 */
.sx-rpane[data-rpane="sum"] {
  display: none;
  min-height: 100%;
}

.sx-rpane[data-rpane="sum"].on {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sx-rpane[data-rpane="sum"] .sx-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 2px 8px;
  margin: 0;
  min-height: 0;
}

.sx-rpane[data-rpane="sum"] .sx-card h3 {
  padding: 0 8px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--sx-line);
  letter-spacing: 0.16em;
}

.sx-points {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: none;
  overflow: visible;
  overscroll-behavior: contain;
  flex: 1;
  padding: 4px 2px 12px;
}

.sx-points a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 10px;
  border-radius: 12px;
  color: var(--sx-ink-2);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: all 0.35s var(--sx-soft);
}

.sx-points a:hover {
  background: rgba(247, 241, 232, 0.07);
  color: var(--sx-ink);
  transform: translateX(3px);
}

.sx-points a.on {
  background: rgba(232, 168, 124, 0.14);
  color: var(--sx-accent);
}

.sx-points .idx {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--sx-ink-3);
  padding-top: 2px;
  min-width: 1.6em;
}

/* 扩展链接 */
.sx-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 13px;
  text-decoration: none;
  color: var(--sx-ink);
  transition: all 0.4s var(--sx-spring);
  border: 1px solid transparent;
}

.sx-link:hover {
  background: rgba(247, 241, 232, 0.06);
  border-color: var(--sx-line);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.sx-link .ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex: none;
}

.sx-link b {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.sx-link span {
  display: block;
  font-size: 10px;
  color: var(--sx-ink-3);
}

.sx-mini {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--sx-line);
  background: rgba(247, 241, 232, 0.05);
  color: var(--sx-accent);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.35s var(--sx-spring);
}

.sx-mini:hover {
  background: var(--sx-accent-2);
  color: #fff;
  transform: rotate(90deg) scale(1.08);
}

/* 表单 */
.sx-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin: 8px 0 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sx-line);
}

.sx-form.open {
  display: flex;
  animation: sx-pane 0.35s var(--sx-soft);
}

.sx-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-ink-3);
}

.sx-form input,
.sx-form select {
  border: 1px solid var(--sx-line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--sx-ink);
  background: rgba(247, 241, 232, 0.05);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.sx-form input:focus,
.sx-form select:focus {
  border-color: rgba(232, 168, 124, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.12);
}

.sx-form-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.sx-btn {
  flex: 1;
  border-radius: 11px;
  border: 1px solid var(--sx-line);
  background: rgba(247, 241, 232, 0.06);
  color: var(--sx-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  transition: all 0.35s var(--sx-spring);
}

.sx-btn.primary {
  background: linear-gradient(145deg, var(--sx-accent-2), #9a4423);
  border-color: transparent;
  color: #fff;
}

.sx-btn:hover { transform: translateY(-1px); }

.sx-site-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.sx-site-row .ops {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sx-site-row .ops button {
  border: none;
  background: transparent;
  color: var(--sx-ink-3);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.25s;
}

.sx-site-row .ops button:hover {
  color: var(--sx-accent);
  background: rgba(232, 168, 124, 0.12);
}

/* ---------- 边界流体 ---------- */
.sx-edge {
  position: fixed;
  top: 15%;
  bottom: 15%;
  width: 28px;
  z-index: 210;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
}

.sx-edge.armed {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.sx-edge.left { left: 0; }
.sx-edge.right { right: 0; }

.sx-edge .glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(232, 168, 124, calc(var(--e, 0) * 0.55)),
    rgba(232, 168, 124, 0)
  );
  filter: blur(8px);
  border-radius: 0 20px 20px 0;
  transition: opacity 0.12s linear;
}

.sx-edge.right .glow {
  background: linear-gradient(
    270deg,
    rgba(94, 234, 212, calc(var(--e, 0) * 0.5)),
    rgba(94, 234, 212, 0)
  );
  border-radius: 20px 0 0 20px;
}

.sx-edge .rail {
  position: absolute;
  top: 10%;
  bottom: 10%;
  width: 2px;
  border-radius: 2px;
  background: rgba(247, 241, 232, 0.12);
  overflow: hidden;
}

.sx-edge.left .rail { right: 6px; }
.sx-edge.right .rail { left: 6px; }

.sx-edge .rail i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 22%;
  top: 0;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--sx-accent),
    var(--sx-gold),
    var(--sx-accent),
    transparent
  );
  transform: translateY(calc(var(--e, 0) * 320%));
  filter: blur(calc(2px - var(--e, 0) * 2px));
  box-shadow: 0 0 18px rgba(232, 168, 124, calc(var(--e, 0) * 0.7));
  transition: transform 0.12s linear, filter 0.12s, box-shadow 0.12s;
}

.sx-edge.right .rail i {
  background: linear-gradient(
    180deg,
    transparent,
    var(--sx-teal),
    #fff,
    var(--sx-teal),
    transparent
  );
  box-shadow: 0 0 18px rgba(94, 234, 212, calc(var(--e, 0) * 0.65));
}

.sx-edge .label {
  position: absolute;
  top: 50%;
  writing-mode: vertical-rl;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(247, 241, 232, calc(0.2 + var(--e, 0) * 0.8));
  transform: translateY(-50%);
  pointer-events: none;
}

.sx-edge.left .label { left: 8px; }
.sx-edge.right .label {
  right: 8px;
  transform: translateY(-50%) rotate(180deg);
  color: rgba(94, 234, 212, calc(0.2 + var(--e, 0) * 0.8));
}

/* 遮罩 */
.sx-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 14, 12, 0.35);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.sx-veil.show {
  opacity: 1;
  visibility: visible;
}

/* 搜索浮层 */
.sx-search-pop {
  position: fixed;
  top: calc(var(--sx-nav-h) + 12px);
  right: 20px;
  width: min(380px, 92vw);
  z-index: 240;
  border-radius: 18px;
  background: var(--sx-glass-2);
  border: 1px solid var(--sx-line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: all 0.45s var(--sx-spring);
}

.sx-search-pop.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sx-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.sx-search-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--sx-ink);
  font-size: 15px;
}

.sx-search-row input::placeholder {
  color: var(--sx-ink-3);
}

.sx-search-list {
  max-height: 300px;
  overflow: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sx-search-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--sx-ink);
  transition: background 0.25s;
}

.sx-search-list a:hover {
  background: rgba(232, 168, 124, 0.12);
}

.sx-search-list b {
  font-size: 13px;
}

.sx-search-list span {
  font-size: 11px;
  color: var(--sx-ink-3);
}

@media (max-width: 720px) {
  .sx-edge { display: none; }
  .sx-side {
    top: 8px;
    bottom: 8px;
    left: 8px !important;
    right: 8px !important;
    width: auto;
    transform: translateY(30px) scale(0.97);
  }
  .sx-side.left,
  .sx-side.right {
    transform: translateY(30px) scale(0.97);
    rotate: none;
  }
  .sx-side.open {
    transform: none;
  }
}


/* ========== 右侧分段导航（对齐首页） ========== */
.sx-seg {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 190;
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: min(48vh, 420px);
  pointer-events: none;
}

.sx-seg-track {
  width: 2px;
  background: rgba(43, 37, 29, 0.12);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.sx-seg-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--sx-scroll, 0) * 100%);
  background: linear-gradient(180deg, #E8A87C, #B8552F, #9A4423);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(184, 85, 47, 0.35);
  transition: height 0.15s linear;
}

.sx-seg-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  pointer-events: auto;
}

.sx-seg-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(43, 37, 29, 0.38);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s;
  padding: 4px 0;
}

.sx-seg-list li i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(43, 37, 29, 0.28);
  background: transparent;
  flex: none;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.44, 1);
}

.sx-seg-list li span {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.34, 1.3, 0.44, 1);
  font-size: 10px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sx-seg-list li:hover span,
.sx-seg-list li.on span {
  opacity: 1;
  transform: none;
}

.sx-seg-list li:hover { color: #B8552F; }
.sx-seg-list li:hover i { border-color: #B8552F; transform: scale(1.2); }

.sx-seg-list li.on {
  color: #9A4423;
  font-weight: 700;
}

.sx-seg-list li.on i {
  border-color: #B8552F;
  background: #B8552F;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(184, 85, 47, 0.18);
}

@media (max-width: 900px) {
  .sx-seg { display: none; }
}


/* 分段导航：纯圆点 · 贴右 · 不挡正文 */
.sx-seg {
  right: 6px !important;
  width: 18px;
  gap: 8px !important;
}
.sx-seg-list {
  gap: 10px;
  align-items: center;
}
.sx-seg-list li {
  width: 18px;
  height: 18px;
  padding: 0;
  justify-content: center;
}
.sx-seg-list li i {
  width: 8px;
  height: 8px;
}
.sx-seg-list li span { display: none !important; }
.sx-seg-list li:hover i,
.sx-seg-list li.on i {
  width: 10px;
  height: 10px;
}


.sx-seg { z-index: 230 !important; pointer-events: auto !important; }
.sx-seg-list li { pointer-events: auto; }
.sx-seg-list li i { pointer-events: none; }


/* 顶栏中部 · 横向分段导航 */
.sx-seg-top {
  position: static !important;
  top: auto !important;
  right: auto !important;
  /* transform used for center align */
  height: auto !important;
  width: auto !important;
  max-width: min(520px, 42vw);
  flex: 1 1 auto;
  display: flex !important;
  align-items: center;
  gap: 10px;
  z-index: auto !important;
  pointer-events: auto !important;
  min-width: 0;
}
.sx-seg-top .sx-seg-track {
  width: 100%;
  max-width: 120px;
  height: 3px;
  flex: 0 1 120px;
  min-width: 48px;
}
.sx-seg-top .sx-seg-fill {
  height: 100% !important;
  top: 0;
  left: 0;
}
.sx-seg-top .sx-seg-list {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: none;
}
.sx-seg-top .sx-seg-list::-webkit-scrollbar { display: none; }
.sx-seg-top .sx-seg-list li {
  width: auto !important;
  height: auto !important;
  padding: 5px 10px;
  border-radius: 999px;
  gap: 6px;
  justify-content: flex-start;
  background: transparent;
  transition: background .25s, color .25s;
}
.sx-seg-top .sx-seg-list li span {
  display: block !important;
  opacity: 1 !important;
  /* transform used for center align */
  max-width: 96px;
  font-size: 11px;
  white-space: nowrap;
}
.sx-seg-top .sx-seg-list li i {
  width: 6px !important;
  height: 6px !important;
}
.sx-seg-top .sx-seg-list li:hover {
  background: rgba(184, 85, 47, 0.1);
  color: #B8552F;
}
.sx-seg-top .sx-seg-list li.on {
  background: rgba(184, 85, 47, 0.14);
  color: #9A4423;
}
.sx-seg-top .sx-seg-list li.on i {
  background: #B8552F !important;
  border-color: #B8552F !important;
  box-shadow: 0 0 0 3px rgba(184, 85, 47, 0.15);
}
@media (max-width: 960px) {
  .sx-seg-top { display: none !important; }
}


/* 分段：仅当前项显示文字，其余圆点 */
.sx-seg-top {
  max-width: min(420px, 38vw) !important;
  justify-content: center;
}
.sx-seg-top .sx-seg-list {
  justify-content: center;
  gap: 6px;
}
.sx-seg-top .sx-seg-list li {
  width: 10px !important;
  height: 10px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  overflow: hidden;
  max-width: 10px;
  background: rgba(43, 37, 29, 0.08) !important;
  transition: max-width 0.45s cubic-bezier(0.34, 1.25, 0.44, 1),
    width 0.45s cubic-bezier(0.34, 1.25, 0.44, 1),
    background 0.3s, color 0.3s, padding 0.35s;
}
.sx-seg-top .sx-seg-list li i {
  display: none !important;
}
.sx-seg-top .sx-seg-list li span {
  display: block !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  transition: max-width 0.45s cubic-bezier(0.34, 1.25, 0.44, 1),
    opacity 0.3s, margin 0.35s;
}
.sx-seg-top .sx-seg-list li.on {
  width: auto !important;
  max-width: 180px !important;
  padding: 6px 12px !important;
  background: rgba(184, 85, 47, 0.14) !important;
  color: #9A4423;
}
.sx-seg-top .sx-seg-list li.on span {
  max-width: 140px !important;
  opacity: 1 !important;
}
.sx-seg-top .sx-seg-list li:hover:not(.on) {
  background: rgba(184, 85, 47, 0.2) !important;
  transform: scale(1.15);
}


/* 进度条在圆点正下方 · 整体居中 · 丝滑 */
.sx-seg-top {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  max-width: min(480px, 46vw) !important;
}
.sx-seg-top .sx-seg-list {
  order: 1;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 7px;
}
.sx-seg-top .sx-seg-track {
  order: 2;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  height: 3px !important;
  min-width: 0;
  border-radius: 999px;
}
.sx-seg-top .sx-seg-fill {
  height: 100% !important;
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.sx-seg-top .sx-seg-list li {
  transition:
    max-width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s,
    color 0.3s,
    transform 0.4s cubic-bezier(0.34, 1.35, 0.44, 1) !important;
}
.sx-seg-top .sx-seg-list li span {
  transition:
    max-width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    color 0.3s !important;
}
.sx-seg-top .sx-seg-list li:hover:not(.on) {
  transform: scale(1.2);
}



/* 边界提示文字 · 故障抖动，引鼠标靠近 */
.sx-edge .label {
  animation: sx-edge-glitch 3.6s steps(1, end) infinite;
}
.sx-edge.armed .label {
  animation: none !important;
  text-shadow: none !important;
}
@keyframes sx-edge-glitch {
  0%, 55%, 100% {
    opacity: calc(0.35 + var(--e, 0) * 0.65);
    filter: none;
    text-shadow: none;
  }
  56% {
    opacity: 0.95;
    filter: blur(0.3px);
    text-shadow: 2px 0 rgba(232, 168, 124, 0.7);
  }
  58% {
    text-shadow: -2px 0 rgba(200, 96, 53, 0.6);
  }
  60% {
    filter: none;
    text-shadow: none;
  }
}


/* 标题文字为水平中心轴 */
.sx-seg-top .sx-seg-list {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 10px;
}
.sx-seg-top .sx-seg-side {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.sx-seg-top .sx-seg-side.left { justify-content: flex-end; }
.sx-seg-top .sx-seg-side.right { justify-content: flex-start; }
.sx-seg-top .sx-seg-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(43, 37, 29, 0.1);
  cursor: pointer;
  flex: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.35, 0.44, 1), background 0.25s;
}
.sx-seg-top .sx-seg-dot:hover {
  background: rgba(184, 85, 47, 0.35);
  transform: scale(1.25);
}
.sx-seg-top .sx-seg-dot i { display: none; }
.sx-seg-top .sx-seg-cur {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(184, 85, 47, 0.12);
  color: #9A4423;
  cursor: pointer;
  transition: background 0.3s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sx-seg-top .sx-seg-cur::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #B8552F;
  box-shadow: 0 0 0 3px rgba(184, 85, 47, 0.15);
}
.sx-seg-top .sx-seg-txt {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.35s;
}


.sx-seg-top .sx-seg-cur {
  padding: 6px 12px !important;
}
.sx-seg-top .sx-seg-cur::before {
  left: -13px !important;
}


/* 跳转遮罩：显示目标页标题 */
.sx-mask-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(320px, 80vw);
}
.sx-mask-label {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: rgba(247, 241, 232, 0.4);
}
.sx-mask-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #F7F1E8;
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.34, 1.25, 0.44, 1);
}
.sx-mask-title.show {
  opacity: 1;
  transform: none;
}
.sx-mask-bar {
  width: min(220px, 55vw);
  height: 2px;
  background: rgba(247, 241, 232, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.sx-mask-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, #C86035, #E8A87C);
  animation: sx-mask-load 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sx-mask-load {
  from { width: 0; }
  to { width: 100%; }
}


.sx-mask {
  display: flex !important;
  align-items: center;
  justify-content: center;
}


/* 纠正：当前标题始终可见（覆盖旧 li span 零宽规则） */
.sx-seg-top .sx-seg-list li span,
.sx-seg-top .sx-seg-txt {
  max-width: 160px !important;
  opacity: 1 !important;
  display: block !important;
  width: auto !important;
}
.sx-seg-top .sx-seg-cur {
  width: auto !important;
  max-width: none !important;
}
