/* 피드백 리포트 공유 스타일 — index.html(인라인 표시)과 report.html(메인 뷰어) 공용.
   화면용 + 인쇄(PDF)용 규칙 포함. 랜딩 라이트 팔레트와 통일. */

.report {
  --r-navy: #0a1f44;
  --r-ink: #18243b;
  --r-slate: #4a5568;
  --r-mist: #7a8699;
  --r-line: #e2e6ed;
  --r-line-soft: #eef1f6;
  --r-paper: #ffffff;
  --r-bg-tint: #f6f8fb;
  --r-accent: #1d4ed8;
  --r-accent-tint: #eaf0fe;
  --r-gold: #b08534;
  --r-gold-tint: #faf4e6;
  --r-pos: #2f7d32;
  --r-pos-tint: #eef7ef;
  --r-neg: #c0492f;
  --r-neg-tint: #fbeeea;
  font-family: 'DM Sans', 'Pretendard', system-ui, -apple-system, sans-serif;
  color: var(--r-ink);
  line-height: 1.6;
}

/* ── 헤더 ── */
.report .rpt-head { border-bottom: 2px solid var(--r-navy); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.report .rpt-eyebrow {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.22em;
  color: var(--r-accent); text-transform: uppercase;
}
.report .rpt-title {
  font-family: 'Cormorant Garamond', 'Newsreader', Georgia, serif;
  font-size: 2rem; font-weight: 700; color: var(--r-navy);
  margin: 0.25rem 0 0.6rem;
}
.report .rpt-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; font-size: 0.82rem; color: var(--r-slate); }
.report .rpt-meta b { color: var(--r-ink); }

/* ── 종합 등급 ── */
.report .rpt-grade {
  display: flex; gap: 1.25rem; align-items: center;
  background: linear-gradient(135deg, var(--r-bg-tint), #fff);
  border: 1px solid var(--r-line); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 2rem;
}
.report .grade-badge {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 14px;
  background: var(--r-navy); color: #fff;
  display: grid; place-items: center;
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 2.6rem; font-weight: 700;
  box-shadow: 0 8px 22px rgba(10,31,68,0.22);
}
.report .grade-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--r-mist); }
.report .grade-desc { margin-top: 0.2rem; font-size: 0.95rem; font-weight: 600; color: var(--r-navy); }
.report .grade-summary { margin-top: 0.35rem; font-size: 0.95rem; color: var(--r-ink); }

/* ── 섹션 공통 ── */
.report .rpt-sec { margin-bottom: 2rem; }
.report .rpt-h2 {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem; font-weight: 700; color: var(--r-navy);
  margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--r-line);
}
.report .rpt-h2 .num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px;
  background: var(--r-navy); color: #fff;
  display: grid; place-items: center;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 700;
}
.report .rpt-h2 .num.pos { background: var(--r-pos); }
.report .rpt-h2 .num.neg { background: var(--r-neg); }
.report .rpt-h2 .num.gold { background: var(--r-gold); }

/* ── 별점 ── */
.report .stars { color: var(--r-gold); letter-spacing: 0.06em; font-size: 0.9rem; white-space: nowrap; }
.report .stars .star-dim { color: #d8cdb0; }

/* ── 영역별 평가 ── */
.report .dim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.report .dim-card { background: var(--r-paper); border: 1px solid var(--r-line); border-radius: 10px; padding: 0.9rem 1rem; }
.report .dim-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.report .dim-name { font-weight: 600; font-size: 0.92rem; color: var(--r-navy); }
.report .dim-subs { list-style: none; margin: 0; padding: 0; }
.report .dim-subs li { font-size: 0.8rem; color: var(--r-slate); padding: 0.25rem 0; border-top: 1px dashed var(--r-line-soft); }
.report .dim-subs li:first-child { border-top: none; }
.report .sub-name { font-weight: 500; color: var(--r-ink); margin-right: 0.35rem; }
.report .sub-reason { display: block; margin-top: 0.15rem; color: var(--r-mist); }

/* ── 좋았던/아쉬운 점 카드 ── */
.report .cards { display: flex; flex-direction: column; gap: 0.85rem; }
.report .fb-card { border-radius: 10px; padding: 1rem 1.1rem; border-left: 4px solid var(--r-line); background: var(--r-paper); border: 1px solid var(--r-line); }
.report .fb-card.pos { border-left: 4px solid var(--r-pos); background: var(--r-pos-tint); }
.report .fb-card.neg { border-left: 4px solid var(--r-neg); background: var(--r-neg-tint); }
.report .fb-head { font-weight: 600; font-size: 0.9rem; color: var(--r-navy); margin-bottom: 0.45rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.report blockquote { margin: 0 0 0.5rem; padding: 0.4rem 0.8rem; border-left: 2px solid var(--r-mist); color: var(--r-slate); font-style: italic; font-size: 0.88rem; background: rgba(255,255,255,0.5); }
.report .fb-comment { font-size: 0.9rem; color: var(--r-ink); margin: 0; }

/* ── 좋았던 점 (문자열 리스트) ── */
.report .strength-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.report .strength-list li { font-size: 0.92rem; color: var(--r-ink); line-height: 1.5; }

/* ── 디테일한 피드백 (카테고리 블록 + issue/advice) ── */
.report .fb-cat-block { display: flex; flex-direction: column; gap: 0.6rem; }
.report .fb-cat-block + .fb-cat-block { margin-top: 0.4rem; }
.report .fb-cat-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--r-accent); margin-bottom: 0.1rem;
}
.report .fb-good { font-size: 0.86rem; font-weight: 600; color: var(--r-pos); margin-bottom: 0.3rem; }
/* 개선점은 빨강(--r-neg)이 아니라 accent로 — 결함 경고가 아니라 '다음 단계'로 읽히게. */
.report .fb-issue { font-size: 0.86rem; font-weight: 600; color: var(--r-accent); margin-bottom: 0.35rem; }

