/* 谁是枪王 · 2026 控制台 UI（后台 / 个人中心） */
:root {
  --bg: #0c0e12;
  --bg2: #141820;
  --card: #1a1f28;
  --line: #2a3340;
  --text: #f0f2f5;
  --muted: #8b939e;
  --accent: #d3542e;
  --accent2: #e0b040;
  --ok: #3cb371;
  --danger: #e05555;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --nav-w: 220px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html, body { min-height: 100%; background: var(--bg); color: var(--text); }

body {
  background:
    radial-gradient(ellipse 70% 40% at 10% -10%, rgba(211,84,46,.22), transparent 55%),
    radial-gradient(ellipse 50% 30% at 90% 0%, rgba(224,176,64,.12), transparent 50%),
    var(--bg);
}

a { color: var(--accent2); text-decoration: none; }

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.nav {
  background: rgba(18,22,30,.95);
  border-right: 1px solid var(--line);
  padding: 18px 12px 80px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.nav-brand .nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-brand h1 {
  font-size: 1.05rem;
  letter-spacing: .08em;
  color: var(--accent);
}

.nav-brand p {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
}

.nav button, .nav a.nav-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .9rem;
  font-family: inherit;
  margin-bottom: 4px;
}

.nav button:hover, .nav a.nav-link:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(211,84,46,.25), transparent);
  color: #fff;
}

.main {
  padding: 20px 22px 40px;
  max-width: 1100px;
}

.top-mobile {
  display: none;
}

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

.card h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  letter-spacing: .04em;
}

.card h3 {
  font-size: .92rem;
  margin: 12px 0 8px;
  color: var(--accent2);
}

