/* Earn 框架 v4 — 对齐现网 ant Card + Statistic */
.proto-earn-stats {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  width: 100% !important;
  max-width: none !important;
}

@media (max-width: 1200px) {
  .proto-earn-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .proto-earn-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.proto-earn-stat-card .ant-statistic-title,
.proto-earn-stat-card .pe-stat-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.proto-earn-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 10px;
  line-height: 1;
  opacity: 0.75;
  cursor: help;
  flex-shrink: 0;
  vertical-align: middle;
  color: inherit;
}

.proto-earn-tip:hover,
.proto-earn-tip.is-open {
  opacity: 1;
}

/* 浮层 Tooltip：挂 body，避免被表格 overflow 裁切 */
#proto-earn-float-tip {
  position: fixed;
  z-index: 11000;
  max-width: 300px;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2937;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: none;
}

#proto-earn-float-tip.is-visible {
  display: block;
}

.proto-earn-status-tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 22px;
  border: 1px solid #374151;
  color: #d1d5db;
  background: #1f2937;
  white-space: nowrap;
}

.proto-earn-status-tag.is-hold {
  color: #34d399;
  border-color: #065f46;
  background: rgba(6, 95, 70, 0.25);
}

.proto-earn-status-tag.is-processing {
  color: #fbbf24;
  border-color: #92400e;
  background: rgba(146, 64, 14, 0.25);
}

.proto-earn-status-tag.is-done {
  color: #9ca3af;
  border-color: #4b5563;
}

.proto-earn-status-tag.is-open {
  color: #93c5fd;
  border-color: #1e3a8a;
  background: rgba(30, 58, 138, 0.25);
}

/* 存入弹窗 */
#proto-earn-deposit-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
}

#proto-earn-deposit-modal.is-open {
  display: block;
}

#proto-earn-deposit-modal .pe-dep-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

#proto-earn-deposit-modal .pe-dep-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  background: #141414;
  border: 1px solid #303030;
  border-radius: 12px;
  padding: 20px 24px 16px;
  color: #e5e7eb;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

#proto-earn-deposit-modal .pe-dep-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

#proto-earn-deposit-modal .pe-dep-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

#proto-earn-deposit-modal .pe-dep-label {
  font-size: 12px;
  color: #9ca3af;
  margin: 16px 0 6px;
}

#proto-earn-deposit-modal .pe-dep-select,
#proto-earn-deposit-modal .pe-dep-input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #303030;
  background: #1f1f1f;
  color: #e5e7eb;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

#proto-earn-deposit-modal .pe-dep-select:focus,
#proto-earn-deposit-modal .pe-dep-input:focus {
  border-color: #059669;
}

#proto-earn-deposit-modal .pe-dep-amount-row {
  position: relative;
}

#proto-earn-deposit-modal .pe-dep-max {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #34d399;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

#proto-earn-deposit-modal .pe-dep-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

#proto-earn-deposit-modal .pe-dep-tips {
  margin: 16px 0 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.55;
  text-align: center;
}

#proto-earn-deposit-modal .pe-dep-submit {
  margin-top: 20px;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: #059669;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

#proto-earn-deposit-modal .pe-dep-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#proto-earn-deposit-modal .pe-dep-error {
  margin-top: 8px;
  font-size: 12px;
  color: #f87171;
  min-height: 18px;
}

#proto-earn-deposit-modal .pe-dep-state {
  margin-top: 8px;
  font-size: 12px;
  color: #fbbf24;
  min-height: 18px;
  text-align: center;
}

#proto-earn-detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
}

#proto-earn-detail-drawer.is-open {
  display: block;
}

#proto-earn-detail-drawer .pe-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

#proto-earn-detail-drawer .pe-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: #111827;
  border-left: 1px solid #374151;
  padding: 20px;
  overflow: auto;
  color: #e5e7eb;
}

#proto-earn-detail-drawer .pe-drawer h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

#proto-earn-detail-drawer .pe-drawer .pe-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
}

/* Earn 页强制隐藏社群埋点卡 */
body[data-proto-earn-page="1"] #proto-oct-track-panel {
  display: none !important;
}
