/* ============================================================
   DESIGN SYSTEM — barotem.com 디자인 참조
   GongGothic 폰트 기반, 시안 컬러 시스템
   ============================================================ */

/* ── GongGothic 폰트 ── */
@font-face {
  font-family: 'GongGothic';
  src: url('../fonts/GongGothic/GongGothicLight.woff2') format('woff2'),
       url('../fonts/GongGothic/GongGothicLight.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: 'GongGothic';
  src: url('../fonts/GongGothic/GongGothicMedium.woff2') format('woff2'),
       url('../fonts/GongGothic/GongGothicMedium.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: 'GongGothic';
  src: url('../fonts/GongGothic/GongGothicBold.woff2') format('woff2'),
       url('../fonts/GongGothic/GongGothicBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: optional;
}

/* ── 색상 변수 ── */
:root {
  /* Primary — 바로템 시안 */
  --c-primary:       #46AFD2;
  --c-primary-dark:  #2B99C0;
  --c-primary-light: #ECF7FA;
  --theme-button:    var(--c-primary);   /* 구 코드 호환 */

  /* 판매/구매 */
  --c-sell:          #F03E3E;
  --c-sell-light:    #FFF0F0;
  --c-buy:           #46AFD2;
  --c-buy-light:     #ECF7FA;

  /* 등록 버튼 */
  --c-reg-sell:      #24B54A;
  --c-reg-buy:       #46AFD2;

  /* 카테고리 색상 — 바로템 */
  --c-category-item:        #F18194;
  --c-category-item-light:  #FFF0F4;
  --c-category-gift:        #5CB575;
  --c-category-gift-light:  #EAF8ED;
  --c-category-money:       #5D6175;
  --c-category-money-light: #EEEEF2;

  /* 텍스트 */
  --c-text:          #333333;
  --c-text-sub:      #6C6D72;
  --c-text-muted:    #808080;
  --c-text-disabled: #B4B4B4;

  /* 서피스 */
  --c-bg:            #F8F8F8;
  --c-surface:       #FFFFFF;
  --c-surface-2:     #F2F2F3;

  /* 보더 */
  --c-border:        #DAE0ED;
  --c-border-strong: #CCCCCC;

  /* 그린 */
  --c-green:         #24B54A;
  --c-green-light:   #EAF8ED;

  /* 콘텐츠 최대 너비 */
  --max-w:           1280px;
  --header-h:        66px;
  --subnav-h:        56px;

  /* 라디어스 */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* 그림자 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.12);
  --shadow-lg: 0 6px 16px rgba(0,0,0,0.14);

  /* 트랜지션 */
  --tr: 0.2s ease;

  /* 구 코드 호환 — blue 변수 (itemmania.css 로드 시 재정의됨) */
  --color-blue1:  var(--c-primary-light);  /* #ECF7FA */
  --color-blue6:  var(--c-primary);        /* #46AFD2 */
  --color-blue7:  var(--c-primary);        /* #46AFD2 — trade_register.css 호환 */
  --color-blue8:  var(--c-primary);        /* #46AFD2 */
  --theme-primary: var(--c-primary);       /* itemmania.css 호환 */
  --theme-buy:     var(--c-primary);       /* itemmania.css 호환 */
}

/* ── 스크롤바 — 바로템 스타일 ── */
*::-webkit-scrollbar { width: 10px; }
*::-webkit-scrollbar-thumb { background: #46AFD2; border-radius: 10px; height: 30%; }
*::-webkit-scrollbar-track { background: #CCCCCC; }

/* ── 리셋 & 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* 패널·드로어 off-screen transform으로 인한 가로 스크롤 방지 */
}

body {
  font-family: 'GongGothic', 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── 레이아웃 유틸 ── */
.ds-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 플래시 메시지 ── */
.g_messages { padding: 12px 20px; }
.g_alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  font-size: 14px;
}
.g_alert-success { background: var(--c-green-light); color: #008029; border: 1px solid #b7f4cf; }
.g_alert-error   { background: var(--c-sell-light);  color: #c62828; border: 1px solid #ffd0d0; }
.g_alert-warning { background: #FFF9E6; color: #856404; border: 1px solid #ffe69c; }
.g_alert-info    { background: var(--c-primary-light); color: #46AFD2; border: 1px solid #a8dcea; }

/* ============================================================
   HEADER
   ============================================================ */

.ds-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  box-shadow: 0 1px 0 var(--c-border), 0 4px 16px rgba(0,0,0,0.05);
}

/* ── 상단 행: 로고 + 검색 + 인증 ── */
.ds-header-top {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 뒤로가기 버튼 (모바일 전용, PC에서는 숨김) */
.ds-back-btn {
  display: none;
}

/* 로고 */
.ds-logo {
  flex: 1;
  display: flex;
  align-items: center;
}
.ds-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ds-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: opacity var(--tr);
}
.ds-logo a:hover img { opacity: 0.88; }
.ds-logo-text {
  display: none; /* 로고 이미지 실패 시 onerror JS로 표시됨 */
  font-size: 21px;
  font-weight: 900;
  color: var(--c-text);
  letter-spacing: -1px;
  white-space: nowrap;
}

/* 검색 */
.ds-search {
  flex: 0 0 580px;
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(to right, #46AFD2, #24B54A) border-box;
  transition: box-shadow var(--tr);
  position: relative;
}
.ds-search:focus-within { box-shadow: 0 0 0 3px rgba(70,175,210,0.15); }
/* 검색창 끝 모서리 처리 */
.ds-select-btn { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.ds-search-btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 0; width: 44px; }
/* 기존 native select — 숨김 처리 (하위 호환) */
.ds-search-select { display: none; }

/* ── 검색 자동완성 드롭다운 — 검색창과 어울리는 플로팅 카드 ── */
#g_search_frame {
  margin-top: 8px;
  min-height: 0;
  padding: 0 6px 6px;
  border: 1px solid #E3E8F0;
  border-radius: var(--r-sm);
  box-shadow: 0 14px 36px rgba(20, 30, 55, 0.16);
  overflow: hidden;
}
#g_search_frame::before {
  content: "";
  display: block;
  height: 3px;
  margin: 0 -6px;
  background: linear-gradient(to right, #46AFD2, #24B54A);
}
#g_search_frame .g_search_frame_wrapper {
  margin: 0 8px;
  padding: 14px 6px 8px;
  border-top: none;
}

/* ── 팝니다/삽니다 라디오 ── */
.ds-trade-radio-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border-right: 1.5px solid #DAE0ED;
  height: 100%;
  padding: 0 4px;
}
.ds-trade-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 100%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  white-space: nowrap;
  transition: color 0.15s;
  user-select: none;
}
.ds-trade-radio-input { display: none; }
.ds-trade-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ds-trade-radio--sell .ds-trade-radio-input:checked ~ .ds-trade-radio-dot {
  border-color: #46AFD2;
  background: #46AFD2;
}
.ds-trade-radio--buy .ds-trade-radio-input:checked ~ .ds-trade-radio-dot {
  border-color: #24B54A;
  background: #24B54A;
}
.ds-trade-radio--sell:has(.ds-trade-radio-input:checked) { color: #46AFD2; }
.ds-trade-radio--buy:has(.ds-trade-radio-input:checked) { color: #24B54A; }


/* ── 커스텀 카테고리 드롭다운 ── */
.ds-select-wrap {
  position: relative;
  flex-shrink: 0;
  height: 100%;
  border-right: 1.5px solid #DAE0ED;
}

.ds-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 14px 0 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #46AFD2;
  white-space: nowrap;
  transition: color 0.15s;
}
.ds-select-btn:hover { color: #2B99C0; }

.ds-select-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.ds-select-wrap.is-open .ds-select-arrow {
  transform: rotate(180deg);
}

/* 드롭다운 패널 */
.ds-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: -2px;
  min-width: 120px;
  background: #fff;
  border: 1px solid #DAE0ED;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 6px;
  margin: 0;
  list-style: none;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.ds-select-wrap.is-open .ds-select-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 옵션 아이템 */
.ds-select-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.ds-select-opt:hover { background: #ECF7FA; color: #46AFD2; }
.ds-select-opt.is-sel {
  background: #ECF7FA;
  color: #46AFD2;
  font-weight: 700;
}
.ds-select-opt.is-sel::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #46AFD2;
  margin-left: auto;
}

/* 카테고리 아이콘 배지 */
.ds-opt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.ds-opt-icon--all  { background: #46AFD2; }
.ds-opt-icon--money { background: #5D6175; }
.ds-opt-icon--char { background: #46AFD2; }
.ds-opt-icon--item { background: #F18194; }
.ds-opt-icon--etc  { background: #808080; }
.ds-search-input {
  flex: 1;
  height: 100%;
  padding: 0 12px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 300;
  color: var(--c-text);
  outline: none;
}
.ds-search-input::placeholder { color: #B4B4B4; font-weight: 300; }
.ds-search-btn[type="submit"] {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
  margin: 0 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: #46AFD2;
  transition: color var(--tr);
}
.ds-search-btn[type="submit"]:hover { background: none; color: #2B99C0; }
.ds-search-btn svg { width: 20px; height: 20px; }

/* 인증 영역 */
.ds-header-auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.ds-auth-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text-muted);
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: color var(--tr), background var(--tr);
  white-space: nowrap;
}
.ds-auth-link:hover { color: var(--c-text); background: var(--c-surface-2); }
.ds-auth-divider {
  width: 1px;
  height: 14px;
  background: var(--c-border);
  flex-shrink: 0;
  margin: 0 4px;
}
.ds-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 20px;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 700;
  transition: all var(--tr);
  white-space: nowrap;
  letter-spacing: -0.1px;
}
.ds-auth-btn--login {
  background: #46AFD2;
  color: #fff;
  box-shadow: 0 2px 8px rgba(70,175,210,0.30);
}
.ds-auth-btn--login:hover { background: #2B99C0; box-shadow: none; }
.ds-auth-btn--signup {
  background: #fff;
  color: var(--c-text-sub);
  border: 1.5px solid #DAE0ED;
}
.ds-auth-btn--signup:hover { border-color: #46AFD2; color: #46AFD2; background: #ECF7FA; }

/* ── 하단 행: 서브 네비 ── */
.ds-header-nav {
  height: 56px;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 0;
}

/* 등록 버튼 (판매/구매) */
.ds-reg-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  padding-right: 16px;
  border-right: 1.5px solid var(--c-border);
  flex-shrink: 0;
}
.ds-reg-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 15px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--tr);
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.ds-reg-btn--sell {
  background: #24B54A;
  color: #fff;
  box-shadow: 0 2px 6px rgba(36,181,74,0.28);
}
.ds-reg-btn--sell:hover { background: #1a9a3d; box-shadow: none; }
.ds-reg-btn--buy {
  background: #46AFD2;
  color: #fff;
  box-shadow: 0 2px 6px rgba(70,175,210,0.25);
}
.ds-reg-btn--buy:hover { background: #2B99C0; box-shadow: none; }
.ds-reg-btn svg { width: 11px; height: 11px; }

/* 카테고리 탭 */
.ds-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  flex: 1;
  height: 100%;
}
.ds-nav-tab a {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text-muted);
  border-bottom: 3px solid transparent;
  transition: color var(--tr), background var(--tr), border-color var(--tr);
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.ds-nav-tab a:hover { color: var(--c-text); background: var(--c-surface-2); }
.ds-nav-tab.is-active a {
  color: #46AFD2;
  border-bottom-color: #46AFD2;
  font-weight: 700;
  background: none;
}

/* 판매/구매등록 탭 색상 */
.ds-nav-tab--sell a { color: #24B54A; }
.ds-nav-tab--sell a:hover { color: #1a9a3d; background: rgba(36,181,74,0.07); }
.ds-nav-tab--sell.is-active a { color: #24B54A; border-bottom-color: #24B54A; }
.ds-nav-tab--buy a { color: #46AFD2; }
.ds-nav-tab--buy a:hover { color: #2B99C0; background: rgba(70,175,210,0.07); }
.ds-nav-tab--buy.is-active a { color: #46AFD2; border-bottom-color: #46AFD2; }

/* SALE 배지 */
.ds-nav-sale-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

/* PC(와이드) — 서브 네비 가독성 */
@media (min-width: 1040px) {
  :root { --subnav-h: 58px; }
  .ds-header-nav { height: 58px; }
  .ds-nav-tab a { height: 58px; }
  .ds-reg-btn { height: 34px; padding: 0 16px; }
  .ds-reg-btn svg { width: 12px; height: 12px; }
}

/* 우측 아이콘 */
.ds-nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
#dsPanelBtn { display: none; }
.ds-nav-icon {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  transition: all var(--tr);
}
.ds-nav-icon:hover { background: var(--c-surface-2); color: var(--c-text); }
.ds-nav-icon svg { width: 24px; height: 24px; }
.ds-nav-icon-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px;
  height: 8px;
  padding: 0;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #fff;
  font-size: 0;
}

/* 관리자 링크 */
.ds-nav-admin {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 0%, #f3d0dc 100%);
  padding: 3px 10px;
  border-radius: var(--r-full);
  margin-left: 6px;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(240, 62, 62, 0.35);
}

/* ── 전체 서비스 패널 (드롭다운) ── */
.ds-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--tr);
}
.ds-panel.is-open {
  pointer-events: auto;
  opacity: 1;
}
.ds-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.ds-panel-card {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: #f7f9fc;
  box-shadow: -4px 0 32px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.ds-panel.is-open .ds-panel-card { transform: translateX(0); }

/* 헤더 */
.ds-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 18px;
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%);
}
.ds-panel-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.ds-panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.85);
  transition: background var(--tr), color var(--tr);
}
.ds-panel-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.ds-panel-close svg { width: 20px; height: 20px; }

/* 섹션 공통 */
.ds-panel-section { padding: 18px 16px 14px; }
.ds-panel-section + .ds-panel-section {
  border-top: 1px solid var(--c-border);
}
.ds-panel-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ds-panel-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* 거래 아이콘 그리드 */
.ds-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ds-panel-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px 10px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--c-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ds-panel-item a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(70,175,210,0.18);
  border-color: var(--c-primary);
}
.ds-panel-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* 아이콘별 배경색 */
.ds-panel-item:nth-child(1) .ds-panel-item-icon { background: #e8f4ff; }
.ds-panel-item:nth-child(2) .ds-panel-item-icon { background: #e6f9f0; }
.ds-panel-item:nth-child(3) .ds-panel-item-icon { background: #f0eaff; }
.ds-panel-item:nth-child(4) .ds-panel-item-icon { background: #fff4e6; }
.ds-panel-item:nth-child(5) .ds-panel-item-icon { background: #ffe8e8; }
.ds-panel-item:nth-child(6) .ds-panel-item-icon { background: #e8f8f8; }
.ds-panel-item:nth-child(7) .ds-panel-item-icon { background: #fffbe6; }
.ds-panel-item:nth-child(8) .ds-panel-item-icon { background: #ffe8f5; }
.ds-panel-item-icon img { width: 26px; height: 26px; object-fit: contain; }
.ds-panel-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text);
  text-align: center;
  line-height: 1.3;
}

/* 링크 목록 (마이룸 / 게임정보) */
.ds-panel-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.ds-panel-links a {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-sub);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid transparent;
  transition: color var(--tr), background var(--tr), border-color var(--tr);
}
.ds-panel-links a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-border-strong);
  flex-shrink: 0;
  transition: background var(--tr);
}
.ds-panel-links a:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-light);
  border-color: var(--c-primary);
}
.ds-panel-links a:hover::before { background: var(--c-primary); }

/* 로그인/회원가입 버튼 강조 */
.ds-panel-links a[href*="login"],
.ds-panel-links a[href*="logout"],
.ds-panel-links a[href*="signup"] {
  font-weight: 600;
}
.ds-panel-links a[href*="login"] { color: var(--c-primary-dark); }
.ds-panel-links a[href*="signup"] { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }
.ds-panel-links a[href*="signup"]::before { background: rgba(255,255,255,0.6); }
.ds-panel-links a[href*="signup"]:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); }

/* ============================================================
   MOBILE SEARCH OVERLAY
   ============================================================ */
.ds-mobile-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  visibility: hidden;
}
.ds-mobile-search-overlay.is-open {
  pointer-events: auto;
  visibility: visible;
}
.ds-mso-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.ds-mobile-search-overlay.is-open .ds-mso-backdrop { opacity: 1; }

.ds-mso-card {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  background: #fff;
  padding: 0 0 20px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.ds-mobile-search-overlay.is-open .ds-mso-card { transform: translateY(0); }

/* 헤더 */
.ds-mso-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.ds-mso-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.ds-mso-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.85);
  transition: background var(--tr);
}
.ds-mso-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.ds-mso-close svg { width: 20px; height: 20px; }

/* 폼 내부 */
#g_mobile_search_form { padding: 16px 16px 0; }

/* 팝니다/삽니다 칩 */
.ds-mso-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ds-mso-chip {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.ds-mso-chip input[type="radio"] { display: none; }
.ds-mso-chip span {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-sub);
  background: var(--c-surface-2);
  transition: all 0.18s ease;
  user-select: none;
}
.ds-mso-chip--sell input:checked ~ span {
  background: #e8f4ff;
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
}
.ds-mso-chip--buy input:checked ~ span {
  background: #fff0f0;
  border-color: #e05;
  color: #cc0044;
}

/* 검색 입력 행 */
.ds-mso-input-row {
  display: flex;
  align-items: center;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 0 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ds-mso-input-row:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(70,175,210,0.15);
  background: #fff;
}
.ds-mso-input-row input[type="text"] {
  flex: 1;
  height: 52px;
  font-size: 16px;
  background: none;
  border: none;
  outline: none;
  color: var(--c-text);
}
.ds-mso-input-row input[type="text"]::placeholder { color: var(--c-text-muted); }

/* 검색 버튼 — 전체 너비 그라디언트 */
.ds-mso-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 18px rgba(70,175,210,0.45), 0 1px 4px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
}
/* 버튼 shimmer 효과 */
.ds-mso-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  animation: mso-shimmer 2.8s ease-in-out infinite;
}
@keyframes mso-shimmer {
  0%   { left: -75%; }
  60%  { left: 125%; }
  100% { left: 125%; }
}
.ds-mso-submit:hover {
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, #1e8ab0 100%);
  box-shadow: 0 6px 22px rgba(70,175,210,0.55);
  transform: translateY(-1px);
}
.ds-mso-submit:active {
  transform: scale(0.97) translateY(0);
  box-shadow: 0 2px 10px rgba(70,175,210,0.3);
}
.ds-mso-submit svg { width: 20px; height: 20px; flex-shrink: 0; }
.ds-mso-submit span { font-size: 16px; font-weight: 700; }

/* 데스크탑에서 오버레이 숨김 */
@media (min-width: 768px) {
  .ds-mobile-search-overlay { display: none !important; }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.ds-main {
  min-height: calc(100vh - var(--header-h) - var(--subnav-h) - 60px);
}

/* ── 페이지 배너 ── */
.ds-page-banner {
  background: var(--c-primary-light);
  border-bottom: 1px solid #d4e2ff;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  color: var(--c-primary);
  font-weight: 500;
}

/* ============================================================
   FOOTER
   ============================================================ */

.ds-footer {
  background: #fff;
  border-top: 1px solid var(--c-border);
  margin-top: 48px;
}
.ds-footer-links {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
}
.ds-footer-links a {
  font-size: 13px;
  color: var(--c-text-sub);
  padding: 4px 12px;
  border-right: 1px solid var(--c-border);
  transition: color var(--tr);
}
.ds-footer-links a:first-child { padding-left: 0; }
.ds-footer-links a:last-child { border-right: none; }
.ds-footer-links a:hover { color: var(--c-primary); }
.ds-footer-links a.is-strong { color: var(--c-text); font-weight: 600; }
.ds-footer-badges {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ds-footer-badges img { height: 24px; width: auto; }

.ds-footer-body {
  padding: 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.ds-footer-company-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
}
.ds-footer-company-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ds-footer-company-info p {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.6;
}
.ds-footer-copy {
  font-size: 12px;
  color: var(--c-text-disabled);
  margin-top: 10px;
}
.ds-footer-call { text-align: right; flex-shrink: 0; }
.ds-footer-call-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.ds-footer-call-desc {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}
.ds-footer-certs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.ds-footer-certs img { height: 42px; width: auto; }
.ds-footer-note {
  padding: 14px 0;
  border-top: 1px solid var(--c-border);
  font-size: 11px;
  color: var(--c-text-disabled);
  line-height: 1.7;
}

/* ============================================================
   CARDS & COMPONENTS
   ============================================================ */

/* 상품 카드 (목록용) */
.ds-card {
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: box-shadow var(--tr), border-color var(--tr);
  overflow: hidden;
}
.ds-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
}

/* 배지 */
.ds-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.ds-badge--sell { background: var(--c-sell-light);  color: var(--c-sell);  }
.ds-badge--buy  { background: var(--c-buy-light);   color: var(--c-buy);   }
.ds-badge--new  { background: #FFF0F6; color: #e64980; }
.ds-badge--hot  { background: #FFF3E0; color: #E65100; }
.ds-badge--prem { background: #F3E8FF; color: #7C3AED; }

/* 버튼 */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--tr);
  border: none;
  cursor: pointer;
}
.ds-btn--primary { background: var(--c-primary); color: #fff; }
.ds-btn--primary:hover { background: var(--c-primary-dark); }
.ds-btn--sell { background: var(--c-sell); color: #fff; }
.ds-btn--sell:hover { background: #c62828; }
.ds-btn--buy  { background: #46AFD2; color: #fff; }
.ds-btn--buy:hover { background: #2B99C0; }
.ds-btn--outline {
  background: #fff;
  color: var(--c-text);
  border: 1.5px solid #DAE0ED;
}
.ds-btn--outline:hover { border-color: #46AFD2; color: #46AFD2; background: #ECF7FA; }
.ds-btn--sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: var(--r-xs); }
.ds-btn--lg { height: 52px; padding: 0 28px; font-size: 16px; }
.ds-btn--full { width: 100%; }

/* 인풋 */
.ds-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--c-text);
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none;
}
.ds-input:focus {
  border-color: #46AFD2;
  box-shadow: 0 0 0 3px rgba(70,175,210,0.15);
}
.ds-input::placeholder { color: var(--c-text-muted); }

/* 섹션 타이틀 */
.ds-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ds-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.3px;
}
.ds-section-more {
  font-size: 13px;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color var(--tr);
}
.ds-section-more:hover { color: #46AFD2; }

/* 탭 */
.ds-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 20px;
}
.ds-tab-item {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--tr);
}
.ds-tab-item:hover { color: var(--c-text); }
.ds-tab-item.is-active {
  color: #46AFD2;
  border-bottom-color: #46AFD2;
  font-weight: 700;
}

/* 페이지네이션 */
.ds-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 0;
}
.ds-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-sub);
  transition: all var(--tr);
  border: 1px solid transparent;
}
.ds-page-btn:hover { background: var(--c-surface-2); }
.ds-page-btn.is-active {
  background: #46AFD2;
  color: #fff;
  border-color: var(--c-primary);
}
.ds-page-btn.is-disabled {
  color: var(--c-text-disabled);
  pointer-events: none;
}

/* 가격 표시 */
.ds-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.ds-price--sell { color: var(--c-sell); }
.ds-price--buy  { color: var(--c-buy);  }
.ds-price-unit  { font-size: 13px; font-weight: 500; color: var(--c-text-muted); margin-left: 2px; }

/* 신뢰 뱃지 */
.ds-trust-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--c-primary-light);
  border-radius: var(--r-md);
  padding: 14px 20px;
  margin-bottom: 24px;
}
.ds-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-primary);
}
.ds-trust-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   반응형
   ============================================================ */

