/* ============================================
   ALPHA 质押挖矿 - 全局主题样式
   深蓝 Web3 风格
   ============================================ */

/* --- 主题变量 --- */
:root {
  --bg-main: #06104a;
  --bg-deep: #030936;
  --bg-card: #12235f;
  --bg-card-2: #172b6f;
  --bg-card-dark: #101d54;

  --blue-main: #4b95ff;
  --blue-light: #63aaff;
  --blue-border: #4f84ff;
  --blue-dark: #1a367e;

  --text-main: #ffffff;
  --text-sub: #aebce6;
  --text-muted: #7786bd;

  --orange-profit: #ff9a7a;
  --green: #38d7c2;

  --border-light: rgba(92, 143, 255, 0.75);
  --border-soft: rgba(92, 143, 255, 0.35);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --page-max-width: 480px;
}

/* --- 全局重置 --- */
* { box-sizing: border-box; }

/* --- 页面主体 --- */
body {
  margin: 0;
  min-height: 100vh;
  padding: 0 0 5.5rem;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.app-page {
  width: 100%;
  max-width: var(--page-max-width);
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #030936 0%, #06104a 38%, #071552 100%);
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- 顶部导航栏 --- */
.page-header {
  height: 76px;
  padding: 14px 18px 10px;
  background: #030936;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(75, 132, 255, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(92, 143, 255, 0.55);
  background: rgba(28, 54, 126, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.back-btn svg,
.back-btn i {
  color: #fff;
  font-size: 18px;
}

.page-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-left: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- 蓝色渐变按钮（通用） --- */
.btn-gradient {
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(135deg, #55a8ff, #3f86ff);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.btn-gradient:hover { opacity: 0.9; }
.btn-gradient:active { opacity: 0.8; }

/* --- 钱包胶囊按钮 --- */
.wallet-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #55a8ff, #4b7dff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wallet-pill .vip-tag {
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  font-size: 10px;
  font-weight: 700;
}

/* --- 卡片通用 --- */
.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  padding: 16px;
}

.card-lg {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-card-2) 0%, var(--bg-card) 100%);
  padding: 20px;
}

/* --- 页面内容容器 --- */
.page-content {
  padding: 16px 18px;
}

/* --- 两列网格 --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* --- 统计数字卡片 --- */
.stat-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-dark);
  padding: 14px;
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 800;
}

.stat-card .value.profit {
  color: var(--orange-profit);
}

.stat-card .value.green {
  color: var(--green);
}

/* --- 收益金额橙粉色 --- */
.profit-amount {
  color: var(--orange-profit);
  font-weight: 700;
}

/* --- 浅蓝分割线 --- */
.divider-light {
  height: 1px;
  background: rgba(92, 143, 255, 0.18);
  margin: 12px 0;
  border: none;
}

/* --- 表单输入 --- */
.input-group {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-dark);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group input,
.input-group select,
.input-group textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  padding: 0;
  width: 100%;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group .input-label {
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
}

/* --- 选项卡/Tabs 横向滚动 --- */
.tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-scroll::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-item.active {
  background: linear-gradient(135deg, #55a8ff, #3f86ff);
  color: #fff;
  border-color: transparent;
}

/* --- 表格卡片 --- */
.table-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-card-2) 0%, var(--bg-card) 100%);
  padding: 18px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(92, 143, 255, 0.12);
}

.table-row:last-child {
  border-bottom: none;
}

/* --- VIP 徽章 --- */
.vip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 30px;
  padding: 0 12px;
  border-radius: 16px;
  background: rgba(37, 117, 151, 0.65);
  border: 1px solid rgba(58, 219, 205, 0.28);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

/* --- 橙色进度/数字 --- */
.text-profit { color: var(--orange-profit); }
.text-green { color: var(--green); }
.text-sub { color: var(--text-sub); }
.text-muted { color: var(--text-muted); }

/* --- 状态标签 --- */
.status-tag {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-tag.active {
  background: rgba(56, 215, 194, 0.15);
  color: var(--green);
}

.status-tag.pending {
  background: rgba(255, 154, 122, 0.15);
  color: var(--orange-profit);
}

/* --- 页面底部安全区 --- */
.safe-bottom {
  height: calc(12px + env(safe-area-inset-bottom));
}

/* --- 快捷操作网格（首页用） --- */
.action-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.action-item:hover {
  border-color: var(--blue-border);
  background: rgba(75, 149, 255, 0.08);
}

.action-item .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(75, 149, 255, 0.15);
  color: var(--blue-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.action-item .sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

/* --- 排行榜样式 --- */
.rank-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-dark);
  overflow: hidden;
}

.rank-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(92, 143, 255, 0.08);
}

.rank-row:last-child { border-bottom: none; }

.rank-idx {
  width: 24px;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-main);
}

.rank-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}

.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }

.rank-name {
  flex: 1;
  margin-left: 8px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-power {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}

/* --- 面板标题 --- */
.panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.panel-title .tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* --- Hero 区域（首页用） --- */
.hero-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(75, 149, 255, 0.2);
  background: linear-gradient(135deg, rgba(67,97,238,0.12), rgba(58,12,163,0.08));
  padding: 18px;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.hero-sub {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* --- 资产卡片行（首页用） --- */
.balance-row {
  display: flex;
  gap: 10px;
}

.balance-card {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.03);
}

.balance-card .lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.balance-card .val {
  font-size: 16px;
  font-weight: 700;
}

/* --- 钱包连接弹窗 --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: #141824;
  border-radius: 20px 20px 0 0;
  padding: 1rem 1rem 1.5rem;
}

.modal-box .handle {
  width: 32px;
  height: 3px;
  border-radius: 999px;
  background: var(--border-soft);
  margin: 0 auto 12px;
}

/* --- 简易列表样式 --- */
.list-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-dark);
  overflow: hidden;
}

.list-item {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(92, 143, 255, 0.08);
}

.list-item:last-child { border-bottom: none; }

/* --- toast / 提示信息 --- */
.toast-msg {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(75, 149, 255, 0.1);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-sub);
}

/* --- 响应式 --- */
@media (max-width: 480px) {
  .page-content { padding: 14px 14px; }
}
