/* 平仓特效（盈亏结算弹层）
   独立前缀 cfx-，避免与 style.css / skin-glass.css 冲突。
   用法：CloseFx.show({...})，见 js/close-fx.js */

.cfx{
  position:fixed;inset:0;z-index:9999;display:none;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  background:#0b0700;
  opacity:0;transition:opacity .28s ease;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.cfx.show{display:block;opacity:1}
.cfx *{box-sizing:border-box}
.cfx-in{position:relative;min-height:100%;padding:26px 18px calc(26px + env(safe-area-inset-bottom,0px));
  display:flex;flex-direction:column;align-items:center;justify-content:center}

/* 金色氛围底 */
.cfx-bg{
  position:fixed;inset:0;pointer-events:none;
  background:
    radial-gradient(ellipse 70% 42% at 50% 30%, rgba(255,191,64,.30) 0%, rgba(255,150,20,.10) 42%, transparent 72%),
    radial-gradient(ellipse 90% 55% at 50% 108%, rgba(255,196,74,.34) 0%, transparent 62%),
    radial-gradient(ellipse 60% 40% at 50% 62%, rgba(255,120,0,.12) 0%, transparent 70%),
    linear-gradient(180deg,#150c00 0%,#0b0700 52%,#120a00 100%);
}
.cfx-rays{
  position:fixed;left:50%;top:34%;width:190vmax;height:190vmax;
  margin:-95vmax 0 0 -95vmax;pointer-events:none;
  background:repeating-conic-gradient(from 0deg,
    rgba(255,206,90,.16) 0deg 2.6deg, rgba(255,206,90,0) 2.6deg 11deg);
  -webkit-mask-image:radial-gradient(closest-side, #000 8%, rgba(0,0,0,.55) 34%, transparent 68%);
          mask-image:radial-gradient(closest-side, #000 8%, rgba(0,0,0,.55) 34%, transparent 68%);
  animation:cfxSpin 26s linear infinite;
}
@keyframes cfxSpin{to{transform:rotate(360deg)}}

.cfx-coins,.cfx-stars{position:fixed;inset:0;pointer-events:none;overflow:hidden}
.cfx-coin{
  position:absolute;bottom:-40px;border-radius:50%;
  background:linear-gradient(155deg,#FFF3C4 0%,#FFD166 34%,#E8A020 68%,#FFE9A8 100%);
  box-shadow:0 0 14px rgba(255,196,74,.55), inset 0 0 6px rgba(255,255,255,.55);
  animation:cfxCoin linear infinite;
}
.cfx-coin::after{content:"";position:absolute;inset:16%;border-radius:50%;border:1.5px solid rgba(150,90,0,.35)}
@keyframes cfxCoin{
  0%{transform:translate3d(0,0,0) rotateY(0deg);opacity:0}
  12%{opacity:.95}
  80%{opacity:.85}
  100%{transform:translate3d(14px,-118vh,0) rotateY(540deg);opacity:0}
}
.cfx-star{
  position:absolute;width:14px;height:14px;background:rgba(255,240,190,.95);
  clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);
  filter:drop-shadow(0 0 6px rgba(255,214,110,.9));
  animation:cfxTwinkle ease-in-out infinite;
}
@keyframes cfxTwinkle{
  0%,100%{opacity:0;transform:scale(.3) rotate(0deg)}
  50%{opacity:1;transform:scale(1) rotate(90deg)}
}

.cfx-body{position:relative;width:100%;max-width:440px;margin:0 auto;text-align:center;z-index:2}
.cfx-tag{
  display:inline-block;font-size:11.5px;letter-spacing:.6px;color:#FFE2A8;
  background:rgba(255,186,64,.14);border:1px solid rgba(255,186,64,.45);
  border-radius:20px;padding:5px 12px;margin-bottom:16px;
}
.cfx-cap{font-size:13px;color:#C9A16A;letter-spacing:2px;margin-bottom:2px}
.cfx-amount{
  display:flex;align-items:baseline;justify-content:center;gap:3px;
  font-weight:800;letter-spacing:-1px;line-height:1.15;
  font-variant-numeric:tabular-nums;font-size:46px;
  background:linear-gradient(180deg,#FFF9E0 0%,#FFDF8A 34%,#FFB32E 62%,#FFE8AE 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 3px 0 rgba(120,58,0,.55)) drop-shadow(0 0 22px rgba(255,178,46,.55));
}
.cfx-sign{font-size:30px;margin-right:1px}
.cfx-unit{font-size:14px;font-weight:600;letter-spacing:.5px;color:#D9A85C;
  -webkit-text-fill-color:#D9A85C;margin-left:4px;align-self:center}
.cfx-roi{
  display:inline-block;margin-top:10px;font-size:12.5px;font-weight:700;color:#3A2400;
  background:linear-gradient(135deg,#FFE39A,#FFC24A);border-radius:20px;padding:4px 12px;
  box-shadow:0 6px 18px rgba(255,178,46,.35);
}

.cfx-chart{
  position:relative;margin:20px 0 18px;height:196px;border-radius:16px;overflow:hidden;
  background:linear-gradient(180deg,rgba(38,25,4,.72),rgba(20,13,2,.62));
  border:1px solid rgba(255,196,74,.30);
  box-shadow:0 18px 44px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,224,150,.14);
}
.cfx-chart::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse 60% 60% at 50% 0%, rgba(255,196,74,.16), transparent 70%);
}
.cfx-chart canvas{display:block;width:100%;height:100%}
.cfx-chart-head{
  position:absolute;left:12px;top:9px;z-index:2;font-size:10.5px;letter-spacing:.4px;color:#C9A16A;
  display:flex;gap:10px;
}
.cfx-chart-head i{font-style:normal;color:#8b7355}

.cfx-quote{display:flex;align-items:center;justify-content:center;gap:8px;
  font-size:14px;color:#EBD6AE;line-height:1.6}
.cfx-quote b{color:#FFD166;font-weight:800}
.cfx-crown{width:22px;height:22px;flex:0 0 auto;color:#FFC24A;filter:drop-shadow(0 0 8px rgba(255,178,46,.6))}
.cfx-detail{font-size:11px;color:#8A7350;margin-top:12px;letter-spacing:.2px}
/* 财富自由等级条 */
.cfx-level{
  margin-top:12px;display:flex;flex-direction:column;align-items:center;gap:6px;
  font-size:12px;line-height:1.5;color:#E8CF9C;text-align:center;
}
.cfx-lv-row{display:flex;align-items:center;justify-content:center;gap:7px;max-width:100%}
.cfx-lv-badge{
  flex:0 0 auto;font-size:10.5px;font-weight:800;letter-spacing:.4px;
  color:#3A2400;background:linear-gradient(135deg,#FFE39A,#FFC24A);
  border-radius:6px;padding:2px 7px;
}
.cfx-lv-text{font-weight:700;color:#FFD98F}
.cfx-lv-desc{font-size:11px;line-height:1.65;color:#C2A46F;max-width:300px}
.cfx-close{
  margin-top:22px;width:100%;height:50px;border:0;border-radius:14px;
  font-size:15px;font-weight:700;color:#3A2400;letter-spacing:.5px;
  background:linear-gradient(135deg,#FFE39A,#FFC24A);
  box-shadow:0 14px 30px rgba(255,178,46,.34);
  font-family:inherit;
}
.cfx-close:active{transform:scale(.985)}

.cfx.show .cfx-tag{animation:cfxUp .45s .08s both}
.cfx.show .cfx-cap{animation:cfxUp .45s .16s both}
.cfx.show .cfx-amount{animation:cfxPop .55s .2s both}
.cfx.show .cfx-roi{animation:cfxUp .45s .42s both}
.cfx.show .cfx-chart{animation:cfxUp .5s .3s both}
.cfx.show .cfx-quote{animation:cfxUp .5s 1.5s both}
.cfx.show .cfx-level{animation:cfxUp .5s 1.58s both}
.cfx.show .cfx-detail{animation:cfxUp .5s 1.6s both}
.cfx.show .cfx-close{animation:cfxUp .5s 1.68s both}
@keyframes cfxUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes cfxPop{0%{opacity:0;transform:scale(.72)}60%{transform:scale(1.06)}100%{opacity:1;transform:scale(1)}}

/* 亏损配色 */
.cfx.loss .cfx-bg{
  background:
    radial-gradient(ellipse 70% 42% at 50% 30%, rgba(120,140,170,.22) 0%, rgba(60,80,110,.08) 44%, transparent 72%),
    radial-gradient(ellipse 90% 55% at 50% 108%, rgba(120,60,60,.20) 0%, transparent 62%),
    linear-gradient(180deg,#0b0d14 0%,#080a10 52%,#0a0c14 100%);
}
.cfx.loss .cfx-rays{
  background:repeating-conic-gradient(from 0deg,
    rgba(140,160,190,.10) 0deg 2.6deg, rgba(140,160,190,0) 2.6deg 11deg);
}
.cfx.loss .cfx-star{background:rgba(200,215,235,.8);filter:drop-shadow(0 0 6px rgba(150,180,220,.7))}
.cfx.loss .cfx-coin{display:none}
.cfx.loss .cfx-tag{color:#B9C6D8;background:rgba(140,160,190,.12);border-color:rgba(140,160,190,.35)}
.cfx.loss .cfx-cap{color:#7C8A9E}
.cfx.loss .cfx-amount{
  background:linear-gradient(180deg,#F2F6FF 0%,#C9D6E8 36%,#8FA3BC 64%,#DCE6F5 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 3px 0 rgba(10,20,35,.6)) drop-shadow(0 0 18px rgba(120,160,220,.28));
}
.cfx.loss .cfx-unit{color:#8FA3BC;-webkit-text-fill-color:#8FA3BC}
.cfx.loss .cfx-roi{color:#E6EEF9;background:rgba(120,145,175,.28);box-shadow:none}
.cfx.loss .cfx-chart{background:linear-gradient(180deg,rgba(24,28,38,.8),rgba(14,17,24,.7));border-color:rgba(140,160,190,.24)}
.cfx.loss .cfx-chart::after{background:radial-gradient(ellipse 60% 60% at 50% 0%, rgba(140,165,200,.12), transparent 70%)}
.cfx.loss .cfx-chart-head{color:#8A9AAE}
.cfx.loss .cfx-quote{color:#C3D0E0}
.cfx.loss .cfx-quote b{color:#E8EFF8}
.cfx.loss .cfx-crown{color:#9FB3CB;filter:drop-shadow(0 0 8px rgba(140,170,210,.4))}
.cfx.loss .cfx-detail{color:#6E7C90}
.cfx.loss .cfx-level{color:#AFC0D4}
.cfx.loss .cfx-lv-badge{color:#0D1117;background:linear-gradient(135deg,#DCE6F3,#AFC2D8)}
.cfx.loss .cfx-lv-text{color:#C3D0E0}
.cfx.loss .cfx-lv-desc{color:#8FA1B6}
.cfx.loss .cfx-close{color:#0D1117;background:linear-gradient(135deg,#DCE6F3,#AFC2D8);box-shadow:none}

/* 静态预览（自动化截图用）：停在终态，不做入场动画 */
.cfx.static .cfx-tag,.cfx.static .cfx-cap,.cfx.static .cfx-amount,.cfx.static .cfx-roi,
.cfx.static .cfx-chart,.cfx.static .cfx-quote,.cfx.static .cfx-level,.cfx.static .cfx-detail,.cfx.static .cfx-close{
  animation:none!important;opacity:1!important;transform:none!important
}
.cfx.static .cfx-rays,.cfx.static .cfx-coin,.cfx.static .cfx-star{animation-play-state:paused}
