@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=swap');

:root {
  --page-1: #FFE9F4;
  --page-2: #E9F0FF;
  --page-3: #EAFBF3;
  --ink: #6B5B73;
  --ink-soft: #9C8FA6;
  --card: #FFFFFF;
  --card-line: rgba(150, 130, 170, .14);
  --accent: #FF9EC4;
  --accent-2: #9FB6FF;
  --vip: #FFB454;
  --shadow: 0 10px 30px rgba(170, 140, 190, .18);
  --shadow-hover: 0 16px 40px rgba(170, 140, 190, .30);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

html, body { min-height: 100%; }

body {
  font-family: 'Quicksand', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--page-1), var(--page-2) 50%, var(--page-3));
  background-attachment: fixed;
  min-height: 100vh;
  padding: 28px 18px 60px;
  position: relative;
  overflow-x: hidden;
}

/* ---------- 漂浮装饰 ---------- */
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5;
  animation: drift 14s ease-in-out infinite;
}
.blob-1 { width: 220px; height: 220px; background: #FFC2E0; top: -40px; left: -30px; }
.blob-2 { width: 260px; height: 260px; background: #C2D4FF; bottom: -60px; right: -40px; animation-delay: -5s; }
.blob-3 { width: 180px; height: 180px; background: #C2F5DA; top: 40%; right: 12%; animation-delay: -9s; }
.float-emoji {
  position: absolute; font-size: 26px; opacity: .8;
  animation: float 9s ease-in-out infinite;
}
.e1 { top: 12%; left: 8%; }
.e2 { top: 22%; right: 14%; animation-delay: -2s; }
.e3 { bottom: 18%; left: 16%; animation-delay: -4s; }
.e4 { bottom: 26%; right: 22%; animation-delay: -6s; }
.e5 { top: 55%; left: 50%; animation-delay: -3s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -24px) scale(1.08); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

/* ---------- 头部 ---------- */
.site-header { position: relative; z-index: 1; text-align: center; margin-bottom: 22px; }
.lang-toggle {
  position: absolute; top: 0; right: 0;
  border: 1px solid var(--card-line); cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 12px; padding: 7px 14px; border-radius: 999px;
  background: #fff; color: var(--ink-soft);
  box-shadow: var(--shadow); transition: all .15s ease;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--accent); }
@media (max-width: 520px) {
  .lang-toggle { top: -4px; padding: 6px 11px; font-size: 11px; }
}
.site-header h1 {
  font-size: 30px; font-weight: 700; letter-spacing: .5px;
  color: var(--ink);
  text-shadow: 0 2px 0 #fff;
}
.subtitle { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* ---------- 工具栏 ---------- */
.toolbar {
  position: relative; z-index: 1;
  max-width: 980px; margin: 0 auto 22px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center;
}
.tabs { display: flex; gap: 8px; background: #fff; padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.tab {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; background: transparent; color: var(--ink-soft);
  transition: all .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 12px rgba(255, 158, 196, .4); }
.search {
  flex: 1; min-width: 180px; max-width: 320px;
  border: none; outline: none; font-family: inherit; font-size: 13px;
  padding: 11px 16px; border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: var(--shadow);
}
.search::placeholder { color: var(--ink-soft); }

/* ---------- 颜色筛选栏（聚焦搜索框时展开） ---------- */
.color-filters {
  position: relative; z-index: 1;
  max-width: 980px; margin: 0 auto 22px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  animation: fade-in .2s ease;
}
.color-filters.hidden { display: none; }
.color-filters-label {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  margin-right: 2px;
}
.color-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--card-line); cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px;
  background: #fff; color: var(--ink-soft);
  transition: all .15s ease;
}
.color-pill:hover { color: var(--ink); border-color: var(--accent); }
.color-pill.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(255, 158, 196, .4); }
.color-pill .dot {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}
.color-pill .dot-all {
  background: conic-gradient(#FF9EC4, #B5BAFF, #5974FF, #71C9CE, #7BC461, #F4AE52, #FF8B5A, #E0455E, #A98B76, #2A2230, #FF9EC4);
}

/* ---------- 网格 ---------- */
.grid {
  position: relative; z-index: 1;
  max-width: 980px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 22px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: card-in .4s ease backwards;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.card:hover .preview-hint { opacity: 1; }
.card:hover .preview-wrap { transform: scale(1.015); }

.preview-wrap {
  border-radius: 16px; overflow: hidden;
  transition: transform .2s ease;
}
.preview-hint {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255, 255, 255, .85); color: var(--ink);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.card-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.card-name-en { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }

/* 角标 */
.badge {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge.free { background: #EAFBF3; color: #3E9B6E; }
.badge.vip {
  background: linear-gradient(135deg, #FFD27A, var(--vip)); color: #7A4B00;
  display: inline-flex; align-items: center; gap: 3px;
}

/* 卡片快捷解锁按钮 */
.card-buy {
  display: block; width: 100%; margin-top: 8px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 11px; padding: 7px 10px;
  border-radius: 10px; text-align: center;
  background: linear-gradient(135deg, var(--vip), #FF9A3C); color: #fff;
  box-shadow: 0 4px 12px rgba(255, 180, 84, .35);
  transition: transform .12s ease, filter .12s ease;
}
.card-buy:hover { transform: translateY(-1.5px); filter: brightness(1.04); }
.card-buy:active { transform: translateY(1px); }

/* ---------- 页脚 ---------- */
.site-footer { position: relative; z-index: 1; text-align: center; margin-top: 40px; color: var(--ink-soft); font-size: 13px; }

/* ---------- 详情弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(80, 60, 90, .4); padding: 18px;
  animation: fade-in .2s ease;
}
.modal.hidden { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.detail-card {
  position: relative; width: 100%; max-width: 320px;
  background: #fff; border-radius: 26px; padding: 22px;
  box-shadow: 0 24px 60px rgba(90, 60, 110, .35);
  animation: pop .24s ease; text-align: center;
}
@keyframes pop { from { opacity: .5; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
.detail-close {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; border: none; border-radius: 50%; cursor: pointer;
  background: #F3EEF7; color: var(--ink); font-size: 14px; transition: filter .15s ease;
}
.detail-close:hover { filter: brightness(.95); }
.detail-preview { margin: 6px 0 16px; }
.detail-info h2 { font-size: 22px; color: var(--ink); }
.detail-en { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.detail-info .badge { margin-top: 10px; display: inline-block; }
.detail-hint { font-size: 12px; color: var(--ink-soft); margin: 14px 0; line-height: 1.5; }
.copy-btn {
  width: 100%; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 16px rgba(255, 158, 196, .4); transition: transform .12s ease, filter .12s ease;
}
.copy-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn.copied { background: #8FD6A8; box-shadow: none; }

/* ---------- 授权（Phase 1 = Mock 打桩） ---------- */
.badge.owned { background: #E8F1FF; color: #3E72C4; }

.buy-zone { margin: 4px 0 14px; }
.buy-btn {
  width: 100%; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, var(--vip), #FF9A3C); color: #fff;
  box-shadow: 0 6px 16px rgba(255, 180, 84, .42); transition: transform .12s ease, filter .12s ease;
}
.buy-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.buy-btn:active { transform: translateY(1px); }
.owned-label { display: inline-block; font-size: 14px; font-weight: 700; color: #3E72C4; padding: 12px; }

.demo-panel { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.demo-btn {
  border: 1px dashed var(--card-line); cursor: pointer; font-family: inherit; font-weight: 700; font-size: 12px;
  padding: 8px 16px; border-radius: 999px; background: #fff; color: var(--ink-soft); transition: all .15s ease;
}
.demo-btn:hover { color: var(--ink); border-color: var(--accent); }
.demo-btn.small { padding: 5px 12px; font-size: 11px; }
.token-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: #F7F3FB; border-radius: 12px; padding: 8px 12px; font-size: 11px; color: var(--ink-soft);
}
.token-hint { max-width: 260px; text-align: left; line-height: 1.4; }
.token-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--ink); word-break: break-all; max-width: 260px; user-select: all;
}

.store-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  z-index: 80; background: rgba(60, 45, 70, .94); color: #fff; font-size: 13px; font-weight: 700;
  padding: 11px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(90, 60, 110, .4);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.store-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .site-header h1 { font-size: 24px; }
}