/* ── 1320px 이하 ── */
@media (max-width: 1320px) {
  .ds-inner { padding: 0 20px; }
  .ds-search { flex: 0 0 480px; }
}

/* ── 태블릿 (1039px 이하) ── */
@media (max-width: 1039px) {
  :root { --header-h: 60px; --subnav-h: 44px; }

  .ds-inner { padding: 0 16px; }

  /* 헤더 상단 */
  .ds-header-top { height: 60px; gap: 12px; }
  .ds-logo { flex: 0 0 auto; }
  .ds-logo img { height: 44px; }

  /* 검색창: 카테고리 드롭다운 숨기고 전체 너비 */
  .ds-search { flex: 1; min-width: 0; height: 44px; }
  .ds-select-wrap { display: none; }

  /* 인증 링크 숨김 */
  .ds-header-auth { display: none; }

  /* 서브 네비 */
  .ds-header-nav { height: 44px; }
  .ds-reg-btns { display: none; }
  .ds-nav-tab a { height: 44px; font-size: 13px; padding: 0 12px; }
  .ds-nav-tabs {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .ds-nav-tabs::-webkit-scrollbar { display: none; }
}

/* ── 모바일 (767px 이하) ── */
@media (max-width: 767px) {
  :root { --header-h: 56px; --subnav-h: 0px; }

  /* 헤더 상단 */
  .ds-header-top { height: 56px; gap: 8px; }
  .ds-logo img { height: 40px; }
  .ds-logo-text { font-size: 20px; }

  /* 뒤로가기 버튼 */
  .ds-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #222;
    margin-left: -4px;
  }

  /* 모바일: 헤더 검색창 숨김 → 하단 검색 버튼 + 오버레이로 대체 */
  .ds-search { display: none; }

  /* 서브 네비 완전 숨김 (햄버거 메뉴로 대체) */
  .ds-header-nav { display: none; }

  /* 전체 서비스 패널 - 모바일 전체 너비 */
  .ds-panel-card { width: 100%; max-width: 340px; }
  .ds-panel-links { grid-template-columns: repeat(2, 1fr); }
}

