:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dbe3ec;
  --line-strong: #c9d4e0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #94a3b8;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 18px 36px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", -apple-system, sans-serif;
}

#boss-main-v4 {
  padding: 18px 0 28px;
}

#boss-main-v4 a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 14px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.searchWrap {
  position: relative;
  flex: 1;
  border: 1px solid #d4deea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.searchWrap:hover {
  border-color: #c3d1e1;
}

.searchIcon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: #64748b;
  opacity: 0.6;
  transition: color 0.18s ease, opacity 0.18s ease;
}

#q {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  transition: color 0.16s ease;
}

#q::placeholder {
  color: #94a3b8;
  font-weight: 450;
}

#q:focus {
  outline: 0;
}

.searchWrap:focus-within {
  border-color: #9ec0ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 10px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.searchWrap:focus-within .searchIcon {
  color: #2563eb;
  opacity: 0.85;
}

.topActions {
  display: flex;
}

#btnWrite {
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

#btnWrite:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28);
}

#btnWrite:active {
  transform: translateY(0);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.feedCol,
.sideCol {
  min-width: 0;
}

.feedCard,
.sideCard {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.sideStack {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activeBar {
  display: none;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.pill {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e1ea;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pill:hover {
  border-color: #b8c6d8;
  transform: translateY(-1px);
}

.pill strong {
  opacity: 0.75;
  font-weight: 600;
}

.pill .x {
  font-size: 14px;
  opacity: 0.6;
}

.resultsTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.resultsCount {
  font-size: 14px;
  color: var(--text-muted);
}

#resultCount {
  color: #1d4ed8;
  font-weight: 700;
}

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

#loadingHint {
  display: none;
  color: var(--text-soft);
  font-size: 12px;
}

#sort {
  height: 38px;
  min-width: 112px;
  padding: 0 34px 0 12px;
  border: 1px solid #d2dce8;
  border-radius: 9999px;
  background: #ffffff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg width=%2212%22 height=%228%22 viewBox=%220 0 12 8%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath d=%22M1 1.25L6 6.25L11 1.25%22 stroke=%2264778b%22 stroke-width=%222%22 stroke-linecap=%22round%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

#sort:hover {
  border-color: #bfcddd;
  background-color: #f8fafc;
}

#sort:focus {
  outline: 0;
  border-color: #9ec0ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.list {
  display: flex;
  flex-direction: column;
}

.item {
  display: block;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.14s ease;
}

.item:last-child {
  border-bottom: 0;
}

.item:hover {
  background: #f9fbfd;
}

.itemTop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12px;
  color: #8a99ab;
}

.category {
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d9e2ed;
  border-radius: var(--radius-pill);
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

.itemTitle {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.itemDesc {
  margin: 0 0 11px;
  color: #64748b;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.itemBottom {
  display: flex;
  gap: 14px;
  color: #94a3b8;
  font-size: 12px;
}

.icon {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}

.mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fafcff;
}

.pager button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid #d5dfeb;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pager button:hover:not(:disabled) {
  border-color: #b7c8dc;
  transform: translateY(-1px);
}

.pager button:disabled {
  opacity: 0.45;
  cursor: default;
}

.sideHead,
.cardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.sideHead h4,
.cardHeader h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hint {
  font-size: 11px;
  color: #94a3b8;
}

.sideBody {
  padding: 13px 14px;
}

.guideGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 8px 11px;
  border: 1px solid #dbe3ec;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  border-color: #b8c6d8;
  background: #f8fafc;
}

.hotList {
  display: flex;
  flex-direction: column;
}

.hotItem {
  display: block;
  margin: 0 -6px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.hotItem:last-child {
  border-bottom: 0;
}

.hotItem:hover {
  background: #f8fafc;
}

.hotItem b {
  display: block;
  margin-bottom: 6px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.hotItem span {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.group {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.group:last-child {
  border-bottom: 0;
}

.groupTitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}

.groupTitle b {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

#policyHint {
  font-size: 11px;
  color: #2563eb;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fchip {
  height: 34px;
  padding: 0 13px;
  border: 1px solid #dce4ed;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.fchip:hover {
  border-color: #bccbdd;
  background: #f8fafc;
  transform: translateY(-1px);
}

.fchip.on {
  border-color: #c9d3df;
  background: #e8edf3;
  color: #1e293b;
}

.sideActions {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.btn {
  width: 100%;
  height: 38px;
  border: 1px solid #d5dfeb;
  border-radius: 11px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  border-color: #b8c6d8;
  background: #f8fafc;
  transform: translateY(-1px);
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.btn.primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-float);
}

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  transform: translateY(110%);
  transition: transform 0.22s ease;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 -16px 40px rgba(2, 6, 23, 0.2);
}

.drawer.on {
  transform: translateY(0);
}

.drawerHead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.drawerHead .close {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d5dfeb;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-weight: 600;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sideStack {
    position: static;
  }
}

@media (max-width: 760px) {
  #boss-main-v4 {
    padding: 10px 0 84px;
  }

  .topbar {
    top: 8px;
    grid-template-columns: 1fr auto;
    display: grid;
    grid-template-areas: "search actions";
  }

  .searchWrap {
    grid-area: search;
  }

  .topActions {
    grid-area: actions;
  }

  .filtersCard {
    display: none;
  }

  .fab {
    display: inline-flex;
    align-items: center;
  }

  #btnWrite {
    position: fixed;
    right: 16px;
    bottom: 72px;
    z-index: 60;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-float);
  }

  .activeBar {
    display: none !important;
  }

  .resultsTop {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .resultsControls {
    margin-left: auto;
  }

  #q {
    height: 50px;
    font-size: 15px;
  }

  #sort {
    height: 36px;
    min-width: 108px;
    padding: 0 30px 0 11px;
    font-size: 13px;
    border-radius: 9999px;
  }

  .itemTitle {
    font-size: 17px;
  }

  .itemDesc {
    font-size: 14px;
  }

  .itemBottom {
    font-size: 13px;
    gap: 12px;
  }

  .fchip {
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .btn {
    height: 44px;
    font-size: 14px;
  }

  .pager button {
    height: 40px;
    font-size: 13px;
  }
}