/* ── 개선 제안 ── */
.report .imp-card { border: 1px solid var(--r-line); border-radius: 10px; padding: 1rem 1.1rem; background: var(--r-paper); }
.report .imp-ref { font-weight: 600; font-size: 0.88rem; color: var(--r-neg); margin-bottom: 0.4rem; }
.report .imp-sug { font-size: 0.9rem; margin: 0 0 0.5rem; }
.report .imp-script, .report .imp-point { font-size: 0.88rem; color: var(--r-ink); margin: 0.4rem 0 0; }
.report .imp-script { background: var(--r-accent-tint); border-radius: 8px; padding: 0.6rem 0.8rem; font-style: italic; }
.report .imp-tag {
  display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--r-accent); margin-right: 0.5rem;
}
.report .imp-point .imp-tag { color: var(--r-slate); }

/* ── 모범답안 ── */
.report .model-answer {
  background: var(--r-gold-tint); border: 1px solid #ecdcb8; border-radius: 12px;
  padding: 1.25rem 1.4rem;
}
.report .model-answer p { margin: 0 0 0.85rem; font-size: 0.93rem; }
.report .model-answer p:last-child { margin-bottom: 0; }

/* ── 다음 연습 제안 ── */
.report .next-steps { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.report .next-steps li { position: relative; padding-left: 1.5rem; font-size: 0.92rem; }
.report .next-steps li::before { content: '→'; position: absolute; left: 0; color: var(--r-accent); font-weight: 700; }

/* ── 푸터 ── */
/* 복습 케이스 제작 CTA — 리포트 하단(로그 앞). opt-in 이라 지난 리포트 화면엔 안 뜬다. */
.report .rpt-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
  flex-wrap: wrap; margin-top: 1.6rem; padding: 1.1rem 1.3rem;
  background: #fdfaf3; border: 1px solid #f0e4c9; border-left: 3px solid #b08534;
  border-radius: 0 10px 10px 0;
}
.report .rpt-cta .cta-body { flex: 1 1 320px; min-width: 0; }
.report .rpt-cta .cta-h { font-weight: 700; color: #403315; font-size: 0.95rem; margin-bottom: 0.25rem; }
.report .rpt-cta p { font-size: 0.86rem; line-height: 1.75; color: #5c4a24; }
.report .rpt-cta .cta-go {
  flex: 0 0 auto; font-size: 0.87rem; font-weight: 700; color: #8a6a26;
  background: #fff; border: 1.5px solid #d8c48d; border-radius: 9px;
  padding: 0.6rem 1.05rem; text-decoration: none;
}
.report .rpt-cta .cta-go:hover { background: #b08534; border-color: #b08534; color: #fff; }
@media (max-width: 640px) { .report .rpt-cta .cta-go { width: 100%; text-align: center; } }
/* 인쇄·PDF 에는 영업 문구를 넣지 않는다. */
@media print { .report .rpt-cta { display: none !important; } }

.report .rpt-foot { text-align: center; font-size: 0.72rem; color: var(--r-mist); margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--r-line); }

/* ── 5. 인터뷰 로그 (대화 전문) ── */
.report .rpt-log .log-turns {
  display: flex; flex-direction: column; gap: 0.9rem;
  border-top: 1px solid var(--r-line-soft); padding-top: 1.1rem;
}
.report .log-turn { display: flex; flex-direction: column; gap: 0.25rem; }
.report .log-turn .log-role {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.report .log-turn.i .log-role { color: var(--r-gold); }
.report .log-turn.u .log-role { color: var(--r-accent); }
.report .log-turn .log-text {
  font-size: 0.92rem; color: var(--r-ink);
  padding-left: 0.8rem; border-left: 2px solid var(--r-line);
}
.report .log-turn.i .log-text { border-left-color: var(--r-gold); }
.report .log-turn.u .log-text { border-left-color: var(--r-accent); }
/* 턴 번호 — 채점 리포트의 [T#] 인용과 같은 숫자. 이게 보여야 링크가 의미를 갖는다. */
.report .log-turn .log-n { color: var(--r-mist); font-weight: 600; }

/* ── 리포트 → 로그 점프 링크 ──
   채점기가 [T12]로 인용한 것을 #12 링크로 렌더한다(report-render.js:turnRefs).
   클릭하면 해당 턴으로 스크롤 + 잠깐 하이라이트. */
.report a.tref {
  color: var(--r-accent); font-weight: 600; text-decoration: none;
  background: var(--r-accent-tint); border-radius: 4px;
  padding: 0 0.28em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.report a.tref:hover { text-decoration: underline; }
/* 점프 도착 표시. 요소는 이미 보이는 상태이고 애니메이션은 장식일 뿐이라
   "애니메이션이 안 돌면 안 보인다"는 함정(2026-08-10b)에 걸리지 않는다. */
.report .log-turn.flash .log-text {
  animation: tref-flash 1.6s ease-out;
}
@keyframes tref-flash {
  0%   { background: var(--r-gold-tint); }
  100% { background: transparent; }
}

/* 모범답안이 "내 답변을 정리해준 것"으로 읽히던 문제(베타테스터) → 출처를 명시 */
.report .model-answer-note {
  font-size: 0.78rem; color: var(--r-mist); margin: 0 0 0.7rem;
}

/* ── 모바일 ──
   375px 실측(2026-08-10): 본문 폭이 301px밖에 안 남고, 종합등급 블록이
   text-align:center 라 4줄짜리 한국어 총평이 가운데 정렬돼 읽기 나빴다.
   → 배지는 등급 라벨과 한 줄로 붙이고, 총평은 왼쪽 정렬로 되돌린다. */
@media (max-width: 640px) {
  .report .dim-grid { grid-template-columns: 1fr; }
  /* 세로로 쌓되 가운데 정렬은 쓰지 않는다 (긴 문장 가독성) */
  .report .rpt-grade {
    flex-direction: column; align-items: stretch; text-align: left;
    gap: 0.9rem; padding: 1.1rem 1.15rem; border-radius: 10px; margin-bottom: 1.5rem;
  }
  .report .grade-badge {
    width: 54px; height: 54px; border-radius: 11px; font-size: 1.75rem;
    box-shadow: 0 5px 14px rgba(10,31,68,0.2);
  }
  .report .grade-desc { font-size: 0.9rem; margin-top: 0.15rem; }
  .report .grade-summary { font-size: 0.9rem; margin-top: 0.2rem; }
  .report .rpt-title { font-size: 1.6rem; margin-bottom: 0.45rem; }
  .report .rpt-head { padding-bottom: 0.8rem; margin-bottom: 1.2rem; }
  .report .rpt-meta { font-size: 0.78rem; gap: 0.3rem 0.8rem; }
  .report .rpt-sec { margin-bottom: 1.5rem; }
  .report .rpt-h2 { font-size: 1.2rem; gap: 0.5rem; margin-bottom: 0.8rem; }
  .report .rpt-h2 .num { width: 22px; height: 22px; border-radius: 6px; font-size: 0.76rem; }
  /* 카드 여백 축소 → 본문 폭 확보 */
  .report .fb-card, .report .imp-card { padding: 0.85rem 0.9rem; }
  .report .model-answer { padding: 1rem 1.05rem; border-radius: 10px; }
  .report .model-answer p { font-size: 0.9rem; margin-bottom: 0.75rem; }
  .report .strength-list { padding-left: 1rem; gap: 0.45rem; }
  .report .strength-list li, .report .next-steps li { font-size: 0.9rem; }
  .report .next-steps li { padding-left: 1.2rem; }
  .report blockquote { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
  /* 인터뷰 로그: 들여쓰기를 줄여 한 줄에 글자를 더 넣는다 */
  .report .rpt-log .log-turns { gap: 0.75rem; padding-top: 0.9rem; }
  .report .log-turn .log-text { font-size: 0.89rem; padding-left: 0.6rem; }
  .report .log-turn .log-role { font-size: 0.62rem; letter-spacing: 0.08em; }
}

/* ── 인쇄(PDF) ── */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .no-print, .controls, nav, footer, header, .topbar { display: none !important; }
  .report { color: #000; }
  .report .rpt-sec, .report .fb-card, .report .imp-card, .report .dim-card, .report .model-answer { break-inside: avoid; }
  .report .rpt-log { break-inside: auto; }
  .report .log-turn { break-inside: avoid; }
  .report .rpt-h2 { break-after: avoid; }
  .report .grade-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .fb-card.pos, .report .fb-card.neg, .report .model-answer, .report .imp-script,
  .report .grade-badge, .report .rpt-h2 .num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
