@charset "utf-8";

.ai_sc {
  --ai-icon-mic: url(./img/icon_mic-fill.svg);
  --ai-icon-mic-mute: url(./img/icon_mic-mute-fill.svg);
  --ai-icon-stickies: url(./img/copy.svg);
  --ai-icon-thumbs-up: url(./img/like.svg);
  --ai-icon-thumbs-down: url(./img/dislike.svg);
  --ai-icon-chevron-down: url(./img/arrow-down.svg);

  margin: 20px 0 60px;
  position: relative;
  padding-bottom: 20px;
}

.ai_sc .title-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0 0 105px;
}

.ai_sc .title{
  color: #2C62D4;
  font-size: 32px;
  font-weight: 700;
}

.ai-disclaimer {
  font-size: 14px;
  color: #4B6180;
}

@property --badge-glow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.badge-beta {
  --badge-glow-1: #447AE8;
  --badge-glow-2: #57C7F2;

  position: relative;
  display: inline-block;
  vertical-align: middle;
  color: #477CE9;
  padding: 4px 12px 6px;
  border-radius: 100px;
  background-color: #fff;
  border: 1px solid #447ae8;
  font-size: 16px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
}

/* #contents 로 우선순위(ID)를 올려 서버 reset/전역 CSS 의 u 밑줄을 이긴다.
   (대민 #aiSummarySection .badge-beta > u 와 동일 방식) */
#contents .badge-beta > u {
  font-weight: 400;
  text-decoration: none;
}

.badge-beta::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--badge-glow-angle, 0deg),
      var(--badge-glow-1),
      var(--badge-glow-2),
      var(--badge-glow-1),
      var(--badge-glow-2),
      var(--badge-glow-1));
  filter: blur(6px);
  pointer-events: none;
  animation:
    badge-beta-glow-spin 6s linear infinite,
    badge-beta-glow-pulse 2.6s ease-in-out infinite;
}

@keyframes badge-beta-glow-spin {
  to {
    --badge-glow-angle: 360deg;
  }
}

@keyframes badge-beta-glow-pulse {

  0%,
  100% {
    opacity: .55;
    transform: scale(1);
  }

  50% {
    opacity: .95;
    transform: scale(1.08);
  }
}

.badge-beta::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #447AE8;
  box-shadow: 0 0 6px 1px rgba(68, 122, 232, .8);
  pointer-events: none;

  /* 부모의 border-box(둥근 pill) 외곽선을 그대로 경로로 사용 */
  offset-path: border-box;
  offset-anchor: 50% 50%;
  offset-rotate: 0deg;
  offset-distance: 0%;
  animation: badge-beta-orbit 5s linear infinite;
}

@keyframes badge-beta-orbit {
  to {
    offset-distance: 100%;
  }
}

@supports not (offset-path: border-box) {
  .badge-beta::after {
    display: none;
  }
}

/* 2026-08-12: reduced-motion 환경(엣지/윈도우 애니메이션 OFF)에서 배지 글로우 정지 문제 →
   배지 노출 우선 요청으로 임시 주석. 되돌리려면 아래 주석 해제.
@media (prefers-reduced-motion: reduce) {
  .badge-beta::after {
    animation: none;
    offset-distance: 12%;
  }

  .badge-beta::before {
    animation: none;
    opacity: .7;
  }
}
*/

.ai_sc .title::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 8px;
  width: 70px;
  aspect-ratio: 69/94;
  background: url(./img/ai-char.gif) no-repeat center / contain;
  z-index: 1;
}

.ai_sc .search_box {
  position: relative;
  z-index: 2;
}

/* box 효과*/
.search_box.is-loading {
  position: relative;
  border-radius: 8px;
  z-index: 2;
}

.search_box.is-loading .ai-summary-body {
  animation: searching-glow 3.5s ease-in-out infinite;
}

@keyframes searching-glow {
  0%, 100% {
    box-shadow: 0 0 6px 0 rgba(43, 98, 211, 0.45);
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(43, 98, 211, 0.9);
  }
}

.ai_sc .ai-summary-body {
  position: relative;
  padding: 20px;
  margin: 0 15px;
  border-radius: 20px;
  border:2px solid #2B62D4;
  background: #fff;
  box-shadow: 0 0 14px 0 rgba(43, 98, 211, 0.80);
}

.ai_sc .ai-loading, .ai_sc .ai-result-content  {
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
}

