/* ===== CSS 변수 (라이트/다크 모드) ===== */
:root {
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --bg-header: #ffffff;
  --bg-sidemenu: #ffffff;
  --font-black: #222222;
  --font-gray: #888888;
  --font-light: #aaaaaa;
  --border-color: #e0e0e0;
  --nav-bg: #2c2c2c;
  --nav-text: #ffffff;
  --nav-hover: #ff6b35;
  --accent: #ff6b35;
  --accent-dark: #e55a2b;
  --btn-dark-bg: #444444;
  --tab-active-bg: #ff6b35;
  --tab-active-text: #ffffff;
  --tab-inactive-bg: #f0f0f0;
  --tab-inactive-text: #666666;
  --badge-sale: #e53935;
  --badge-event: #1976d2;
  --badge-notice: #388e3c;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --ad-bg: #e8e8e8;
  --ad-text: #999999;
  --footer-bg: #2c2c2c;
  --footer-text: #aaaaaa;
  --danger: #f44336;
  --danger-bg: #fff3f3;
  --success-bg: #f1f8f1;
  --warning-bg: #fff8e1;
  --info-blue: #2196f3;
  --link-blue: #1976d2;
  --card-bg: #f8f8f8;
  --card-border: #cccccc;
}

body.dark-mode {
  --bg: #1a1a1a;
  --bg-white: #252525;
  --bg-header: #1e1e1e;
  --bg-sidemenu: #252525;
  --font-black: #e8e8e8;
  --font-gray: #aaaaaa;
  --font-light: #777777;
  --border-color: #3a3a3a;
  --nav-bg: #111111;
  --nav-text: #dddddd;
  --nav-hover: #ff6b35;
  --tab-active-bg: #ff6b35;
  --tab-inactive-bg: #333333;
  --tab-inactive-text: #aaaaaa;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --ad-bg: #333333;
  --ad-text: #777777;
  --footer-bg: #111111;
  --footer-text: #888888;
  --danger: #ff6b6b;
  --danger-bg: #3b1212;
  --success-bg: #122b12;
  --warning-bg: #2d2600;
  --info-blue: #64b5f6;
  --link-blue: #64b5f6;
  --card-bg: #2c2c2c;
  --card-border: #3a3a3a;
}

/* ===== 기본 리셋 ===== */
* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--font-black);
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
  font-size: 13px;
  margin: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}
a { color: var(--font-black); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { border: none; background: none; cursor: pointer; }

/* ===== 오버레이 ===== */
.sidemenu-overlay,
.alarm-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
}
.sidemenu-overlay.active,
.alarm-overlay.active { display: block; pointer-events: auto; }

/* ===== 모바일 왼쪽 사이드메뉴 ===== */
.mobile-sidemenu {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1200;
  pointer-events: none;
}
.mobile-sidemenu.open { pointer-events: auto; }
.sidemenu-content {
  position: absolute;
  top: 0; left: -280px; bottom: 0;
  width: 280px;
  background: var(--bg-sidemenu);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  pointer-events: auto;
}
.mobile-sidemenu.open .sidemenu-content { left: 0; }

/* 하단 고정 네비가 있는 페이지: 사이드메뉴 스크롤 영역 하단 여백 확보 */
body.has-app-bottom-nav .sidemenu-content {
  padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 12px);
}
@media (min-width: 768px) {
  body.has-app-bottom-nav .sidemenu-content { padding-bottom: 0; }
}

.sidemenu-profile {
  display: flex;
  align-items: center;
  padding: 20px 15px;
  background: var(--nav-bg);
  gap: 12px;
}
.sidemenu-profile .profile-img {
  width: 50px; height: 50px;
  border-radius: 50%;
  object-fit: cover;
}
.sidemenu-profile .nickname {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}
.login-btns { display: flex; gap: 6px; }
.btn-login, .btn-join {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  color: #fff;
}
.btn-login { background: var(--accent); }
.btn-join { background: #555; }

.sidemenu-list li { border-bottom: 1px solid var(--border-color); }
.sidemenu-list li a {
  display: block;
  padding: 11px 20px;
  color: var(--font-black);
  font-size: 13px;
}
.sidemenu-list li a:hover { background: var(--bg); color: var(--accent); }
/* 카테고리 제목 (접기/펼치기) */
.sidemenu-category {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg);
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}
.sidemenu-category:active { background: var(--border-color); }
/* 하위 메뉴 */
.sidemenu-sub a { padding-left: 32px !important; }
/* 단일 링크 (세차장 찾기 등) */
.sidemenu-single { border-top: 3px solid var(--bg); }
.sidemenu-single a { font-weight: 600 !important; }

