/* ============================================================
   狗狗币 · 宠物养成游戏 — 设计系统
   暗紫金 · 东方美学 · 游戏化
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@600;700;900&family=ZCOOL+KuaiLe&display=swap');

:root {
  --bg-deep: #0b0618;
  --bg-1: #150b2b;
  --bg-2: #1e1238;
  --bg-3: #2a1745;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --fire: #e0445b;
  --fire-light: #ff7a8a;
  --gold: #d4a574;
  --gold-bright: #e8c38a;
  --gold-deep: #b8894f;
  --champagne: #c9a25b;
  --text: #f3ecf8;
  --text-dim: #b9a8d0;
  --text-faint: #7d6a9c;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(212, 165, 116, 0.18);
  --card-hover: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glow-gold: 0 0 24px rgba(212, 165, 116, 0.35);
  --glow-purple: 0 0 24px rgba(124, 58, 237, 0.4);
  --font-serif: 'Noto Serif SC', 'PingFang SC', serif;
  --font-fun: 'ZCOOL KuaiLe', 'PingFang SC', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景层 */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(1000px 500px at 90% 5%, rgba(224, 68, 91, 0.22), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, rgba(212, 165, 116, 0.16), transparent 60%),
    linear-gradient(160deg, #0b0618 0%, #150b2b 45%, #0f0820 100%);
}
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 195, 138, 0.8), rgba(232, 195, 138, 0) 70%);
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

/* 布局 */
.app {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(11, 6, 24, 0.96) 70%, rgba(11, 6, 24, 0));
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, #7c3aed, #e0445b);
  box-shadow: var(--glow-purple);
  animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(124, 58, 237, 0.4); }
  50% { box-shadow: 0 0 32px rgba(224, 68, 91, 0.55); }
}
.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 19px;
  background: linear-gradient(90deg, #e8c38a, #f5dfb8, #d4a574);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.logo-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 2px; }

/* 导航 */
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav-item {
  position: relative;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--text-dim);
  transition: all 0.25s;
  white-space: nowrap;
  user-select: none;
  font-weight: 500;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(224,68,91,0.25));
}
.nav-item.active::after {
  content: '';
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-bright), var(--fire-light));
}

/* 用户区 */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.user-avatar { font-size: 20px; }
.bone-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212,165,116,0.2), rgba(232,195,138,0.12));
  border: 1px solid rgba(212, 165, 116, 0.4);
  font-weight: 700;
  color: var(--gold-bright);
  cursor: pointer;
}
.bone-chip .b { font-size: 15px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  user-select: none;
  letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(135deg, #e8c38a, #d4a574 50%, #b8894f);
  color: #3a2508;
  box-shadow: 0 4px 18px rgba(212, 165, 116, 0.4);
}
.btn-gold:hover { box-shadow: 0 6px 26px rgba(212, 165, 116, 0.6); }
.btn-purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
}
.btn-purple:hover { box-shadow: 0 6px 26px rgba(124, 58, 237, 0.65); }
.btn-fire {
  background: linear-gradient(135deg, #ff7a8a, #e0445b);
  color: #fff;
  box-shadow: 0 4px 18px rgba(224, 68, 91, 0.45);
}
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { background: var(--card-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px;
}
.card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gold-text {
  background: linear-gradient(90deg, #e8c38a, #f5dfb8, #d4a574);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 4, 18, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, #241540, #160d29);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow), var(--glow-gold);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  margin-bottom: 6px;
  text-align: center;
}
.modal-sub { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--purple-light); box-shadow: 0 0 0 3px rgba(124,58,237,0.2); }

/* Toast */
.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(30, 18, 56, 0.95);
  border: 1px solid rgba(212, 165, 116, 0.4);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s;
  max-width: 80vw;
}
.toast.ok { border-color: rgba(120, 220, 160, 0.5); }
.toast.err { border-color: rgba(224, 68, 91, 0.6); }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 加载 */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(212,165,116,0.2);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(212,165,116,0.3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* 响应式 */
@media (max-width: 720px) {
  .nav { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; }
  .nav-item { padding: 8px 12px; font-size: 13.5px; }
  .topbar { flex-wrap: wrap; }
  .user-chip .nick { display: none; }
}
