/* ==========================================================================
   TRX 能量租赁平台 — 购买卡片样式
   前缀 bc-，仅服务挂载点与配套弹窗/遮罩，不与全站样式冲突。
   颜色 / 圆角 / 阴影全部复用 assets/css/style.css 的设计变量。
   ========================================================================== */

/* ---------- 0. hidden 属性兜底 ----------
   本文件里 .bc-overlay / .bc-modal / .bc-banner / .bc-err 都设了 display，
   会覆盖 hidden 属性的 UA 默认 display:none，必须显式压制（与原版一致） */
.bc-overlay[hidden],
.bc-modal[hidden],
.bc-banner[hidden],
.bc-err[hidden],
.bc-mini[hidden],
.bc-ovstate[hidden] {
  display: none !important;
}

/* ---------- 1. 卡片本体 ---------- */
.bc-card {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* 桌面端固定 750px 高，与左栏等高；支付区贴底填充 */
@media (min-width: 721px) {
  .bc-card {
    height: 750px;
  }
  .bc-pay {
    margin-top: auto;
  }
}

.bc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bc-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
}

.bc-title svg { width: 19px; height: 19px; color: var(--red); }

.bc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.bc-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: bc-pulse 1.6s ease-in-out infinite;
}

.bc-badge .is-live,
.bc-badge span.is-live { color: var(--green); }
.bc-badge:has(.is-live) i { background: var(--green); }

@keyframes bc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------- 2. 单价行 ---------- */
.bc-price-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 59, 47, 0.28);
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(255, 59, 47, 0.12), transparent 70%),
    var(--surface-2);
}

.bc-price { display: flex; align-items: baseline; gap: 5px; }
.bc-price b {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad-red);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bc-price span { font-size: 0.85rem; font-weight: 700; color: var(--red-2); }
.bc-per { font-size: 12px; color: var(--text-muted); }

/* ---------- 3. 网络提示条 ---------- */
.bc-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  font-size: 12.5px;
  line-height: 1.55;
}

.bc-banner svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- 4. 表单字段 ---------- */
.bc-field { display: flex; flex-direction: column; gap: 6px; }

.bc-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bc-label label { font-size: 13px; font-weight: 600; color: var(--text); }
.bc-hint { font-size: 11.5px; color: var(--text-dim); }

.bc-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 3px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bc-shell:focus-within {
  border-color: rgba(255, 59, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 59, 47, 0.12);
}

.bc-shell.is-invalid { border-color: rgba(255, 59, 47, 0.65); }

.bc-input,
.bc-amount {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  padding: 8px 0;
}

.bc-amount { cursor: default; }
.bc-input::placeholder, .bc-amount::placeholder { color: var(--text-dim); }
.bc-mono { font-family: var(--mono); font-size: 13.5px; }

.bc-mini {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.bc-mini:hover { color: var(--text); border-color: rgba(255, 59, 47, 0.45); background: rgba(255, 59, 47, 0.08); }

.bc-err {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--red);
}

.bc-err svg { width: 13px; height: 13px; flex: 0 0 auto; }

/* ---------- 5. 能量档位 ---------- */
.bc-units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bc-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.bc-unit:hover {
  border-color: rgba(255, 59, 47, 0.5);
  background: rgba(255, 59, 47, 0.08);
  transform: translateY(-1px);
}

.bc-unit:active { transform: translateY(0); }
.bc-unit strong { font-size: 13.5px; color: var(--text); }
.bc-unit span { font-size: 10.5px; color: var(--text-dim); }

.bc-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 12px;
  color: var(--text-muted);
}

.bc-note span:first-child { color: var(--green); }

/* ---------- 6. 时长（固定） ---------- */
.bc-readonly {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}

.bc-readonly__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
}

.bc-readonly__label svg { width: 14px; height: 14px; color: var(--text-dim); }
.bc-readonly b { font-size: 13px; color: var(--text); }

/* ---------- 7. 汇总 ---------- */
.bc-summary {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 0 0 auto;   /* 关键：禁止 flex 压缩本区块，否则固定高度卡片会裁掉「应付金额」行 */
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
}

.bc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.bc-row + .bc-row { border-top: 1px solid var(--border); }
.bc-row b { font-weight: 600; color: var(--text); text-align: right; }

.bc-row--total {
  background: rgba(255, 59, 47, 0.07);
  padding: 10px 14px;
}

.bc-row--total span { color: var(--text); font-weight: 600; }
.bc-row--total b {
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--grad-red);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 8. 支付按钮 ---------- */
.bc-pay {
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--grad-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 34px -12px rgba(255, 59, 47, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.bc-pay:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 40px -12px rgba(255, 59, 47, 0.65);
}

.bc-pay:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45) brightness(0.75);
  box-shadow: none;
}