/* ===== 알림 오른쪽 사이드바 ===== */
.alarm-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 1200;
  pointer-events: none;
}
.alarm-sidebar.open { pointer-events: auto; }
.alarm-content {
  position: absolute;
  top: 0; right: -320px; bottom: 0;
  width: 320px;
  background: var(--bg-sidemenu);
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.alarm-sidebar.open .alarm-content { right: 0; }
.alarm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}
.alarm-title { font-weight: bold; font-size: 16px; }
.alarm-close { font-size: 20px; color: var(--font-gray); padding: 0; }
.alarm-desc {
  padding: 10px 15px;
  font-size: 11px;
  color: var(--font-gray);
  border-bottom: 1px solid var(--border-color);
  line-height: 1.5;
}
.desc-blue { color: #1976d2; }
.alarm-empty { padding: 30px 15px; text-align: center; color: var(--font-gray); font-size: 13px; }

/* 알림 목록 */
.alarm-list { flex: 1; overflow-y: auto; }
.alarm-item {
  display: flex; gap: 10px; padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none; color: var(--font-black);
  transition: background 0.1s;
}
.alarm-item:hover { background: var(--bg); color: var(--font-black); }
.alarm-item.unread { background: rgba(255,107,53,0.06); }
.alarm-icon {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border-radius: 50%;
  background: var(--bg);
}
.alarm-body { flex: 1; min-width: 0; }
.alarm-msg { font-size: 13px; line-height: 1.4; margin-bottom: 2px; }
.alarm-post {
  font-size: 11px; color: var(--font-gray);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alarm-time { font-size: 10px; color: var(--font-light); margin-top: 2px; }

/* 접속상태 표시 */
.online-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf50;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 4px rgba(76,175,80,0.6);
}

/* 알림 뱃지 */
.push-count {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: #f44336; color: #fff;
  border-radius: 8px;
  font-size: 10px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.alarm-btn { position: relative; }

/* ===== 헤더 ===== */
#header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
}
.header-center { max-width: 930px; margin: 0 auto; padding: 0 15px; box-sizing: border-box; }

/* 모바일 상단바 */
.header-mobile-bar {
  display: none;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}
.btn-hamburger {
  font-size: 20px;
  color: var(--font-black);
  padding: 4px;
}
.logo-link { flex: 1; text-align: center; }
.logo-text { display: none; }
.logo-img {
  height: 28px;
  width: auto;
  vertical-align: middle;
}
body.dark-mode .logo-img,
body.dark-mode .logo-img-pc {
  filter: brightness(0) invert(1);
}
.header-mobile-icons { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  font-size: 16px;
  color: var(--font-black);
  padding: 6px;
  position: relative;
}
.push-count {
  position: absolute;
  top: 2px; right: 0;
  background: red;
  color: #fff;
  font-size: 9px;
  border-radius: 8px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
}

/* PC 헤더 */
.header-pc {
  display: flex;
  align-items: center;
  padding: 10px 0;
  gap: 15px;
  position: relative;
  z-index: 200;
}
.header-pc-left { flex-shrink: 0; }
.logo-link-pc { text-decoration: none; }
.logo-text-pc { display: none; }
.logo-img-pc {
  height: 40px;
  width: auto;
  vertical-align: middle;
  letter-spacing: 3px;
}

.header-search { flex: 1; }
.search-form { display: flex; }
.search-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background: var(--bg);
  color: var(--font-black);
  font-size: 13px;
  outline: none;
}
.search-submit {
  padding: 7px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
}
.search-submit:hover { background: var(--accent-dark); }

