/* ========== 主题变量：优先取站点 base.css 的同名变量，独立使用时回退默认值（不覆盖站点变量） ========== */
:root{
  --ccj-paper: var(--paper, #f2f5fa);
  --ccj-paper-2: var(--paper-2, #f9fbfe);
  --ccj-ink: var(--ink, #10233c);
  --ccj-ink-2: var(--ink-2, #5d6c81);
  --ccj-line: var(--line, #d7dfeb);
  --ccj-accent: var(--accent, #145bbd);
  --ccj-accent-deep: var(--accent-deep, #0d4290);
  --ccj-accent-tint: var(--accent-tint, #e7effa);
  --ccj-serif: var(--serif, 'Noto Serif SC','STSong','SimSun',serif);
  --ccj-sans: var(--sans, 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif);
}

/* ==========================================================
   组件根容器：固定右侧 · 垂直居中 · 跟随滚动
   ========================================================== */
.ccj-share{
  position:fixed;
  right:0;
  top:50%;
  transform:translateY(-50%);
  z-index:120;
  font-family:var(--ccj-sans);
  font-size:13px;
  color:var(--ccj-ink);
  line-height:1.7;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  -webkit-font-smoothing:antialiased;
  /* 触屏端避免横向拖动误触 */
  touch-action:manipulation;
}
.ccj-share *{box-sizing:border-box;}
.ccj-share svg{display:block;}

/* ========== 悬浮主按钮：仿站点 .mf-btn 青花蓝实心 ========== */
.ccj-share-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:56px;
  padding:14px 0 12px;
  font-family:inherit;
  font-size:11.5px;
  letter-spacing:.14em;
  color:#fff;
  background:var(--ccj-accent);
  border:none;
  border-left:1px solid rgba(255,255,255,.18);
  border-radius:6px 0 0 6px;
  box-shadow:-4px 0 16px rgba(16,35,60,.16);
  cursor:pointer;
  transition:background .2s,box-shadow .2s,padding-right .2s;
  user-select:none;
  writing-mode:vertical-rl;
  text-orientation:upright;
}
.ccj-share-btn:hover{
  background:var(--ccj-accent-deep);
  padding-right:4px;
  box-shadow:-6px 0 22px rgba(16,35,60,.24);
}
.ccj-share-btn:active{transform:translateX(-1px);}
.ccj-share-btn:focus-visible{outline:2px solid var(--ccj-accent);outline-offset:2px;}
.ccj-share-btn svg{
  width:18px;height:18px;
  stroke:currentColor;fill:none;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
  writing-mode:horizontal-tb;
}

/* 收起态的小箭头提示 */
.ccj-share-btn::after{
  content:'';
  width:0;height:0;
  border:4px solid transparent;
  border-right-color:rgba(255,255,255,.75);
  margin-top:2px;
  transition:transform .25s;
}
.ccj-share.is-open .ccj-share-btn::after{
  transform:rotate(180deg);
}

/* ==========================================================
   展开面板：从按钮左侧滑出，白卡风格仿站点 .lang-pop
   ========================================================== */
.ccj-share-pop{
  position:absolute;
  top:50%;
  right:calc(100% + 10px);
  transform:translate(10px,-50%);
  width:268px;
  max-height:86vh;
  overflow-y:auto;
  background:#fff;
  border:1px solid var(--ccj-line);
  border-radius:8px;
  box-shadow:0 14px 34px rgba(16,35,60,.14);
  padding:6px;
  opacity:0;
  visibility:hidden;
  transition:opacity .22s,transform .22s,visibility .22s;
}
.ccj-share-pop::-webkit-scrollbar{width:5px;}
.ccj-share-pop::-webkit-scrollbar-thumb{background:#cfdaea;border-radius:3px;}
.ccj-share.is-open .ccj-share-pop{
  opacity:1;
  visibility:visible;
  transform:translate(0,-50%);
}

/* 浮层小标题 */
.ccj-pop-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px 6px;
  border-bottom:1px solid var(--ccj-line);
  margin-bottom:4px;
}
.ccj-pop-head b{
  font-family:var(--ccj-serif);
  font-size:13px;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--ccj-ink);
}
.ccj-pop-head span{font-size:11px;color:var(--ccj-ink-2);letter-spacing:.05em;}

/* 分享渠道列表 */
.ccj-item{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  padding:8px 10px;
  background:none;
  border:none;
  border-radius:5px;
  cursor:pointer;
  font-family:inherit;
  font-size:12.5px;
  color:#33455f;
  text-align:left;
  transition:background .18s,color .18s;
}
.ccj-item:hover{background:var(--ccj-accent-tint);color:var(--ccj-accent);}
.ccj-item .ccj-ico{
  width:28px;height:28px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;
  background:var(--ccj-accent-tint);
  color:var(--ccj-accent);
  transition:background .18s,color .18s;
}
.ccj-item:hover .ccj-ico{background:var(--ccj-accent);color:#fff;}
.ccj-item .ccj-ico svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.ccj-item .ccj-txt{flex-shrink:0;}
.ccj-item small{margin-left:auto;font-size:11px;color:#9aa9bd;letter-spacing:.05em;}

/* ========== 二维码区 ========== */
.ccj-qr{
  display:none;
  flex-direction:column;
  align-items:center;
  gap:9px;
  padding:14px 10px 12px;
  border-top:1px solid var(--ccj-line);
  margin-top:4px;
}
.ccj-qr.is-show{display:flex;}
.ccj-qr-box{
  width:132px;height:132px;
  padding:7px;
  background:#fff;
  border:1px solid var(--ccj-line);
  border-radius:6px;
  box-shadow:0 0 0 2.5px #f5f8fd,0 0 0 3.5px var(--ccj-accent);
}
.ccj-qr-box canvas,.ccj-qr-box img{width:100%;height:100%;display:block;}
.ccj-qr p{
  font-size:11.5px;
  color:var(--ccj-ink-2);
  letter-spacing:.06em;
  text-align:center;
}
.ccj-qr p b{color:var(--ccj-accent);font-weight:600;font-family:var(--ccj-serif);}

/* ========== 复制链接行 ========== */
.ccj-copy{
  display:flex;
  gap:6px;
  padding:8px 10px 10px;
  border-top:1px solid var(--ccj-line);
  margin-top:4px;
}
.ccj-copy input{
  flex:1;
  min-width:0;
  padding:7px 9px;
  font-family:var(--ccj-sans);
  font-size:11.5px;
  color:var(--ccj-ink-2);
  background:var(--ccj-paper-2);
  border:1px solid var(--ccj-line);
  border-radius:3px;
  outline:none;
}
.ccj-copy input:focus{border-color:var(--ccj-accent);}
.ccj-copy button{
  flex-shrink:0;
  padding:7px 14px;
  font-family:inherit;
  font-size:12px;
  letter-spacing:.08em;
  color:#fff;
  background:var(--ccj-accent);
  border:none;
  border-radius:3px;
  cursor:pointer;
  transition:background .2s;
}
.ccj-copy button:hover{background:var(--ccj-accent-deep);}

/* ========== 轻提示 ========== */
.ccj-toast{
  position:fixed;
  left:50%;
  bottom:60px;
  transform:translate(-50%,12px);
  padding:9px 22px;
  font-family:var(--ccj-sans);
  font-size:12.5px;
  letter-spacing:.08em;
  color:#fff;
  background:rgba(13,28,48,.92);
  border-radius:3px;
  box-shadow:0 10px 26px rgba(16,35,60,.16);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s,transform .25s;
  z-index:9999;
}
.ccj-toast.is-show{opacity:1;transform:translate(-50%,0);}

/* ========== 回到顶部小按钮（悬浮组内，可选） ========== */
.ccj-top{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  width:56px;
  padding:11px 0;
  margin-top:6px;
  font-family:inherit;
  font-size:11px;
  letter-spacing:.14em;
  color:#33455f;
  background:#fff;
  border:1px solid var(--ccj-line);
  border-right:none;
  border-radius:6px 0 0 6px;
  box-shadow:-4px 0 14px rgba(16,35,60,.1);
  cursor:pointer;
  writing-mode:vertical-rl;
  text-orientation:upright;
  opacity:0;
  visibility:hidden;
  transform:translateX(14px);
  transition:opacity .25s,transform .25s,visibility .25s,color .18s,border-color .18s;
}
.ccj-top.is-show{opacity:1;visibility:visible;transform:translateX(0);}
.ccj-top:hover{color:var(--ccj-accent);border-color:var(--ccj-accent);}
.ccj-top svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;writing-mode:horizontal-tb;}

/* ==========================================================
   移动端底部面板
   ========================================================== */
.ccj-mask{
  position:fixed;inset:0;
  background:rgba(9,20,38,.5);
  opacity:0;visibility:hidden;
  transition:opacity .25s,visibility .25s;
  z-index:998;
}
.ccj-mask.is-show{opacity:1;visibility:visible;}
.ccj-sheet{
  position:fixed;left:0;right:0;bottom:0;
  background:#fff;
  border-radius:14px 14px 0 0;
  padding:16px 16px 22px;
  transform:translateY(102%);
  transition:transform .28s cubic-bezier(.32,.72,.34,1);
  z-index:999;
}
.ccj-sheet.is-show{transform:translateY(0);}
.ccj-sheet-head{
  display:flex;align-items:center;justify-content:space-between;
  padding-bottom:12px;border-bottom:1px solid var(--ccj-line);margin-bottom:12px;
}
.ccj-sheet-head b{font-family:var(--ccj-serif);font-size:14px;letter-spacing:.08em;color:var(--ccj-ink);}
.ccj-sheet-close{
  width:28px;height:28px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--ccj-line);border-radius:50%;background:#fff;cursor:pointer;
  color:#8b9aae;transition:all .2s;
}
.ccj-sheet-close:hover{border-color:var(--ccj-accent);color:var(--ccj-accent);}
.ccj-sheet-close svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.ccj-sheet-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px 4px;}
.ccj-sheet-grid .ccj-item{flex-direction:column;gap:6px;padding:10px 2px;text-align:center;justify-content:center;}
.ccj-sheet-grid .ccj-item .ccj-txt{font-size:11.5px;letter-spacing:.03em;}
.ccj-sheet-grid .ccj-item small{display:none;}

/* ========== 响应式 ========== */
@media (max-width:768px){
  /* 移动端：右侧悬浮主按钮缩窄，面板改用底部抽屉 */
  .ccj-share{right:0;top:auto;bottom:118px;transform:none;}
  .ccj-share-btn{width:48px;padding:11px 0;font-size:11px;border-radius:6px 0 0 6px;}
  .ccj-share-btn svg{width:17px;height:17px;}
  .ccj-top{width:48px;padding:10px 0;}
  .ccj-share-pop{display:none !important;}
}
@media (max-width:768px) and (orientation:landscape){
  .ccj-share{bottom:64px;}
}
