:root{
  --primary:#2563EB;
  --primary-100:#DBEAFE;
  --text:#0F172A;
  --muted:#475569;
  --bg:#F8FAFC;
  --card:#FFFFFF;
  --border:#E5E7EB;

  --success:#22C55E;
  --danger:#EF4444;
  --warning:#F59E0B;

  --shadow: 0 4px 12px rgba(15,23,42,0.06);
  --radius-lg:16px;
  --radius-md:12px;
  --container:1200px;

  --header-bg: rgba(255,255,255,0.92);
  --soft: linear-gradient(180deg, #fff, #fbfdff);
}

html[data-theme="dark"]{
  --primary:#60A5FA;
  --primary-100: rgba(96,165,250,.14);
  --text:#E5E7EB;
  --muted:#A3A3A3;
  --bg:#121212;
  --card:#1A1A1A;
  --border: rgba(255,255,255,.10);
  --shadow: 0 12px 28px rgba(0,0,0,0.45);
  --header-bg: rgba(18,18,18,0.78);
  --soft: linear-gradient(180deg, rgba(26,26,26,1), rgba(18,18,18,1));
}

*{box-sizing:border-box}
html,body{height:100%}

/* ✅ 핵심: 페이지가 짧아도 푸터가 하단으로 내려가게 레이아웃 고정 */
body{
  margin:0;
  font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.55;

  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* ✅ header.php에서 감싼 .site-shell 이 실제 flex 컨테이너 */
.site-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* ✅ 모든 페이지 본문이 남은 공간을 채워 푸터를 아래로 밀게 됨 */
.site-main{
  flex:1 1 auto;
  padding:22px 0 70px;
}

a{color:inherit; text-decoration:none}
button{font:inherit}
.container{max-width:var(--container); margin:0 auto; padding:0 20px}

.header{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--header-bg);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.header.scrolled{
  box-shadow:var(--shadow);
  border-bottom:1px solid var(--border);
}
.header-inner{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  font-weight:900;
  letter-spacing:0.04em;
  font-size:24px;
  line-height:1;
}

.nav{
  display:flex;
  align-items:center;
  gap:18px;
  color:var(--muted);
  font-weight:560;
}
.nav > a,
.nav .nav-item > button{
  padding:10px 8px;
  border-bottom:2px solid transparent;
  transition: .15s ease;
  color:inherit;
  background:transparent;
  border:none;
  cursor:pointer;
  font-weight:560;
}
.nav > a:hover,
.nav .nav-item > button:hover{
  color:var(--primary);
  border-bottom-color:var(--primary);
}

.nav-item{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 2px;
  margin:-6px -2px;
}

.dropdown{
  position:absolute;
  top:44px;
  left:0;
  min-width:240px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
  padding:8px;
  display:none;
  z-index:60;
}
.dropdown a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  color:var(--text);
  transition:.12s ease;
  font-weight:650;
  letter-spacing:-0.01em;
}
.dropdown a:hover{
  background:var(--primary-100);
  color:var(--primary);
}
.dropdown .desc{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  margin-left:auto;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown{
  display:block;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.btn{
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  padding:10px 14px;
  border-radius:var(--radius-md);
  cursor:pointer;
  transition:.15s ease;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.btn:hover{transform:translateY(-1px); box-shadow:var(--shadow)}
.btn.primary{
  border-color:transparent;
  background:var(--primary);
  color:#fff;
  box-shadow:0 14px 30px rgba(37,99,235,.22);
}
html[data-theme="dark"] .btn.primary{box-shadow:0 14px 30px rgba(0,0,0,.32)}
.btn.primary:hover{filter:brightness(0.98)}
.btn.ghost{
  background:transparent;
  border-color:rgba(37,99,235,.35);
  color:var(--primary);
}
html[data-theme="dark"] .btn.ghost{border-color:rgba(96,165,250,.28)}

.header-actions .btn{
  font-size:13px;
  padding:10px 12px;
  font-weight:750;
  letter-spacing:-0.02em;
}

.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  background:var(--card);
  cursor:pointer;
  transition:.15s ease;
}
.toggle:hover{transform:translateY(-1px); box-shadow:var(--shadow)}
.toggle .dot{
  width:10px; height:10px; border-radius:50%;
  background:var(--primary);
  box-shadow:0 0 0 6px rgba(37,99,235,.12);
}
html[data-theme="dark"] .toggle .dot{box-shadow:0 0 0 6px rgba(96,165,250,.10)}
.toggle .label{
  font-weight:750;
  letter-spacing:-0.02em;
  color:var(--text);
  font-size:13px;
}

/* ✅ 기존 main{...} 는 .site-main에서 처리하므로 삭제/미사용 (중복 영향 방지) */
section{margin:64px 0}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.section-title{
  font-size:28px;
  letter-spacing:-0.03em;
  margin:0;
  font-weight:720;
}
.section-sub{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

.hero{ margin-top:24px; }
.hero-grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:22px;
  align-items:stretch;
}
.hero-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:28px;
  overflow:hidden;
  position:relative;
}
.hero-card::before{
  content:"";
  position:absolute;
  inset:-120px -120px auto auto;
  width:260px; height:260px;
  background:radial-gradient(circle at 30% 30%, rgba(37,99,235,.22), rgba(37,99,235,0) 60%);
  pointer-events:none;
}
html[data-theme="dark"] .hero-card::before{
  background:radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), rgba(255,255,255,0) 60%);
}

