:root {
  --bg: #fff5f7;
  --panel: #ffffff;
  --ink: #3a2436;
  --muted: #9c7b8c;
  --pink: #e0508a;
  --pink-dark: #b8306a;
  --gold: #d4a441;
  --border: #f3d9e3;
  --shadow: 0 10px 30px rgba(184, 48, 106, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang HK", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #fff5f7 0%, #fdf0f4 100%);
  color: var(--ink);
  min-height: 100vh;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 900;
  font-size: 20px;
  color: var(--pink-dark);
  text-decoration: none;
}
.brand .dot { color: var(--gold); }

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

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdf0f4;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  color: var(--pink-dark);
  text-decoration: none;
}
.wallet-chip .coin::before { content: "💰"; margin-right: 2px; }

.link { color: var(--muted); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--pink-dark); }

.btn {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease, background .15s ease;
}
.btn:hover { background: var(--pink-dark); transform: translateY(-1px); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #b78a2f; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.flash {
  background: #fff0f5;
  border: 1px solid var(--border);
  color: var(--pink-dark);
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 600;
}

.title.lg { font-size: 26px; font-weight: 900; margin: 8px 0 4px; }
.tagline { color: var(--muted); margin: 0 0 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
  padding: 40px 20px 24px;
}
.hero h1 { font-size: 30px; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; }
.hero .disclaimer {
  font-size: 12px;
  color: var(--muted);
  max-width: 560px;
  margin: 14px auto 0;
  line-height: 1.6;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  padding: 10px 0 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-4px); }

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #fff;
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.12);
  object-fit: cover;
}
.avatar.lg { width: 140px; height: 140px; font-size: 60px; }

.card .name { font-weight: 900; font-size: 17px; margin-bottom: 2px; }
.card .cardline { font-size: 12px; color: var(--muted); margin-bottom: 10px; min-height: 32px; }

.tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--pink-dark);
  background: #fdf0f4;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

.progress {
  background: #f7e3ea;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--gold));
}

.profile-head {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  padding: 30px 0 10px;
}
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { margin: 0 0 4px; font-size: 26px; }
.profile-info .cardline { color: var(--muted); margin-bottom: 10px; }
.profile-info .bio { color: var(--ink); line-height: 1.6; }

.shop-section { margin-top: 24px; }
.shop-cat-title {
  font-weight: 900;
  font-size: 15px;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gift-item {
  background: #fffafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.gift-item .gicon { font-size: 28px; }
.gift-item .gphoto {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 4px;
}
.gift-item .glabel { font-weight: 800; font-size: 13px; margin: 6px 0 2px; }
.gift-item .gpoints { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.gift-item .gcost { font-weight: 900; color: var(--pink-dark); margin-bottom: 8px; }

.gift-log { margin-top: 24px; }

.chat-section { margin-top: 20px; }

.chat-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.chat-visual {
  flex: 0 0 240px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

@media (max-width: 720px) {
  .chat-layout { flex-direction: column; }
  .chat-visual { flex-basis: auto; max-height: 320px; }
}

.chat-log {
  max-height: 360px;
  min-height: 160px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin-top: 20px;
}

.chat-bubble {
  max-width: 75%;
  padding: 9px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.me {
  align-self: flex-end;
  background: var(--pink);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.her {
  align-self: flex-start;
  background: #f7e3ea;
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fffafc;
}
.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.package-card {
  position: relative;
  background: #fffafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px 14px;
  text-align: center;
}
.package-bonus {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.package-usd { font-size: 22px; font-weight: 900; color: var(--ink); }
.package-coins { font-size: 13px; color: var(--pink-dark); font-weight: 700; margin: 4px 0 12px; }

.memories-section { margin-top: 24px; }
.memory-list { display: flex; flex-direction: column; gap: 10px; }
.memory-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffafc;
  border: 1px solid var(--border);
}
.memory-item.locked { opacity: .55; }
.memory-tier { font-weight: 800; font-size: 12px; color: var(--pink-dark); }
.memory-line { font-size: 13px; color: var(--ink); }
.memory-line.locked-text { color: var(--muted); font-style: italic; }

.auth-wrap {
  max-width: 380px;
  margin: 60px auto;
  padding: 0 16px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
}
.switch-line { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.switch-line a { color: var(--pink-dark); font-weight: 700; text-decoration: none; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--border); }
table.data td { padding: 8px; border-bottom: 1px solid var(--border); }
table.data .center { text-align: center; color: var(--muted); }

.topup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.topup-row input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); flex: 1; min-width: 160px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pink-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.toast.show { opacity: 1; }
