/* ============================================================
   Leonis AI 中转站 · 全站推广位样式（P1 / P2 / P3 / P4 / P5）
   ------------------------------------------------------------
   设计原则：
   1. 圆角 / 阴影 / 字体 / 文字色一律复用本站 styles.css 的设计令牌
      （--radius-* / --shadow-* / --ink-* / --line / --surface），
      不引入外来风格，也不改动任何既有选择器。
   2. 本站主色是蓝色系（--brand-*），Leonis 用金色渐变作为「合作推荐」
      的独立识别色，与站内自营业务（代充值 / 成品账号）在视觉上分区，
      读者一眼能看出这是并列的第三条路，而不是站内商品。
   3. 站点固定浅色（:root 声明了 color-scheme: light，全站无深色变体），
      因此这里刻意不写 prefers-color-scheme: dark 覆盖——否则系统深色下
      只有推广位变深，会与页面其余部分割裂。
   4. 在 styles.css 之后加载，同特异性下可安全覆盖。
   ============================================================ */

:root {
  /* Leonis 品牌金（取自狮子鬃毛渐变） */
  --leo-g1: #f7b441;
  --leo-g2: #efa22b;
  --leo-g3: #9c5606;
  /* 三段渐变：仅用于装饰（色条 / 徽标底 / 把手），其上不承载正文 */
  --leo-grad-full: linear-gradient(150deg, var(--leo-g1) 0%, var(--leo-g2) 52%, var(--leo-g3) 100%);
  /* 按钮渐变：只取明亮两段 + 近黑墨字，对比度 ≈8:1，达 AA */
  --leo-grad-btn: linear-gradient(135deg, var(--leo-g1) 0%, var(--leo-g2) 100%);
  --leo-btn-ink: #2a1705;
  --leo-ink: #8a4c05;
  --leo-tint: #fff8ec;
  --leo-line: #f0d9a8;
  --leo-glow: rgba(239, 162, 43, .32);
  --leo-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* 终端卡：Leonis 的签名元素，深底以突出「这是要粘进终端的东西」 */
  --leo-code-bg: #181510;
  --leo-code-ink: #e8dcc4;
  --leo-code-dim: #8b7e68;
  --leo-code-key: #f7b441;
  --leo-code-line: rgba(247, 180, 65, .22);
}

/* ============================================================
   通用零件：按钮 / 徽标 / 终端卡
   ============================================================ */

