﻿:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --surface-muted: #f2f2f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --secondary: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, 0.1);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 30px rgba(0, 0, 0, 0.08);
  --shadow-light: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 18px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -18%, rgba(0, 122, 255, 0.1), transparent 330px),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 360px, var(--bg) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(36px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 2px 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.total-meter {
  min-width: 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
  box-shadow: var(--shadow-light);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.total-meter span,
.total-meter strong {
  display: block;
}

.total-meter span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.total-meter strong {
  margin-top: 2px;
  color: var(--blue);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
}

.box-panel,
.progress-panel {
  margin-top: 12px;
}

.box-toggle,
.progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.box-toggle {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.box-toggle:active {
  transform: scale(0.992);
}

.box-toggle.is-collected {
  border-color: rgba(52, 199, 89, 0.38);
  background: linear-gradient(90deg, var(--green-soft), rgba(255, 255, 255, 0.9));
}

.box-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f2f2f7);
  overflow: hidden;
}

.box-image img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: grayscale(1) saturate(0.45) brightness(1.04);
  opacity: 0.48;
  transition: filter 180ms ease, opacity 180ms ease;
}

.is-collected .box-image img {
  filter: none;
  opacity: 1;
}

.box-copy {
  min-width: 0;
}

.box-copy b,
.box-copy span {
  display: block;
}

.box-copy b {
  font-size: 19px;
  font-weight: 760;
}

.box-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.is-collected .box-copy span {
  color: var(--green);
}

.box-check,
.status-dot {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: transparent;
  font-style: normal;
  font-weight: 850;
}

.box-check {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.is-collected .box-check,
.is-collected .status-dot {
  border-color: transparent;
  background: var(--green);
  color: #ffffff;
}

.progress-panel {
  padding: 15px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e5ea;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #5ac8fa);
  transition: width 180ms ease;
}

.suit-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.suit-stat {
  min-width: 0;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.suit-stat b,
.suit-stat span {
  display: block;
  white-space: nowrap;
}

.suit-stat b {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
}

.suit-stat span {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 760;
}

.suit-stat:active {
  transform: scale(0.98);
}

.suit-stat.is-active {
  border-color: rgba(0, 122, 255, 0.36);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.06);
}

.suit-stat.is-active b {
  color: var(--blue);
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  background: rgba(245, 245, 247, 0.74);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.filter-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-chip:active {
  transform: scale(0.98);
}

.filter-chip.is-active {
  border-color: rgba(0, 122, 255, 0.28);
  background: var(--blue);
  color: #ffffff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.card-tile {
  position: relative;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: var(--shadow-light);
  cursor: pointer;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.card-tile:active {
  transform: scale(0.975);
}

.card-tile.is-collected {
  border-color: rgba(52, 199, 89, 0.36);
  background: linear-gradient(180deg, var(--green-soft), rgba(255, 255, 255, 0.94));
}

.card-image-wrap {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f2f2f7);
  overflow: hidden;
}

.card-image-wrap img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: grayscale(1) saturate(0.45) brightness(1.02);
  opacity: 0.48;
  transition: filter 160ms ease, opacity 160ms ease;
}

.card-tile.is-collected img {
  filter: none;
  opacity: 1;
}

.card-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 25px;
  padding-top: 7px;
  font-size: 12px;
  font-weight: 700;
}

.card-name span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-dot {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-size: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-align: center;
}

@media (hover: hover) {
  .box-toggle:hover,
  .progress-panel:hover,
  .card-tile:hover,
  .suit-stat:hover,
  .filter-chip:hover {
    border-color: rgba(0, 0, 0, 0.18);
  }

  .card-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 24px rgba(0, 0, 0, 0.1);
  }
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero {
    align-items: stretch;
  }

  .total-meter {
    min-width: 96px;
  }

  .box-toggle {
    grid-template-columns: 68px minmax(0, 1fr) 30px;
  }

  .suit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}
