/* ============================================
   IEO Module — Consolidated Stylesheet
   Renovation v1.0

   颜色语言:
     Gold  (#E9C46A / var(--gold))   → 强调、进度条、倒计时、主操作
     Green (#3DD9A0 / var(--green))  → 正收益、Live 状态、已投票
     Gray  (#66739A / var(--text-3)) → 标签、说明、零值、已锁定
     Red   (#FF6B7A / var(--red))    → 仅用于：跌幅、失败、错误
   ============================================ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. KEYFRAMES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@keyframes ieo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 196, 106, .45); }
  50%      { box-shadow: 0 0 0 10px rgba(233, 196, 106, 0); }
}

@keyframes ieo-pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, .45); }
  50%      { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

@keyframes ieo-trend-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. PROJECT CARD — Base
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-pc {
  background: var(--grad-card);
  border: 0;
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  margin-bottom: var(--gap-card);
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-card);
  transition: box-shadow var(--dur-fast);
}

.ieo-pc--locked {
  opacity: .55;
  pointer-events: none;
}

.ieo-pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ieo-pc-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* ★ Badge: 深色圆形 + 白色首字母 */
.ieo-pc-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  flex-shrink: 0;
  border: 0;
}

.ieo-pc-name {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}

.ieo-pc-gain {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.3;
}

.ieo-pc-right {
  text-align: right;
  flex-shrink: 0;
}

.ieo-pc-price {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}

.ieo-pc-plabel {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. PROGRESS TRACK — 全部金色
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-pc-track {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.ieo-pc-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--grad-gold);
  transition: width .6s ease;
}

/* 已满额 / 已锁定 → 灰色 */
.ieo-pc-fill--gray {
  background: var(--text-3);
}

.ieo-pc-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: 12px;
}

.ieo-pc-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-2);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. FOOTER / INPUT / BUTTON
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-pc-foot {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.ieo-pc-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: box-shadow var(--dur-fast);
}

/* ★ 输入框聚焦：金色描边 + 柔光（和 Swap 一致） */
.ieo-pc-input-wrap:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 8px rgba(233, 196, 106, .15);
}

.ieo-pc-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text-1);
  background: transparent;
  border: none;
  outline: none;
}

.ieo-pc-input::placeholder {
  color: var(--text-3);
}

.ieo-pc-max {
  padding: 0 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--gold);
  background: transparent;
  border: none;
  border-left: 1px solid var(--gold-border);
  cursor: pointer;
  white-space: nowrap;
}

/* ★ Subscribe 订单预览（预渲染容器，防布局跳动） */
.ieo-pc-preview {
  font-size: 11px;
  color: #22c55e;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
  line-height: 1.4;
}

.ieo-pc-preview:not(:empty) {
  margin-top: 6px;
}

/* ── Button base ── */
.ieo-pc-btn {
  min-height: var(--control-h);
  padding: 10px 18px;
  border: none;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--dur-fast), color var(--dur-fast),
              box-shadow var(--dur-fast), transform var(--dur-fast);
}

.ieo-pc-btn.active {
  background: var(--grad-gold);
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold);
}

.ieo-pc-btn.active:active {
  transform: scale(.99);
}

/* ★ Secondary：列表中第 2+ 个 Subscribe 按钮 */
.ieo-pc-btn.secondary {
  background: var(--surface-2);
  color: var(--text-1);
  box-shadow: none;
}

.ieo-pc-btn.secondary:active {
  transform: scale(.99);
  background: var(--surface-3);
}

.ieo-pc-btn.locked {
  background: var(--surface-2);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  cursor: default;
}

.ieo-pc-btn.claim {
  background: var(--grad-gold);
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold);
  font-weight: 600;
}

.ieo-pc-btn.claim:active {
  transform: scale(.99);
}

.ieo-pc-btn.disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
  opacity: .6;
}

/* ── Locked placeholder ── */
.ieo-pc-lock-input {
  flex: 1;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ieo-pc-lock-btn {
  padding: 10px 14px;
  border: none;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

/* ── Wallet display ── */
.ieo-pc-wallet {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border: 0;
  background: var(--surface-2);
}

.ieo-pc-wallet--empty {
  color: var(--text-3);
  font-weight: 400;
}

.ieo-pc-watermark {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: .04;
  pointer-events: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. HERO WIDE CARD (锁仓阶段)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-hero-wide {
  border: 0 !important;
  box-shadow: var(--sh-card);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. BOOST ROW (嵌入代币卡内部)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-boost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  margin-bottom: 6px;
}

.ieo-boost-row.locked {
  opacity: .5;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. COLLAPSED CARDS (已完成 / 可领取)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-collapsed {
  background: var(--grad-card);
  border: 0;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: var(--sh-card);
}

.ieo-collapsed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast);
}

.ieo-collapsed-head:active {
  background: var(--surface-2);
}

.ieo-collapsed-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.ieo-collapsed.open .ieo-collapsed-body {
  max-height: 300px;
}

.ieo-collapsed.open .ieo-collapsed-arrow {
  transform: rotate(180deg);
}

.ieo-collapsed-arrow {
  transition: transform .25s;
  color: var(--text-3);
  font-size: 11px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   8. TREND CHART (v2 — 英雄级图表面板)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-trend {
  position: relative;
  height: 100px;
  margin: 6px calc(-1 * var(--sp-4, 16px)) 12px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.12);
}

/* 顶部渐变遮罩 — 图表从卡片里"生长"出来 */
.ieo-trend::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(180deg, rgba(15, 20, 40, 0.6), transparent);
  z-index: 1;
  pointer-events: none;
}

.ieo-trend svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 扫光 — 降低 opacity 不抢图表注意力 */
.ieo-trend::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .03), transparent);
  animation: ieo-trend-sweep 3s ease-in-out infinite;
}
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   8.1 LOCK PHASE — Dual Pills
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-pc-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ieo-pc-pill {
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.ieo-pc-pill--gain {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
}

.ieo-pc-pill--gain.neutral {
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 500;
  font-size: 12px;
}

.ieo-pc-pill--time {
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 16px;
  letter-spacing: 1.5px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   8.2 ACTION REQUIRED BANNER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(233, 196, 106, 0.06);
  border: 1px solid rgba(233, 196, 106, 0.15);
  border-radius: var(--r-md);
  margin-bottom: var(--gap-card);
  cursor: pointer;
  transition: background var(--dur-fast);
}

.ieo-action-banner:active {
  background: rgba(233, 196, 106, 0.12);
}
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   9. HORIZONTAL SCROLL (备用)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-cscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px;
  margin: 0 -4px 14px;
  scrollbar-width: none;
}

.ieo-cscroll::-webkit-scrollbar {
  display: none;
}

.ieo-cscroll-item {
  flex: 0 0 86%;
  scroll-snap-align: start;
  background: var(--grad-card);
  border: 0;
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   10. PLACEHOLDER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ieo-placeholder {
  text-align: center;
  padding: 48px 20px;
}

.ieo-placeholder h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}

.ieo-placeholder p {
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.6;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━
   11. NUMBER ANIMATION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rolling-number {
  transition: color .3s;
}

.rolling-up {
  color: var(--green) !important;
}

.rolling-down {
  color: var(--red) !important;
}