/* ============================================================
   Tele App - 重新设计的 UI
   ============================================================ */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-soft: #d1fae5;
  --primary-bg: #ecfdf5;
  --primary-faint: #f0fdf4;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --purple: #8b5cf6;
  --purple-bg: #f3f0ff;
  --orange: #f97316;
  --orange-grad: linear-gradient(135deg, #fb923c, #f97316);
  --bg: #f6f8fa;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e5e7eb;
  --border-soft: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 2px 12px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
input, textarea, button, select { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
img { max-width: 100%; display: block; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ============ 通用元素 ============ */
.page { padding: 14px 14px 24px; min-height: calc(100vh - 64px); }

.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.ic svg { display: block; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, .25); }
.btn-primary:active { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: #fff; }
.btn-orange { background: var(--orange-grad); color: #fff; box-shadow: 0 4px 12px rgba(249,115,22,.25); }
.btn-ghost { color: var(--primary); background: transparent; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  outline: none;
  transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--primary); background: #fff; }
textarea.input { resize: vertical; min-height: 80px; }

.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; min-width: 0; }
.muted { color: var(--text-3); font-size: 12px; }
.label { color: var(--text-2); font-size: 13px; margin-bottom: 8px; font-weight: 500; }
.h2 { font-size: 20px; font-weight: 700; margin: 6px 0 14px; letter-spacing: -.01em; }
.section-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; font-weight: 600; font-size: 15px; }
.section-title .more { color: var(--primary); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 500;
}
.tag-green { background: var(--primary-bg); color: var(--primary-dark); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-orange { background: var(--warn-bg); color: var(--warn); }
.tag-gray { background: #f1f5f9; color: var(--text-2); }

.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 13px; }

/* ============ 头部用户栏 ============ */
.user-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 17px; font-weight: 700; }
.user-info .username { color: var(--primary); font-size: 13px; margin-top: 1px; }
.user-info .uid { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.signin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 12px;
  background: var(--orange-grad); color: #fff;
  font-weight: 600; font-size: 13px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, .3);
  flex-direction: column; line-height: 1.2;
}
.signin-pill .sub { font-size: 10px; opacity: .9; font-weight: 400; }

/* ============ 轮播图 ============ */
.banner-wrap {
  position: relative; border-radius: var(--radius);
  overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  box-shadow: var(--shadow-sm);
}
.banner-track { display: flex; transition: transform .45s cubic-bezier(.4,0,.2,1); }
.banner-track > * { width: 100%; flex-shrink: 0; }
.banner-track img { width: 100%; height: auto; display: block; }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.banner-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); transition: .2s; }
.banner-dots span.on { width: 16px; border-radius: 3px; background: #fff; }

/* ============ 功能列表 ============ */
.feature-list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.feature-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}
.feature-item:last-child { border-bottom: 0; }
.feature-item:active { background: var(--border-soft); }
.feature-ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-ico.green { background: var(--primary-bg); color: var(--primary); }
.feature-ico.blue { background: var(--info-bg); color: var(--info); }
.feature-ico.purple { background: var(--purple-bg); color: var(--purple); }
.feature-ico.orange { background: var(--warn-bg); color: var(--warn); }
.feature-ico.red { background: var(--danger-bg); color: var(--danger); }
.feature-text { flex: 1; min-width: 0; }
.feature-text .t { font-size: 15px; font-weight: 600; color: var(--text); }
.feature-text .d { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.feature-arrow { color: #cbd5e1; }

/* ============ 资产卡片 ============ */
.assets-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.assets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.asset-box { padding: 16px; border-radius: var(--radius-md); }
.asset-trx { background: linear-gradient(135deg, #fff1f2, #ffe4e6); }
.asset-usdt { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.coin-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.coin-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; }
.coin-dot.trx { background: linear-gradient(135deg, #ef4444, #dc2626); }
.coin-dot.usdt { background: linear-gradient(135deg, #10b981, #059669); }
.asset-box .vl { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.asset-trx .vl { color: #1f2937; }
.asset-usdt .vl { color: var(--primary-dark); }
.assets-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.energy-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--primary-faint);
  padding: 12px 14px; border-radius: var(--radius-md);
  margin-top: 12px;
}
.energy-bar .left { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.energy-bar .left .ic { color: var(--primary); }
.energy-bar .num { font-weight: 700; font-size: 16px; color: var(--text); }

/* ============ 菜单列表 (个人中心) ============ */
.menu-list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--border-soft); }
.menu-ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.menu-ico.green { background: var(--primary-bg); color: var(--primary); }
.menu-ico.blue { background: var(--info-bg); color: var(--info); }
.menu-ico.purple { background: var(--purple-bg); color: var(--purple); }
.menu-ico.orange { background: var(--warn-bg); color: var(--warn); }
.menu-ico.red { background: var(--danger-bg); color: var(--danger); }
.menu-text { flex: 1; font-size: 15px; }
.menu-extra { color: var(--text-3); font-size: 13px; }

/* ============ Tabs(标签切换) ============ */
.tabs { display: flex; background: #eef1f5; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs .t { flex: 1; text-align: center; padding: 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; transition: .2s; }
.tabs .t.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.06); font-weight: 600; }

/* ============ 能量档位卡片 ============ */
.pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pkg-card {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: .2s;
}
.pkg-card.on { border-color: var(--primary); background: var(--primary-faint); }
.pkg-card .num { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.pkg-card .desc { color: var(--text-3); font-size: 12px; margin: 8px 0; }
.pkg-card .price { color: var(--primary); font-weight: 700; font-size: 16px; }
.pkg-card.on .price { color: var(--primary-dark); }
.pkg-card .price.muted-price { color: var(--text-2); }

/* ============ 转账模式收款卡片(QR) ============ */
.transfer-card {
  background: var(--primary-faint);
  border: 1.5px solid var(--primary-soft);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 14px;
}
.qr-wrap {
  width: 220px; height: 220px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, .12);
  display: flex; align-items: center; justify-content: center;
}
.qr-wrap img { width: 100%; height: 100%; }
.transfer-label {
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: 4px;
  margin-bottom: 10px;
}
.address-box {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.address-box .text { flex: 1; min-width: 0; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; color: var(--text); }
.address-box .copy {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.address-box .copy:active { background: #e2e8f0; }

/* 提示框 */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; gap: 10px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
  margin-bottom: 14px;
}
.notice .ic { color: var(--warn); flex-shrink: 0; margin-top: 2px; }

.notice-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
}
.notice-info .ic { color: var(--info); }

.notice-list {
  background: #f0f9ff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: #1e3a8a;
  line-height: 1.8;
}
.notice-list .title { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; color: var(--info); }
.notice-list ul { padding-left: 20px; color: #334155; }

/* ============ 闪兑 ============ */
.exch-box { background: #f8fafc; border-radius: var(--radius-md); padding: 16px; margin: 8px 0; }
.exch-input { display: flex; align-items: center; gap: 10px; }
.exch-input input { flex: 1; border: 0; background: transparent; font-size: 26px; font-weight: 700; outline: none; min-width: 0; letter-spacing: -.02em; }
.exch-coin {
  background: #fff; padding: 9px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; min-width: 96px;
  box-shadow: var(--shadow-sm);
}
.exch-swap { display: flex; justify-content: center; padding: 6px 0; }
.exch-swap-btn {
  width: 40px; height: 40px;
  background: var(--primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .35);
}
.rate-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
}

/* ============ 签到弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1000;
  display: flex; align-items: flex-end;
  animation: fadeIn .25s;
}
.modal-sheet {
  width: 100%;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
  max-height: 86vh;
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
}
.modal-sheet .handle { width: 40px; height: 4px; background: #e5e7eb; border-radius: 2px; margin: 0 auto 18px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.signin-card {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  margin: 8px 0 18px;
}
.signin-card .num { font-size: 44px; font-weight: 800; color: var(--primary-dark); letter-spacing: -.02em; }
.signin-card .lbl { color: var(--primary); margin-top: 4px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 18px; }
.week-day { text-align: center; padding: 4px 0; }
.week-day .c {
  width: 36px; height: 36px; line-height: 34px;
  border-radius: 50%;
  margin: 0 auto;
  background: #f1f5f9; color: var(--text-2);
  font-weight: 500;
  border: 2px solid transparent;
}
.week-day.today .c { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.week-day.signed .c { background: var(--primary); color: #fff; border-color: var(--primary); }
.week-day .lbl { color: var(--text-3); font-size: 11px; margin-top: 4px; }

.modal-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.modal-subtitle { text-align: center; color: var(--text-3); font-size: 13px; }

/* ============ 底部 tab ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 64px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  display: flex;
  border-top: 1px solid var(--border-soft);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
}
.tabbar .tab .ic { color: currentColor; }
.tabbar .tab.on { color: var(--primary); font-weight: 600; }

/* ============ 客服浮标 ============ */
.cs-fab {
  position: fixed;
  right: 16px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, .4);
  z-index: 40;
}

/* ============ Toast / Loading ============ */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, .9); color: #fff;
  padding: 11px 20px; border-radius: 10px;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  max-width: 80%; text-align: center; font-size: 14px;
}
.toast.show { opacity: 1; }
.loading { position: fixed; inset: 0; background: rgba(255,255,255,.4); z-index: 9998; display: none; align-items: center; justify-content: center; }
.loading.show { display: flex; }
.spinner { width: 38px; height: 38px; border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 列表项 ============ */
.list-item { background: var(--card); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.list-item .h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); }
.list-item .b { margin-top: 6px; font-weight: 600; font-size: 14px; }
.list-item .c { margin-top: 4px; font-size: 12px; color: var(--text-2); }

.address-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #f8fafc; padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.address-item .a { flex: 1; min-width: 0; }
.address-item .a .l { font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.address-item .a .ad { word-break: break-all; font-family: ui-monospace, monospace; font-size: 12px; color: var(--text); }

/* ============ 返回按钮 ============ */
.page-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-btn {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.back-btn:active { background: #f1f5f9; }
.page-header .title { font-size: 18px; font-weight: 700; flex: 1; }

/* ============ 表单详情/总价 ============ */
.summary {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.summary .row { padding: 8px 0; font-size: 14px; }
.summary .row + .row { border-top: 1px solid var(--border-soft); }
.summary .label-text { color: var(--text-2); }
.summary .price { color: var(--primary); font-weight: 700; }
.summary .total { font-size: 17px; }

/* 开关 */
.switch {
  position: relative; width: 46px; height: 26px;
  background: #e5e7eb; border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content: ''; position: absolute;
  left: 2px; top: 2px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .2s;
}
.switch.on { background: var(--primary); }
.switch.on::after { left: 22px; }
