/* ===== 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;
}

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;
}

/* ===== 기본 리셋 ===== */
* { 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: 900;
}
.sidemenu-overlay.active,
.alarm-overlay.active { display: block; }

/* ===== 모바일 왼쪽 사이드메뉴 ===== */
.mobile-sidemenu {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
}
.sidemenu-content {
  position: absolute;
  top: 0; left: -280px; bottom: 0;
  width: 280px;
  background: var(--bg-sidemenu);
  overflow-y: auto;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}
.mobile-sidemenu.open .sidemenu-content { left: 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-title {
  padding: 10px 20px 6px !important;
  font-size: 11px !important;
  color: var(--font-gray) !important;
  background: var(--bg) !important;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== 알림 오른쪽 사이드바 ===== */
.alarm-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 1000;
}
.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;
}
.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;
}
.header-center { max-width: 1100px; margin: 0 auto; }

/* 모바일 상단바 */
.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 15px;
  gap: 15px;
  max-width: 1400px;
  margin: 0 auto;
}
.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; max-width: 400px; }
.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-banner-area {
  flex: 1;
  max-width: 300px;
  height: 50px;
  overflow: hidden;
}
.header-banner-placeholder {
  height: 50px;
  background: var(--ad-bg);
  color: var(--ad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
}

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

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

/* 하단 네비 */
.header-nav {
  background: var(--nav-bg);
  overflow-x: clip;
}
.nav-list {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
  justify-content: center;
}
.nav-item a {
  display: block;
  padding: 10px 16px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item a:hover,
.nav-item.active a {
  color: var(--nav-hover);
}

/* 인기글 🔥 아이콘 버튼 */
.nav-fire a {
  padding: 10px 8px !important;
  font-size: 15px !important;
  line-height: 1;
}
.nav-fire.active a,
.nav-fire a:hover {
  filter: brightness(1.3);
}

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

/* ===== 왼쪽 섹션 ===== */
.section-left {
  flex: 1;
  min-width: 0;
}

/* 상단 배너 (PC) */
.section-top-banner {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.banner-left, .banner-right { flex: 1; }
.ad-placeholder-large {
  height: 80px;
  background: var(--ad-bg);
  color: var(--ad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
}

/* 모바일 퀵메뉴 */
.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); }

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

.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: 500;
  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: 5px 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: 7px 15px;
  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;
  border-top: 1px solid var(--border-color);
}
.latest-title {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding: 9px 15px 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--font-black);
  cursor: pointer;
}
.latest-title:hover { color: var(--accent); }
.latest-list { padding: 5px 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: 7px 15px;
  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 {}
.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: 200px;
  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);
}

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

.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;
}

/* ===== 푸터 ===== */
#footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 20px;
  padding: 20px 15px;
}
.footer-center { max-width: 1100px; 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: 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-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; }

  .nav-list { overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; padding: 0 5px; }
  .nav-item a { padding: 9px 10px; 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;
}

/* ===== 스크롤바 스타일 ===== */
::-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); }
