:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1d1f27;
  --muted: #6b7080;
  /* 브랜드 하늘색(#21aee5)은 로고·장식에 쓰고, 글자·버튼은 대비 4.5 이상인 진한 톤을 쓴다 */
  --brand: #21aee5;
  --accent: #0a72a0;
  --on-accent: #ffffff;
  --accent-soft: #e8f6fc;
  --sale: #d32f2f;
  --border: #e6e8ef;
  --skeleton: #eceef4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --card: #1c1f27;
    --text: #f1f2f6;
    --muted: #9aa0b0;
    --accent: #21aee5;
    --on-accent: #08141b;
    --accent-soft: #143140;
    --sale: #ff6b6b;
    --border: #2a2e39;
    --skeleton: #252933;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* 티글 로고: 헤더는 Lottie 애니메이션(.brand-logo), 그 외엔 정적 SVG */
.brand-logo { position: relative; display: block; flex: none; height: 40px; aspect-ratio: 2080 / 1400; }
.brand-logo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; padding: 6.7% 6.8% 6.7% 10.7%; box-sizing: border-box; }
.brand-logo > svg { display: block; }
.logo-mark {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft);
}
.logo-mark > img { width: 72%; height: 72%; }

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; color: inherit; text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  outline: none;
}
.thumb { position: relative; overflow: hidden; aspect-ratio: 1200 / 630; background: var(--skeleton); }
/* 이미지가 아무리 길어도(상세페이지 전체 캡처 등) 영역 비율대로 잘리도록 겹쳐 놓는다 */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cat { font-size: 12px; color: var(--accent); font-weight: 600; }
.card .name { font-size: 16px; font-weight: 700; line-height: 1.35; margin: 0; }
.brand-name { font-size: 13px; color: var(--muted); }
.summary { font-size: 14px; color: var(--muted); line-height: 1.45; margin: 2px 0 0; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card .price { margin-top: auto; padding-top: 10px; }
.rate { color: var(--sale); font-weight: 800; font-size: 17px; }
.now { font-weight: 800; font-size: 17px; }
.was { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.pending-tag { align-self: flex-start; margin-top: 6px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 12px; font-weight: 600; }

/* 콘텐츠 카드: 썸네일이 상세페이지 윗부분 캡처라 세로로 길다 → 위쪽 기준으로 자른다 */
.content-card .thumb { aspect-ratio: 4 / 5; }
.content-card .thumb img { object-position: top; }
.content-card .body { padding: 12px 14px 14px; }
.content-card .name { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-card .summary { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-card .rate, .content-card .now { font-size: 15px; }

/* 이미지 없음·깨짐 */
.thumb.noimg { display: grid; place-items: center; }
.thumb.noimg::after { content: ""; width: 56px; height: 56px; background: url(/logo-mark.svg) center / contain no-repeat; opacity: .35; }

/* 안내 메시지 */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 30; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.card.skeleton .body > div { background: var(--skeleton); border-radius: 6px; height: 14px; }
.card.skeleton .body > div:nth-child(2) { width: 70%; height: 18px; }
.card.skeleton .body > div:nth-child(3) { width: 40%; }

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

.empty, .error { text-align: center; color: var(--muted); padding: 60px 0; grid-column: 1 / -1; }
.btn {
  display: inline-block;
  margin-top: 12px; padding: 10px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: inherit; font-size: 14px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 40px; border-top: 1px solid var(--border); }
footer a { color: inherit; }
