/* 기본 리셋 */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 전체 배경: 검정 */
html, body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* 상단 탭 */
.topbar {
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.topbar-inner {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  box-sizing: border-box;
  overflow: visible;
}
.logo-area {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.logo { height: 38px; width: auto; }

/* 상단 메인 네비게이션 그룹 */
.top-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}
.top-nav-group::-webkit-scrollbar {
  display: none;
}
.nav-btn {
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #334155;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.nav-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

/* 메인 카테고리 (가운데) */
.main-cats ul {
  list-style: none;
  display: flex;
  gap: 12px;
}
.main-cats a {
  color: #ddd;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.main-cats a:hover, .main-cats a.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* 로그인 영역 및 버튼 */
.login-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.login-btn {
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #0b84ff, #6a00ff);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(11, 132, 255, 0.3);
  transition: opacity 0.2s, transform 0.1s;
}
.login-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
#themeSelect {
  background: #1e293b;
  color: #fff;
  border: 1px solid #334155;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  width: auto !important;
  min-width: 85px !important;
  max-width: 120px !important;
}

/* 모바일 메뉴 버튼 (숨김: 데스크탑) */
.mobile-menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
}

/* 레이아웃: 전체 너비 / 높이 사용 */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  padding: 0;
  height: calc(100vh - 60px);
}

/* 좌측 패널 (제거되었으나 기본 스타일 유지) */
.left-panel {
  display: none;
}
.subcats ul { list-style: none; }
.subcats li {
  padding: 8px 10px;
  border-radius: 6px;
  color: #ddd;
  cursor: pointer;
  margin-bottom: 6px;
}
.subcats li:hover, .subcats li.active {
  background: rgba(255,255,255,0.04);
  color: #fff;
}

/* 메인 콘텐츠: 100% 프레임 전체 채움 */
.main-content, #mainContent {
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  flex: 1;
}
.board-list .board-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.board-list .board-item:last-child { border-bottom: none; }
.board-list .title { color: #fff; font-weight: 600; }
.board-list .meta { color: #aaa; font-size: 13px; }

/* 푸터 */
.site-footer {
  margin-top: 0;
  padding: 10px 0;
  border-top: 1px solid #1e293b;
  background: #090d16;
}
.footer-inner { max-width: 100%; margin: 0 auto; padding: 0 12px; color: #aaa; font-size: 13px; }

/* 반응형: 모바일 및 소형 화면 최적화 */
.mobile-menu-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .topbar-inner { padding: 6px 10px; gap: 8px; }
  .logo { height: 30px; }
  .nav-btn { padding: 5px 9px; font-size: 12px; }
  #themeSelect { padding: 4px 6px; font-size: 12px; }
  .login-btn { padding: 5px 10px; font-size: 12px; }
}

/* ================= 포털 허브 (Portal Hub) 홈 화면 스타일 ================= */
#mainContent {
  padding: 16px 20px;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
}

.portal-hub-container {
  width: 100%;
  height: 100%;
  padding: 20px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, 0.16), rgba(15, 23, 42, 0.96));
  border: 2px solid transparent;
  border-radius: 16px;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(99, 102, 241, 0.2);
  text-align: center;
  animation: fadeInPortal 0.4s ease-out;
  overflow: hidden;
}

body.light-mode .portal-hub-container {
  background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, 0.12), rgba(248, 250, 252, 0.98));
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.15), inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.portal-hub-container::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b, #10b981, #3b82f6, #8b5cf6);
  border-radius: 18px;
  z-index: -1;
  animation: borderRotate 5s linear infinite;
  background-size: 300% 300%;
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeInPortal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.portal-hero-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.portal-badge-marquee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.25), rgba(99, 102, 241, 0.3));
  border: 1px solid rgba(236, 72, 153, 0.5);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #f472b6;
  letter-spacing: 2px;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(236, 72, 153, 0.3); }
  100% { box-shadow: 0 0 25px rgba(236, 72, 153, 0.8); }
}

.portal-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.25;
  background: linear-gradient(135deg, #ffffff 15%, #f472b6 45%, #60a5fa 80%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
  margin: 0;
  letter-spacing: -0.5px;
}

body.light-mode .portal-hero-title {
  background: linear-gradient(135deg, #1e1b4b 15%, #db2777 45%, #2563eb 80%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-hero-sub {
  font-size: 0.92rem;
  color: #94a3b8;
  max-width: 780px;
  line-height: 1.4;
  margin: 0;
}

body.light-mode .portal-hero-sub {
  color: #64748b;
}

.portal-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-feature-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f1f5f9;
  backdrop-filter: blur(4px);
}

body.light-mode .portal-feature-tag {
  background: rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
  color: #334155;
}

/* 반응형 풀와이드 포털 서비스 카드 그리드 */
.portal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  flex: 1;
  margin: 10px 0;
  box-sizing: border-box;
  align-items: stretch;
}

@media (max-width: 900px) {
  .portal-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .portal-cards-grid {
    grid-template-columns: 1fr;
  }
}
  .portal-hero-title {
    font-size: 1.4rem;
  }
}

.portal-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: 100%;
}

.portal-card::after {
  content: 'OPEN ▶';
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #60a5fa;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
}

body.light-mode .portal-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.portal-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: #3b82f6;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
  background: rgba(30, 41, 59, 0.95);
}

.portal-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

body.light-mode .portal-card:hover {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
}

.pc-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.pc-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pc-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #f8fafc;
}

body.light-mode .pc-title {
  color: #0f172a;
}

.pc-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.pc-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.light-mode .pc-desc {
  color: #64748b;
}

.pc-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.pc-tag {
  font-size: 0.7rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
}

body.light-mode .pc-tag {
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.04);
}

.portal-bottom-bar {
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

body.light-mode .portal-bottom-bar {
  background: rgba(0, 0, 0, 0.03);
  border-color: #e2e8f0;
  color: #64748b;
}
