/* ============ 收藏家的桌面 ============ */
:root {
  --felt: #10241c;
  --felt-hi: #1b3a2d;
  --gold: #e8c565;
  --paper: #fffdf4;
  --ink: #2b2620;
}

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

/* .arena 的 display:flex 会覆盖 UA 的 [hidden] 规则，这里强制生效 */
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--paper);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--felt-hi), transparent 70%),
    radial-gradient(900px 500px at 80% 110%, #142b36 0%, transparent 60%),
    var(--felt);
  position: relative;
}
/* 桌面噪点质感 */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
}

/* ============ 标题区 ============ */
.masthead { text-align: center; margin-bottom: 36px; }
.pokeball {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #1c1c1c;
  background: linear-gradient(to bottom, #ffe411 0 46%, #1c1c1c 46% 54%, #f6f2e9 54% 100%);
  position: relative;
  animation: wobble 4s ease-in-out infinite;
}
.pokeball::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f6f2e9;
  border: 3px solid #1c1c1c;
}
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  8% { transform: rotate(-14deg); }
  16% { transform: rotate(10deg); }
  24% { transform: rotate(0); }
}
h1 {
  font-family: 'ZCOOL QingKe HuangYou', sans-serif;
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 3px 0 #4a3a10, 0 8px 24px rgba(0, 0, 0, 0.5);
}
.sub {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 3px;
  color: #9db8a7;
}

