:root {
  --ink: #403d47;
  --muted: #938b91;
  --paper: #fffdfb;
  --blush: #f2e6df;
  --accent: #c47d72;
  --shadow: 0 14px 35px #67565318;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f8f2ee;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 90% 5%, #f4dfd6 0, transparent 28rem), #f8f2ee;
}

[hidden] { display: none !important; }

.app-shell {
  width: 100%;
  max-width: 620px;
  margin: auto;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(120px + env(safe-area-inset-bottom));
}

.topbar { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 15px; background: #655c6c; display: grid; place-items: center; box-shadow: 0 6px 15px #5f4e5b2b; }
.brand-mark span { font-size: 22px; }
.eyebrow { margin: 0; font-size: 10px; letter-spacing: 1.7px; color: #a69a99; font-weight: 700; }
.topbar h1 { margin: 3px 0 0; font-size: 21px; letter-spacing: 2px; }
.count-pill { margin-left: auto; flex: 0 0 auto; background: #fffaf7; border: 1px solid #eee3df; border-radius: 18px; padding: 7px 12px; text-align: center; box-shadow: var(--shadow); }
.count-pill strong { font-family: Georgia, serif; font-size: 20px; color: #bd746b; display: block; line-height: 1; }
.count-pill span { font-size: 10px; color: var(--muted); }
.intro-card { width: 100%; margin-top: 23px; border-radius: 23px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #eadbd7; color: #695e64; }
.intro-card p { min-width: 0; margin: 0; font-size: 14px; font-weight: 600; }
.spark { color: #bd7d73; font-size: 20px; margin-right: 7px; }
.intro-cat { flex: 0 0 auto; font-size: 35px; color: #a77e7a; transform: rotate(-8deg); }
.collection-head { width: 100%; display: flex; justify-content: space-between; align-items: center; margin: 29px 0 15px; }
.collection-head h2 { font-size: 21px; margin: 5px 0 0; }
.icon-button, .close-button { border: 0; background: #fffaf7; color: #897d84; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; box-shadow: var(--shadow); cursor: pointer; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.dex-card { min-width: 0; position: relative; overflow: hidden; border-radius: 18px; padding: 8px; background: var(--card-bg); box-shadow: var(--shadow); cursor: pointer; transition: transform .2s; }
.dex-card:active { transform: scale(.97); }
.mini-photo { height: 174px; border-radius: 13px; overflow: hidden; background: #ddd; }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; }
.mini-meta { min-width: 0; padding: 10px 5px 6px; display: flex; justify-content: space-between; align-items: flex-end; gap: 5px; }
.mini-meta h3 { overflow: hidden; font-size: 16px; margin: 0 0 4px; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta p { overflow: hidden; font-size: 10px; color: #8d7d7b; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.power { flex: 0 0 auto; font-family: Georgia, serif; color: #b96f68; font-size: 14px; }
.rarity-dot { position: absolute; right: 15px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: #fff8d2; border: 2px solid #fff; }
.empty-state { text-align: center; padding: 27px 16px 18px; color: var(--muted); }
.empty-illustration { font-size: 35px; color: #bd9e9d; margin-bottom: 9px; }
.empty-state h2 { font-size: 17px; color: #6b6267; margin: 0 0 7px; }
.empty-state p { font-size: 13px; line-height: 1.7; margin: 0; }
.meet-button { position: fixed; z-index: 3; right: 20px; bottom: calc(19px + env(safe-area-inset-bottom)); left: 20px; width: auto; max-width: 440px; margin: 0; border: 0; border-radius: 20px; padding: 13px 18px; display: flex; align-items: center; background: #655c6c; color: #fff; box-shadow: 0 12px 24px #51435545; cursor: pointer; text-align: left; font-size: 16px; font-weight: 700; }
.meet-button .plus { font-size: 24px; vertical-align: -2px; margin-right: 8px; }
.meet-button small { min-width: 0; margin-left: auto; overflow: hidden; font-size: 11px; line-height: 25px; color: #ded6df; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.desktop-hint { display: none; font-style: normal; }
.drop-overlay { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: #655c6ccc; color: white; pointer-events: none; }
.drop-overlay > div { width: min(80vw, 360px); padding: 42px 20px; border: 2px dashed #fff; border-radius: 26px; text-align: center; }
.drop-overlay span, .drop-overlay strong, .drop-overlay small { display: block; }
.drop-overlay span { font-size: 38px; margin-bottom: 12px; }
.drop-overlay strong { font-size: 22px; }
.drop-overlay small { margin-top: 8px; color: #eee7ef; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 5; background: #342b3288; display: grid; align-items: end; }
.dialog { width: 100%; max-width: 620px; max-height: 94vh; overflow: auto; margin: 0 auto; background: #fffaf7; border-radius: 27px 27px 0 0; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); position: relative; }
.close-button { position: absolute; right: 17px; top: 17px; background: #f3e9e5; }
.dialog h2 { margin: 0 35px 18px; font-size: 21px; }
.form-label { display: block; font-size: 12px; color: #867a7f; margin: 14px 0 6px; }
.text-input, .select-input { width: 100%; min-width: 0; border: 1px solid #eadeda; background: #fff; border-radius: 12px; padding: 12px; font: inherit; color: var(--ink); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-preview { height: 220px; border-radius: 17px; overflow: hidden; background: #eee; margin-bottom: 17px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.primary-button, .secondary-button, .danger-button { width: 100%; border: 0; border-radius: 14px; padding: 14px; font: inherit; font-weight: 700; cursor: pointer; margin-top: 18px; }
.primary-button { background: #655c6c; color: white; }
.secondary-button { background: #eee5e0; color: #625960; }
.danger-button { background: #fae4e0; color: #b85e57; }
.detail-card { border-radius: 22px; padding: 10px; background: var(--card-bg); margin-bottom: 20px; }
.detail-card .photo-preview { margin: 0; height: 310px; }
.tag { display: inline-block; padding: 6px 10px; border-radius: 20px; background: #fff8ed; color: #a76e58; font-size: 12px; margin-top: 10px; }
.detail-copy { font-size: 13px; color: #81767b; line-height: 1.7; }
.laser { background: linear-gradient(115deg, #fff8 0%, #fff0 28%, #fff9 42%, #fff0 60%, #fff7 80%); background-size: 220% 100%; animation: shine 3s linear infinite; }
@keyframes shine { to { background-position: -220% 0; } }
@media (min-width: 700px) { .desktop-hint { display: inline; } }
@media (min-width: 520px) { .card-grid { grid-template-columns: repeat(3, 1fr); } .mini-photo { height: 190px; } }