/* ── 소형 모바일 (479px 이하) ── */
@media (max-width: 479px) {
  .ds-header-top { gap: 6px; }
  .ds-logo img { height: 36px; }
  .ds-logo-text { font-size: 18px; }
}

/* ============================================================
   FOOTER RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .ds-footer { margin-top: 24px; }
  .ds-footer-links {
    padding: 12px 0 10px;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  .ds-footer-links a { font-size: 12px; padding: 5px 8px; }
  .ds-footer-links a:first-child { padding-left: 8px; }
  .ds-footer-badges { margin-left: 0; margin-top: 10px; width: 100%; justify-content: center; }
  .ds-footer-body { flex-direction: column; gap: 16px; padding: 16px 0; }
  .ds-footer-call {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 12px;
    width: 100%;
  }
  .ds-footer-call-num { font-size: 18px; grid-column: 1; grid-row: 1; }
  .ds-footer-call-desc { grid-column: 1; grid-row: 2; }
  .ds-footer-certs { grid-column: 2; grid-row: 1 / 3; align-self: center; justify-self: end; justify-content: flex-end; margin-top: 0; }
  .ds-footer-certs img { height: 28px; }
  /* 하단 네비 높이만큼 여백 */
  .ds-footer { padding-bottom: 64px; }
}
@media (max-width: 479px) {
  .ds-footer-links a { font-size: 11px; padding: 3px 6px; }
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.ds-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #fff;
  border-top: 1px solid var(--c-border);
  height: 60px;
  align-items: stretch;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
.ds-mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--c-text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--tr);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.ds-mobile-nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ds-mobile-nav-item.is-active,
.ds-mobile-nav-item:active { color: var(--c-primary); }

