:root {
  --bg: #070707;
  --bg-card: #111111;
  --bg-elevated: #181818;
  --gold: #d4af37;
  --gold-light: #f0d875;
  --gold-dim: #8a7028;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --text: #f5f0e6;
  --text-muted: #9a9588;
  --border: rgba(212, 175, 55, 0.22);
  --success: #4ade80;
  --danger: #f87171;
  --radius: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 55, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212, 175, 55, 0.06), transparent),
    var(--bg);
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 16px 0 64px;
}

/* Top social bar */
.top-bar {
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.top-social {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.top-social a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  transition: 0.2s;
}

.top-social a:hover {
  border-color: var(--gold);
  text-decoration: none;
  box-shadow: 0 0 14px var(--gold-glow);
  background: rgba(212, 175, 55, 0.08);
}

@media (max-width: 600px) {
  .top-social {
    justify-content: center;
  }
}

/* Header */
.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 28px var(--gold-glow);
  border: 2px solid rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
}

.brand h1 .tag {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--gold-light);
  -webkit-text-fill-color: var(--gold-light);
  margin-left: 4px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-light));
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 0 24px var(--gold-glow);
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* Buttons */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-color: var(--gold);
  color: #0a0a0a;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-outline {
  background: transparent;
}

.wallet-chip {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.wallet-chip.connected {
  color: var(--gold-light);
  border-color: var(--gold-dim);
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.single-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.section-highlight {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.06), transparent);
}

.card-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 14px;
}

.btn-block {
  width: 100%;
}

.hero-compact .hero-inner {
  padding: 16px 20px;
}

.hero-compact .hero-lead {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.hero-compact .hero-sub {
  display: none;
}

.stat-row .highlight {
  color: var(--gold-light);
  font-size: 1.05em;
}

/* Tabs removed — kept for legacy */
.tabs, .panel { display: block; }

.tabs { display: none; }

/* Cards grid */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: linear-gradient(160deg, var(--bg-card), #0d0d0d);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0.6;
}

.card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-light);
  word-break: break-all;
}

.card-value.sm {
  font-size: 1.05rem;
}

.card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Section */
.section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}

/* Status bar */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.ok {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge.warn {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border);
}

.badge.err {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Stake form */
.stake-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .stake-layout {
    grid-template-columns: 1fr;
  }
}

.form-card {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrap {
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="number"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--gold);
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn-row .btn {
  flex: 1;
  min-width: 120px;
}

/* My stats list */
.stat-list {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

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

.stat-row span:first-child {
  color: var(--text-muted);
}

.stat-row span:last-child {
  font-weight: 600;
  color: var(--gold-light);
  text-align: right;
}

/* Toast / alert */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transform: translateY(120%);
  opacity: 0;
  transition: 0.3s;
  font-size: 0.9rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.5);
}

.toast.success {
  border-color: rgba(74, 222, 128, 0.4);
}

.vault-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.vault-input-row input {
  flex: 1;
  min-width: 200px;
}

.loading {
  opacity: 0.5;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.desc-box {
  padding: 16px 18px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Hero */
.hero {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-card), #0a0a0a);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.06), transparent 40%);
  pointer-events: none;
}

.hero-inner {
  padding: 22px 24px;
  position: relative;
  z-index: 1;
}

.hero-lead {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.mechanism-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mech-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.84rem;
  color: var(--text);
}

.mech-icon {
  font-size: 1rem;
}

.form-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-social a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  transition: 0.2s;
}

.footer-social a:hover {
  border-color: var(--gold);
  text-decoration: none;
  box-shadow: 0 0 12px var(--gold-glow);
}

.footer-qq {
  font-size: 0.82rem;
  line-height: 1.8;
}

.footer-meta {
  opacity: 0.7;
}
