/* candidate.json의 theme로 :root 변수 주입 */
:root {
  --primary: #C8102E;
  --bg: #FFFFFF;
  --text: #1A1A1A;
  --muted: #888888;
  --pink-50: #FFF5F7;
  --pink-100: #FFE5EC;
  --pink-200: #FFD0DC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  width: 100%;
  overflow-x: hidden;
}

.page {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

/* ─── 헤더 ─── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.photo-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE5EC 0%, #FFD0DC 100%);
  border: 4px solid #FFFFFF;
  box-shadow: 0 8px 32px rgba(200, 16, 46, 0.15);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.title {
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1;
  margin: 0 0 8px;
  word-break: keep-all;
}
.title .title-dark { color: #1A1A1A; }
.title .title-red  { color: var(--primary); }

.subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ─── 검색창 ─── */
.search-form {
  position: relative;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 20px 60px 20px 24px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid var(--pink-200);
  border-radius: 32px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  box-shadow: 0 4px 24px rgba(200, 16, 46, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: #B8B8B8; }
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 4px 24px rgba(200, 16, 46, 0.15);
}
.search-input:disabled { opacity: 0.6; cursor: progress; }

.send-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.send-btn:hover { background: #A50D26; }
.send-btn:active { transform: translateY(-50%) scale(0.95); }
.send-btn:disabled { opacity: 0.6; cursor: progress; }

/* ─── 추천 질문 칩 ─── */
.suggest {
  text-align: left;
  margin-bottom: 24px;
}

.suggest-label {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 12px;
}

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

.chip {
  padding: 10px 18px;
  background: var(--pink-100);
  border: none;
  border-radius: 24px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.chip:hover { background: var(--pink-200); }
.chip:active { background: var(--pink-200); transform: scale(0.98); }

/* ─── 답변 카드 ─── */
.answer-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  text-align: left;
  max-height: none;
  overflow: visible;
}

.answer-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.answer-content {
  flex: 1 1 auto;
  min-width: 0;
}

.answer-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 1.7em;
  max-height: none;
}

.answer-text .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.matched-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.matched-tags .tag {
  background: var(--primary);
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 11px;
  padding: 4px 10px;
  font-weight: 600;
  display: inline-block;
}

/* ─── 푸터 ─── */
.footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--pink-100);
  font-size: 12px;
  color: #999999;
}

/* ─── 모바일 (v1) ─── */
@media (max-width: 600px) {
  .page { padding: 20px 16px; }
  .photo-wrap { width: 120px; height: 120px; }
  .title { font-size: 40px; letter-spacing: -1.5px; }
  .search-input { padding: 16px 50px 16px 20px; font-size: 15px; }
  .send-btn { width: 38px; height: 38px; right: 6px; }
  .send-btn svg { width: 17px; height: 17px; }
  .chip { padding: 9px 16px; font-size: 13px; }
  .suggest-label { font-size: 12px; }
  .answer-card { padding: 16px; }
  .answer-text { font-size: 14px; }
}


/* ════════════════════════════════════════════════════
   v2 레이아웃 (Chat Go청장 등)
   ──────────────────────────────────────────────────── */

body.v2-mode {
  background: #FAF6F7;
  padding: 24px 16px 32px;
  min-height: 100vh;
  overflow-x: hidden;
}

.card-v2 {
  background: #FFFFFF;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid #FFE0E5;
  overflow: hidden;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1A1A1A;
  box-shadow: 0 12px 48px rgba(200, 16, 46, 0.08);
}

