/* BAM Premium UI v2 —— 对比度、字重、配色、浮动按钮避让 */
:root{
  --bm-ink:#0c2a1e;
  --bm-ink-2:#123a2a;
  --bm-emerald:#0f7a52;
  --bm-gold:#c9a227;
  --bm-text:#14231c;
  --bm-muted:#5b6e63;
  --bm-line:#dfe6e1;
}

body{color:var(--bm-text)}
.muted,[class*="muted"],small,.hint,.note{color:var(--bm-muted)!important}
[style*="color:#9aa9a1"],[style*="color: #9aa9a1"]{color:var(--bm-muted)!important}
[style*="color:#7d8f85"],[style*="color: #7d8f85"]{color:var(--bm-muted)!important}

/* 按钮字重加深 */
button,.btn,a.btn,[class*="acc-actions"] a,[class*="acc-refresh"],nav a,nav button{
  font-weight:800!important;letter-spacing:.2px;
}

.btn.line,button.line,.ghost,[class*="ghost"]{
  color:var(--bm-ink)!important;border-color:#cfdad4!important;background:#fff!important;
}
[class*="acc-actions"] a{color:var(--bm-ink)!important;background:#e8f0eb!important;font-size:13px!important}
[class*="acc-refresh"]{color:var(--bm-ink-2)!important;background:#eef3ef!important}

.btn:not(.line):not(.ghost):not([class*="red"]):not([class*="gold"]),
button.primary{
  background:linear-gradient(135deg,#0c2a1e 0%,#123a2a 55%,#1a5740 100%)!important;
  box-shadow:0 3px 12px #0c2a1e26!important;border:0!important;
}

.card,.panel{box-shadow:0 1px 2px #0c2a1e0a,0 4px 14px #0c2a1e08!important}
.card,.panel,.item,.member,.order,.proj{border-color:var(--bm-line)!important}


[class*="acc-label"]{color:var(--bm-muted)!important;font-weight:700!important}

.amount,.price,[class*="amount"],[id*="Price"],[id*="Bal"]{
  color:var(--bm-ink)!important;font-variant-numeric:tabular-nums;letter-spacing:-.4px;
}

input,select,textarea{
  border-color:#d3ddd7!important;color:var(--bm-text)!important;background:#fbfdfb!important;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--bm-emerald)!important;box-shadow:0 0 0 3px #0f7a5218!important;background:#fff!important;
}
input::placeholder,textarea::placeholder{color:#8d9c93!important}

.pill{background:#e6efe9!important;color:var(--bm-ink)!important;font-weight:800!important}
.pill.on{background:#dcf3e6!important;color:#0a6b46!important}
.pill.off{background:#fbe4e1!important;color:#a52f22!important}
.pill.wait{background:#fbf0d4!important;color:#8a6412!important}

#bamGlobalBottom a,#bottom>*{color:#55685d!important;font-weight:700!important}
#bamGlobalBottom a.active,#bottom>*.active{color:var(--bm-ink)!important;font-weight:800!important}
#bamGlobalBottom a.active svg,#bottom>*.active svg{stroke:var(--bm-ink)!important}

hr{border-color:var(--bm-line)!important}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-thumb{background:#c3d0c8;border-radius:3px}
button:active,.btn:active,a.btn:active{transform:scale(.975)}

/* ── 浮动客服按钮避让：不压住底部内容 ── */
#bamCsBtn{right:14px!important;bottom:calc(96px + env(safe-area-inset-bottom))!important;
  width:50px!important;height:50px!important;font-size:21px!important}
/* 给页面底部留出按钮空间 */
main{padding-bottom:calc(110px + env(safe-area-inset-bottom))!important}
#bamEntryGrid{padding-bottom:4px}

/* ── 底部导航：强制居中铺满，图标与文字对齐 ── */
.bottomnav,#bottom,#bamGlobalBottom{
  position:fixed!important;
  left:0!important;right:0!important;
  bottom:0!important;
  width:100%!important;max-width:100%!important;
  margin:0!important;
  transform:none!important;
  display:grid!important;
  grid-template-columns:repeat(4,1fr)!important;
  align-items:center!important;
  gap:0!important;
  padding:6px 4px calc(6px + env(safe-area-inset-bottom))!important;
  background:#fff!important;
  border-top:1px solid #dfe6e1!important;
  box-sizing:border-box!important;
}
.bottomnav > *,#bottom > *,#bamGlobalBottom > *{
  display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;
  gap:3px!important;min-width:0!important;width:100%!important;
  padding:5px 2px!important;margin:0!important;
  text-align:center!important;line-height:1.2!important;
}
.bottomnav svg,#bottom svg,#bamGlobalBottom svg{
  width:21px!important;height:21px!important;flex:0 0 21px!important;
  margin:0 auto!important;display:block!important;
}
.bottomnav b,#bottom b,.bottomnav span,#bottom span,#bamGlobalBottom span{
  font-size:10px!important;line-height:1.2!important;
  display:block!important;width:100%!important;text-align:center!important;
}
/* 图标外层容器不再撑开宽度 */
.bottomnav button b,#bottom a b{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:auto!important;height:auto!important;
}

/* ══════ 设计 token：圆角 / 间距 / 数字 ══════ */
:root{
  --r-sm: 8px;    /* 小元素：标签、徽章 */
  --r-md: 10px;   /* 按钮、输入框 */
  --r-lg: 12px;   /* 卡片 */
  --r-xl: 16px;   /* 大区块 */
  --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
}

/* 卡片统一 12px */
.card,.panel,.item,.member,.order,.proj,.device-card,.order-card,
.bam-assets-card,.acc-assets,[class*="acc-balance"]{
  border-radius: var(--r-lg) !important;
}
/* 按钮 / 输入统一 10px */
button,.btn,input,select,textarea,
[class*="acc-actions"] a,[class*="acc-refresh"]{
  border-radius: var(--r-md) !important;
}
/* 胶囊保持全圆 */
.pill,[class*="badge"]{ border-radius: var(--r-pill) !important; }

/* 数字等宽：价格、余额跳动时不抖 */
.amount,.price,strong,[id*="Price"],[id*="Bal"],[class*="amount"],
.acc-balance .amount,.device-value,.order-stats strong{
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 图标与文字基线对齐 */
svg{ vertical-align: middle; display: inline-block; flex-shrink: 0; }


/* ══════ 对比度修正（WCAG 1.4.3）══════ */

/* 标题只在浅底区域用深色，深底区域继承 */
h1,h2,h3{color:inherit;font-weight:800}
main h1, main h2, .card h1, .card h2, .card h3{color:var(--bm-ink)}
.hero h1,.hero h2,.hero h3,
[class*="acc-member"] h1,[class*="acc-member"] h2,
.membership-strip h1,.membership-strip h2{color:#fff}

/* 按钮：填充式白字，描边式用深色 */
button.primary,.btn.primary,[class*="acc-actions"] a.primary{color:#fff}
button.secondary,.btn.secondary,button.outline,.btn.outline,
button.line,.btn.line{color:var(--bm-ink)}

/* 灰色说明文字加深到 4.5:1 以上 */
#bamCsEmpty,.cscontacts summary,
[class*="muted"],[style*="color:#9aa9a1"],[style*="color: #9aa9a1"],
[style*="color:#7d8f85"],[style*="color: #7d8f85"],
#note,.note{color:var(--bm-muted)!important}

/* 汇率页货币名 */
.rate .code span{color:#55685d!important}
#stamp{color:#4f6257!important}

/* 排行榜徽章：白字对比不够 → 深字 */
.rk{color:#20302a!important;font-weight:800}
.rk.g1{background:linear-gradient(135deg,#e8c04a,#f5d978)!important;color:#3d2c05!important}
.rk.g2{background:linear-gradient(135deg,#c2cfc8,#dfe7e2)!important;color:#28332e!important}
.rk.g3{background:linear-gradient(135deg,#d9a86c,#ebc99a)!important;color:#3d2a12!important}
.rk:not(.g1):not(.g2):not(.g3){background:#e6ece8!important}

/* 榜单/明细里的小字 */
.nm span,.amount-sub,.meta,small{color:#55685d}
div[style*="font-size:11px"]{color:#55685d!important}
div[style*="font-size:10.5px"],div[style*="font-size:10px"]{color:#5b6e63!important}

/* 资金明细时间戳 */
.ledger .time,.ledger time,.entry time{color:#55685d!important}

/* 充值页提示条 */
p.warning,[class*="warning"]{color:#6b5210!important;background:#fbf3dd!important}


/* 图片预留比例，避免加载后撑开 */
.device-media{aspect-ratio:16/9}
img{max-width:100%}


/* ══════ CLS：按实测高度预留（2026-12-04 量）══════ */




#memberContent{min-height:200px}


.kline-wrap{min-height:311px}
p.time-note{min-height:18px;height:18px}
p.warning{min-height:62px}
#rates{min-height:300px}


/* 交易页状态条 */
#session{color:#c7d8ce!important}
#session *{color:inherit}
/* 标的元数据标签 */
.inst-row span,[class*="meta"] span,[class*="label"]{color:#4f6257!important}


/* 静态父容器预留（子元素由 JS 动态插入） */
section.view.active{min-height:800px}
#tabContent{min-height:240px}
#bodyBox{min-height:1324px!important}


/* ══════════════════════════════════════════════
   对比度修正 v2（按实测选择器，目标 WCAG AA 4.5:1）
   ══════════════════════════════════════════════ */

/* 资金明细：时间戳 / 状态 */
.l .s,.r .s,div.l>div.s,div.r>div.s{color:#55685d!important}

/* 交易页 */
#assetTabs button,.asset-tabs button{color:#4f6257!important}
.row>label,.row>label.lbl,label,#qtyLabel{color:#4f6257!important}
.kline-wrap #klineTitle,.kline-wrap #klineTip,#klineTitle,#klineTip{color:#4f6257!important}
#instInfo span,#instInfo label,#instInfo div>span{color:#55685d!important}

/* 设备页 */
.brand>span,p.eyebrow,main.main>p.intro{color:#55685d!important}
#zoneTabs button,.tabs button{color:#4f6257!important}
#deviceCount,.catalogue-count{color:#55685d!important}
.device-content p.device-description,.device-description{color:#55685d!important}
.device-stat>span,.device-stat span{color:#55685d!important}
.return-summary p,.return-note{color:#55685d!important}
.device-category{color:#7a5f22!important}
.rent-label,.device-category.rent-label{color:#4f6257!important}

/* 邀请页 */
main>p.intro,.brand>span{color:#55685d!important}
#drawTab,.reward-top-tabs button{color:#4f6257!important}
p.footer,#memberContent p.footer{color:#55685d!important}

/* 充值页 */
main>p.sub,p.netline,.netline{color:#55685d!important}

/* 排行页 */
.seg button{color:#4f6257!important}

/* 首页深色卡片上的文字 */
.acc-member-meta span,.acc-member-meta #bamMemberTier,
.acc-member-meta #bamProfileStatus{color:#cfe0d6!important}
.acc-balance .acc-label,.acc-balance>span.acc-label{color:#cfe0d6!important}
.acc-balance .acc-mini .acc-label{color:#b9cdc0!important}

/* 首页播报条 */
.head .nums,.head .nums span{color:#55685d!important}
.head .nums b{color:#1f7a4d!important}


/* ══════════════════════════════════════════════
   可访问性基础
   ══════════════════════════════════════════════ */

/* 键盘焦点必须可见 */
:focus-visible{
  outline:3px solid #0f7a52!important;
  outline-offset:2px!important;
  border-radius:6px;
}
/* 深色底上用浅色焦点环 */
.acc-member :focus-visible,
[style*="background:#183e31"] :focus-visible,
[style*="background:#0c2a1e"] :focus-visible{
  outline-color:#7ee0b0!important;
}
/* 鼠标点击不显示焦点环 */
:focus:not(:focus-visible){outline:none!important}

/* 跳转主内容链接：键盘用户第一个 Tab 到达 */
.bam-skip{
  position:absolute;left:-9999px;top:0;z-index:99999;
  padding:10px 16px;border-radius:0 0 10px 0;
  background:#0c2a1e;color:#fff;font-size:13px;font-weight:800;
  text-decoration:none;
}
.bam-skip:focus{left:0}

/* 仅屏幕阅读器可见 */
.bam-sr{
  position:absolute!important;width:1px;height:1px;
  padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* 尊重系统「减少动效」 */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:0.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:0.01ms!important;
    scroll-behavior:auto!important;
  }
}

/* 触控目标 ≥ 24×24（WCAG 2.5.8） */
button,a.btn,[role="button"]{
  min-height:24px;
}
/* 图标按钮补足尺寸 */
#bamCsBtn{min-width:44px;min-height:44px}

/* 表单：错误状态不只靠颜色 */
input[aria-invalid="true"],select[aria-invalid="true"],textarea[aria-invalid="true"]{
  border-color:#c0392b!important;
  box-shadow:0 0 0 3px #c0392b1f!important;
}


/* ── 对比度 v3：区分选中态 / 深浅上下文 ── */

/* 选中/激活的按钮：深底白字 */
.asset-tabs button.on,.asset-tabs button[aria-pressed="true"],
#assetTabs button.on,#assetTabs button[aria-pressed="true"],
.seg button.on,.seg button.active,
.tabs button.on,.tabs button.active,
#zoneTabs button.on,#zoneTabs button[aria-selected="true"],
.reward-top-tabs button.on,
button.primary,.btn.primary,
[role="tab"][aria-selected="true"]{
  color:#ffffff!important;
}
.asset-tabs button.on *,#assetTabs button.on *,
.seg button.on *,.tabs button.on *,
#zoneTabs button.on *,#zoneTabs button.on *{color:#ffffff!important}

/* 白卡上的标签用深色 */
.acc-balance .acc-label,.acc-assets .acc-label,
.acc-balance>span.acc-label,div>span.acc-label{color:#55685d!important}

/* 深色会员卡上的文字用浅色 */
.acc-member .acc-label,.acc-member-meta span,
#bamMemberTier,#bamProfileStatus{color:#cfe0d6!important}

/* 设备页时间说明 */
p.time-note,main p.time-note{color:#55685d!important}

/* 未选中的分段按钮保持深灰 */
.seg button:not(.on):not(.active){color:#4f6257!important}


/* ── 对比度 v4：选中态成对设置（背景 + 文字）── */
.asset-tabs button.on,.asset-tabs button[aria-pressed="true"],
#assetTabs button.on,#assetTabs button[aria-pressed="true"],
.seg button.on,.seg button.active,
.tabs button.on,.tabs button.active,
#zoneTabs button.on,#zoneTabs button[aria-selected="true"],
.reward-top-tabs button.on,
#tabLong.on,#tabLong.active,#tabLong[aria-selected="true"],
#teamTab.on,#teamTab.active,#teamTab[aria-selected="true"],
#drawTab.on,#drawTab.active,
#tab-initial.on,#tab-initial.active,#tab-initial[aria-selected="true"],
#tab-formal.on,#tab-formal.active,
#tab-activity.on,#tab-activity.active,
[role="tab"][aria-selected="true"]{
  background:var(--bm-ink)!important;
  color:#ffffff!important;
  border-color:var(--bm-ink)!important;
}
.asset-tabs button.on *,#assetTabs button.on *,
.seg button.on *,.tabs button.on *,
#zoneTabs button.on *,#tabLong.on *,#teamTab.on *,
#tab-initial.on *,[role="tab"][aria-selected="true"] *{
  color:#ffffff!important;
}
/* 未选中态：浅底深字 */
.asset-tabs button:not(.on),#assetTabs button:not(.on),
.seg button:not(.on):not(.active),
.tabs button:not(.on):not(.active),
#zoneTabs button:not(.on):not(.active){
  background:#ffffff!important;
  color:#4f6257!important;
  border:1px solid #d3ddd7!important;
}


/* ══════ CLS：按峰值预留（display:none 的元素不能靠自身 min-height）══════ */