.header-pc-icons { display: flex; gap: 5px; flex-shrink: 0; }
.pc-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--font-black);
  cursor: pointer;
  border-radius: 4px;
  gap: 3px;
  min-width: 52px;
  min-height: 48px;
}
.pc-icon-item i { font-size: 18px; }
.pc-icon-item:hover { color: var(--accent); }
.pc-icon-item.darkmode-btn i { font-size: 18px; }

/* 모바일 검색바 */
.header-search-mobile { padding: 8px 12px; }

/* 하단 네비 */
.header-nav {
  overflow: visible;
  position: relative;
  z-index: 100;
}
.nav-list {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  overflow: visible;
  list-style: none;
  background: var(--nav-bg);
  border-radius: 4px;
}
.nav-arrow { display: none; }
.nav-item a {
  display: block;
  padding: 10px 12px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-item a:hover,
.nav-item.active a {
  color: var(--nav-hover);
}

/* 인기글 🔥 */
.nav-fire.active a,
.nav-fire a:hover {
  filter: brightness(1.3);
}

/* ===== 네비 드롭다운 서브메뉴 ===== */
.nav-has-sub { position: relative; }
.nav-has-sub > a::after {
  content: ' ▾';
  font-size: 9px;
  opacity: .5;
}
.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 6px 6px;
  padding: 6px 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  list-style: none;
  margin: 0;
}
.nav-has-sub.sub-open > .nav-submenu,
.nav-has-sub:hover > .nav-submenu { display: block; }
.nav-submenu li a {
  display: block;
  padding: 8px 16px;
  color: var(--text-primary, #e0e0e0);
  font-size: 13px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-submenu li a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.nav-submenu li a.sub-active {
  color: #fff;
  background: var(--accent, #ff6b35);
  font-weight: bold;
}

/* ===== 메인 콘텐츠 레이아웃 ===== */
#section-main {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 15px;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

/* ===== 좌우 사이드바 ===== */
.section-sidebar {
  width: 160px;
  flex-shrink: 0;
}
.section-sidebar-inner {
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 80px;
}

/* 하단 가로 배너 */
.section-bottom-banner { margin-top: 10px; }
.section-bottom-banner img { width: 100%; height: auto; display: block; border-radius: 4px; }
[data-banner-slot] img { max-width: 100%; height: auto; }

/* ===== 중앙 섹션 ===== */
.section-left {
  flex: 1;
  min-width: 0;
  max-width: 900px;
}

/* 상단 배너 (PC) */
.section-top-banner {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
.banner-left { flex: 1; min-width: 0; }
.banner-right {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ad-bg);
}
.ad-placeholder-large {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ad-text);
  font-size: 12px;
}
.banner-right img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* 날씨 위젯 */
.weather-widget {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}
.weather-today {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 14px;
}
.weather-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent);
}
.forecast-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  font-size: 18px;
  color: var(--accent);
}
.weather-info {
  flex-shrink: 0;
}
.weather-location {
  font-size: 11px;
  color: var(--font-gray);
  margin-bottom: 2px;
}
.weather-temp {
  font-size: 20px;
  font-weight: 700;
  color: var(--font-black);
  line-height: 1.2;
}
.weather-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--font-gray);
  margin-left: auto;
}
.weather-forecast {
  display: flex;
  border-top: 1px solid var(--border-color);
}
.forecast-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 2px;
}
.forecast-day + .forecast-day {
  border-left: 1px solid var(--border-color);
}
.forecast-label {
  font-size: 10px;
  color: var(--font-gray);
}
.forecast-icon {
  font-size: 14px;
  color: var(--accent);
}
.forecast-temp {
  font-size: 11px;
  font-weight: 600;
  color: var(--font-black);
}
.forecast-temp-min {
  font-size: 10px;
  color: var(--font-gray);
}

/* 모바일 퀵메뉴 */
.mobile-quickmenu { margin-bottom: 8px; }
.quick-menu-list {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}
.quick-menu-list li { flex: 1; }
.quick-menu-list li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  font-size: 11px;
  color: var(--font-black);
  gap: 4px;
}
.quick-menu-list li a i { font-size: 18px; color: var(--accent); }
.quick-menu-list li a:hover { color: var(--accent); }