/* ── 헤더(핑크 그라데이션) ── */
.hero-v2 {
  position: relative;
  background: linear-gradient(135deg, #FFF5F7 0%, #FFE0E5 50%, #FFCDD6 100%);
  padding: 40px 32px 0;
  overflow: visible;
  height: 400px;
}

.badge-num {
  position: absolute;
  top: 24px;
  right: 28px;
  background: #C8102E;
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}

.party-label {
  font-size: 11px;
  color: #C8102E;
  letter-spacing: 4px;
  margin-bottom: 12px;
  font-weight: 500;
  position: relative;
  z-index: 2;
}

.slogan-v2 {
  position: relative;
  z-index: 2;
  margin: 0 0 16px;
}
.slogan-v2 .slogan-line {
  display: block;
  font-size: 48px;
  font-weight: 500;
  color: #1A1A1A;
  letter-spacing: -2px;
  line-height: 1.05;
}
.slogan-v2 .slogan-hl {
  color: #C8102E;
}

.hero-bottom {
  display: block;
  position: relative;
  z-index: 2;
}

.profile-block {
  padding-bottom: 28px;
  max-width: 320px; /* 우측 사진과 안 겹치게 좌측에만 */
  min-width: 0;
}
.tagline-v2 {
  font-size: 13px;
  color: #C8102E;
  margin-bottom: 6px;
  font-weight: 500;
}
.name-v2 {
  font-size: 40px;
  font-weight: 500;
  color: #1A1A1A;
  letter-spacing: -2px;
  margin-bottom: 14px;
  line-height: 1;
}
.career-v2 {
  font-size: 11px;
  color: #6B4248;
  line-height: 1.7;
  word-break: keep-all;
}

.photo-block {
  position: absolute;
  right: 0;
  top: -160px;
  bottom: auto;
  width: 420px;
  height: 720px;
  z-index: 1;
  pointer-events: none;
}
.photo-aura {
  position: absolute;
  top: 80px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255,180,195,0.6) 0%, rgba(255,205,214,0) 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}
.photo-stand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  background-position: top center;
  background-size: contain;
  background-repeat: no-repeat;
}
.photo-png {
  display: none; /* 사진은 .photo-stand의 background-image로 표시 */
}

/* ── 본문 ── */
.body-v2 {
  background: #FFFFFF;
  padding: 32px 28px 24px;
  position: relative;
  z-index: 20; /* 사진 하반신을 흰 배경으로 자연스럽게 가림 */
}

.chat-pill-wrap {
  text-align: left;
  max-width: 360px;
  margin-bottom: 24px;
}
.chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #C8102E;
  color: #FFFFFF;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.chat-pill .dot {
  width: 6px;
  height: 6px;
  background: #FFFFFF;
  border-radius: 50%;
  display: inline-block;
}
.intro-v2 {
  font-size: 14px;
  color: #555555;
  margin: 0;
  line-height: 1.6;
  word-break: keep-all;
}