/* 뒤로가기 버튼 — 다른 목적지 아이템과 구분 */
.ds-mobile-nav-back {
  background: none;
  border: none;
  cursor: pointer;
  border-right: 1px solid var(--c-border);
  /* flex: 0 0 auto; — 다른 아이템보다 조금 좁게 */
  flex: 0 0 52px;
  color: var(--c-text-muted);
}
.ds-mobile-nav-badge {
  position: absolute;
  top: 7px;
  right: calc(50% - 20px);
  width: 8px;
  height: 8px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  background: #f04646;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px #fff;
}
@media (max-width: 767px) {
  .ds-mobile-nav { display: flex; }
  /* 콘텐츠가 하단 네비에 가리지 않도록 */
  body { padding-bottom: 60px; }
  /* 채팅방 — 자체 fixed 레이아웃이므로 하단 네비 숨김 */
  body.page_chat_room .ds-mobile-nav { display: none; }
  body.page_chat_room { padding-bottom: 0; }
  #dsPanelBtn { display: flex; }
}

/* ============================================================
   HOME PAGE (index)
   ============================================================ */

/* g_container 패딩 제거 */
body.page-home .g_container {
  padding: 0 !important;
  max-width: 100% !important;
}

/* 모바일에서 common.css가 숨긴 헤더를 홈페이지에서 복원 */
@media (max-width: 767px) {
  body.page-home #ds_header { display: block !important; }
}

