@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --bg: #fafaf8;
  --card: #ffffff;
  --ink: #191a18;
  --ink-2: #3a3c38;
  --muted: #7a7d76;
  --line: #e7e6e1;
  --line-2: #d6d4cd;
  --brand: #1f5c4a;
  --drop: #d23f22;
  --drop-dark: #b3341b;
  --up: #2b62c4;
  --r: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard", -apple-system, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 헤더 */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 56px; }
.logo { font-weight: 800; font-size: 19px; letter-spacing: -0.04em; display: flex; align-items: center; gap: 2px; }
.logo b { color: var(--drop); }
.logo .arrow { color: var(--drop); font-size: 22px; line-height: 1; margin-left: 2px; font-weight: 700; transform: translateY(-1px); }
.nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); height: 100%; }
.nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.top .login { margin-left: auto; font-size: 14px; color: var(--ink-2); }
.top .login:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 히어로 검색 */
.hero { padding: 44px 0 36px; }
.hero h1 { font-size: clamp(25px, 4vw, 36px); line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.045em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--drop); }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.search { display: flex; max-width: 680px; height: 50px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--card); overflow: hidden; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(25,26,24,.08); }
.search svg.i { margin: 0 0 0 14px; align-self: center; color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 15px; background: transparent; padding: 0 12px; }
.search button { border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; padding: 0 22px; cursor: pointer; white-space: nowrap; }
.search button:hover { background: #000; }
.hint { font-size: 13px; color: var(--muted); margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.hint span { color: var(--ink-2); cursor: pointer; }
.hint span:hover { text-decoration: underline; text-underline-offset: 3px; }
.figures { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); max-width: 680px; }
.figures strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* 섹션 */
.sec { margin-bottom: 52px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { font-size: 20px; margin: 0; letter-spacing: -0.04em; }
.sec-head a, .sec-head span.sub { font-size: 13px; color: var(--muted); }

/* 카테고리: 밑줄 탭 */
.chips { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.chip { flex: none; border: 0; background: none; padding: 8px 0 10px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.chip:hover { color: var(--ink); }
.chip.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* 상품 카드 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 16px; }
.card { display: flex; flex-direction: column; }
.thumb { aspect-ratio: 1; background: #efeee9; position: relative; border-radius: 4px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card:hover .name { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.badge { position: absolute; left: 0; bottom: 0; background: var(--drop); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; letter-spacing: 0; }
.badge.low { background: var(--ink); }
.card .body { padding: 10px 0 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card .name { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; line-height: 1.45; }
.price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.price-row .rate { color: var(--drop); font-weight: 800; font-size: 16px; }
.price-row .now { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.card .meta { display: flex; gap: 8px; font-size: 12px; color: var(--muted); min-height: 18px; }
.was { color: var(--muted); text-decoration: line-through; }
.spark { height: 26px; width: 100%; display: block; margin-top: 6px; opacity: .85; }

/* 랭킹 리스트 */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.rank ol { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.rank li { display: grid; grid-template-columns: 22px 48px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank .no { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 14px; }
.rank .ico { width: 48px; height: 48px; border-radius: 3px; background: #efeee9; overflow: hidden; }
.rank .ico img { width: 100%; height: 100%; object-fit: cover; }
.rank .t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rank .t:hover { text-decoration: underline; text-underline-offset: 2px; }
.rank .p { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.rank .p b { display: block; }
.rank .p small { color: var(--drop); font-size: 12px; }

/* 이용 방법 */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--ink); }
.how > div { padding: 18px 20px 4px 0; }
.how > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.how b { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 6px; font-weight: 600; }
.how h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.03em; }
.how p { margin: 0; color: var(--muted); font-size: 14px; }

/* 하위 페이지 */
.narrow { max-width: 820px; }
.page-head { padding: 36px 0 22px; }
.page-head h1 { font-size: clamp(24px, 3.6vw, 32px); margin: 0 0 6px; letter-spacing: -0.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 15px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 18px; font-size: 13px; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select { font: inherit; font-size: 13px; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 28px 6px 10px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7d76' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; appearance: none; cursor: pointer; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.three .rank li { grid-template-columns: 22px 44px 1fr auto; gap: 10px; }
.three .rank .ico { width: 44px; height: 44px; }
.faq { margin: 0; border-top: 1.5px solid var(--ink); }
.faq dt { font-weight: 700; padding: 16px 0 4px; font-size: 15.5px; letter-spacing: -0.02em; }
.faq dd { margin: 0; padding: 0 0 16px; color: var(--ink-2); font-size: 14.5px; border-bottom: 1px solid var(--line); }

/* 글 페이지 */
.article { padding-bottom: 20px; word-break: keep-all; }
.article > p, .article li, .article dd { font-size: 16.5px; line-height: 1.85; color: var(--ink-2); }
.article > p { margin: 0 0 1.3em; }
.article h2 { font-size: 23px; letter-spacing: -0.04em; margin: 2.4em 0 .8em; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.article h3 { font-size: 18px; letter-spacing: -0.03em; margin: 1.8em 0 .5em; }
.article strong { color: var(--ink); }
.article a:not(.btn) { color: var(--drop); text-decoration: underline; text-underline-offset: 3px; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.article li { margin-bottom: .35em; }
.article code { font-size: .92em; background: #efeee9; padding: 1px 5px; border-radius: 3px; }
.article .adsbygoogle { margin: 0 0 1.6em; }
.notes { margin: 0 0 1.4em; }
.notes dt { font-weight: 700; font-size: 16.5px; margin-top: 1em; }
.notes dd { margin: .2em 0 0; }
.article .faq dd { font-size: 15.5px; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 420px; }
.compare th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px 10px 0; border-bottom: 1.5px solid var(--ink); }
.compare td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.compare th + th, .compare td + td { padding-left: 14px; border-left: 1px solid var(--line); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 50px; padding: 0 20px; border-radius: var(--r); font-size: 15px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn.primary { background: var(--drop); color: #fff; }
.btn.primary:hover { background: var(--drop-dark); }
.btn.ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.btn .ext { opacity: .8; width: 14px; height: 14px; }

/* 상세 페이지 */
.crumb { font-size: 13px; color: var(--muted); margin: 20px 0 16px; }
.crumb a:hover { color: var(--ink); }
.detail { display: grid; grid-template-columns: 400px 1fr; gap: 36px; align-items: start; }
.detail .thumb { border-radius: 4px; }
.detail h1 { font-size: 20px; margin: 0 0 10px; letter-spacing: -0.035em; line-height: 1.45; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.tag + .tag::before { content: "·"; margin: 0 7px; color: var(--line-2); }
.tag.hot { color: var(--drop); font-weight: 700; }
.big-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.big-price .rate { color: var(--drop); font-size: 26px; font-weight: 800; }
.big-price .now { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.big-price .was { font-size: 15px; }
.verdict { display: flex; gap: 8px; align-items: baseline; margin: 0 0 16px; font-size: 14.5px; color: var(--ink-2); }
.verdict::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; transform: translateY(-2px); }
.verdict.wait::before { background: var(--drop); }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mini div { padding: 12px 0; }
.mini div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.mini small { color: var(--muted); font-size: 12px; display: block; }
.mini strong { font-variant-numeric: tabular-nums; font-size: 15px; }

.panel { border-top: 1.5px solid var(--ink); padding: 16px 0 0; margin-top: 44px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.panel h2 { font-size: 18px; margin: 0; letter-spacing: -0.035em; }
.panel > h2 { margin-bottom: 12px; }
.panel .desc { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }

/* 기간 선택: 세그먼트 */
.tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.tabs button { border: 0; background: var(--card); font-size: 13px; padding: 6px 13px; cursor: pointer; color: var(--muted); }
.tabs button + button { border-left: 1px solid var(--line-2); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--ink); color: #fff; }
#chart { width: 100%; height: 280px; display: block; }
.chart-tip { font-size: 13px; color: var(--muted); min-height: 20px; font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.alert-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.field { display: flex; align-items: center; height: 50px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); padding: 0 14px; gap: 6px; }
.field:focus-within { border-color: var(--ink); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 15px; background: transparent; }
.field span { color: var(--muted); font-size: 14px; }

.history { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.history th { font-weight: 500; color: var(--muted); font-size: 13px; }
.history th, .history td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: right; }
.history th:first-child, .history td:first-child { text-align: left; }
.history .d { color: var(--drop); }
.history .u { color: var(--up); }

/* 푸터 */
.foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 26px 0 40px; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 3px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .two, .three { grid-template-columns: 1fr; gap: 44px; }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .detail .thumb { max-width: 420px; width: 100%; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .how { grid-template-columns: 1fr; }
  .how > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .search button { padding: 0 16px; }
  .search svg.i { display: none; }
  .rank li { grid-template-columns: 20px 44px 1fr auto; gap: 10px; }
  .rank .ico { width: 44px; height: 44px; }
  .alert-form { grid-template-columns: 1fr; }
  .btns { grid-template-columns: 1fr 1fr; }
}
