/* 520FX UX layer — Binance light product behaviors (non-admin)
   Depends on fx_tokens.css + fx_brand.css */

/* ---- Page enter / density ---- */
@keyframes fx-fade-up{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes fx-fade-in{
  from{opacity:0}
  to{opacity:1}
}
@keyframes fx-spin{
  to{transform:rotate(360deg)}
}
@keyframes fx-pulse{
  0%,100%{opacity:1}
  50%{opacity:.55}
}
@keyframes fx-pop{
  from{opacity:0;transform:translateY(4px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.xq-shell,.fx-auth-shell,.xq-timeline-wrap{
  animation:fx-fade-up var(--fx-motion-slow) var(--fx-ease-out) both;
}
.xq-panel,.fx-idea-card,.fx-auth-card{
  animation:fx-fade-in var(--fx-motion-normal) var(--fx-ease-out) both;
}
.xq-feed > li{
  animation:fx-fade-in var(--fx-motion-normal) var(--fx-ease-out) both;
}
.xq-feed > li:nth-child(1){animation-delay:20ms}
.xq-feed > li:nth-child(2){animation-delay:40ms}
.xq-feed > li:nth-child(3){animation-delay:60ms}
.xq-feed > li:nth-child(4){animation-delay:80ms}
.xq-feed > li:nth-child(5){animation-delay:100ms}
.xq-feed > li:nth-child(6){animation-delay:120ms}

@media (prefers-reduced-motion:reduce){
  .xq-shell,.fx-auth-shell,.xq-timeline-wrap,.xq-panel,.fx-idea-card,.fx-auth-card,.xq-feed > li{
    animation:none !important;
  }
}

/* ---- Buttons — Binance secondary / tertiary ---- */
.xq-btn-secondary,.fx-btn-secondary{
  display:inline-flex;align-items:center;justify-content:center;
  height:var(--fx-ctrl-lg);padding:0 18px;border-radius:var(--fx-radius-pill);
  background:var(--fx-bg-subtle);color:var(--fx-text) !important;border:0;
  font-weight:600;font-size:var(--fx-fs-md);text-decoration:none !important;cursor:pointer;
  transition:background var(--fx-motion-fast) var(--fx-ease),transform var(--fx-motion-instant) var(--fx-ease);
}
.xq-btn-secondary:hover,.fx-btn-secondary:hover{background:var(--fx-border);}
.xq-btn-secondary:active,.fx-btn-secondary:active{transform:scale(.98);background:var(--fx-border-strong);}
.xq-btn-sm,.fx-btn-sm{height:var(--fx-ctrl-sm);padding:0 12px;font-size:var(--fx-fs-sm);}
.xq-btn-lg,.fx-btn-lg{height:var(--fx-ctrl-xl);padding:0 28px;font-size:var(--fx-fs-lg);}

/* Ghost aligns to Binance outline secondary */
.xq-btn-ghost{
  background:transparent !important;color:var(--fx-text) !important;
  border:1px solid var(--fx-border) !important;
}
.xq-btn-ghost:hover{
  background:var(--fx-hover) !important;color:var(--fx-text) !important;
  border-color:var(--fx-border-strong) !important;
}

/* ---- Controls / forms (global Discuz) ---- */
.px,.pt,.ps,.select select,textarea.pt,input.px,
.fx-field .px,.fx-field .pt,.fx-field select,
.fx-idea-form .px,.fx-idea-form .pt,.fx-idea-form select,
.fx-auth-card input[type=text],.fx-auth-card input[type=password],.fx-auth-card input[type=email],
.fx-auth-card .px,.fx-auth-card .txt{
  border-radius:var(--fx-radius-md) !important;
  border:1px solid transparent !important;
  background:var(--fx-input-bg) !important;
  color:var(--fx-text) !important;
  transition:border-color var(--fx-motion-fast) var(--fx-ease),background var(--fx-motion-fast) var(--fx-ease),box-shadow var(--fx-motion-fast) var(--fx-ease) !important;
}
.px:hover,.pt:hover,textarea.pt:hover,input.px:hover{background:#EFEFEF !important;}
.px:focus,.pt:focus,textarea.pt:focus,input.px:focus,
.fx-field .px:focus,.fx-field .pt:focus,.fx-field select:focus,
.fx-auth-card input:focus{
  border-color:var(--fx-primary) !important;
  background:var(--fx-surface) !important;
  box-shadow:var(--fx-focus-ring) !important;
  outline:none !important;
}
.pn,.pnc,button.pn,.fx-auth-card .pn,.fx-auth-card .pnc,.fx-auth-card button[type=submit]{
  border-radius:var(--fx-radius-pill) !important;
  background:var(--fx-primary) !important;
  color:var(--fx-on-primary) !important;
  border:0 !important;
  font-weight:700 !important;
  transition:background var(--fx-motion-fast) var(--fx-ease),transform var(--fx-motion-instant) var(--fx-ease) !important;
}
.pn:hover,.pnc:hover{background:var(--fx-primary-hover) !important;}
.pn:active,.pnc:active{background:var(--fx-primary-active) !important;transform:scale(.98);}
.pn:disabled,.pnc:disabled{opacity:.45;pointer-events:none;}

/* ---- Dropdown / popper (Binance soft panel) ---- */
.poptip-popper,.header-user-dropdown,.notice-dropdown,.header-i18n-dropdown,
#append_parent .p_pop,#fwin_content{
  background:var(--fx-surface) !important;
  border:1px solid var(--fx-border) !important;
  border-radius:var(--fx-radius-lg) !important;
  box-shadow:var(--fx-shadow-pop) !important;
  animation:fx-pop var(--fx-motion-fast) var(--fx-ease-out);
}
.notice-content .notice-item a,
.user-card-area a,
.header-user-dropdown a{
  border-radius:var(--fx-radius-sm);
  transition:background var(--fx-motion-fast) var(--fx-ease);
}
.notice-content .notice-item a:hover,
.user-card-area a:hover{background:var(--fx-hover);}

/* ---- Discuz blocks / tables ---- */
.bm,.tl,.nfl .f_c{
  background:var(--fx-surface) !important;
  border:1px solid var(--fx-border) !important;
  border-radius:var(--fx-radius-lg) !important;
  box-shadow:none !important;
  color:var(--fx-text) !important;
}
.bm_h{
  background:var(--fx-elevated) !important;
  border-bottom:1px solid var(--fx-border) !important;
  border-radius:var(--fx-radius-lg) var(--fx-radius-lg) 0 0 !important;
}
.tl th,.tl td{border-color:var(--fx-border) !important;}
.tl th{color:var(--fx-text-tertiary) !important;font-weight:600 !important;font-size:var(--fx-fs-sm) !important;}
.tl tr:hover th,.tl tr:hover td{background:var(--fx-hover) !important;}
.pg a,.pg strong,.pgb a{
  border-radius:var(--fx-radius-sm) !important;
  border-color:var(--fx-border) !important;
  color:var(--fx-text) !important;
  transition:background var(--fx-motion-fast) var(--fx-ease),border-color var(--fx-motion-fast) var(--fx-ease);
}
.pg strong,.pg a:hover{background:var(--fx-primary) !important;border-color:var(--fx-primary) !important;color:var(--fx-on-primary) !important;}

/* ---- Plugin pages share shell density ---- */
body.nv_plugin #wp,.plugin .wp,body.nv_plugin .ct2{
  max-width:var(--fx-page-max);
}
body.nv_plugin .bm,body.nv_plugin .xq-panel{
  border-radius:var(--fx-radius-lg);
}
body.nv_home #ct,body.nv_home .ct2{
  max-width:var(--fx-page-max);margin-left:auto;margin-right:auto;
}
body.nv_home .bm{
  border-radius:var(--fx-radius-lg);
  border:1px solid var(--fx-border);
  overflow:hidden;
}

/* Space profile polish */
.fx-profile-stats{
  display:flex;flex-wrap:wrap;gap:12px;align-items:center;
  padding:10px 0;font-size:var(--fx-fs-md);color:var(--fx-text-secondary);
}
.fx-profile-stats a{color:var(--fx-text);text-decoration:none;font-weight:600;}
.fx-profile-stats a:hover{color:var(--fx-primary);}
.fx-profile-stats strong{color:var(--fx-text);margin-right:2px;}

/* ---- Intermediate states ---- */
.fx-busy,.is-loading{
  position:relative;pointer-events:none;opacity:.72;
}
.fx-busy::after,.is-loading::after{
  content:"";position:absolute;inset:0;margin:auto;width:18px;height:18px;
  border:2px solid var(--fx-border);border-top-color:var(--fx-primary);border-radius:50%;
  animation:fx-spin .7s linear infinite;
}
.fx-skeleton-row{display:grid;grid-template-columns:40px 1fr;gap:12px;padding:14px 16px;border-bottom:1px solid var(--fx-border);}
.fx-skeleton-avatar{width:40px;height:40px;border-radius:50%;}
.fx-skeleton-line{height:12px;margin-bottom:8px;}
.fx-skeleton-line.w60{width:60%}.fx-skeleton-line.w40{width:40%}.fx-skeleton-line.w80{width:80%}
.fx-empty{
  padding:var(--fx-space-7) var(--fx-space-5);
  text-align:center;color:var(--fx-text-tertiary);
}
.fx-empty strong{display:block;color:var(--fx-text);margin-bottom:8px;font-size:var(--fx-fs-lg);font-weight:700;}
.fx-empty p{margin:0 0 16px;font-size:var(--fx-fs-md);line-height:var(--fx-lh-body);}
.fx-toast-ok{color:var(--fx-up)}.fx-toast-err{color:var(--fx-down)}

/* Feed press / active feedback */
.xq-feed > li:active{background:var(--fx-pressed);}
.xq-feed-title:active{opacity:.85;}
.xq-avatar{
  transition:transform var(--fx-motion-fast) var(--fx-ease-spring),box-shadow var(--fx-motion-fast) var(--fx-ease);
}
.xq-avatar:hover{transform:scale(1.04);box-shadow:0 0 0 2px var(--fx-primary-soft);}
.xq-compose:active{transform:scale(.995);}

/* Tabs — Binance underline weight */
.xq-tabs a{
  position:relative;font-weight:500;color:var(--fx-text-tertiary) !important;
  border-bottom-width:2px !important;
}
.xq-tabs a.a{
  color:var(--fx-text) !important;font-weight:700 !important;
  border-bottom-color:var(--fx-primary) !important;
}
.xq-tabs a:hover{color:var(--fx-text) !important;}

/* Cards — hairline, soft hover lift */
.xq-panel,.fx-idea-card{
  border-radius:var(--fx-radius-lg) !important;
  border:1px solid var(--fx-border) !important;
  box-shadow:none !important;
}
.xq-panel:hover{
  border-color:color-mix(in srgb,var(--fx-border-strong) 70%,var(--fx-border));
}
.fx-idea-card:hover{
  transform:translateY(-1px);
  box-shadow:var(--fx-shadow) !important;
}

/* Primary CTA pill — darker press */
.xq-btn,.fx-btn,.fx-publish-cta,.xq-compose-cta,.header-user-login .login_btn a{
  background:var(--fx-primary) !important;
  color:var(--fx-on-primary) !important;
}
.xq-btn:hover,.fx-btn:hover,.fx-publish-cta:hover{background:var(--fx-primary-hover) !important;}
.xq-btn:active,.fx-btn:active,.fx-publish-cta:active,.header-user-login .login_btn a:active{
  background:var(--fx-primary-active) !important;
}

/* Quote / market numbers */
.fx-quote-card strong{font-variant-numeric:tabular-nums;letter-spacing:var(--fx-tracking);}
.fx-dir-up,.fx-dir-badge.fx-dir-up{color:var(--fx-up) !important;}
.fx-dir-down,.fx-dir-badge.fx-dir-down{color:var(--fx-down) !important;}

/* Footer */
#ft,.dz_footc{
  background:var(--fx-elevated) !important;
  border-top:1px solid var(--fx-border) !important;
  color:var(--fx-text-tertiary) !important;
  font-size:var(--fx-fs-sm);
}
#ft a,.dz_footc a{color:var(--fx-text-secondary) !important;}
#ft a:hover,.dz_footc a:hover{color:var(--fx-primary) !important;}

/* Mobile tabbar — Binance-like */
.fx-mobile-tabbar{
  height:56px;backdrop-filter:saturate(1.2) blur(10px);
  background:rgba(255,255,255,.92) !important;
}
.fx-mtab{transition:color var(--fx-motion-fast) var(--fx-ease),transform var(--fx-motion-instant) var(--fx-ease);}
.fx-mtab:active{transform:scale(.96);}
.fx-mtab.is-on{color:var(--fx-primary) !important;font-weight:600;}
.fx-mtab-pub i,.fx-mtab-pub svg.fx-lucide{
  box-shadow:0 4px 12px rgba(200,28,40,.35);
  transition:transform var(--fx-motion-fast) var(--fx-ease-spring),background var(--fx-motion-fast) var(--fx-ease);
}
.fx-mtab-pub:active i,.fx-mtab-pub:active svg.fx-lucide{transform:scale(.94);}

/* Auth card */
.fx-auth-card{
  border-radius:var(--fx-radius-xl) !important;
  box-shadow:var(--fx-shadow-lg) !important;
  padding:32px 28px !important;
}
.fx-auth-card h1,.fx-auth-card .xs2{
  display:flex;align-items:center;gap:8px;font-size:var(--fx-fs-2xl);font-weight:800;letter-spacing:var(--fx-tracking);
}
.fx-auth-shell{
  background:
    radial-gradient(900px 400px at 10% -10%,var(--fx-primary-soft),transparent 60%),
    var(--fx-bg-subtle);
}

/* Viewthread article-like */
body.nv_forum.pg_viewthread #postlist .plc,
body.nv_forum.pg_viewthread .pcb{
  padding-top:4px;
}
body.nv_forum.pg_viewthread .authi a:hover{color:var(--fx-primary) !important;}
body.nv_forum.pg_viewthread .psth{
  background:var(--fx-elevated) !important;border-color:var(--fx-border) !important;color:var(--fx-text-secondary) !important;
}

/* Focus visible a11y */
a:focus-visible,.xq-btn:focus-visible,.fx-btn:focus-visible,button:focus-visible,.fx-mtab:focus-visible{
  outline:2px solid var(--fx-primary);
  outline-offset:2px;
}

/* Selection */
::selection{background:var(--fx-primary-muted);color:var(--fx-text);}

/* ---- Xueqiu-like column (Discuz space) ---- */
.fx-column-shell{max-width:860px;margin:0 auto;padding:var(--fx-space-4) var(--fx-gutter) var(--fx-space-7);}
.fx-column-hero{
  padding:20px 18px !important;margin-bottom:14px;
  display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;align-items:flex-start;
}
.fx-column-hero-main{display:flex;gap:14px;min-width:0;flex:1 1 280px;}
.fx-column-avatar{width:64px !important;height:64px !important;font-size:22px !important;margin-top:0 !important;}
.fx-column-meta{min-width:0;flex:1;}
.fx-column-name-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px;}
.fx-column-name{margin:0;font-size:22px;font-weight:800;letter-spacing:var(--fx-tracking);color:var(--fx-text);}
.fx-column-kicker{
  display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:var(--fx-radius-pill);
  font-size:11px;font-weight:700;background:var(--fx-primary-soft);color:var(--fx-primary);
}
.fx-column-bio{margin:0 0 10px;font-size:var(--fx-fs-md);line-height:var(--fx-lh-body);color:var(--fx-text-secondary);}
.fx-column-bio-empty{color:var(--fx-text-tertiary);font-style:normal;}
.fx-column-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}
.fx-column-stats{padding:0 !important;gap:14px;}
.fx-column-stats a{text-decoration:none;}
.fx-column-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.fx-column-feed .xq-feed-hd-top{padding-bottom:4px;}
.fx-column-article{background:linear-gradient(90deg,var(--fx-primary-soft),transparent 42%);}
.fx-column-article .xq-feed-title{font-weight:700;}
.fx-column-edit-shell{max-width:640px;margin:0 auto;padding:24px 16px 64px;}
.fx-column-edit .xq-panel-hd{padding:14px 16px;}
.fx-column-inline{margin-top:8px;}
.fx-column-actions-inline{margin:10px 0 0;}
@media (max-width:640px){
  .fx-column-hero{padding:16px 14px !important;}
  .fx-column-avatar{width:52px !important;height:52px !important;}
  .fx-column-name{font-size:18px;}
  .fx-column-actions{width:100%;}
  .fx-column-actions .xq-btn{flex:1 1 auto;}
}
