:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dce4ee;
  --text: #172019;
  --muted: #647084;
  --green: #1f8f5f;
  --green-dark: #146344;
  --blue: #2b69c8;
  --blue-soft: #e8f1ff;
  --amber: #c78214;
  --red: #c84632;
  --shadow: 0 14px 34px rgba(24, 36, 28, 0.08);
  --page-width: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.site-logo {
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-menu {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.top-menu-button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.top-menu-button.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(20, 99, 68, 0.12);
}

.layout {
  max-width: 1540px;
  margin: 0 auto;
  padding: 22px 24px 56px;
}

.filter-section {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  width: min(var(--page-width), 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.filter-main {
  min-width: 0;
  border-left: 1px solid var(--line);
}

.primary-sidebar {
  align-self: start;
  background: var(--surface);
}

.primary-sidebar h2 {
  margin: 0;
  padding: 16px 14px 12px;
  color: #1c2637;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 900;
}

.category-list,
.topic-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.category-button,
.topic-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #263247;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}

.compact-category {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}

.category-button:hover,
.topic-button:hover,
.category-button.active,
.topic-button.active {
  background: var(--blue-soft);
  color: #1d5fd6;
  font-weight: 700;
}

.category-button.active,
.topic-button.active {
  box-shadow: inset 0 0 0 1px #cfe0fb;
}

.category-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.category-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  color: #9aa8ba;
  font-size: 12px;
}

.topic-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.filter-section .topic-panel {
  margin-top: 0;
  border: 0;
}

.topic-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: #1c2637;
}

.topic-panel-head div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topic-panel-head span {
  color: var(--green-dark);
  font-weight: 900;
}

.topic-panel-head strong {
  font-size: 15px;
}

#clearTopic {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 5px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
}

.topic-panel .topic-list {
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
}

.topic-panel .topic-button {
  justify-content: space-between;
  min-height: 46px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  color: #263247;
  font-size: 14px;
  font-weight: 650;
}

.question-button {
  align-items: center;
}

.question-main {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.question-prefix {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-weight: 900;
}

.question-text {
  line-height: 1.55;
}

.topic-count {
  flex: 0 0 auto;
  margin-left: 14px;
  color: #9aa8ba;
  font-size: 12px;
  font-weight: 800;
}

.topic-panel .topic-button.active {
  background: #e9f4ef;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px #b9d9c8;
}

.model-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.model-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-right: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
  color: #263247;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.model-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.model-check span {
  flex: 1 1 auto;
}

.model-check em {
  color: #9aa8ba;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.model-check.active {
  background: #e9f4ef;
  color: var(--green-dark);
}

.content {
  width: min(var(--page-width), 100%);
  min-width: 0;
  margin: 0 auto;
  padding-top: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 0;
  min-height: 310px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-actions button {
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.hero-actions button:last-child {
  color: var(--green-dark);
  background: #e5f4ea;
}

.hero-media {
  min-height: 310px;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.results-section {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.stage-badge,
.card-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 5px;
  background: #e5f4ea;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.topic-match {
  background: #e9f4ef;
  color: var(--green-dark);
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--line);
}

.page-button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #4b5a70;
  cursor: pointer;
  font-weight: 800;
}

.page-button:hover,
.page-button.active {
  border-color: var(--green);
  background: #e9f4ef;
  color: var(--green-dark);
}

.video-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.video-info {
  align-self: center;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #dce6df;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  font-weight: 900;
}

.video-info h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.38;
}

.video-info p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.video-info > .badge-row {
  margin-top: 0;
  margin-bottom: 6px;
}

.duration-badge {
  background: #f5f7f9;
  color: #526174;
}

.tag {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #47534b;
  font-size: 12px;
  background: var(--surface-2);
}

.tag-button {
  font: inherit;
  cursor: pointer;
}

.tag-button:hover,
.tag-button.active {
  border-color: #9fc6b7;
  background: #e9f4ef;
  color: var(--green-dark);
}

.intent-high {
  background: #fcebe8;
  color: var(--red);
}

.intent-medium {
  background: #fff3dc;
  color: var(--amber);
}

.intent-low {
  background: #e8f0fc;
  color: var(--blue);
}

.empty-state {
  padding: 22px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 18, 0.5);
}

.modal-panel {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 42px);
  margin: 21px auto;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(20, 28, 24, 0.24);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #dce6df;
  overflow: hidden;
}

.modal-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.modal-body {
  padding: 24px;
}

.modal-body h2 {
  margin: 12px 0 0;
  font-size: 28px;
  line-height: 1.3;
}

.modal-body p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .filter-section {
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 220px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-menu {
    width: 100%;
  }

  .top-menu-button {
    flex: 1 1 0;
  }

  .model-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout {
    display: block;
    padding: 14px;
  }

  .filter-section {
    display: block;
  }

  .filter-main {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .content {
    padding: 0;
  }

  .primary-sidebar {
    min-height: 0;
  }

  .category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    padding: 26px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-card {
    grid-template-columns: 1fr;
  }

}

.reason-line {
  color: #4b5a70 !important;
  font-size: 13px;
  font-weight: 600;
}

.reason-label {
  display: inline-block;
  margin-right: 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.reason-label::after {
  content: ":";
}

.modal-reason {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.modal-reason h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 16px;
}

.modal-reason p {
  margin: 10px 0 0;
  color: #263247;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.75;
}


.modal-detail {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-detail h3 {
  margin: 0;
  color: #17211b;
  font-size: 16px;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.evidence-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.evidence-time {
  border: 1px solid #9fc6b7;
  border-radius: 5px;
  background: #e9f4ef;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
  padding: 6px 7px;
}

.evidence-time:disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}

.evidence-item p {
  margin: 0;
  color: #344258;
  font-size: 14px;
  line-height: 1.65;
}

.evidence-item strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--green-dark);
}

.empty-evidence {
  margin: 10px 0 0;
  color: var(--muted);
}

.modal-contact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #b7d4c8;
  background: #f2faf6;
}

.modal-contact strong {
  color: var(--green-dark);
  font-size: 16px;
}

.modal-contact p {
  margin: 6px 0 0;
  color: #42506a;
  font-size: 14px;
}

.modal-contact a {
  flex: 0 0 auto;
  padding: 10px 13px;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 760px) {
  .evidence-item,
  .modal-contact {
    display: block;
  }

  .evidence-item p,
  .modal-contact a {
    margin-top: 10px;
  }
}