.ai_sc .ai-loading-message {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.ai_sc .ai-loading-title {
  width: 100%;
  color: #2A62D3;
  font-size: 20px;
  font-weight: 700;
}

.ai_sc .ai-loading-desc {
  font-size: 16px;
  margin-top: 7px;
  font-weight: 400;
  color: #000;
}

.ai_sc .ai-loading-cont {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.ai_sc .ai-loading-icon {
  position: absolute;
  inset: 0;
}

.ai_sc .ai-loading-icon > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
}

/* 바깥쪽: 시안색 (반지름 38, 둘레 ≈ 238.8) */
.ai_sc .ai-loading-icon > svg:nth-child(1) {
  transform-origin: center;
  animation:
    pop-out 1.8s cubic-bezier(0.34, 1.7, 0.64, 1) infinite,
    spin-cw 1.8s ease-in-out infinite;
}

.ai_sc .ai-loading-icon > svg:nth-child(1) circle {
  stroke-dasharray: 0.1 240;
  animation: arc-grow-outer 1.8s ease-in-out infinite;
}

/* 안쪽: 주황색 (반지름 20, 둘레 ≈ 125.7) — 반대 방향 회전 + 살짝 시간차 */
.ai_sc .ai-loading-icon > svg:nth-child(2) {
  transform-origin: center;
  animation:
    pop-out 1.8s cubic-bezier(0.34, 1.7, 0.64, 1) infinite,
    spin-ccw 1.8s ease-in-out infinite;
  animation-delay: -0.15s, -0.15s;
}

.ai_sc .ai-loading-icon > svg:nth-child(2) circle {
  stroke-dasharray: 0.1 130;
  animation: arc-grow-inner 1.8s ease-in-out infinite;
  animation-delay: -0.15s;
}

@keyframes pop-out {
  0%   { scale: 0; }
  30%  { scale: 1; }
  100% { scale: 1; }
}

@keyframes spin-cw {
  0%, 25% { rotate: -90deg; }
  100%    { rotate: 270deg; }
}

@keyframes spin-ccw {
  0%, 25% { rotate: -90deg; }
  100%    { rotate: -450deg; }
}

@keyframes arc-grow-outer {
  0%, 30% { stroke-dasharray: 0.1 240; }
  70%     { stroke-dasharray: 210 240; }
  100%    { stroke-dasharray: 0.1 240; }
}

@keyframes arc-grow-inner {
  0%, 30% { stroke-dasharray: 0.1 130; }
  70%     { stroke-dasharray: 110 130; }
  100%    { stroke-dasharray: 0.1 130; }
}

/* btn */
.ai_sc .ai-summary-controls {
  display: flex;
  gap: 10px;
}

.ai_sc .tts-btn {
  width: 160px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 1px solid #2C63D4;
  background-color: #2C63D4;
  padding-right: 2px;
}

.ai_sc .tts-btn::before {
  content: "";
  width: 24px;
  height: 24px;
  background-color: #fff;
  display: inline-flex;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  mask-image: var(--ai-icon-mic);
  -webkit-mask-image: var(--ai-icon-mic);
}

.ai_sc .tts-btn.auto-reading {
  color: #2C63D4;
  background-color: #fff;
  border-color: #2C63D4;
}

.ai_sc .tts-btn.auto-reading::before {
  background-color: #2C63D4;
  mask-image: var(--ai-icon-mic);
  -webkit-mask-image: var(--ai-icon-mic);
}

.ai_sc .tts-btn.auto-reading.off {
  color: #E2E2E2;
  background-color: #777;
  border-color: #777;
}

/* 자동읽기 off일경우, off 클래스 붙이기*/
.ai_sc .tts-btn.auto-reading.off::before {
  background-color: #E2E2E2;
  mask-image: var(--ai-icon-mic-mute);
  -webkit-mask-image: var(--ai-icon-mic-mute);
}

/* 키워드 분석 안내 — extract-keywords 응답 후 답변 본문 위에 표시 */
.ai_sc .ai-question-notice {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
.ai_sc .ai-question-keywords {
  font-weight: 700;
  color: #2E66D7;
}

/*max-height 조절가능*/
.ai_sc .ai-result {
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.ai-summary-section {
  padding-left: 20px;
  position: relative;
}

.ai-summary-section::before {
  content: "";
  display: inline-flex;
  position: absolute;
  left: 0;
  width: 6px;
  height: 100%;
  background-color: #2C62D4;
  border-radius: 100px;
}

.ai-detail-section::before {
  background-color: #4B6180;
}

.ai-summary-section * {
  color: #000;
}

.ai-summary-section .ai-summary-tit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #013F9D;
}

.ai-detail-section .ai-summary-tit {
  color: #002154;
}

.ai-summary-section + .ai-summary-section {
  margin-top: 24px;
}

.ai-detail-section ul {
  list-style: none;
  padding: 0;
}

.ai-detail-section li {
  position: relative;
  padding-left: 20px;
  white-space: pre-line;
  line-height: 1.6;
}

.ai-detail-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #777;
}

.ai-detail-section ul > li+li {
  margin-top: 20px;
}

.ai-detail-section .ai-detail-line {
  margin-top: 6px;
}

.ai_sc .divider {
  display: inline-block;
  width: 100%;
  height: 1px;
  background: #ccc;
  margin: 10px 0 17px 0;
}

.ai_sc .feedback-btn-cont {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.ai_sc .response-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai_sc .feedback-btn {
  width: 28px;
  height: 28px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: transparent;
}

.ai_sc .feedback-btn i {
  display: inline-flex;
  width: 18px;
  height: 18px;
  background-color: #4B6180;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* active 상태 — 배경 유지, 손가락 아이콘만 강조 색 (hover 보다 먼저 선언해서 hover 가 cascade 로 덮도록).
   좋아요=파랑, 싫어요=빨강 — 감정 코딩 */
.ai_sc .feedback-btn.is-up.is-active i {
  background-color: #2563EB;
}

.ai_sc .feedback-btn.is-down.is-active i {
  background-color: #DC2626;
}

.ai_sc .feedback-btn:hover, .ai_sc .feedback-btn.is-copied  {
  background-color: #4B6180;
  border-radius: 8px;
}

.ai_sc .feedback-btn:hover i, .ai_sc .feedback-btn.is-copied i {
  background-color: #fff;
}

.ai_sc .feedback-btn.copy i {
  mask-image: var(--ai-icon-stickies);
  -webkit-mask-image: var(--ai-icon-stickies);
}

.ai_sc .feedback-btn.is-up i {
  mask-image: var(--ai-icon-thumbs-up);
  -webkit-mask-image: var(--ai-icon-thumbs-up);
}

.ai_sc .feedback-btn.is-down i {
  mask-image: var(--ai-icon-thumbs-down);
  -webkit-mask-image: var(--ai-icon-thumbs-down);
}

.ai_sc .flex-column {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 20px 15px 0 15px;
}

.ai_sc .ai-result-sources {
  font-size: 14px;
  color: #333333;
  margin: 0;
}

.ai_sc .source-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai_sc .source-label {
  flex-shrink: 0;
  color: #4B6180;
  font-size: 16px;
  margin: 0;
}

.ai_sc .source-group > dd {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.ai_sc .source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ai_sc .source-list > li {
  flex: 0 0 calc((100% - 24px) / 3);
  min-width: 0;
}

.ai_sc .source-title {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 15px;
  border: 1px solid #4B6180;
  border-radius: 6px;
  color: #2C63D4;
  text-decoration: underline;
  box-sizing: border-box;
}

.ai_sc .source-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai_sc .ai-expand-icon {
  background-color: #4B6180;
  display: inline-flex;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  mask-image: var(--ai-icon-chevron-down);
  -webkit-mask-image: var(--ai-icon-chevron-down);
  vertical-align: middle;
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.ai_sc .ai-summary-expanded.is-expanded .ai-expand-icon {
  transform: rotate(180deg);
}

.ai_sc .ai-summary-expanded {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 160px;
  height: 50px;
  color: #4B6180;
  background: #fff;
  border: 1px solid #4B6180;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  margin: 20px auto;
}

.ai_sc .source-title .ai-download-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  background: url(./img/box-arrow-down.svg) no-repeat center / contain;
}

.ai_sc .ai-detail-download .ai-download-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  background: url(./img/box-arrow-down.svg) no-repeat center / contain;
}

.ai_sc .ai-detail-link .ai-link-icon {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  background: url(./img/external-link.svg) no-repeat center / contain;
}

.ai_sc .ai-detail-link,
.ai_sc .ai-detail-download {
  display: inline-flex;
  align-items: center;
  vertical-align: -3px;
  text-decoration: none;
  color: #2B62D4;
  margin-left: 6px;
  line-height: 1;
  height: 18px;
}
.ai_sc .ai-detail-link:hover .ai-link-icon,
.ai_sc .ai-detail-download:hover .ai-download-icon {
  opacity: 0.65;
}
/* === 시안 hover 추가 (중진공AI통합검색_hover추가) === */
.ai_sc .tts-btn:hover {
  border-color: #004F96;
  background-color: #004F96;
}
.ai_sc .tts-btn.auto-reading:hover {
  background-color: #EDF3FF;
}
.ai_sc .source-item:hover {
  background-color: #EDF3FF;
}
.ai_sc .ai-summary-expanded:hover {
  color: #000;
  border-color: #000;
}
.ai_sc .ai-summary-expanded:hover .ai-expand-icon {
  background-color: #000;
}

/* === 검색 프로젝트 fix — 거대 SVG/이미지 강제 사이즈 제한 === */
/* .ai-loading svg 는 .ai-loading-cont (60x60) 에 inset:0 으로 stretch 되어야 하므로 제외 */
.ai-summary-section svg,
.ai-summary-body > svg,
.ai-result > svg {
    max-width: 32px !important;
    max-height: 32px !important;
}
.ai-summary-section img,
.ai-summary-body img,
.ai-result img {
    max-width: 100%;
    max-height: 80px;
}

/* ai-char.png 숨김 룰 제거 — 로봇 캐릭터 정상 표시 */