.search-form-v2 {
  position: relative;
  margin-bottom: 20px;
}
.search-input-v2 {
  width: 100%;
  padding: 18px 60px 18px 22px;
  border: 2px solid #C8102E;
  border-radius: 14px;
  font-size: 15px;
  background: #FFFFFF;
  outline: none;
  box-sizing: border-box;
  color: #1A1A1A;
  font-weight: 500;
  font-family: inherit;
}
.search-input-v2::placeholder { color: #B8B8B8; }
.search-input-v2:focus {
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
.search-input-v2:disabled { opacity: 0.6; cursor: progress; }

.send-btn-v2 {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #C8102E;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.send-btn-v2:hover { background: #A50D26; }
.send-btn-v2:active { transform: translateY(-50%) scale(0.95); }
.send-btn-v2:disabled { opacity: 0.6; cursor: progress; }

.suggest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
.suggest-card {
  padding: 14px 16px;
  background: #FFF5F7;
  border: 1px solid #FFCDD6;
  border-radius: 12px;
  font-size: 13px;
  color: #1A1A1A;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  line-height: 1.4;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.suggest-card:hover { background: #FFE0E5; }
.suggest-card:active { transform: scale(0.98); }
.suggest-card .cat {
  color: #C8102E;
  font-size: 11px;
  margin-bottom: 4px;
  font-weight: 500;
}

.answer-card-v2 {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FFF5F7;
  border-radius: 14px;
  padding: 20px;
  border-left: 3px solid #C8102E;
  margin-top: 4px;
  text-align: left;
  max-height: none;
  overflow: visible;
}
.answer-avatar-v2 {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #C8102E;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 500;
  font-size: 14px;
}
.answer-content-v2 {
  flex: 1 1 auto;
  min-width: 0;
}
.answer-cat-v2 {
  font-size: 11px;
  color: #C8102E;
  font-weight: 500;
  margin-bottom: 6px;
}
.answer-text-v2 {
  font-size: 14px;
  color: #1A1A1A;
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 1.7em;
}
.answer-text-v2 .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #1A1A1A;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
.matched-tags-v2 {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.matched-tags-v2 .tag {
  background: #C8102E;
  color: #FFFFFF;
  border-radius: 10px;
  font-size: 11px;
  padding: 3px 9px;
  font-weight: 600;
  display: inline-block;
}

.footer-v2 {
  background: #FFE0E5;
  padding: 16px 28px;
  text-align: center;
  font-size: 11px;
  color: #8D5560;
  letter-spacing: 1px;
  position: relative;
  z-index: 20;
}

/* ── v2 태블릿 이하 ── */
@media (max-width: 768px) {
  body.v2-mode { padding: 0; }
  .card-v2 { border-radius: 0; border: none; }
  .hero-v2 { padding: 28px 20px 0; height: 320px; }
  .badge-num { top: 20px; right: 20px; font-size: 11px; padding: 5px 12px; }
  .party-label { font-size: 10px; letter-spacing: 3px; }
  .slogan-v2 .slogan-line { font-size: 36px; letter-spacing: -1.5px; }
  .name-v2 { font-size: 32px; letter-spacing: -1.5px; }
  .career-v2 { font-size: 10px; }
  .profile-block { max-width: 55%; }
  .photo-block { width: 320px; height: 540px; right: -40px; top: -150px; bottom: auto; }
  .photo-aura { width: 340px; height: 340px; top: 60px; bottom: auto; }
  .photo-png { width: 320px; height: 540px; }
  .body-v2 { padding: 24px 20px 20px; }
  .chat-pill-wrap { max-width: 100%; text-align: left; }
  .search-input-v2 { padding: 16px 54px 16px 18px; font-size: 14px; }
  .send-btn-v2 { width: 38px; height: 38px; right: 5px; }
  .suggest-card { padding: 12px 14px; font-size: 12px; }
  .answer-card-v2 { padding: 16px; }
  .answer-text-v2 { font-size: 13px; }
  .footer-v2 { padding: 14px 20px; font-size: 10px; }
}

@media (max-width: 420px) {
  .slogan-v2 .slogan-line { font-size: 32px; letter-spacing: -1px; }
  .name-v2 { font-size: 28px; }
  .career-v2 { font-size: 10px; }
  .hero-v2 { padding: 24px 18px 0; height: 290px; }
  .profile-block { max-width: 55%; }
  .photo-block { width: 280px; height: 480px; right: -32px; top: -130px; bottom: auto; }
  .photo-aura { width: 300px; height: 300px; top: 50px; bottom: auto; }
  .photo-png { width: 280px; height: 480px; }
  .body-v2 { padding: 22px 18px 18px; }
}

@media (max-width: 360px) {
  .slogan-v2 .slogan-line { font-size: 28px; }
  .name-v2 { font-size: 24px; }
  .profile-block { max-width: 52%; }
  .hero-v2 { height: 260px; }
  .photo-block { width: 240px; height: 420px; right: -28px; top: -110px; bottom: auto; }
  .photo-aura { width: 260px; height: 260px; top: 40px; bottom: auto; }
  .photo-png { width: 240px; height: 420px; }
  .body-v2 { padding: 20px 16px 16px; }
}