/* 공통 내부 너비 */
.idx-inner {
  max-width: var(--max-w);
  width: min(var(--max-w), calc(100% - 32px));
  margin: 0 auto;
  box-sizing: border-box;
}

/* 섹션 헤더 */
.idx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.idx-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
}

.idx-section-title strong { color: var(--c-primary); font-weight: 700; }

.idx-more-link {
  font-size: 13px;
  color: var(--c-text-sub);
  text-decoration: none;
}
.idx-more-link:hover { color: var(--c-primary); }

/* ── 히어로 ── */
.idx-hero {
  background: linear-gradient(135deg, #1b3c5a 0%, #1e4d6b 50%, #1a3850 100%);
  padding: 44px 0 40px;
  display: none; /* 모바일 기본 숨김, PC에서 표시 */
}

@media (min-width: 900px) {
  .idx-hero { display: block; }
}

.idx-hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* 왼쪽 */
.idx-hero-left {
  flex: 1 1 0;
  min-width: 0;
  color: #fff;
}

.idx-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #7dd4f0;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.idx-hero-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #46AFD2;
  border-radius: 50%;
}

.idx-hero-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
  margin: 0 0 22px;
  word-break: keep-all;
}

.idx-hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.idx-hero-tags-label {
  font-size: 12px;
  color: #94c9e2;
  margin-right: 2px;
}

