-
협상 긴장도
- {tension != null ? tension.toFixed(2) : '—'}
+ 협상 긴장도
+ {tension != null ? tension.toFixed(2) : '—'}
-
-
적용 페르소나
+ 적용 페르소나
{meta.persona ? (
-
+
{meta.persona}
) : (
- —
+ —
)}
) : (
-
+
{nego.done
- ? '카드 라운드 없이 조기 합의됐습니다 — 첫 제안가가 앵커가 이하면 협상 카드 없이 종료됩니다.'
+ ? '카드 라운드 없이 조기 합의됐어요 — 첫 제안가가 앵커가 이하면 협상 카드 없이 종료됩니다.'
: '가격 협상이 시작되면 선택된 협상 카드와 가격 지표·긴장도·페르소나가 여기에 표시됩니다.'}
)}
diff --git a/frontend/src/components/PriceChart.tsx b/frontend/src/components/PriceChart.tsx
new file mode 100644
index 0000000..fa55550
--- /dev/null
+++ b/frontend/src/components/PriceChart.tsx
@@ -0,0 +1,149 @@
+import type { DemoCase } from '../content/cases'
+
+/**
+ * 제안가 추이 차트 — 이 화면의 시그니처.
+ * 라운드마다 내려오는 제안가를 영역 차트로 그리고, 기존가·목표가·앵커가를
+ * 점선 기준선으로 깔아 "지금 제안이 어느 구간에 있는지" 하나만 전달한다.
+ */
+export function PriceChart({ demoCase, priceTrail }: { demoCase: DemoCase; priceTrail: number[] }) {
+ const { anchor, target, item_price } = demoCase
+
+ const W = 300
+ const H = 150
+ const PAD = { top: 14, right: 72, bottom: 12, left: 10 }
+ const plotW = W - PAD.left - PAD.right
+ const plotH = H - PAD.top - PAD.bottom
+
+ const hi = Math.max(item_price, ...(priceTrail.length ? priceTrail : [item_price]))
+ const lo = Math.min(anchor, ...(priceTrail.length ? priceTrail : [anchor]))
+ const span = (hi - lo) || 1
+ const yOf = (v: number) => PAD.top + (1 - (v - lo) / span) * plotH
+
+ // 첫 라운드부터 점이 왼쪽에 고정되도록 슬롯을 최소 3칸으로 유지
+ const slots = Math.max(priceTrail.length - 1, 3)
+ const xOf = (i: number) => PAD.left + (i / slots) * plotW
+
+ // 기준선 3종 — 라벨은 선 오른쪽에 두고, 세로로 가까우면 밀어내서 겹침을 막는다
+ const refs = [
+ { v: item_price, label: '기존가', color: 'var(--color-base-content)', op: 0.4 },
+ { v: target, label: '목표가', color: 'var(--color-base-content)', op: 0.75 },
+ { v: anchor, label: '앵커가', color: 'var(--color-primary)', op: 1 },
+ ]
+ .map((r) => ({ ...r, y: yOf(r.v), ly: yOf(r.v) }))
+ .sort((a, b) => a.y - b.y)
+ const MIN_GAP = 13
+ for (let i = 1; i < refs.length; i++) {
+ if (refs[i].ly - refs[i - 1].ly < MIN_GAP) refs[i].ly = refs[i - 1].ly + MIN_GAP
+ }
+ const overflow = refs[refs.length - 1].ly - (H - 4)
+ if (overflow > 0) for (const r of refs) r.ly -= overflow
+
+ const pts = priceTrail.map((v, i) => ({ x: xOf(i), y: yOf(v), v }))
+ const line = pts.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`).join(' ')
+ const area = pts.length >= 2
+ ? `${line} L${pts[pts.length - 1].x},${H - PAD.bottom} L${pts[0].x},${H - PAD.bottom} Z`
+ : null
+ const last = pts.length ? pts[pts.length - 1] : null
+
+ return (
+
+ )
+}
diff --git a/frontend/src/components/PriceTrack.tsx b/frontend/src/components/PriceTrack.tsx
deleted file mode 100644
index aa0e8ef..0000000
--- a/frontend/src/components/PriceTrack.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import type { DemoCase } from '../content/cases'
-
-/**
- * 가격 트랙 — 이 페이지의 시그니처.
- * 앵커가·목표가·기존 공급가를 한 수평 트랙에 놓고, 제안가가 내려오는 과정을 마커로 보여준다.
- * 파랑 구간(앵커 이하) = 구매측 최적 · 앰버 구간(목표가 초과) = 협상 여지.
- */
-export function PriceTrack({ demoCase, priceTrail }: { demoCase: DemoCase; priceTrail: number[] }) {
- const { anchor, target, item_price } = demoCase
- const current = priceTrail.length ? priceTrail[priceTrail.length - 1] : null
-
- // 트랙 범위: min(앵커, 최저 제안가) 아래 여유 3% ~ max(기존가, 최고 제안가) 위 여유 3%
- // (제안가가 앵커보다 낮아도 마커가 트랙 밖으로 클리핑되지 않도록 동적 확장)
- const hi = Math.max(item_price, ...(priceTrail.length ? priceTrail : [item_price])) * 1.03
- const lo = Math.min(anchor, ...(priceTrail.length ? priceTrail : [anchor])) * 0.97
- const pos = (v: number) => Math.min(Math.max(((v - lo) / (hi - lo)) * 100, 0), 100)
-
- // 기준선 3종 — 제안가가 범위를 크게 넓히면 서로 몰려 라벨이 겹치므로,
- // 가까운 라벨(간격 < MIN_GAP%)은 아랫줄로 내려 층을 나눈다.
- const MIN_GAP = 18
- const ticks = [
- { value: anchor, label: '앵커가', cls: 'bg-blue' },
- { value: target, label: '목표가', cls: 'bg-ink/50' },
- { value: item_price, label: '기존가', cls: 'bg-muted/60' },
- ].sort((a, b) => a.value - b.value)
- const rows = ticks.map(() => 0)
- for (let i = 1; i < ticks.length; i++) {
- let row = 0
- for (let j = 0; j < i; j++) {
- if (pos(ticks[i].value) - pos(ticks[j].value) < MIN_GAP && rows[j] === row) {
- row += 1
- j = -1 // 줄을 내렸으니 앞 라벨들과 다시 비교
- }
- }
- rows[i] = row
- }
- const maxRow = Math.max(...rows)
-
- // 가장자리에선 중앙정렬 대신 안쪽으로 붙여 패널 밖 클리핑을 막는다
- const align = (p: number) =>
- p <= 6
- ? 'translate-x-0 text-left'
- : p >= 94
- ? '-translate-x-full text-right'
- : '-translate-x-1/2 text-center'
-
- const Tick = ({ value, label, cls, row }: { value: number; label: string; cls: string; row: number }) => (
-
-
-
-
{label}
-
{value.toLocaleString()}
-
-
- )
-
- return (
-
-
- {/* 구간 채색: [lo~anchor]=파랑(최적) · [anchor~target]=연파랑(합의권) · [target~hi]=앰버(초과) */}
-
-
-
- {ticks.map((t, i) => (
-
- ))}
-
- {/* 과거 제안 흔적 */}
- {priceTrail.slice(0, -1).map((p, i) => (
-
- ))}
-
- {/* 현재 제안가 마커 */}
- {current != null && (
-
-
-
- {current.toLocaleString()}
-
-
- )}
-
- {current == null && (
-
첫 제안가를 입력하면 트랙 위에 표시됩니다.
- )}
-
- )
-}
diff --git a/frontend/src/index.css b/frontend/src/index.css
index f3d2142..efeb6cb 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -1,22 +1,50 @@
@import "tailwindcss";
-@theme {
- /* 콘솔 팔레트 — 파랑 = 인하/성공 (국내 시장 컨벤션: 파랑=하락) */
- --color-paper: #f5f6f8;
- --color-panel: #ffffff;
- --color-ink: #171b26;
- --color-muted: #68707f;
- --color-line: #e2e5eb;
- --color-blue: #1d4ed8; /* 인하·성공·주요 액션 */
- --color-blue-soft: #eef2ff;
- --color-amber: #b45309; /* 긴장도·주의 */
- --color-amber-soft: #fef3e2;
- --color-green: #067647; /* 협상완료 */
- --color-green-soft: #e7f6ee;
- --color-bot: #f0f2f6; /* 봇 말풍선 */
+@plugin "daisyui" {
+ themes: false;
+}
+/* 콘솔 라이트 테마 — 연회색 바탕 위 무보더 흰 카드, 악센트는 파랑 하나만
+ (국내 시장 컨벤션: 파랑=인하·성공) */
+@plugin "daisyui/theme" {
+ name: "console-light";
+ default: true;
+ color-scheme: light;
+
+ --color-base-100: #ffffff;
+ --color-base-200: #f2f4f6;
+ --color-base-300: #e5e8ec;
+ --color-base-content: #191f28;
+
+ --color-primary: #3182f6;
+ --color-primary-content: #ffffff;
+ --color-secondary: #191f28;
+ --color-secondary-content: #ffffff;
+ --color-accent: #3182f6;
+ --color-accent-content: #ffffff;
+ --color-neutral: #333d4b;
+ --color-neutral-content: #ffffff;
+
+ --color-info: #3182f6;
+ --color-info-content: #ffffff;
+ --color-success: #00885c;
+ --color-success-content: #ffffff;
+ --color-warning: #d97706;
+ --color-warning-content: #ffffff;
+ --color-error: #e5484d;
+ --color-error-content: #ffffff;
+
+ /* 동심원 정합: 카드 20px − 안쪽 여백 8px = 필드 12px */
+ --radius-box: 1.25rem;
+ --radius-field: 0.75rem;
+ --radius-selector: 0.5rem;
+ --border: 1px;
+ --depth: 0;
+ --noise: 0;
+}
+
+@theme {
--font-body: "Pretendard Variable", Pretendard, ui-sans-serif, system-ui, sans-serif;
- --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
html, body, #root {
@@ -24,13 +52,18 @@ html, body, #root {
}
body {
- background: var(--color-paper);
- color: var(--color-ink);
+ background: var(--color-base-200);
+ color: var(--color-base-content);
font-family: var(--font-body);
-webkit-font-smoothing: antialiased;
word-break: keep-all;
}
+/* 숫자는 고정폭 숫자로 정렬 (별도 모노 폰트 대신 본문 서체 유지) */
+.num {
+ font-variant-numeric: tabular-nums;
+}
+
/* 봇 응답 등장 */
@keyframes rise {
from { opacity: 0; transform: translateY(6px); }
@@ -41,8 +74,17 @@ body {
.msg-in { animation: none; }
}
-/* 가격 트랙 마커 이동 */
-.track-marker { transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
+/* 추이 차트 마지막 점 강조 */
+@keyframes pulse-dot {
+ 0% { opacity: 0.5; transform: scale(1); }
+ 70% { opacity: 0; transform: scale(2.4); }
+ 100% { opacity: 0; transform: scale(2.4); }
+}
+.chart-pulse {
+ transform-origin: center;
+ transform-box: fill-box;
+ animation: pulse-dot 2s ease-out infinite;
+}
@media (prefers-reduced-motion: reduce) {
- .track-marker { transition: none; }
+ .chart-pulse { animation: none; opacity: 0; }
}