.tip, .muted { color: var(--muted); font-size: .8rem; line-height: 1.5; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  background: linear-gradient(160deg, #222833, #171b22);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.stat .n {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent2);
}

.stat .l { font-size: .75rem; color: var(--muted); margin-top: 4px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin: 8px 0 4px;
}

input, select, textarea {
  width: 100%;
  background: #10141b;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .92rem;
  font-family: inherit;
}

textarea { min-height: 90px; resize: vertical; }

.btn {
  border: 1px solid var(--line);
  background: #222833;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: .85rem;
}

.btn:hover { border-color: var(--accent2); }
.btn.primary {
  background: linear-gradient(180deg, #d3542e, #9a3218);
  border-color: #e07040;
  color: #fff;
}
.btn.ok { background: #1e3d2f; border-color: var(--ok); color: #b8f0d0; }
.btn.danger { background: #3a1c1c; border-color: var(--danger); color: #ffc9c9; }
.btn.ghost { background: transparent; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  border: 1px solid var(--line);
}
.badge.pending { color: #f0c060; border-color: #806020; }
.badge.approved { color: #7ddea8; border-color: #2a6040; }
.badge.rejected { color: #f0a0a0; border-color: #803030; }
.badge.vip { color: var(--accent2); border-color: #806020; }

.hidden { display: none !important; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card .login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
}

.login-card label,
.login-card input,
.login-card .row,
.login-card .tip {
  text-align: left;
}

.login-card h1 {
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: 6px;
}

.field-captcha {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: end;
}

.field-captcha img {
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  width: 120px;
  object-fit: cover;
  background: #000;
}

.qr-preview {
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tabs button {
  border: 1px solid var(--line);
  background: #151a22;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}
.tabs button.active {
  color: #fff;
  border-color: var(--accent);
  background: rgba(211,84,46,.25);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.asset-item {
  background: #12161e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.asset-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.asset-item .name { font-size: .72rem; margin: 6px 0; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  background: #222;
  border: 1px solid var(--accent2);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 99;
  font-size: .85rem;
  max-width: 90vw;
}

.bottom-nav {
  display: none;
}

.nav button i[data-icon],
.nav a.nav-link i[data-icon],
.bottom-nav button i[data-icon],
.user-nav button i[data-icon],
.menu-list i[data-icon],
.nav button i[data-lucide],
.nav a.nav-link i[data-lucide],
.bottom-nav button i[data-lucide],
.user-nav button i[data-lucide],
.menu-list i[data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav button i[data-icon] svg,
.nav a.nav-link i[data-icon] svg,
.bottom-nav button i[data-icon] svg,
.user-nav button i[data-icon] svg,
.menu-list i[data-icon] svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding-bottom: calc(72px + var(--safe-b));
  }
  .nav {
    display: none;
  }
  .top-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(18,22,30,.96);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .main { padding: 14px 12px 24px; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(14,16,22,.97);
    border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + var(--safe-b));
    z-index: 30;
    justify-content: space-around;
    gap: 2px;
  }
  .bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .68rem;
    padding: 4px 2px;
    font-family: inherit;
    line-height: 1.1;
    min-height: 52px;
  }
  .bottom-nav button i[data-icon],
  .bottom-nav button i[data-lucide] {
    width: 22px;
    height: 22px;
  }
  .bottom-nav button.active {
    color: var(--accent2);
  }
  .bottom-nav button.active i[data-icon],
  .bottom-nav button.active i[data-lucide] {
    color: var(--accent2);
  }
}

/* —— 个人中心 —— */
.user-page {
  --user-header-h: 58px;
}

.user-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: var(--user-header-h);
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(42, 51, 64, 0.85);
  background: rgba(12, 14, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.user-header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  color: var(--accent2);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.user-header-back:hover {
  color: #fff;
  background: rgba(224, 176, 64, 0.12);
  border-color: rgba(224, 176, 64, 0.35);
}

.user-header-back i[data-icon],
.user-header-back i[data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.user-header-title {
  justify-self: center;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  white-space: nowrap;
}

.user-header-end {
  justify-self: end;
  width: 1px;
  height: 1px;
}

.user-shell {
  min-height: calc(100vh - var(--user-header-h));
  padding: 20px 16px calc(72px + var(--safe-b));
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* 未登录：全屏居中大气布局 */
body:has(#authCard:not(.hidden)) {
  background:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(211, 84, 46, 0.32), transparent 58%),
    radial-gradient(ellipse 45% 35% at 95% 20%, rgba(224, 176, 64, 0.12), transparent 50%),
    radial-gradient(ellipse 40% 30% at 5% 70%, rgba(211, 84, 46, 0.08), transparent 45%),
    linear-gradient(180deg, #06070b 0%, #0c0e12 45%, #10141c 100%);
}

body:has(#authCard:not(.hidden)) .user-header-title {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
}

body:has(#authCard:not(.hidden)) .user-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px calc(28px + var(--safe-b));
  max-width: none;
}

.auth-gate {
  width: min(440px, 100%);
  margin: 0 auto;
}

.auth-panel {
  position: relative;
  background:
    linear-gradient(165deg, rgba(32, 38, 50, 0.96), rgba(18, 22, 30, 0.98));
  border: 1px solid rgba(224, 176, 64, 0.22);
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(224, 176, 64, 0.12) inset;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.auth-hero {
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo-wrap {
  width: 104px;
  height: 104px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 35%, rgba(211, 84, 46, 0.28), transparent 65%),
    rgba(10, 12, 16, 0.75);
  border: 1px solid rgba(211, 84, 46, 0.28);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.auth-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.auth-hero h2 {
  color: var(--accent);
  font-size: clamp(1.45rem, 4.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 0 0 10px;
  text-shadow: 0 2px 0 #8a3018, 0 0 32px rgba(211, 84, 46, 0.35);
}

.auth-hero .age-tip {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  font-size: 0.72rem;
  color: #f0a0a0;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid rgba(224, 85, 85, 0.35);
  background: rgba(58, 28, 28, 0.45);
}

.auth-lead {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 18em;
}

.auth-tabs.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  background: rgba(8, 10, 14, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.auth-tabs.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.auth-tabs.tabs button.active {
  color: #fff;
  background: linear-gradient(180deg, #d3542e, #9a3218);
  box-shadow: 0 6px 16px rgba(211, 84, 46, 0.35);
}

.auth-fields label {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.auth-fields label:first-child {
  margin-top: 0;
}

.auth-fields input {
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  background: rgba(10, 13, 18, 0.9);
  border-color: rgba(42, 51, 64, 0.95);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-fields input:focus {
  outline: none;
  border-color: rgba(211, 84, 46, 0.65);
  box-shadow: 0 0 0 3px rgba(211, 84, 46, 0.18);
}

.auth-fields .field-captcha {
  grid-template-columns: 1fr min(128px, 38%);
  gap: 10px;
  align-items: stretch;
}

.auth-fields .field-captcha img {
  width: 100%;
  height: 100%;
  min-height: 46px;
  border-radius: 12px;
}

#pwd2Wrap[hidden] {
  display: none !important;
}

.auth-submit {
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: 0 10px 28px rgba(211, 84, 46, 0.32);
}

.auth-msg {
  min-height: 1.4em;
  margin-top: 14px;
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 520px) {
  .user-page {
    --user-header-h: 54px;
  }

  .user-header {
    gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  }

  .user-header-back {
    font-size: 0.8rem;
    padding: 7px 10px 7px 6px;
  }

  .user-header-back span {
    max-width: 5.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-header-title {
    font-size: 0.88rem;
    letter-spacing: 0.08em;
  }

  body:has(#authCard:not(.hidden)) .user-shell {
    align-items: flex-start;
    padding: 18px 12px calc(20px + var(--safe-b));
  }

  .auth-panel {
    padding: 26px 18px 22px;
    border-radius: 18px;
  }

  .auth-logo-wrap {
    width: 92px;
    height: 92px;
    border-radius: 24px;
  }

  .auth-logo {
    width: 68px;
    height: 68px;
  }

  .auth-hero {
    margin-bottom: 18px;
  }

  .auth-fields .field-captcha {
    grid-template-columns: 1fr 110px;
  }

  .auth-submit {
    margin-top: 18px;
    padding: 13px 14px;
    letter-spacing: 0.12em;
  }
}

@media (min-width: 860px) {
  .user-header {
    padding-left: max(28px, env(safe-area-inset-left, 0px));
    padding-right: max(28px, env(safe-area-inset-right, 0px));
  }

  .auth-panel {
    padding: 36px 34px 30px;
  }
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #222833;
  border: 2px solid var(--line);
  flex-shrink: 0;
}

.avatar.lg {
  width: 96px;
  height: 96px;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 700;
}

.menu-list {
  list-style: none;
}

.menu-list li {
  border-bottom: 1px solid var(--line);
}

.menu-list li:last-child { border-bottom: 0; }

.menu-list button,
.menu-list a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  cursor: pointer;
  text-align: left;
}

.menu-list .menu-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #12161e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
}

.menu-list .menu-ico i[data-icon],
.menu-list .menu-ico i[data-lucide] {
  width: 18px;
  height: 18px;
}

.menu-list .chev {
  margin-left: auto;
  color: var(--muted);
}

.menu-list .meta {
  margin-left: auto;
  color: var(--muted);
  font-size: .82rem;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--accent2);
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 0;
}

.order-card {
  background: #12161e;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.order-card .row-between { margin-bottom: 6px; }

.order-card .amt {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent2);
}

.pkg-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 8px 0;
  cursor: pointer;
  background: #12161e;
}
.pkg-option.active {
  border-color: var(--accent);
  background: rgba(211,84,46,.12);
}

.user-nav {
  display: flex;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(14,16,22,.97);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + var(--safe-b));
  z-index: 30;
  justify-content: space-around;
  max-width: 720px;
  margin: 0 auto;
}
.user-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  padding: 4px 2px;
  font-family: inherit;
  min-height: 52px;
}
.user-nav button i[data-icon],
.user-nav button i[data-lucide] {
  width: 22px;
  height: 22px;
}
.user-nav button.active { color: var(--accent2); }

.subpage { display: none; }
.subpage.active { display: block; }

.avatar-edit-wrap {
  text-align: center;
  padding: 12px 0 20px;
}
.avatar-edit-wrap .avatar {
  margin: 0 auto 12px;
  display: block;
}