.idx-hero-tag {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: 13px;
  color: #e0f3fb;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.idx-hero-tag:hover {
  background: rgba(70,175,210,.35);
  border-color: #46AFD2;
  color: #fff;
}

.idx-hero-users {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94c9e2;
}

.idx-hero-users strong { color: #fff; }

.idx-hero-users-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74,222,128,.25);
  animation: hero-pulse 2s infinite;
}

@keyframes hero-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(74,222,128,.1); }
}

/* 오른쪽 */
.idx-hero-right {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idx-hero-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 16px 20px;
  transition: background .15s;
}

.idx-hero-stat:hover { background: rgba(255,255,255,.13); }

.idx-hero-stat-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(70,175,210,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7dd4f0;
}

.idx-hero-stat-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.idx-hero-stat-sub {
  font-size: 11px;
  color: #94c9e2;
}

.idx-hero-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

/* ── 배너 ── */
.idx-banner {
  padding: 20px 0 0;
}

.idx-banner .idx-inner { width: min(var(--max-w), calc(100% - 32px)); }

/* 배너 프레임 PC/모바일 노출 제어 */
@media (min-width: 640px) {
  .idx-banner[data-show-pc="false"] { display: none; }
}
@media (max-width: 639px) {
  .idx-banner[data-show-mobile="false"] { display: none; }
}