.bc-paynote {
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- 9. 弹窗（钱包信息 / 支付确认） ---------- */
.bc-layer { position: static; }

.bc-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bc-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px 24px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-raise);
  box-shadow: var(--shadow);
  animation: bc-pop 0.22s ease;
}

@keyframes bc-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.bc-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.bc-x:hover { color: var(--text); background: var(--surface-2); }

.bc-dialog__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 13px;
  background: rgba(255, 59, 47, 0.12);
  color: var(--red);
}

.bc-dialog__icon svg { width: 22px; height: 22px; }

.bc-dialog h3 { margin: 0 0 6px; font-size: 1.12rem; color: var(--text); }
.bc-dialog__sub { margin: 0 0 14px; font-size: 12.5px; color: var(--text-dim); }

.bc-address-box {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 12px;
}

.bc-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.bc-balance b { color: var(--text); }

.bc-grid-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.bc-tiny { margin: 0; font-size: 11px; color: var(--text-dim); line-height: 1.6; }

/* 确认弹窗明细 */
.bc-details {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 12px;
}

.bc-drow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.bc-drow + .bc-drow { border-top: 1px solid var(--border); }
.bc-drow b { font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }
.bc-drow .bc-accent { color: var(--red-2); font-size: 13.5px; }

.bc-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.bc-tip svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px; color: var(--amber); }

.bc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- 10. 按钮 ---------- */
.bc-btn {
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bc-btn--primary {
  background: var(--grad-red);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(255, 59, 47, 0.55);
}

.bc-btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.bc-btn--primary:disabled { filter: grayscale(0.5) brightness(0.75); cursor: not-allowed; box-shadow: none; }

.bc-btn--ghost {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.bc-btn--ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.bc-btn--danger { color: var(--red); border-color: rgba(255, 59, 47, 0.35); }
.bc-btn--danger:hover { color: var(--red); background: rgba(255, 59, 47, 0.1); border-color: rgba(255, 59, 47, 0.5); }

/* ---------- 11. 处理 / 结果遮罩 ---------- */
.bc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.bc-ovcard {
  width: min(380px, 100%);
  padding: 30px 26px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-raise);
  box-shadow: var(--shadow);
  text-align: center;
  animation: bc-pop 0.22s ease;
}

.bc-ovstate h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--text); }
.bc-ovstate p { margin: 0 0 16px; font-size: 13px; line-height: 1.7; color: var(--text-muted); }

.bc-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 59, 47, 0.18);
  border-top-color: var(--red);
  animation: bc-spin 0.8s linear infinite;
}

@keyframes bc-spin { to { transform: rotate(360deg); } }

.bc-ovbadge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
}

.bc-ovbadge svg { width: 26px; height: 26px; }
.bc-ovbadge--ok { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.bc-ovbadge--fail { background: rgba(255, 59, 47, 0.14); color: var(--red); }

.bc-tx {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--cyan);
  text-decoration: none;
  word-break: break-all;
}

.bc-tx:hover { text-decoration: underline; }

/* ---------- 12. Toast ---------- */
.bc-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 1400;
  transform: translate(-50%, 16px);
  max-width: min(420px, calc(100vw - 40px));
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bc-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.bc-toast.is-error { border-color: rgba(255, 59, 47, 0.5); color: #ffb4ad; }

/* ---------- 13. 滚动锁定 ---------- */
body.bc-locked { overflow: hidden; }

/* ---------- 13b. 首屏左侧宣传区 ----------
   与原版一致的自然流布局：标题 → 描述 → 标签 → 数据区 → 保障区，
   固定间距（40px / 26px），不强行拉伸贴底。 */
/* 标题与原版同级别的大字号 */
.hero--split .h-display {
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.08;
}

.hero--split .hero__stats {
  margin-top: 40px;
}

/* 数据大数字里的小单位：65,000 能量/笔 · 2.5 TRX/笔 · 1 小时起 */
.hero__stat__v small {
  font-size: 0.52em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 5px;
  letter-spacing: 0;
}

/* 数据格子加高一点，保证「2.5 TRX / 笔」等值完整显示不被裁切 */
.hero--split .hero__stat {
  padding: 22px 18px;
}
.hero--split .hero__stat__v {
  line-height: 1.5;
}
.hero--split .hero__stat__v small {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}

/* 三条保障：链上直付 / 钱包签名 / 自动交付 */
.hero-assur {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
  align-self: stretch;
}

.hero-assur__item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.hero-assur__ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 59, 47, 0.12);
  color: var(--red);
}

.hero-assur__ico svg { width: 15px; height: 15px; }

.hero-assur__item b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.hero-assur__item div > span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .hero-assur { grid-template-columns: 1fr; }
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 720px) {
  .bc-units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-card { padding: 17px 15px 15px; }
  .bc-price b { font-size: 1.6rem; }
  .bc-grid-actions { grid-template-columns: 1fr 1fr; }
  .bc-modal-actions { flex-wrap: wrap; }
}