.hero-kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  background:var(--primary-100);
  border:1px solid rgba(37,99,235,.18);
  border-radius:999px;
  color:var(--primary);
  font-weight:650;
  font-size:13px;
}
html[data-theme="dark"] .hero-kicker{border-color: rgba(255,255,255,.10)}
.pill-dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--success);
  box-shadow:0 0 0 6px rgba(34,197,94,.12);
}

.hero h1{
  margin:14px 0 10px;
  font-size:40px;
  line-height:1.15;
  letter-spacing:-0.05em;
  font-weight:780;
}
.hero p{
  margin:0;
  color:var(--muted);
  font-size:15px;
}

.hero-media{
  margin-top:16px;
  display:flex;
  align-items:center;
  gap:12px;
}

/* ✅ 수정: GIF 바깥 테두리박스 제거 */
.hero-gif{
  width:220px;
  max-width:100%;
  border-radius:18px;
  border:none;
  box-shadow:none;
  background:transparent;
  overflow:hidden;
}
.hero-gif img{width:100%; height:auto; display:block}

.hero-media-note{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.hero-cta{
  display:flex;
  gap:10px;
  margin-top:18px;
  flex-wrap:wrap;
}
.hero-metrics{
  display:flex;
  gap:12px;
  margin-top:18px;
  color:var(--muted);
  font-size:13px;
  flex-wrap:wrap;
}
.metric{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px dashed var(--border);
  background:transparent;
  border-radius:999px;
}
.metric strong{color:var(--text)}
.mini-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
  height:100%;
  justify-content:space-between;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
}
.grid{display:grid; gap:14px}
.grid.cols-4{grid-template-columns:repeat(4, 1fr)}

.rate-card{padding:16px; display:flex; flex-direction:column; gap:10px; min-height:132px}
.gc-name{
  font-weight:900;
  letter-spacing:-0.02em;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  line-height:1.25;
}
.rate-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: var(--dot, var(--primary));
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--dot, var(--primary)) 22%, transparent),
    0 10px 18px rgba(15,23,42,.08);
  flex:0 0 auto;
}
html[data-theme="dark"] .rate-dot{
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--dot, var(--primary)) 18%, transparent),
    0 12px 22px rgba(0,0,0,.28);
}
.rate-mid{display:flex; gap:12px; color:var(--muted); font-size:13px}
.rate-mid .kv{
  flex:1;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--soft);
}
.kv .k{font-size:12px}
.kv .v{
  margin-top:4px;
  font-weight:900;
  letter-spacing:-0.02em;
  color:var(--text);
  font-variant-numeric: tabular-nums;
}