.idx-swiper {
  border-radius: 12px;
  overflow: hidden;
  height: 350px;
}

.idx-swiper .swiper-slide { height: 350px; }

.idx-swiper img,
.idx-swiper a {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: cover;
}

/* ── 실시간 순위 + 충전 그리드 ── */
.idx-main-row { padding: 28px 0; }

.idx-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: stretch;
  min-width: 0;
}

.idx-rank-col,
.idx-charge-col {
  min-width: 0;
}

/* 순위 컬럼 */
.idx-rank-col {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-sizing: border-box;
}

.idx-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-sell, #F03E3E);
}

.idx-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-sell, #F03E3E);
  animation: live-pulse 1.4s infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.idx-rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
}

.idx-rank-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--c-text);
  transition: background .12s;
}

.idx-rank-link:hover { background: var(--c-surface-2); }

.idx-rank-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text-muted);
  min-width: 20px;
  text-align: center;
}

.idx-rank-num--top { color: var(--c-primary); }

.idx-rank-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.idx-rank-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idx-rank-name {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idx-rank-badge {
  font-size: 13px;
  color: #fff;
  background: var(--c-primary);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.idx-rank-empty { color: var(--c-text-muted); font-size: 13px; padding: 20px 0; }

/* 충전 컬럼 */
.idx-charge-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idx-charge-box {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-sizing: border-box;
}

.idx-charge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.idx-charge-title { font-size: 16px; font-weight: 700; color: var(--c-text); }

.idx-charge-more {
  font-size: 12px;
  color: var(--c-primary);
  text-decoration: none;
}

.idx-charge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.idx-charge-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--c-text);
  font-size: 12px;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  box-sizing: border-box;
}

.idx-charge-item:hover {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(70,175,210,.15);
}

.idx-charge-item--highlight { border-color: var(--c-primary); }

.idx-charge-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--c-sell, #F03E3E);
  border-radius: 3px;
  padding: 1px 4px;
}

.idx-charge-icon { display: flex; align-items: center; justify-content: center; color: var(--c-text-sub); }
.idx-charge-icon--toss { height: 20px; }
.idx-charge-icon--kakao svg { width: 26px; height: 26px; }
.idx-charge-name { font-size: 11px; color: var(--c-text-sub); }

/* 상품권 배너 */
.idx-gift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: #fff;
  flex: 1;
  box-sizing: border-box;
  transition: opacity .15s;
}

.idx-gift-banner:hover { opacity: .92; color: #fff; }

.idx-gift-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 20px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.idx-gift-title { font-size: 14px; font-weight: 700; line-height: 1.5; margin: 0 0 4px; }
.idx-gift-desc  { font-size: 11px; color: rgba(255,255,255,.7); margin: 0 0 8px; }
.idx-gift-cta   { font-size: 12px; color: var(--c-primary); font-weight: 600; }

/* ── 급상승 물품 ── */
.idx-hot { padding: 0 0 28px; }

.idx-hot-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.idx-hot-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--c-text);
  flex-shrink: 0;
  width: 120px;
}

.idx-hot-thumb {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-surface-2);
}

.idx-hot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s;
}

.idx-hot-card:hover .idx-hot-thumb img { transform: scale(1.05); }

.idx-hot-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,.6);
  border-radius: 4px;
  padding: 2px 5px;
}

.idx-hot-name {
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idx-hot-empty { font-size: 13px; color: var(--c-text-muted); }

/* ── CTA 배너 ── */
.idx-cta {
  background: var(--c-primary);
  padding: 20px 0;
  margin-bottom: 0;
}

.idx-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.idx-cta-text strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.idx-cta-text span {
  font-size: 13px;
  color: rgba(255,255,255,.85);
}

.idx-cta-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.idx-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}

.idx-cta-btn:hover { opacity: .88; }
.idx-cta-btn--sell { background: #fff; color: var(--c-primary); }
.idx-cta-btn--buy  { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.5); }

/* ── 공지 스트립 ── */
.idx-notice {
  background: #1e1e1e;
  padding: 0;
}

.idx-notice-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  overflow: hidden;
}

.idx-notice-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--c-primary);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.idx-notice-inner dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.idx-notice-inner dd a {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
}