a.leo-btn,
button.leo-btn {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: .9rem;
  font-family: var(--body);
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.leo-btn:hover,
button.leo-btn:hover {
  transform: translateY(-2px);
}

a.leo-btn.solid,
button.leo-btn.solid {
  color: var(--leo-btn-ink);
  background: var(--leo-grad-btn);
  box-shadow: 0 .8rem 1.8rem var(--leo-glow);
}

a.leo-btn.ghost,
button.leo-btn.ghost {
  border-color: var(--leo-line);
  color: var(--leo-ink);
  background: rgba(255, 255, 255, .82);
}

a.leo-btn.sm,
button.leo-btn.sm {
  min-height: 2.25rem;
  padding: .4rem .8rem;
  border-radius: .65rem;
  font-size: .78rem;
}

a.leo-btn.lg,
button.leo-btn.lg {
  min-height: 3.3rem;
  padding: .85rem 1.4rem;
  font-size: .95rem;
}

.leo-mark {
  display: grid;
  width: 2.65rem;
  flex: 0 0 auto;
  aspect-ratio: 1;
  place-items: center;
  border-radius: .85rem;
  background: var(--leo-grad-full);
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: 0 .5rem 1.3rem var(--leo-glow);
}

.leo-mark.sm {
  width: 1.9rem;
  border-radius: .6rem;
  font-size: .95rem;
  box-shadow: none;
}

.leo-term {
  overflow: hidden;
  border: 1px solid var(--leo-code-line);
  border-radius: var(--radius-md);
  background: var(--leo-code-bg);
  box-shadow: var(--shadow-sm);
}

.leo-term-top {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .85rem;
  border-bottom: 1px solid var(--leo-code-line);
  color: var(--leo-code-dim);
  font-family: var(--leo-mono);
  font-size: .7rem;
}

.leo-dots {
  display: inline-flex;
  flex: 0 0 auto;
  gap: .3rem;
}

.leo-dots i {
  display: block;
  width: .55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #3a342a;
}

.leo-dots i:first-child {
  background: var(--leo-g2);
}

.leo-term-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leo-term pre {
  margin: 0;
  padding: .9rem;
  overflow-x: auto;
  color: var(--leo-code-ink);
  font-family: var(--leo-mono);
  font-size: .78rem;
  line-height: 1.85;
  text-align: left;
}

.leo-term .k {
  color: var(--leo-code-key);
}

.leo-term .c {
  color: var(--leo-code-dim);
}

.leo-copy {
  margin-left: auto;
  flex: 0 0 auto;
  padding: .28rem .55rem;
  border: 1px solid var(--leo-code-line);
  border-radius: .45rem;
  color: var(--leo-code-key);
  background: none;
  font-family: var(--leo-mono);
  font-size: .68rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease;
}

.leo-copy:hover {
  background: rgba(247, 180, 65, .12);
}

.leo-hint {
  margin: .7rem 0 0;
  color: var(--ink-500);
  font-size: .74rem;
  line-height: 1.6;
}

/* ============================================================
   P2 · 顶部通栏（在文档流内，随页面滚动、不吸顶）
   ============================================================ */

.leo-no-topbar .leo-topbar {
  display: none;
}

.leo-topbar {
  position: relative;
  border-bottom: 1px solid var(--leo-line);
  background: var(--leo-tint);
}

.leo-topbar::before {
  position: absolute;
  height: .2rem;
  inset: 0 0 auto 0;
  background: var(--leo-grad-full);
  content: "";
}

.leo-topbar-inner {
  display: flex;
  min-height: 3rem;
  align-items: center;
  gap: .7rem;
  padding-block: .5rem;
}

.leo-topbar-ico {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.leo-topbar-text {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  color: var(--ink-600);
  font-size: .78rem;
  line-height: 1.5;
}

.leo-topbar-text b {
  color: var(--leo-ink);
  font-weight: 850;
}

.leo-topbar-x {
  display: inline-flex;
  width: 1.75rem;
  flex: 0 0 auto;
  align-items: center;
  aspect-ratio: 1;
  justify-content: center;
  border: 0;
  border-radius: .5rem;
  color: var(--ink-500);
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.leo-topbar-x:hover {
  color: var(--ink-900);
  background: rgba(156, 86, 6, .1);
}

/* ============================================================
   P1 · 首页原生推荐区块
   ============================================================ */

.leo-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border: 1px solid var(--leo-line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.leo-hero::before {
  position: absolute;
  height: .25rem;
  inset: 0 0 auto 0;
  background: var(--leo-grad-full);
  content: "";
}

.eyebrow.leo-eye {
  border-color: var(--leo-line);
  color: var(--leo-ink);
  background: var(--leo-tint);
}

.leo-hero-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.leo-hero-head > div {
  min-width: 0;
}

.leo-hero h2 {
  margin: 0 0 .6rem;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.045em;
}

.leo-hero h2 span {
  display: block;
  margin-top: .45rem;
  color: var(--leo-ink);
  font-size: .55em;
  font-weight: 800;
  letter-spacing: 0;
}

.leo-hero-sub {
  max-width: 46rem;
  margin: 0;
  color: var(--ink-600);
  font-size: .95rem;
}

.leo-hero code,
.leo-dock-body code,
.leo-inline code {
  padding: .1em .4em;
  border: 1px solid var(--leo-line);
  border-radius: .3rem;
  color: var(--leo-ink);
  background: var(--leo-tint);
  font-family: var(--leo-mono);
  font-size: .85em;
}

.leo-feats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.6rem 0;
}

.leo-feat {
  padding: 1.1rem;
  border: 1px solid var(--leo-line);
  border-radius: var(--radius-md);
  background: var(--leo-tint);
}

.leo-feat-t {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .45rem;
  color: var(--ink-900);
  font-family: var(--body);
  font-size: .92rem;
  font-weight: 850;
}

.leo-feat-t::before {
  display: block;
  width: .5rem;
  height: .5rem;
  flex: 0 0 auto;
  border-radius: .15rem;
  background: var(--leo-grad-full);
  content: "";
}

.leo-feat p {
  margin: 0;
  color: var(--ink-600);
  font-size: .82rem;
  line-height: 1.7;
}

.leo-split {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: 1.4rem;
}

.leo-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.leo-split .leo-cta {
  flex-direction: column;
  align-items: stretch;
}

/* ============================================================
   P4 · 正文内嵌 Banner
   ============================================================ */

.leo-inline {
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
  padding: 1.4rem 1.4rem 1.4rem 1.65rem;
  border: 1px solid var(--leo-line);
  border-radius: var(--radius-lg);
  background: var(--leo-tint);
}

.leo-inline::before {
  position: absolute;
  width: .25rem;
  inset: 0 auto 0 0;
  background: var(--leo-grad-full);
  content: "";
}

.leo-inline-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .8rem;
}

.leo-inline-eyebrow {
  color: var(--leo-ink);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.leo-inline .leo-inline-h {
  margin: 0 0 .5rem;
  color: var(--ink-900);
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.leo-inline p {
  margin: 0 0 .8rem;
  color: var(--ink-600);
  font-size: .85rem;
  line-height: 1.75;
}

.leo-inline .leo-term {
  margin: 1rem 0;
  background: var(--leo-code-bg);
}

.leo-inline .leo-cta {
  margin-top: 1rem;
}

/* ============================================================
   P3 · 右下悬浮窗（桌面把手 + 卡片 / 窄屏 FAB + 底部 sheet）
   ============================================================ */

.leo-dock[hidden],
.leo-scrim[hidden] {
  display: none;
}

.leo-dock {
  position: fixed;
  z-index: 60;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
  opacity: 0;
  transform: translateY(.75rem);
  transition: opacity .28s ease, transform .28s ease;
}

.leo-dock.is-in {
  opacity: 1;
  transform: none;
}

.leo-dock-handle {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.05rem;
  border: 0;
  border-radius: 999px;
  color: var(--leo-btn-ink);
  background: var(--leo-grad-btn);
  font-family: var(--body);
  font-size: .85rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 .7rem 1.6rem var(--leo-glow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.leo-dock-handle:hover {
  transform: translateY(-2px);
  box-shadow: 0 1rem 2rem var(--leo-glow);
}

.leo-dock.is-open .leo-dock-handle {
  display: none;
}

.leo-dock-panel {
  position: relative;
  display: none;
  width: 21.5rem;
  max-width: calc(100vw - 2.5rem);
  overflow: hidden;
  border: 1px solid var(--leo-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.leo-dock.is-open .leo-dock-panel {
  display: block;
}

.leo-dock-panel::before {
  position: absolute;
  z-index: 1;
  height: .25rem;
  inset: 0 0 auto 0;
  background: var(--leo-grad-full);
  content: "";
}

.leo-dock-body {
  padding: 1.3rem 1.1rem 1.1rem;
}

.leo-dock-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .7rem;
  padding-right: 1.8rem;
}

.leo-dock-title {
  color: var(--ink-900);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.leo-dock-kicker {
  display: block;
  color: var(--leo-ink);
  font-family: var(--body);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.leo-dock-body p {
  margin: 0 0 .7rem;
  color: var(--ink-600);
  font-size: .8rem;
  line-height: 1.7;
}

.leo-dock-body .leo-term {
  margin-bottom: .9rem;
}

.leo-dock-body .leo-term pre {
  padding: .7rem;
  font-size: .72rem;
}

.leo-dock-body .leo-cta {
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
}

.leo-dock-x {
  position: absolute;
  z-index: 2;
  top: .6rem;
  right: .55rem;
  display: inline-flex;
  width: 1.9rem;
  align-items: center;
  aspect-ratio: 1;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-600);
  background: var(--surface-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.leo-dock-x:hover {
  color: var(--ink-900);
  background: var(--line);
}

.leo-scrim {
  position: fixed;
  z-index: 55;
  inset: 0;
  border: 0;
  background: rgba(13, 29, 59, .5);
}

/* ============================================================
   P5 · 页脚链接标记
   ============================================================ */

.footer-links a.leo-foot {
  color: var(--leo-ink);
  font-weight: 850;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1199px) {
  .leo-dock {
    right: 1rem;
    bottom: 1rem;
    left: auto;
  }

  .leo-dock-handle {
    width: 3.4rem;
    height: 3.4rem;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    font-size: 1.5rem;
  }

  .leo-dock-handle-t {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .leo-dock.is-open {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .leo-dock-panel {
    width: 100%;
    max-width: none;
    max-height: 82vh;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .leo-dock-body {
    padding-bottom: max(1.3rem, env(safe-area-inset-bottom));
  }
}

@media (min-width: 1200px) {
  .leo-scrim {
    display: none;
  }
}

@media (max-width: 900px) {
  .leo-feats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leo-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .leo-feats {
    grid-template-columns: 1fr;
  }

  .leo-hide-sm {
    display: none;
  }

  /* 窄屏压成两行：第一行「图标 + 文案 + 关闭」，第二行整宽 CTA，避免占掉过多首屏 */
  .leo-topbar-inner {
    flex-wrap: wrap;
    gap: .4rem .5rem;
  }

  .leo-topbar-ico {
    order: 1;
  }

  .leo-topbar-text {
    min-width: 0;
    flex: 1 1 auto;
    order: 2;
  }

  .leo-topbar-x {
    order: 3;
  }

  .leo-topbar .leo-btn {
    flex: 1 1 100%;
    margin-left: 1.5rem;
    order: 4;
  }

  .leo-hero-head {
    gap: .75rem;
  }

  .leo-mark {
    width: 2.25rem;
    font-size: 1.1rem;
  }

  .leo-cta .leo-btn {
    flex: 1 1 100%;
  }

  .leo-inline {
    padding: 1.1rem 1.1rem 1.1rem 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leo-dock {
    opacity: 1;
    transform: none;
    transition: none;
  }

  a.leo-btn:hover,
  button.leo-btn:hover,
  .leo-dock-handle:hover {
    transform: none;
  }
}
