/* RealToken 代理中心 —— 黑金会员卡 */

:root {
  --bg: #0b100e;
  --bg-soft: #101714;
  --card: #141d19;
  --card-edge: rgba(212, 181, 120, 0.14);
  --ink: #e9e4d8;
  --muted: #8a927f;
  --gold: #d4b578;
  --gold-deep: #a8894f;
  --gold-bright: #f0d9a8;
  --green: #4fae7d;
  --red: #d97a6c;
  --num-font: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif SC', serif;
  --body-font: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body-font);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(212, 181, 120, 0.07), transparent 60%),
    repeating-linear-gradient(115deg, transparent 0 3px, rgba(255, 255, 255, 0.006) 3px 6px),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
}

.shell { max-width: 480px; margin: 0 auto; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
body.wide .shell { max-width: 1080px; padding-bottom: 40px; }

.num { font-family: var(--num-font); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gold-text { color: var(--gold-bright); }
.neg { color: var(--red); }

/* ---------- 卡片 ---------- */

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.028), transparent 45%), var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 14px;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.pad { padding: 18px 16px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.shell > *:nth-child(2) { animation-delay: 0.04s; }
.shell > *:nth-child(3) { animation-delay: 0.09s; }
.shell > *:nth-child(4) { animation-delay: 0.14s; }
.shell > *:nth-child(5) { animation-delay: 0.19s; }

/* ---------- 登录 ---------- */

.auth { padding-top: 9vh; display: flex; flex-direction: column; gap: 22px; }
.auth-brand { text-align: center; }
.seal {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center;
  font-family: var(--num-font); font-size: 24px; font-weight: 700; color: #1a130a;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 10px 34px rgba(212, 181, 120, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.auth-sub { font-size: 10px; letter-spacing: 0.34em; color: var(--gold-deep); margin-bottom: 6px; }
.auth h1 { font-size: 30px; font-weight: 600; letter-spacing: 0.12em; margin-bottom: 8px; }
.auth-foot { text-align: center; font-size: 13px; }
.auth-foot a { color: var(--gold); }

/* ---------- 表单 ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.form input {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 181, 120, 0.18);
  border-radius: 10px; padding: 12px 13px;
  color: var(--ink); font-size: 16px; font-family: var(--body-font);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 181, 120, 0.14); }
.form input[readonly] { opacity: 0.5; }

.btn {
  border: none; border-radius: 10px; padding: 13px 20px;
  font-size: 15px; font-weight: 600; font-family: var(--body-font);
  cursor: pointer; letter-spacing: 0.14em;
  transition: transform 0.12s, filter 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; }
.btn.gold {
  color: #1a130a;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 6px 22px rgba(212, 181, 120, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border: 1px solid var(--card-edge); color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(212, 181, 120, 0.3); border-radius: 99px;
  background: rgba(212, 181, 120, 0.07);
  color: var(--gold); font-size: 12.5px; padding: 5px 13px;
  text-decoration: none; cursor: pointer; font-family: var(--body-font);
  transition: background 0.2s;
}
.chip:hover, .chip.on { background: rgba(212, 181, 120, 0.16); }
.badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; font-style: normal; }

.flash {
  background: rgba(212, 181, 120, 0.1); border: 1px solid rgba(212, 181, 120, 0.35);
  color: var(--gold-bright); border-radius: 10px; padding: 10px 14px;
  font-size: 13.5px; margin-bottom: 14px; animation: rise 0.3s both;
}

/* ---------- 顶部 ---------- */

.tophead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tophead .hello { font-size: 16px; font-weight: 600; }
.tophead-actions { display: flex; gap: 8px; }
.pagehead { margin: 6px 0 16px; }
.pagehead h1 { font-size: 22px; font-weight: 600; letter-spacing: 0.04em; }

/* ---------- 等级卡 ---------- */

.tiercard {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 20px 18px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.tiercard::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(420px 180px at 88% -20%, rgba(255, 255, 255, 0.16), transparent 55%),
    repeating-linear-gradient(105deg, transparent 0 2px, rgba(255, 255, 255, 0.02) 2px 4px);
}
.t-bronze { background: linear-gradient(150deg, #3d2f24, #241a12 58%, #171009); }
.t-silver { background: linear-gradient(150deg, #3c4148, #23272d 58%, #14171b); }
.t-gold   { background: linear-gradient(150deg, #4d3d1e, #2c2210 58%, #191307); }
.t-black  { background: linear-gradient(150deg, #26221c, #0f0d0a 62%, #060505); border-color: rgba(212, 181, 120, 0.4); }

.tiercard-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.tier-label { font-size: 11px; letter-spacing: 0.22em; color: rgba(233, 228, 216, 0.55); }
.tier-name { font-size: 28px; font-weight: 700; letter-spacing: 0.1em; margin-top: 2px;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tier-rate { text-align: right; }
.tier-rate .num { font-size: 34px; color: var(--gold-bright); display: block; line-height: 1.1; }
.tier-rate-sub { font-size: 11px; color: rgba(233, 228, 216, 0.5); letter-spacing: 0.12em; }

.progress-wrap { position: relative; z-index: 1; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(233, 228, 216, 0.75); margin-bottom: 7px; }
.progress-meta b { color: var(--gold-bright); font-weight: 600; }
.progress {
  height: 9px; border-radius: 99px; overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.progress i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 55%, var(--gold-bright));
  position: relative; overflow: hidden;
  animation: fill 0.9s cubic-bezier(0.25, 0.8, 0.3, 1) both 0.25s;
  transform-origin: left;
}
.progress i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 2.6s ease-in-out 1.2s infinite;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
.progress-scale { display: flex; justify-content: space-between; font-size: 11px; color: rgba(233, 228, 216, 0.4); margin-top: 6px; }

.tier-steps { display: flex; gap: 6px; margin-top: 14px; position: relative; z-index: 1; }
.step {
  flex: 1; text-align: center; font-size: 11px; padding: 6px 2px;
  border-radius: 8px; color: rgba(233, 228, 216, 0.45);
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.05);
}
.step b { display: block; font-size: 12.5px; font-weight: 600; margin-top: 1px; }
.step.hit { color: var(--gold-bright); border-color: rgba(212, 181, 120, 0.4); background: rgba(212, 181, 120, 0.1); }

/* ---------- 数据块 ---------- */

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.statgrid.four { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 14px 15px; }
.stat .big { font-size: 21px; margin-top: 3px; }
.huge { font-size: 34px; margin: 6px 0 14px; }

/* ---------- 列表 ---------- */

.list { display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 15px; }
.row-title { font-size: 14.5px; font-weight: 500; }
.row-right { text-align: right; }
.row-right .num { font-size: 15.5px; }
.tag {
  font-size: 11px; color: var(--gold); border: 1px solid rgba(212, 181, 120, 0.35);
  padding: 0 6px; border-radius: 6px; margin-left: 4px;
}
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.secline { font-size: 14px; color: var(--muted); margin: 20px 0 10px; font-weight: 500; }
.pager { display: flex; justify-content: space-between; margin-top: 14px; }

.status { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid; }
.s-pending { color: var(--gold); border-color: rgba(212, 181, 120, 0.4); }
.s-ok { color: var(--green); border-color: rgba(79, 174, 125, 0.4); }
.s-no { color: var(--red); border-color: rgba(217, 122, 108, 0.4); }

/* ---------- 邀请 ---------- */

.invite-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.invite-head h3 { font-size: 15px; }
.invite-link {
  font-size: 13px; word-break: break-all; color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.3); border: 1px dashed rgba(212, 181, 120, 0.35);
  border-radius: 10px; padding: 11px 12px; margin-bottom: 8px;
}
.invite a { color: var(--gold); }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  max-width: 480px; margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(13, 18, 15, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(212, 181, 120, 0.12);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11.5px;
  padding: 3px 14px; border-radius: 10px; transition: color 0.2s;
}
.tabbar a .ico { font-size: 17px; line-height: 1; }
.tabbar a.on { color: var(--gold-bright); }
body.wide .tabbar { display: none; }

/* ---------- 管理端表格 ---------- */

.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--card-edge); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid rgba(212, 181, 120, 0.07); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 8px; flex-direction: row; margin-bottom: 12px; }
.inline-form input { flex: 1; min-width: 0; }
.card h3 { font-size: 15px; margin-bottom: 12px; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .statgrid.four { grid-template-columns: 1fr 1fr; }
}