/* 세차장찾기 버튼 강조 — 라운드 컬러 애니메이션 보더 (메인 서비스 어필) */
.quick-menu-list li.highlight-wash { position: relative; }
.quick-menu-list li.highlight-wash a {
  position: relative;
  z-index: 1;
  margin: 3px;
  border-radius: 10px;
  background: var(--bg-white);
  font-weight: 700;
}
.quick-menu-list li.highlight-wash::before {
  content: '';
  position: absolute;
  top: 2px; right: 2px; bottom: 2px; left: 2px;
  border-radius: 11px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    #2196f3, #9c27b0, #e91e63, #ff9800, #4caf50, #00bcd4, #2196f3
  );
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: highlight-wash-border 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.quick-menu-list li.highlight-wash a i {
  background: linear-gradient(135deg, #2196f3, #9c27b0, #ff9800);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
@keyframes highlight-wash-border {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== 투데이 박스 ===== */
.section-center {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.today-box {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.today-tab-menu {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}
.tab-item {
  flex: 1;
  padding: 10px 15px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--tab-inactive-bg);
  color: var(--tab-inactive-text);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.tab-item:first-child { border-right: 1px solid var(--border-color); }
.tab-item.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
}
.tab-item i { margin-right: 5px; }

.today-list { padding: 0; margin: 0; }
.today-list li {
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.today-list li:last-child { border-bottom: none; }
.today-list li a {
  display: block;
  padding: 8px 16px;
  color: var(--font-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-list li a:hover { background: var(--bg); color: var(--accent); }

/* 뱃지 */
.badge-sale { color: var(--badge-sale); font-weight: bold; margin-right: 3px; }
.badge-event { color: var(--badge-event); font-weight: bold; margin-right: 3px; }
.badge-notice { color: var(--badge-notice); font-weight: bold; margin-right: 3px; }
.cat-tag { color: var(--font-gray); margin-right: 3px; }
.comment-count { color: var(--badge-sale); font-size: 11px; }

/* ===== 최신글 박스 ===== */
.latest-bbs-wrapper {
  padding: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.latest-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px) {
  .latest-grid-4 { grid-template-columns: 1fr; gap: 10px; }
}
.latest-title {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-color);
  color: var(--font-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.latest-title::after {
  content: '더보기 >';
  font-size: 11px;
  font-weight: 400;
  color: var(--font-gray);
}
.latest-title:hover { color: var(--accent); }
.latest-list { padding: 0; margin: 0; }
.latest-list li { border-bottom: 1px solid var(--border-color); }
.latest-list li:last-child { border-bottom: none; }
.latest-list li a {
  display: block;
  padding: 8px 16px;
  color: var(--font-black);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.latest-list li a:hover { background: var(--bg); color: var(--accent); }

/* ===== 오른쪽 광고 섹션 (하위 호환) ===== */
.section-right {
  width: 160px;
  flex-shrink: 0;
}
.section-right-inner { display: flex; flex-direction: column; gap: 6px; }

.right-ad-item { display: none; } /* JS에서 배너 로드 후 활성 슬롯만 표시 */
body > ins { display: none !important; } /* 쿠팡 위젯이 body에 추가하는 <ins> 태그 숨기기 (사이드바로 이동 전) */
.ad-placeholder-sm {
  width: 160px;
  height: 120px;
  background: var(--ad-bg);
  color: var(--ad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.right-ad-item.big .ad-placeholder-big {
  width: 160px;
  height: 600px;
  background: var(--ad-bg);
  color: var(--ad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.right-ad-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* ===== 모바일 전용 / PC 전용 ===== */
.ad-mobile-only { display: none; }
.only-pc { display: flex; }
.section-sidebar.only-pc { display: block; }

.mobile-top-banner .ad-placeholder-wide {
  height: 60px;
  background: var(--ad-bg);
  color: var(--ad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-bottom: 8px;
  border-radius: 4px;
}

/* ===== 후원사/파트너 ===== */
.sponsor-section-inline { margin-top: 10px; }
.sponsor-section {
  max-width: 900px;
  margin: 8px auto 0;
  padding: 0 15px;
}
.sponsor-inner {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-height: 100px;
  overflow: hidden;
  transition: max-height 0.4s ease;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.sponsor-grid.expanded {
  max-height: 5000px;
  -webkit-mask-image: none;
  mask-image: none;
}
.sponsor-item {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-white);
}
.sponsor-item img {
  max-width: 110px;
  max-height: 34px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.2s, opacity 0.2s;
}
.sponsor-item:hover img {
  filter: grayscale(0%);
  opacity: 1;
}
.sponsor-item .sponsor-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--font-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sponsor-toggle {
  margin-top: 12px;
  padding: 6px 20px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg);
  color: var(--font-gray);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.sponsor-toggle:hover {
  background: var(--border-color);
}
.sponsor-toggle i {
  margin-left: 4px;
  transition: transform 0.3s;
}
.sponsor-toggle.expanded i {
  transform: rotate(180deg);
}
@media (max-width: 768px) {
  .sponsor-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 84px; -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 100%); mask-image: linear-gradient(to bottom, #000 10%, transparent 100%); }
  .sponsor-grid.expanded { -webkit-mask-image: none; mask-image: none; }
  .sponsor-item { height: 36px; }
  .sponsor-item img { max-width: 70px; max-height: 28px; }
}

/* 인라인 푸터 (메인 페이지 section-left 내) */
.footer-inline {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 10px;
  padding: 20px 16px;
  border-radius: 8px;
}

/* ===== 푸터 ===== */
#footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 20px;
  padding: 20px 15px;
}
.footer-center { max-width: 900px; margin: 0 auto; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.footer-links li { font-size: 12px; }
.footer-links li a { color: var(--footer-text); }
.footer-links li a:hover { color: #fff; }

.footer-caution {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--footer-text);
}
.footer-company, .footer-contact {
  font-size: 11px;
  color: var(--footer-text);
  margin-bottom: 4px;
}
.divline { margin: 0 5px; }
.mobile-only { display: none; }
.pc-only { display: block; }

/* ===== 다크모드 버튼 활성화 ===== */
body.dark-mode .darkmode-btn { color: #ffcc44; }

/* ===== 반응형: 태블릿 (사이드바 숨기기) ===== */
@media (max-width: 1100px) {
  .section-sidebar { display: none !important; }
  .section-right { display: none !important; }
  #section-main { max-width: 900px; }
}

/* ===== 반응형: 모바일 ===== */
@media (max-width: 768px) {
  .header-mobile-bar { display: flex !important; }
  .header-pc { display: none !important; }
  .ad-mobile-only { display: block; }
  .only-pc { display: none !important; }
  .section-right { display: none; }
  .section-sidebar { display: none !important; }

  #section-main { padding: 0; gap: 0; }
  .section-left { width: 100%; }
  .section-center { border-radius: 0; border-left: none; border-right: none; }

  .pc-only { display: none; }
  .mobile-only { display: block; }

  .header-nav { position: relative; background: var(--nav-bg); margin: 0 -15px; padding: 0 15px; }
  .nav-list { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; padding: 0 24px; justify-content: flex-start; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; border-radius: 0; max-width: none; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-arrow { position: absolute; top: 0; bottom: 0; width: 32px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: rgba(255,255,255,.7); pointer-events: none; z-index: 5; transition: opacity .2s; }
  .nav-arrow-left { left: 0; background: linear-gradient(to right, var(--nav-bg) 40%, transparent); padding-left: 4px; }
  .nav-arrow-right { right: 0; background: linear-gradient(to left, var(--nav-bg) 40%, transparent); padding-right: 4px; }
  .nav-arrow.hidden { opacity: 0; }
  .nav-item:first-child a { padding-left: 12px; }
  .nav-item a { padding: 9px 10px; font-size: 12px; }

  /* 모바일 드롭다운 */
  .nav-submenu {
    position: fixed;
    top: auto;
    left: 0; right: 0;
    border-radius: 0;
    min-width: auto;
    display: none;
  }
  .nav-has-sub.sub-open > .nav-submenu {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    gap: 0;
  }
  .nav-submenu li { flex: 0 0 auto; }
  .nav-submenu li a { padding: 6px 12px; font-size: 12px; }

  .footer-links { gap: 4px; }
}

@media (min-width: 769px) {
  .header-mobile-bar { display: none !important; }
  .header-search-mobile { display: none !important; }
}

/* ===== PC 유저 드롭다운 ===== */
.pc-user-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.pc-user-wrap:hover { background: var(--bg); }
.pc-user-avatar {
  font-size: 20px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.pc-username  { font-size: 13px; font-weight: bold; line-height: 1.2; color: var(--font-black); }
.pc-usergrade { font-size: 10px; line-height: 1.2; }

.pc-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 150px;
  z-index: 600;
  overflow: hidden;
}
.pc-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--font-black);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.12s;
}
.pc-user-dropdown a:last-child { border-bottom: none; }
.pc-user-dropdown a:hover { background: var(--bg); color: var(--accent); }
.pc-user-dropdown a i { width: 14px; text-align: center; color: var(--font-gray); }

/* 사이드메뉴 닉네임/등급 */
.sm-nickname { color: #fff; font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.sm-grade    { margin-bottom: 6px; }
.sidemenu-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ===== 유저 닉네임 팝업 ===== */
.user-nick-link {
  cursor: pointer;
  position: relative;
}
.user-nick-link:hover { color: var(--accent); }
.user-popup {
  position: fixed;
  z-index: 9999;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 140px;
  padding: 6px 0;
  display: none;
}
.user-popup.show { display: block; }
.user-popup a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--font-black);
  text-decoration: none;
  white-space: nowrap;
}
.user-popup a:hover { background: var(--bg); color: var(--accent); }
.user-popup a i { width: 16px; text-align: center; color: var(--font-gray); font-size: 13px; }
.user-popup a:hover i { color: var(--accent); }
.user-popup a.btn-send-dm {
  background: none; color: var(--font-black); border: none;
  border-radius: 0; padding: 10px 16px; opacity: 1;
}
.user-popup a.btn-send-dm:hover { background: var(--bg); color: var(--accent); opacity: 1; }
.user-popup a.btn-send-dm i { color: var(--font-gray); }
.user-popup a.btn-send-dm:hover i { color: var(--accent); }
.user-popup a.btn-subscribe-popup.subscribed { color: var(--accent); font-weight: 600; }
.user-popup a.btn-subscribe-popup.subscribed i { color: var(--accent); }

/* ===== 프로필 모달 ===== */
.profile-modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 10000;
  justify-content: center; align-items: center;
}
.profile-modal-overlay.show { display: flex; }
.profile-modal {
  background: var(--bg-white);
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 24px;
}
.profile-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  font-size: 24px; color: var(--font-gray);
  cursor: pointer; line-height: 1;
}
.profile-modal-close:hover { color: var(--text-primary); }

.pm-header {
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.pm-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  color: var(--font-gray);
}
.pm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pm-name { font-size: 18px; font-weight: bold; color: var(--text-primary); }
.pm-userid { font-size: 13px; color: var(--font-gray); font-weight: normal; }
.pm-grade { font-size: 14px; margin-top: 2px; }
.pm-stats {
  display: flex; gap: 12px; font-size: 13px; color: var(--font-gray); margin-top: 6px;
}
.pm-stats b { color: var(--text-primary); }
.pm-join { font-size: 12px; color: var(--font-light); margin-top: 4px; }

.pm-actions {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.pm-btn {
  flex: 1; padding: 10px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 600; text-align: center; cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-white); color: var(--font-black);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.pm-btn:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.pm-btn-subscribe.pm-subscribed { background: var(--accent); color: #fff; border-color: var(--accent); }

.pm-tabs {
  display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 0;
}
.pm-tab {
  padding: 8px 16px; cursor: pointer;
  font-size: 14px; font-weight: bold;
  color: var(--font-gray); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.pm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pm-tab:hover { color: var(--text-primary); }

.pm-tab-content { }
.pm-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--border-color);
  color: var(--text-primary); text-decoration: none;
  font-size: 13px; transition: background .15s;
}
.pm-list-item:hover { background: rgba(255,107,53,.06); }
.pm-list-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 12px; }
.pm-list-date { flex-shrink: 0; color: var(--font-gray); font-size: 12px; }
.pm-list-empty { padding: 20px; text-align: center; color: var(--font-gray); font-size: 13px; }

/* ===== 쪽지 채팅 팝업 ===== */
.msg-popup-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 10000;
  justify-content: center; align-items: center;
}
.msg-popup-overlay.show { display: flex; }
.msg-popup {
  background: var(--bg-white);
  border-radius: 12px;
  width: 420px;
  max-width: 95vw;
  height: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  overflow: hidden;
}

/* 헤더 */
.msg-popup-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.msg-popup-back {
  background: none; border: none; font-size: 18px;
  color: var(--font-gray); cursor: pointer; padding: 0; display: none;
}
.msg-popup-back.show { display: inline-block; }
.msg-popup-title {
  flex: 1; font-size: 16px; font-weight: 700;
  color: var(--font-black); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.msg-popup-close {
  background: none; border: none; font-size: 20px;
  color: var(--font-gray); cursor: pointer; line-height: 1;
}
.msg-popup-close:hover { color: var(--font-black); }

/* 대화 목록 */
.msg-convo-list {
  flex: 1; overflow-y: auto;
}
.msg-convo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background .15s;
}
.msg-convo-item:hover { background: rgba(255,107,53,.06); }
.msg-convo-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--font-gray);
}
.msg-convo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-convo-info { flex: 1; min-width: 0; }
.msg-convo-name {
  font-size: 14px; font-weight: 600; color: var(--font-black);
  margin-bottom: 2px;
}
.msg-convo-preview {
  font-size: 12px; color: var(--font-gray);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-convo-meta {
  flex-shrink: 0; text-align: right;
}
.msg-convo-time {
  font-size: 11px; color: var(--font-light); display: block;
  margin-bottom: 4px;
}
.msg-convo-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 10px; border-radius: 10px; min-width: 18px; height: 18px;
  line-height: 18px; text-align: center; padding: 0 5px;
}
.msg-convo-empty {
  padding: 40px 20px; text-align: center; color: var(--font-gray); font-size: 14px;
}

/* 채팅 영역 */
.msg-chat-area {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
  background: var(--bg);
}
.msg-date-divider {
  text-align: center; font-size: 11px; color: var(--font-light);
  padding: 8px 0;
}
.msg-bubble-wrap {
  display: flex; gap: 6px; max-width: 80%;
}
.msg-bubble-wrap.mine {
  align-self: flex-end; flex-direction: row-reverse;
}
.msg-bubble-wrap.theirs {
  align-self: flex-start;
}
.msg-bubble-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden; background: var(--bg-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--font-gray);
}
.msg-bubble-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-bubble-wrap.mine .msg-bubble-avatar { display: none; }
.msg-bubble {
  padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
  word-break: break-word; position: relative;
}
.msg-bubble-wrap.mine .msg-bubble {
  background: var(--accent); color: #fff;
  border-top-right-radius: 4px;
}
.msg-bubble-wrap.theirs .msg-bubble {
  background: var(--bg-white); color: var(--font-black);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
}
.msg-bubble-time {
  font-size: 10px; color: var(--font-light);
  align-self: flex-end; flex-shrink: 0;
}
.msg-bubble-read {
  font-size: 10px; color: var(--accent); display: block;
}

/* 입력 영역 */
.msg-input-area {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0; background: var(--bg-white);
}
.msg-input-area textarea {
  flex: 1; resize: none; border: 1px solid var(--border-color);
  border-radius: 18px; padding: 8px 14px;
  font-size: 13px; max-height: 80px; min-height: 36px;
  outline: none; background: var(--bg); color: var(--font-black);
  font-family: inherit; line-height: 1.4;
}
.msg-input-area textarea:focus { border-color: var(--accent); }
.msg-send-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 50%; width: 36px; height: 36px;
  cursor: pointer; font-size: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.msg-send-btn:hover { background: var(--accent-dark); }
.msg-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 스크롤바 스타일 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--font-gray); }
