/* ============================================================
 * 后台自定义单页面（page.html?slug=xxx）
 * 复用 base.css 的 .wrap/.btn/.brand 等基础件
 * ============================================================ */
.sp-root { background: var(--paper); }

/* ---------- 顶部导航 ---------- */
.sp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 11, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sp-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.sp-nav-actions { display: flex; align-items: center; gap: 22px; }
.sp-back { color: rgba(255, 255, 255, .82); font-size: 14.5px; font-weight: 600; }
.sp-back:hover { color: #fff; }

/* ---------- HERO ---------- */
.sp-hero {
  position: relative; min-height: 46vh; display: flex; align-items: flex-end;
  padding: 96px 0 68px; overflow: hidden;
  background: linear-gradient(135deg, #151638 0%, #2A2E72 52%, #0A0A0B 100%);
}
.sp-hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10, 10, 11, .22), rgba(10, 10, 11, .82));
}
.sp-hero::after {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 90%; z-index: 0;
  background: radial-gradient(38% 55% at 22% 30%, rgba(124, 134, 232, .38), transparent 70%);
  filter: blur(18px);
}
.sp-hero-cover { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; }
.sp-hero-cover.has-cover { filter: saturate(1.05); }
.sp-hero-inner { position: relative; z-index: 2; }
.sp-eyebrow { display: inline-block; color: var(--indigo-2); font-size: 13.5px; font-weight: 700; letter-spacing: .12em; }
.sp-title { font-size: clamp(30px, 4.6vw, 62px); font-weight: 800; line-height: 1.16; color: #fff; margin-top: 14px; max-width: 900px; }
.sp-sub { font-size: clamp(15px, 1.7vw, 20px); line-height: 1.75; color: var(--on-dark-2); margin-top: 16px; max-width: 780px; }
.sp-sub:empty { display: none; }

/* ---------- 正文排版 ---------- */
.sp-main { padding: 72px 0 96px; background: var(--paper); }
.sp-body { max-width: 860px; margin: 0 auto; font-size: 16.5px; line-height: 1.95; color: var(--text-2); }
.sp-body > *:first-child { margin-top: 0; }
.sp-body p { margin: 0 0 20px; }
.sp-body h1, .sp-body h2, .sp-body h3, .sp-body h4, .sp-body h5 { color: var(--text); font-weight: 800; line-height: 1.35; }
.sp-body h1 { font-size: 32px; margin: 44px 0 18px; }
.sp-body h2 { font-size: 26px; margin: 42px 0 16px; padding-left: 14px; border-left: 4px solid var(--indigo); }
.sp-body h3 { font-size: 21px; margin: 34px 0 14px; }
.sp-body h4 { font-size: 18px; margin: 28px 0 12px; }
.sp-body h5 { font-size: 16px; margin: 24px 0 10px; }
.sp-body strong, .sp-body b { color: var(--text); font-weight: 700; }
.sp-body a { color: var(--indigo); text-decoration: underline; text-underline-offset: 3px; }
.sp-body a:hover { color: #6B76E0; }
.sp-body ul, .sp-body ol { margin: 0 0 22px; padding-left: 26px; }
.sp-body li { margin: 7px 0; }
.sp-body li::marker { color: var(--indigo); }
.sp-body blockquote {
  margin: 26px 0; padding: 16px 22px; border-left: 4px solid var(--indigo-2);
  background: #F5F6FC; border-radius: 0 10px 10px 0; color: var(--text-2);
}
.sp-body blockquote p:last-child { margin-bottom: 0; }
.sp-body hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.sp-body img {
  display: block; max-width: 100%; height: auto; margin: 26px auto;
  border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 20, 40, .10);
  cursor: zoom-in;
}
.sp-body figure { margin: 26px 0; }
.sp-body figcaption { text-align: center; font-size: 13.5px; color: var(--text-3); margin-top: 8px; }
.sp-body pre, .sp-body code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; }
.sp-body pre { background: var(--ink-2); color: #E6E8F0; padding: 18px 22px; border-radius: 10px; overflow-x: auto; }
.sp-body code { background: #F1F2F6; padding: 2px 6px; border-radius: 5px; }
.sp-body pre code { background: none; padding: 0; }
.sp-body table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 15px; }
.sp-body th, .sp-body td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.sp-body th { background: #F5F6FC; color: var(--text); font-weight: 700; }
.sp-body div, .sp-body span { max-width: 100%; }
.sp-state { padding: 64px 20px; text-align: center; color: var(--text-3); font-size: 15px; }
.sp-state.err { color: #B42318; }

/* ---------- 底部 CTA / 页脚 ---------- */
.sp-foot-cta {
  max-width: 860px; margin: 64px auto 0; padding: 30px 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, #F2F3FC, #FAFAFE);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  font-size: 16px; font-weight: 600; color: var(--text-2);
}
.sp-footer { background: var(--ink); color: var(--on-dark-4); padding: 26px 0; font-size: 13.5px; }
.sp-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sp-footer a { color: var(--on-dark-2); }
.sp-footer a:hover { color: #fff; }

/* ---------- 图片灯箱 ---------- */
.sp-lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 40px;
  background: rgba(8, 8, 12, .9); cursor: zoom-out;
}
.sp-lightbox.open { display: flex; }
.sp-lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* ---------- 结构化正文版式（后台富文本可保留的固定 class） ---------- */
.sp-body p.sp-lead {
  font-size: 19px; line-height: 1.9; color: var(--text); font-weight: 500;
  padding: 20px 26px; margin: 0 0 34px;
  background: linear-gradient(120deg, #F4F5FD, #FBFBFF);
  border: 1px solid #E3E6F7; border-left: 4px solid var(--indigo);
  border-radius: 0 14px 14px 0;
}
.sp-body .sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 26px 0 34px; }
.sp-body .sp-card {
  padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, #FFFFFF, #FAFAFE);
  box-shadow: 0 4px 18px rgba(16, 20, 40, .04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.sp-body .sp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(16, 20, 40, .09); border-color: #CFD4F5; }
.sp-body .sp-card h3 { font-size: 17.5px; margin: 0 0 10px; color: var(--text); }
.sp-body .sp-card h3::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 9px; vertical-align: middle; border-radius: 2px; background: var(--indigo); }
.sp-body .sp-card p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--text-2); }
.sp-body .sp-steps { margin: 26px 0 36px; padding-left: 8px; border-left: 2px solid #E1E4F5; }
.sp-body .sp-step { display: flex; gap: 18px; padding: 0 0 22px 20px; position: relative; }
.sp-body .sp-step:last-child { padding-bottom: 0; }
.sp-body .sp-step::before {
  content: ''; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--indigo); box-shadow: 0 0 0 4px #EEF0FC;
}
.sp-body .sp-step-n {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; background: #EEF0FC;
  color: var(--indigo); font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.sp-body .sp-step h3 { font-size: 17px; margin: 4px 0 6px; }
.sp-body .sp-step p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--text-2); }
.sp-body .sp-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 32px; }
.sp-body .sp-pill {
  display: inline-block; padding: 6px 15px; border-radius: 999px;
  background: #F1F2FC; border: 1px solid #E0E3F6; color: #454B8C;
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
}
.sp-body blockquote.sp-note {
  margin: 30px 0; padding: 18px 24px; border-left: 4px solid #E0A53B;
  background: linear-gradient(100deg, #FFF9EC, #FFFDF7);
  border-radius: 0 12px 12px 0; color: #7A5A21;
}
.sp-body blockquote.sp-note p { margin: 0; font-size: 15px; }
.sp-body .sp-cta {
  margin: 44px 0 8px; padding: 30px 34px; border-radius: 16px;
  background: linear-gradient(125deg, #1C2050, #2E3278 58%, #151638);
  color: #E8EAF8;
}
.sp-body .sp-cta p { margin: 0 0 12px; font-size: 16px; line-height: 1.8; }
.sp-body .sp-cta p:last-child { margin-bottom: 0; }
.sp-body .sp-cta a {
  display: inline-block; padding: 10px 22px; border-radius: 10px;
  background: #fff; color: #23275F; font-weight: 700; font-size: 14.5px; text-decoration: none;
}
.sp-body .sp-cta a:hover { background: #EAECFF; color: #23275F; }
.sp-body .sp-kicker { font-size: 13px; letter-spacing: .14em; color: var(--indigo); font-weight: 700; }
.sp-body .sp-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sp-body table th { background: #F1F2FB; }

/* ---------- 超管：单页面内编辑 ---------- */
.sp-root [hidden] { display: none !important; }
.sp-editbar {
  position: sticky; top: 68px; z-index: 99;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; background: rgba(20, 22, 54, .96); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 6px 20px rgba(10, 12, 30, .16);
}
.sp-editbar .wrap-inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-edit-tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #AEB6FF; margin-right: 4px; }
.sp-edit-as { font-size: 12.5px; color: #C9CFFF; font-weight: 600; }
.sp-ebtn-ghost { background: transparent; border-color: rgba(255, 255, 255, .3); color: #E7E9FF; }
.sp-ebtn-ghost:hover { background: rgba(255, 255, 255, .12); }
.sp-ebtn {
  padding: 7px 15px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08); color: #F2F3FF; font-size: 13.5px;
  font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.4;
}
.sp-ebtn:hover { background: rgba(255, 255, 255, .18); }
.sp-ebtn.primary { background: #5B63D3; border-color: #5B63D3; }
.sp-ebtn.primary:hover { background: #6C74E8; }
.sp-ebtn:disabled { opacity: .55; cursor: not-allowed; }
.sp-edit-msg { margin-left: auto; font-size: 13px; color: #C9CFFF; }
.sp-edit-msg.ok { color: #7FE2A8; }
.sp-edit-msg.err { color: #FFB4A8; }

.sp-toolbar {
  position: sticky; top: 122px; z-index: 98;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 24px; background: #F7F8FE; border-bottom: 1px solid var(--line);
}
.sp-toolbar .wrap-inner { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-toolbar button, .sp-toolbar label {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.sp-toolbar button:hover, .sp-toolbar label:hover { border-color: var(--indigo); color: var(--indigo); }
.sp-toolbar .tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.sp-toolbar .tb-hint { margin-left: auto; font-size: 12.5px; color: var(--text-3); }

.sp-editing .sp-title[contenteditable], .sp-editing .sp-sub[contenteditable], .sp-editing .sp-body[contenteditable] {
  outline: 2px dashed #9AA2EE; outline-offset: 6px; background: rgba(124, 134, 232, .045);
  border-radius: 4px;
}
.sp-editing .sp-body[contenteditable] { padding: 18px 22px; }
.sp-editing .sp-body img { cursor: default; }
.sp-editing .sp-sub:empty { display: block; min-height: 1.7em; }
.sp-editing .sp-sub:empty::before { content: '填写副标题（可留空）'; color: rgba(255, 255, 255, .45); }
.sp-editing .sp-title:empty::before { content: '填写页面标题'; color: rgba(255, 255, 255, .5); }

@media (max-width: 760px) {
  .sp-hero { min-height: 38vh; padding: 72px 0 48px; }
  .sp-main { padding: 48px 0 68px; }
  .sp-body { font-size: 15.5px; }
  .sp-nav-actions .btn { display: none; }
  .sp-foot-cta { padding: 24px; }
  .sp-body .sp-grid, .sp-body .sp-2col { grid-template-columns: 1fr; }
  .sp-body p.sp-lead { font-size: 17px; padding: 16px 18px; }
  .sp-body .sp-cta { padding: 24px; }
  .sp-editbar { top: 68px; }
  .sp-toolbar { top: 116px; }
  .sp-edit-msg { width: 100%; margin-left: 0; }
}
