:root {
  --carrot: #ff7e36;
  --carrot-d: #f8631a;
  --ink: #212124;
  --sub: #868b94;
  --line: #eceef1;
  --bg: #ffffff;
  --chip: #f4f5f7;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
.dim { color: var(--sub); }
code { font-family: ui-monospace, Menlo, monospace; }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.brand { font-size: 1.15rem; }
.brand b { color: var(--carrot); }
.loc { border: none; background: none; font-size: .95rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.search { margin-left: auto; flex: 1; max-width: 360px; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--chip); border-radius: 10px;
  padding: 9px 14px; font-size: .95rem; outline: none;
}
.search input:focus { border-color: var(--carrot); background: #fff; }
.login { flex: 0 0 auto; border: 1px solid var(--carrot); background: #fff; color: var(--carrot-d);
  border-radius: 10px; padding: 8px 12px; font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.login:hover { background: var(--carrot); color: #fff; }
.login.on { border-color: var(--line); color: var(--ink); background: var(--chip); }
@media (max-width: 480px) { .search { max-width: 150px; } .loc { display: none; } }
.cats { max-width: 960px; margin: 0 auto; display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; }
.cat {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--sub);
  border-radius: 999px; padding: 6px 14px; font-size: .88rem; cursor: pointer; white-space: nowrap;
}
.cat.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

/* 본문 */
/* 뷰 탭 (마켓/게시판) */
.views { max-width: 960px; margin: 0 auto; display: flex; gap: 4px; padding: 0 16px; }
.viewtab { border: none; background: none; padding: 10px 14px; font-size: .95rem; font-weight: 700;
  color: var(--sub); cursor: pointer; border-bottom: 2.5px solid transparent; }
.viewtab.on { color: var(--ink); border-bottom-color: var(--carrot); }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

/* 게시판 */
.board-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.board-top .cats { flex: 1; padding: 0; margin: 0; }
.btn.sm { flex: 0 0 auto; padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.write-form { background: var(--chip); border-radius: 12px; padding: 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.write-form input, .write-form textarea, .write-form select {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: .95rem; font-family: inherit; width: 100%; }
.write-form textarea { resize: vertical; }
.wf-actions { display: flex; gap: 8px; align-items: center; }
.wf-actions select { flex: 1; }
.post-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.post { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.post-head { display: flex; align-items: center; gap: 8px; }
.post-cat { flex: 0 0 auto; background: var(--chip); color: var(--carrot-d); font-size: .74rem;
  font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.post-title { font-weight: 600; font-size: .98rem; }
.post-meta { color: var(--sub); font-size: .78rem; margin-top: 6px; }
.post-body { font-size: .92rem; margin-top: 10px; white-space: pre-line; color: #333; }
.post-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.post-foot .report { color: var(--sub); font-weight: 500; font-size: .8rem; }
.post-list .empty { text-align: center; color: var(--sub); padding: 40px 0; border: none; }
.notice {
  background: #fff6f0; border: 1px solid #ffe0cc; color: #a8501f; border-radius: 12px;
  padding: 12px 14px; font-size: .86rem; margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.card { cursor: pointer; }
.thumb {
  aspect-ratio: 1 / 1; border-radius: 14px; display: grid; place-items: center;
  font-size: 3rem; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  transition: transform .12s ease;
}
.card:hover .thumb { transform: translateY(-3px); }
.info { padding: 8px 2px 0; }
.info h3 { font-size: .95rem; font-weight: 500; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; font-size: 1rem; }
.meta { color: var(--sub); font-size: .8rem; margin-top: 2px; }
.likes { color: var(--sub); font-size: .8rem; margin-top: 3px; }
.empty { text-align: center; color: var(--sub); padding: 60px 0; }

/* 판매 버튼 */
.fab {
  position: fixed; right: max(16px, calc(50vw - 480px + 16px)); bottom: 24px; z-index: 20;
  background: var(--carrot); color: #fff; border: none; border-radius: 999px;
  padding: 14px 22px; font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(248,99,26,.4);
}
.fab:hover { background: var(--carrot-d); }

/* 모달 */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5);
  display: grid; place-items: end center; }
.modal[hidden] { display: none; }
.sheet {
  background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; position: relative; animation: up .22s ease;
}
.sheet.small { border-radius: 20px; margin-bottom: 5vh; padding: 24px; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.close { position: absolute; top: 12px; right: 12px; z-index: 2; border: none; background: rgba(255,255,255,.85);
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.m-thumb { aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 5rem; }
.m-body { padding: 18px 20px 24px; }
.chip { display: inline-block; background: var(--chip); color: var(--sub); font-size: .78rem;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.m-body h2 { font-size: 1.3rem; margin-bottom: 6px; }
.m-price { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.m-meta { color: var(--sub); font-size: .85rem; margin-bottom: 14px; }
.m-desc { font-size: .95rem; margin-bottom: 18px; white-space: pre-line; }
.m-seller { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--chip); border-radius: 10px; padding: 10px 12px; font-size: .8rem; margin-bottom: 16px; }
.m-seller code { color: var(--carrot-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
/* 온체인 평판 */
.rep { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border-radius: 10px;
  padding: 10px 12px; font-size: .82rem; margin-bottom: 14px; border: 1px solid var(--line); }
.rep-loading { color: var(--sub); }
.rep-good { background: #eefaf0; border-color: #cdeccf; }
.rep-new  { background: #fff8ec; border-color: #ffe6bf; }
.rep-bad  { background: #fdeeee; border-color: #f5c9c9; }
.rep-badge { font-weight: 700; }
.rep-note { color: #4a5568; }
.rep-name { color: var(--carrot-d); font-weight: 600; }
.rep-src { color: var(--sub); font-size: .72rem; }

/* 후기 */
.reviews { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 16px; }
.rev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stars { color: #ffb02e; letter-spacing: 1px; }
.linkbtn { margin-left: auto; border: none; background: none; color: var(--carrot-d);
  font-size: .85rem; font-weight: 700; cursor: pointer; }
.revform { background: var(--chip); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.starpick { font-size: 1.4rem; color: #ffb02e; cursor: pointer; margin-bottom: 8px; letter-spacing: 2px; }
.revform textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  font-size: .9rem; resize: vertical; margin-bottom: 8px; font-family: inherit; }
.revlist { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.revlist li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.rv-top { display: flex; align-items: center; gap: 8px; font-size: .78rem; margin-bottom: 3px; }
.rv-who { color: var(--sub); }
.rv-date { margin-left: auto; }
.rv-text { font-size: .9rem; }

.m-actions { display: flex; gap: 10px; }
.btn { flex: 1; border: none; border-radius: 12px; padding: 13px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--carrot); color: #fff; }
.btn.primary:hover { background: var(--carrot-d); }
.btn.ghost { background: var(--chip); color: var(--ink); }
.m-hint { color: var(--sub); font-size: .78rem; margin-top: 12px; text-align: center; }

footer { max-width: 960px; margin: 40px auto 90px; padding: 20px 16px 0; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; color: var(--sub); font-size: .8rem; }
