:root {
  --cv-width-open: min(1440px, 120vw);
  --cv-tab-size: 44px;
  --cv-radius: 14px;
  --cv-shadow: 0 16px 48px rgba(0,0,0,.18);
  --cv-z: 1050; /* 高于站点 header */
}

/* 容器仅用于 z-index 分层，不参与定位 */
.cv-drawer { position: relative; z-index: var(--cv-z); }

/* 右侧“拉手”按钮 —— 永远贴边 */
.cv-tab{
  position: fixed; inset: 35% 0 auto auto; /* top ~35%, right:0 */
  width: var(--cv-tab-size); height: var(--cv-tab-size);
  border: none; border-radius: 12px 0 0 12px;
  background: #1e293b; color: #fff; font-weight: 700; letter-spacing:.5px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  cursor: pointer; transition: opacity .25s ease, transform .25s ease;
}
.cv-drawer.is-open .cv-tab{ opacity: 0; pointer-events: none; transform: translateX(8px); }

/* 背景遮罩 */
.cv-backdrop{
  position: fixed; inset: 0;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(1.5px);
  opacity: 0; transition: opacity .25s ease;
}
.cv-drawer.is-open .cv-backdrop{ opacity: 1; }
.cv-backdrop[hidden]{ display:none; }

/* 抽屉主体 */
.cv-panel{
  position: fixed;
  top: 0; right: -2%;
  width: var(--cv-width-open);
  height: 100dvh; /* 避免 iOS 工具栏导致的白边 */
  max-height: 100vh; /* 旧浏览器退化 */
  background: #fff; color: #0f172a;
  box-shadow: var(--cv-shadow);
  border-radius: var(--cv-radius) 0 0 var(--cv-radius);
  transform: translateX(calc(100% - 12px)); /* 初始在屏外，只露出一条阴影 */
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  will-change: transform;
}
.cv-drawer.is-open .cv-panel{ transform: translateX(0); }

/* 顶部工具条 */
.cv-toolbar{
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem .75rem .5rem 1rem;
  border-bottom: 1px solid rgba(2,6,23,.06);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.cv-toolbar .grow{ flex: 1 }
.cv-open-full{
  display:inline-flex; align-items:center; justify-content:center;
  width: 34px; height: 34px; border-radius: 8px;
  text-decoration:none; color:#0f172a; font-size: 18px;
  background:#f1f5f9; transition: background .2s ease;
}
.cv-open-full:hover{ background:#e2e8f0; }
.cv-close{
  width: 34px; height: 34px; border-radius: 8px;
  border:none; background:#0f172a; color:#fff; font-size:18px; cursor:pointer;
}

/* 内部内容滚动（iframe 方式） */
.cv-frame{
  display:block; width: 100%;
  height: calc(100dvh - 52px); /* 扣掉 toolbar 高度 */
  max-height: calc(100vh - 52px);
  border: none;
  background: #fff;
}