.community-boards{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}
.board{padding:18px; border-radius:var(--radius-lg)}
.board-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.board-title{margin:0; font-size:18px; font-weight:900; letter-spacing:-0.03em}
.board-sub{margin-top:4px; color:var(--muted); font-size:12px}

.list{display:flex; flex-direction:column; gap:10px}
.row{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px 14px;
  transition:.15s ease;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.row:hover{transform:translateY(-1px); box-shadow:var(--shadow)}
.row-title{font-weight:760; letter-spacing:-0.02em; margin:2px 0 4px}
.row-meta{font-size:12px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap}

.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:750;
  font-size:12px;
  border:1px solid var(--border);
  white-space:nowrap;
}
.tag.danger{color:#EF4444; border-color:rgba(239,68,68,.25); background:rgba(239,68,68,.08)}
.tag.warn{color:#F59E0B; border-color:rgba(245,158,11,.25); background:rgba(245,158,11,.10)}
.tag.info{color:var(--primary); border-color:rgba(37,99,235,.25); background:rgba(37,99,235,.08)}
html[data-theme="dark"] .tag.info{border-color:rgba(96,165,250,.22); background:rgba(96,165,250,.10)}

.vendors-wrap{padding:20px; border-radius:22px}
.vendors-grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:14px;
}
.vendors-panel{
  padding:16px;
  border-radius:18px;
  border:1px solid var(--border);
  background:var(--soft);
}
.vendors-panel h3{margin:0; font-size:16px; font-weight:950; letter-spacing:-0.02em}
.vendors-panel p{margin:6px 0 0; color:var(--muted); font-size:12px}

.chipbar{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-weight:850;
  font-size:12px;
  cursor:pointer;
  transition:.15s ease;
  user-select:none;
}
.chip:hover{transform:translateY(-1px); box-shadow:var(--shadow); color:var(--text)}
.chip.active{
  background:var(--primary-100);
  color:var(--primary);
  border-color:rgba(37,99,235,.22);
}
html[data-theme="dark"] .chip.active{
  border-color:rgba(255,255,255,.12);
  color:#E5E7EB;
}

.vendor-cards{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
  margin-top:12px;
}
.vendor-card{padding:14px; display:flex; flex-direction:column; gap:10px; transition:.15s ease}
.vendor-card:hover{transform:translateY(-1px); box-shadow:var(--shadow)}
.vendor-name{font-weight:950; letter-spacing:-0.02em; display:flex; align-items:center; gap:8px}
.check{
  width:18px; height:18px;
  border-radius:50%;
  background:var(--primary);
  display:grid; place-items:center;
  color:#fff;
  font-size:12px;
  line-height:1;
  box-shadow:0 10px 18px rgba(37,99,235,.25);
}
html[data-theme="dark"] .check{box-shadow:0 10px 18px rgba(0,0,0,.30)}
.vendor-guarantee{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
  border:1px dashed var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:transparent;
}

footer{
  background:var(--text);
  color:#fff;
  padding:34px 0;
  margin-top:40px;
}
html[data-theme="dark"] footer{ background:#0A0A0A; }
.foot-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
  align-items:start;
}
.foot-muted{color:rgba(255,255,255,.7); font-size:13px}
.foot-links{
  display:flex; gap:14px; flex-wrap:wrap;
  justify-content:flex-end;
}
.foot-links a{color:rgba(255,255,255,.85)}
.foot-links a:hover{color:#fff; text-decoration:underline}

@media (max-width: 980px){
  .hero-grid{grid-template-columns:1fr}
  .grid.cols-4{grid-template-columns:repeat(2, 1fr)}
  .vendors-grid-2{grid-template-columns:1fr}
  .community-boards{grid-template-columns:1fr}
  .vendor-cards{grid-template-columns:1fr}
  .foot-grid{grid-template-columns:1fr}
  .foot-links{justify-content:flex-start}
  .nav{display:none}
  .hero-media{flex-direction:column; align-items:flex-start}
  .hero-gif{width:260px}
}
@media (max-width: 560px){
  section{margin:48px 0}
  .hero h1{font-size:32px}
  .grid.cols-4{grid-template-columns:1fr}
  .header-inner{height:66px}
  .btn,.toggle{padding:10px 12px}
  .brand{font-size:22px}
  .header-actions .btn{font-size:13px}
}

/* =========================
   HOME: 인증업체 노출 개수 제한
   ========================= */
#vendorBuy > *:nth-child(n+7){ display:none !important; }
#vendorSell > *:nth-child(n+7){ display:none !important; }
#vendorLocal > *:nth-child(n+5){ display:none !important; }

/* =========================
   COMMUNITY VIEW (댓글 UI 개선)
   ========================= */
.community-view .cv-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}
.community-view .cv-head-left{min-width:0}

.community-view .cv-title{
  margin:0;
  font-size:24px;
  font-weight:950;
  line-height:1.25;
  letter-spacing:-.02em;
  word-break:break-word;
}

.community-view .cv-badge{
  display:inline-block;
  margin-right:8px;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(37,99,235,.12);
  color:var(--primary);
  font-size:12px;
  font-weight:900;
  vertical-align:middle;
}

.community-view .cv-meta{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.community-view .cv-meta strong{color:var(--text); font-weight:950}
.community-view .cv-meta .dot{opacity:.7}

.community-view .cv-body{
  margin-top:16px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(148,163,184,.06);
}
.community-view .cv-body-text{
  white-space:pre-wrap;
  line-height:1.85;
  font-size:15px;
  color:var(--text);
}

.community-view .cv-comments-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.community-view .cv-comments-title{
  margin:0;
  font-size:16px;
  font-weight:950;
}
.community-view .cv-comments-count{
  color:var(--muted);
  font-weight:900;
}
.community-view .cv-comments-note{
  color:var(--muted);
  font-size:12px;
}

.community-view .cv-flash{
  margin:12px 0 0;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
}
.community-view .cv-flash.error{
  border-color: rgba(239,68,68,.25);
  background: rgba(239,68,68,.08);
}
.community-view .cv-flash.success{
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.08);
}

.community-view .cv-comments{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.community-view .cv-empty{
  padding:14px;
  border:1px dashed var(--border);
  border-radius:16px;
  color:var(--muted);
  background:rgba(148,163,184,.04);
}

.community-view .cv-comment{
  display:flex;
  gap:12px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.community-view .cv-avatar{
  width:40px;
  height:40px;
  border-radius:999px;
  background:rgba(37,99,235,.12);
  color:var(--primary);
  display:grid;
  place-items:center;
  font-weight:950;
  flex:0 0 auto;
}

.community-view .cv-comment-main{min-width:0; flex:1}

.community-view .cv-comment-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.community-view .cv-comment-nick{
  font-weight:950;
  letter-spacing:-.02em;
}
.community-view .cv-comment-time{
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.community-view .cv-comment-bubble{
  margin-top:10px;
  padding:12px 12px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:14px;
  background:rgba(148,163,184,.06);
  white-space:pre-wrap;
  line-height:1.75;
  font-size:14px;
  color:var(--text);
  word-break:break-word;
}

/* 댓글 작성 */
.community-view .cv-write-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.community-view .cv-write-title{
  margin:0;
  font-size:14px;
  font-weight:950;
}
.community-view .cv-write-note{
  color:var(--muted);
  font-size:12px;
}

.community-view .cv-write-form{margin-top:12px; display:grid; gap:10px}
.community-view .cv-write-grid{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:10px;
}
.community-view .cv-label{
  font-size:13px;
  font-weight:900;
  margin:0 0 6px;
}
.community-view .cv-input{
  width:100%;
  height:44px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:0 12px;
  background:var(--card);
  color:var(--text);
}
.community-view .cv-textarea{
  width:100%;
  min-height:110px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background:var(--card);
  color:var(--text);
  resize:vertical;
}

.community-view .cv-write-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:2px;
}

@media (max-width: 820px){
  .community-view .cv-write-grid{
    grid-template-columns: 1fr;
  }
}
