﻿:root {
  --bg: linear-gradient(180deg, #f9fafc 0%, #eef1f7 100%);
  --primary: #0b0c10;
  --primary-strong: #0b1220;
  --accent: #2563eb;
  --text: #0b0c10;
  --muted: #6b7280;
  --card: rgba(255, 255, 255, 0.94);
  --shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.2);
  --radius: 10px;
  --border: rgba(12, 18, 32, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: radial-gradient(circle at 20% 20%, #121826 0%, #0a0c14 50%, #05070c 100%);
    --primary: #e5e7eb;
    --primary-strong: #f3f4f6;
    --accent: #60a5fa;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --card: rgba(17, 24, 39, 0.9);
    --shadow: 0 10px 28px -22px rgba(0, 0, 0, 0.55);
    --border: rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: "PingFang SC","Microsoft YaHei","SF Pro Display","SF Pro Text","-apple-system","BlinkMacSystemFont","Segoe UI",sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  letter-spacing: 0.01em;
  line-height: 1.45;
  background-attachment: fixed;
}

.app-shell {
  width: min(520px, 100%);
  padding: 10px 10px 16px;
  position: relative;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #433a63;
  padding: 6px 10px;
  margin: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.35);
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6b61a8, #3f3a63);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px -12px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.14);
}
.nav-logo img {
  width: 16px;
  height: 16px;
  display: block;
}
.nav-name {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.4px;
}

header { display: none; }

.title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(12, 18, 32, 0.06);
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
  border: 1px solid var(--border);
}

.card {
  background: var(--card);
  background-image: linear-gradient(140deg, rgba(255,255,255,0.12), transparent);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.25);
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.card.profile-summary { margin-top: 10px; }
.card:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -18px rgba(0, 0, 0, 0.28); }

.balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.balance .label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.balance .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 6px 0;
}

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.block-gap { margin-top: 8px;margin-bottom: 8px; }

.chip {
  background: rgba(12, 18, 32, 0.04);
  color: var(--text);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.chip-stack { display: grid; gap: 6px; justify-items: end; }
.chip-ghost {
  background: rgba(12, 18, 32, 0.03);
  color: var(--text);
  border-color: var(--border);
}

.chip-button {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}
.chip-button:hover { transform: translateY(-1px); box-shadow: 0 6px 12px -10px rgba(0, 0, 0, 0.12); }
.chip-button.active {
  background: transparent;
  color: inherit;
  border-color: #2f294f;
  box-shadow: 0 0 0 1px rgba(47, 41, 79, 0.12);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 4px;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 14px;
}

.section-sub { color: var(--muted); font-size: 12px; }
.section-sub.right { display: block; text-align: right; }

.list { display: grid; gap: 5px; }
.list.compact .item { padding: 8px; }

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 10px 20px -16px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.item:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -18px rgba(0, 0, 0, 0.22); }

.item-info { display: flex; gap: 10px; align-items: center; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef1f6, #dce2ec);
  display: grid;
  place-items: center;
  color: #0b0c10;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 8px 16px -14px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: dark) {
  .avatar { color: #e5e7eb; background: linear-gradient(135deg, #1f2937, #111827); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 16px -14px rgba(0,0,0,0.6); }
  .pill { background: rgba(255,255,255,0.08); color: var(--text); border-color: rgba(255,255,255,0.1); }
  .chip { background: rgba(255,255,255,0.05); color: var(--text); border-color: rgba(255,255,255,0.08); }
  .chip-button:hover { box-shadow: 0 6px 12px -10px rgba(255,255,255,0.08); }
}

.item-title { font-weight: 700; font-size: 14px; }
.item-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.item-meta { color: var(--muted); font-size: 10.5px; }
.pill-ghost {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.form { display: grid; gap: 8px; }
.form-inline { grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus {
  outline: none;
  border-color: #6b61a8;
  box-shadow: 0 0 0 2px rgba(107, 97, 168, 0.12);
}
.link { color: var(--accent); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

.value-positive { color: #15803d; font-weight: 700; }

.value-neutral { color: #b91c1c; font-weight: 700; }
.ticker { align-items: flex-start; gap: 8px; }
.ticker-metrics { text-align: right; display: grid; gap: 2px; justify-items: end; }
.account-metrics { text-align: right; display: grid; gap: 2px; justify-items: end; }
.map { margin-top: 10px; display: grid; gap: 8px; }
.map-bar {
  width: 100%;
  height: 10px;
  background: rgba(12, 18, 32, 0.05);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.map-segment { height: 100%; }
.map-legend { display: grid; gap: 6px; }
.legend-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-val { color: var(--text); font-weight: 600; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.summary-grid.chain-single-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}
.summary-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 9px; box-shadow: 0 6px 12px -10px rgba(0,0,0,0.12); }
.summary-card.chain-card { padding: 5px; }
.summary-card.active {
  border-color: #6b61a8;
  box-shadow: 0 10px 20px -14px rgba(107, 97, 168, 0.5);
}
.summary-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.summary-value { font-size: 15px; font-weight: 800; }
.summary-meta { color: var(--muted); font-size: 11px; }

.value-token { color: var(--text); font-weight: 800; }

.profile-card { text-align: center; padding: 18px 14px; }

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #eef1f6, #dce2ec);
  color: #0b0c10;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 24px -16px rgba(15, 23, 42, 0.35);
}

@media (prefers-color-scheme: dark) {
  .profile-avatar { color: #e5e7eb; background: linear-gradient(135deg, #1f2937, #111827); box-shadow: 0 12px 24px -16px rgba(0,0,0,0.6); }
}

.profile-name { font-size: 18px; font-weight: 800; margin: 4px 0; }
.profile-desc { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.actions { display: grid; gap: 8px; }

.btn {
  padding: 9px 12px;
  border-radius: 9px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0f172a, #1f2a44);
  color: #f8fafc;
  box-shadow: 0 12px 24px -16px rgba(0,0,0,0.35);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:active { transform: translateY(1px); box-shadow: none; }

.hidden { display: none; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  overflow: visible;
}

.tab-item {
  border: none;
  background: transparent;
  padding: 7px 10px;
  font-weight: 600;
  color: #e6e9f7;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: color 160ms ease;
  border-radius: 6px;
  text-decoration: none;
}

.tab-item .tab-icon { font-size: 0; width: 0; height: 0; }

.tab-item.active {
  color: #ffffff;
  background: linear-gradient(180deg, #51497a 0%, #3a325a 100%);
  box-shadow: 0 10px 18px -16px rgba(0, 0, 0, 0.35);
}
.tab-item.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b61a8, #2563eb);
}
.nav-actions {
  display: flex;
  align-items: center;
}
.nav-logout {
  color: #dfe3f5;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 120ms ease;
}
.nav-logout:hover {
  background: rgba(255,255,255,0.08);
}

@media (prefers-color-scheme: dark) {
  .top-nav { background: #302b4f; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .tab-item { color: #dfe3f5; }
  .tab-item.active { color: #ffffff; background: #231f3b; }
}

@media (max-width: 420px) {
  .app-shell { padding: 10px 10px 14px; }
  .balance .value { font-size: 24px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.login-only { margin-top: 20px; }
