/* 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;
}

/* ─── 모바일 ─── */
@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; }
}