/* ============ 搜索表单 ============ */
.seeker {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto 28px;
}
.seeker input {
  flex: 1;
  padding: 13px 18px;
  font: 14px 'Noto Sans SC', sans-serif;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(232, 197, 101, 0.35);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.seeker input:focus { border-color: var(--gold); background: rgba(255, 255, 255, 0.11); }
.seeker button {
  padding: 13px 28px;
  font: 700 15px 'ZCOOL QingKe HuangYou', sans-serif;
  letter-spacing: 3px;
  color: #3a2503;
  background: linear-gradient(to bottom, #f4d888, #d9a83c);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a6417, 0 8px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s, box-shadow 0.1s;
}
.seeker button:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6417; }
.seeker button:disabled { opacity: 0.6; cursor: wait; }

.status { text-align: center; color: #e0b8a0; margin-bottom: 20px; font-size: 14px; }

/* ============ 展示区 ============ */
.arena {
  display: flex;
  gap: 44px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* 3D 倾斜容器 */
.card-tilt { perspective: 1100px; }

/* ============ 卡片本体 ============ */
.card {
  --frame: #f3d048;          /* 卡框颜色，随稀有度变化 */
  --frame-deep: #c9a52e;
  --body-bg: #fdf7e3;
  width: 366px;
  height: 512px;
  border-radius: 16px;
  padding: 14px 13px 10px;
  background: linear-gradient(135deg, var(--frame) 0%, var(--frame-deep) 50%, var(--frame) 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 -2px 0 rgba(0, 0, 0, 0.25) inset,
    0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* —— 稀有度卡框 —— */
.card[data-rarity='C'] { --frame: #cfc8bb; --frame-deep: #a89f8e; }
.card[data-rarity='U'] { --frame: #d8925c; --frame-deep: #a05f2e; }
.card[data-rarity='R'] { --frame: #7fa8d9; --frame-deep: #40679e; }
.card[data-rarity='SR'] { --frame: #f3d048; --frame-deep: #c9982e; }
.card[data-rarity='UR'] {
  background: linear-gradient(120deg, #f7c3d0, #f9e79b, #b9f0c3, #a9d8f5, #d5b8f2, #f7c3d0);
  background-size: 300% 300%;
  animation: rainbow-frame 6s linear infinite;
}
@keyframes rainbow-frame {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* 镭射闪光层（SR / UR） */
.card .holo {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  mix-blend-mode: color-dodge;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 120, 180, 0.5) 36%,
    rgba(255, 235, 120, 0.55) 44%,
    rgba(120, 255, 200, 0.5) 52%,
    rgba(120, 180, 255, 0.5) 60%,
    transparent 76%
  );
  background-size: 260% 260%;
  background-position: var(--hx, 50%) var(--hy, 50%);
}
.card[data-rarity='SR'] .holo,
.card[data-rarity='UR'] .holo { opacity: 0.8; }
.card[data-rarity='R'] .holo { opacity: 0.35; }

.card-inner {
  background: var(--body-bg);
  border-radius: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 10px 6px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
  position: relative;
  z-index: 2;
  min-height: 0;
}

/* —— 顶栏 —— */
.card-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.stage-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #fff, #d8d2c2);
  border: 1px solid #a89f8e;
  white-space: nowrap;
  align-self: center;
}
.card-name {
  font-family: 'ZCOOL QingKe HuangYou', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-hp {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: #c22;
  white-space: nowrap;
}
.card-hp small { font-size: 11px; margin-right: 2px; }
.type-orb {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  align-self: center;
  flex: none;
  background: radial-gradient(circle at 32% 28%, #fff8 0 18%, transparent 40%), var(--type-color, #999);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1.5px #fff inset;
}

/* —— 画面 —— */
.card-art {
  height: 178px;
  flex: none;
  border: 5px solid;
  border-image: linear-gradient(to bottom, #efe6c8, #b8ad8a) 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) inset, 0 1px 0 #fff;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, #ffffffd8 0 14%, transparent 52%),
    repeating-radial-gradient(
      circle at 50% 42%,
      color-mix(in srgb, var(--type-color, #999) 26%, white) 0 3px,
      var(--type-bg, #eee) 3px 16px,
      color-mix(in srgb, var(--type-color, #999) 14%, white) 16px 30px
    );
}
.card-art img {
  position: absolute;
  left: 50%; top: 50%;
  width: 62%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px #fffc, 0 10px 26px rgba(0, 0, 0, 0.35);
}
.art-badges {
  position: absolute;
  right: 6px; top: 6px;
  display: flex;
  gap: 4px;
}
.art-badges span {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

/* —— 图鉴信息条 —— */
.card-info {
  font-size: 9px;
  text-align: center;
  padding: 3px 6px;
  margin: 5px 8px 6px;
  background: linear-gradient(to bottom, #e9dfbe, #d9cda4);
  border-radius: 999px;
  border: 1px solid #b3a67c;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— 技能区 —— */
.moves { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; padding: 0 2px; min-height: 0; overflow: hidden; }
.move { display: flex; align-items: flex-start; gap: 8px; padding: 2px 0; }
.move + .move { border-top: 1px solid #0002; }
.move-cost { display: flex; gap: 2px; flex: none; padding-top: 2px; }
.energy {
  width: 17px; height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  background: radial-gradient(circle at 32% 28%, #fff8 0 18%, transparent 40%), var(--e-color, #999);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px #fff inset;
}
.move-main { flex: 1; min-width: 0; }
.move-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.move-name { font-weight: 900; font-size: 14px; letter-spacing: 0.5px; }
.move-dmg { font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 900; font-size: 17px; }
.move-text {
  font-size: 9px;
  line-height: 1.4;
  color: #4a4437;
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* —— 弱点 / 抵抗 / 撤退 —— */
.card-bottom {
  display: flex;
  border-top: 2px solid #0003;
  padding: 3px 2px 2px;
  font-size: 8.5px;
  gap: 4px;
  flex: none;
}
.cb-cell { flex: 1; text-align: center; }
.cb-cell b { display: block; font-size: 8px; color: #6b6350; letter-spacing: 1px; margin-bottom: 2px; }
.cb-cell .energy { width: 14px; height: 14px; font-size: 8px; }
.cb-val { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }

/* —— 风味文本 & 卡底 —— */
.card-flavor {
  font-size: 8.4px;
  line-height: 1.45;
  font-style: italic;
  color: #55503f;
  border-top: 1px solid #0002;
  padding: 3px 2px 1px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: none;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  color: #6b6350;
  padding: 3px 2px 0;
}
.rarity-mark { font-weight: 900; letter-spacing: 1px; }
.card[data-rarity='SR'] .rarity-mark { color: #a8821c; }
.card[data-rarity='UR'] .rarity-mark {
  background: linear-gradient(90deg, #d33, #d90, #291, #16b, #92c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ 档案侧栏 ============ */
.dossier {
  width: 300px;
  background: rgba(255, 253, 244, 0.06);
  border: 1px solid rgba(232, 197, 101, 0.25);
  border-radius: 14px;
  padding: 22px 24px;
  font-size: 13px;
  line-height: 1.7;
  backdrop-filter: blur(4px);
}
.dossier h2 {
  font-family: 'ZCOOL QingKe HuangYou', sans-serif;
  font-size: 19px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 12px;
}
.dossier dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; }
.dossier dt { color: #9db8a7; white-space: nowrap; }
.dossier dd { color: var(--paper); }
.dossier .verdict {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(232, 197, 101, 0.3);
  color: #d8cfae;
  font-size: 12.5px;
}

/* ============ 动作 & 页脚 ============ */
.actions { text-align: center; margin-top: 34px; }
.actions button {
  padding: 12px 32px;
  font: 700 14px 'Noto Sans SC', sans-serif;
  letter-spacing: 2px;
  color: var(--paper);
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.actions button:hover { background: var(--gold); color: #3a2503; }

.colophon {
  text-align: center;
  margin-top: 56px;
  font-size: 12px;
  color: #6f8a7a;
}
.colophon a { color: #9db8a7; }
.colophon .brand {
  margin-top: 10px;
  letter-spacing: 1px;
  color: var(--gold);
  opacity: 0.75;
}

/* 卡片入场动画 */
@keyframes card-reveal {
  from { opacity: 0; transform: translateY(40px) rotateY(30deg) scale(0.9); }
  to { opacity: 1; transform: none; }
}
.card.reveal { animation: card-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1); }

@media (max-width: 820px) {
  .arena { flex-direction: column; }
  .dossier { width: 366px; max-width: 100%; }
}