.idx-notice-inner dd a:hover { color: #fff; }

/* ── 반응형 ── */
@media (max-width: 1039px) {
  .idx-main-grid { grid-template-columns: 1fr; }
  .idx-charge-col { flex-direction: row; flex-wrap: wrap; }
  .idx-charge-box { flex: 1; min-width: 280px; }
  .idx-gift-banner { flex: 1; min-width: 280px; }
}

@media (max-width: 639px) {
  .idx-banner .idx-inner { width: 100%; }
  .idx-swiper { border-radius: 0; }
  .idx-swiper, .idx-swiper .swiper-slide, .idx-swiper img, .idx-swiper a { height: 200px; }
  .idx-cta-inner { flex-direction: column; text-align: center; }
  .idx-charge-grid { grid-template-columns: repeat(3, 1fr); }
  .idx-charge-icon--toss { height: 28px; }
  .idx-charge-icon--toss svg { width: 52px; height: 26px; }
  .idx-charge-icon--kakao svg { width: 36px; height: 36px; }

  /* 실시간 순위 — 가로 스크롤 카드 */
  .idx-rank-col {
    padding: 16px 0 16px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
  }
  .idx-rank-col .idx-section-head {
    padding: 0 16px;
    margin-bottom: 12px;
  }
  .idx-rank-list {
    display: flex;
    flex-direction: row;
    grid-template-columns: unset;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 4px 16px 8px;
    scrollbar-width: none;
  }
  .idx-rank-list::-webkit-scrollbar { display: none; }
  .idx-rank-item {
    flex: 0 0 auto;
    width: 80px;
    scroll-snap-align: start;
    margin-right: 10px;
  }
  .idx-rank-item:last-child { margin-right: 0; }
  .idx-rank-link {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    background: var(--c-surface-2, #f7f8fa);
    border-radius: 12px;
    text-align: center;
    position: relative;
  }
  .idx-rank-link:hover { background: #edf4fb; }
  .idx-rank-num {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 12px;
    font-weight: 800;
    min-width: unset;
  }
  .idx-rank-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    margin-top: 4px;
  }
  .idx-rank-name {
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: unset;
    word-break: keep-all;
    max-height: 2.7em;
    flex: none;
  }
  .idx-rank-badge { display: none; }

  /* 1~3위 강조 */
  .idx-rank-item:nth-child(1) .idx-rank-link { background: #fff8e1; }
  .idx-rank-item:nth-child(2) .idx-rank-link { background: #f1f3f5; }
  .idx-rank-item:nth-child(3) .idx-rank-link { background: #fff3eb; }
  .idx-rank-item:nth-child(1) .idx-rank-num { color: #f59f00; }
  .idx-rank-item:nth-child(2) .idx-rank-num { color: #868e96; }
  .idx-rank-item:nth-child(3) .idx-rank-num { color: #e07b39; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.page-login .g_container {
  background: #f4f5f7 !important;
  padding: 0 16px !important;
  max-width: 100% !important;
}

.login-page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 60px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  padding: 40px 36px 32px;
  box-sizing: border-box;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  max-height: 52px;
  max-width: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.login-logo-text {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--c-primary, #46AFD2);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  color: #888;
}

.login-alert {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: #fff5f5;
  border: 1px solid #fecdcc;
  border-radius: 8px;
  font-size: 13px;
  color: #da4328;
  text-align: center;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
  color: #222;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
  background: #fff;
}

.login-input:focus {
  border-color: var(--c-primary, #46AFD2);
}

.login-error {
  margin: 2px 0 0;
  font-size: 12px;
  color: #da4328;
}

/* 비밀번호 래퍼 & 토글 */
.pw_input_wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw_input_wrap .login-input {
  padding-right: 44px;
}

.pw_toggle_btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.pw_toggle_btn svg { width: 18px; height: 18px; }
.pw_toggle_btn .icon_eye_off { display: none; }
.pw_toggle_btn.is-show .icon_eye_on  { display: none; }
.pw_toggle_btn.is-show .icon_eye_off { display: block; }

/* 비밀번호 강도 바 */
.pw_strength_bar {
  height: 3px;
  background: #eee;
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .2s;
}

.pw_strength_bar.is-visible { opacity: 1; }

.pw_strength_fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width .3s ease, background-color .3s;
}

.pw_strength_fill.weak        { background: #e74c3c; }
.pw_strength_fill.medium      { background: #f39c12; }
.pw_strength_fill.strong      { background: #2ecc71; }
.pw_strength_fill.very-strong { background: var(--c-primary, #46AFD2); }

/* 자동로그인 + 찾기 */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.login-autosave {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  user-select: none;
}

.login-autosave input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--c-primary, #46AFD2);
  cursor: pointer;
}

.login-find-link {
  font-size: 13px;
  color: var(--c-primary, #46AFD2);
  text-decoration: none;
}

.login-find-link:hover { text-decoration: underline; }

/* 로그인 버튼 */
.login-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--c-primary, #46AFD2);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}

.login-btn-primary:hover { background: var(--c-primary-dark, #2B99C0); }

/* 또는 구분선 */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #bbb;
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}

/* 소셜 로그인 */
.login-social { display: flex; flex-direction: column; gap: 10px; }

.login-btn-naver {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  background: #03C75A;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity .15s;
}

.login-btn-naver:hover { opacity: .88; color: #fff; }
#naver_id_login { display: none !important; }

/* 회원가입 유도 */
.login-signup-row {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
  color: #888;
}

.login-signup-row a {
  color: var(--c-primary, #46AFD2);
  font-weight: 600;
  text-decoration: none;
  margin-left: 6px;
}

.login-signup-row a:hover { text-decoration: underline; }

/* 19세 미만 카드 */
.login-adult-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.login-adult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: #e74c3c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
}

.login-adult-body {
  flex: 1;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.login-adult-body strong {
  display: block;
  color: #333;
  font-size: 14px;
  margin-bottom: 2px;
}

.login-adult-body p { margin: 0; }

.login-adult-exit {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 7px 14px;
  background: #f0f0f0;
  color: #555;
  font-size: 13px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
}

.login-adult-exit:hover { background: #e0e0e0; color: #333; }

@media (max-width: 480px) {
  .login-page { padding: 30px 0 60px; }
  .login-card { padding: 30px 20px 24px; }
  .login-adult-card { flex-wrap: wrap; }
}
