/* ── 超業模擬語音系統 v0.4 ── 深夜藍 × 香檳金 */
:root {
  --bg:        #0a0d14;
  --bg2:       #0e1219;
  --surface:   rgba(22, 27, 38, 0.82);
  --surface2:  rgba(34, 41, 56, 0.85);
  --border:    rgba(201, 168, 106, 0.14);
  --border2:   rgba(255, 255, 255, 0.07);
  --text:      #ece7dc;
  --text-muted:#8e94a3;
  --gold:      #c9a86a;
  --gold-soft: #e2cb96;
  --green:     #5fbf8f;
  --red:       #d96b6b;
  --blue:      #7da7d9;
  --orange:    #d99e6b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Noto Serif TC", "Noto Sans TC", -apple-system, serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201,168,106,0.06), transparent),
    linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--text);
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--gold-soft); text-decoration: none; }

/* ── Top nav ── */
#topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 30px;
  height: 62px;
  background: rgba(10, 13, 20, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-links a {
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-links a:hover { color: var(--gold-soft); }
.nav-links a.active { color: var(--gold-soft); border-color: var(--border); background: rgba(201,168,106,0.08); }
.nav-user { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: var(--text-muted); }
.nav-user button {
  background: none; border: 1px solid var(--border2); color: var(--text-muted);
  padding: 6px 15px; border-radius: 999px; font-size: 0.82rem;
}
.nav-user button:hover { color: var(--red); border-color: var(--red); }

.page { max-width: 1080px; margin: 0 auto; padding: 36px 24px 70px; }
.page-title { font-size: 1.55rem; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 6px; }
.page-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; letter-spacing: 0.03em; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 24px 26px;
  backdrop-filter: blur(10px);
}

/* ── Login ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 5; }
#particles { position: fixed; inset: 0; z-index: 1; }
.auth-card {
  width: min(410px, 94vw); padding: 44px 40px; text-align: center;
  background: rgba(16, 20, 30, 0.66);
  border: 1px solid var(--border);
  box-shadow: 0 0 80px rgba(201,168,106,0.07), 0 30px 60px rgba(0,0,0,0.5);
  animation: cardIn 1.1s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}
@keyframes cardIn { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-logo { font-size: 2.2rem; margin-bottom: 10px; }
.auth-card h1 { font-size: 1.3rem; letter-spacing: 0.18em; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-muted); font-size: 0.82rem; letter-spacing: 0.12em; margin-bottom: 30px; }
.auth-tabs { display: flex; background: rgba(255,255,255,0.04); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; padding: 9px; border: none; border-radius: 999px;
  background: none; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 0.1em;
}
.auth-tabs button.active { background: var(--gold); color: #14110a; font-weight: 700; }
.auth-card input {
  width: 100%; padding: 13px 16px; margin-bottom: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border2);
  border-radius: 12px; color: var(--text); font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.2s;
}
.auth-card input:focus { outline: none; border-color: var(--gold); }
.auth-card input::placeholder { color: #5c6270; }
.auth-submit {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #b08f52);
  color: #14110a; font-size: 1rem; font-weight: 700; letter-spacing: 0.2em; margin-top: 8px;
  transition: filter 0.2s;
}
.auth-submit:hover { filter: brightness(1.12); }
.auth-error { color: var(--red); font-size: 0.85rem; margin-top: 14px; min-height: 1.2em; }

/* ── Dashboard ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { text-align: center; padding: 28px 16px; }
.stat-value { font-size: 2.1rem; font-weight: 700; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 6px; letter-spacing: 0.1em; }

.session-table { width: 100%; border-collapse: collapse; }
.session-table th {
  text-align: left; color: var(--text-muted); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em; padding: 12px 16px; border-bottom: 1px solid var(--border2);
}
.session-table td { padding: 14px 16px; border-bottom: 1px solid var(--border2); font-size: 0.9rem; }
.session-table tr:last-child td { border-bottom: none; }
.session-table tbody tr { cursor: pointer; transition: background 0.15s; }
.session-table tbody tr:hover { background: rgba(201,168,106,0.05); }
.score-pill {
  display: inline-block; min-width: 46px; text-align: center;
  padding: 4px 11px; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
  background: rgba(255,255,255,0.05); font-variant-numeric: tabular-nums;
}
.deal-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.deal-badge.yes { background: rgba(95,191,143,0.14); color: var(--green); }
.deal-badge.no  { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.empty-hint { text-align: center; color: var(--text-muted); padding: 44px 0; font-size: 0.9rem; }

.cta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b08f52); color: #14110a; border: none;
  padding: 12px 26px; border-radius: 999px; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em;
  transition: filter 0.2s;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: none; color: var(--text); border: 1px solid var(--border);
  padding: 11px 22px; border-radius: 999px; font-size: 0.9rem; letter-spacing: 0.06em;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ── Practice：setup ── */
.practice-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.setup-section h3 { font-size: 0.85rem; margin-bottom: 14px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.12em; }

.scenario-pick { display: flex; flex-direction: column; gap: 9px; max-height: 440px; overflow-y: auto; }
.scenario-pick button {
  text-align: left; background: rgba(255,255,255,0.03); border: 1px solid var(--border2);
  border-radius: 12px; padding: 13px 15px; color: var(--text); transition: all 0.15s;
}
.scenario-pick button:hover { border-color: var(--border); }
.scenario-pick button.selected { border-color: var(--gold); background: rgba(201,168,106,0.08); }
.scenario-pick .t { font-weight: 600; font-size: 0.9rem; display: block; }
.scenario-pick .d { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; display: block; line-height: 1.5; }

.difficulty-row { display: flex; gap: 9px; margin-bottom: 18px; }
.difficulty-row button {
  flex: 1; padding: 11px 0; border-radius: 12px; border: 1px solid var(--border2);
  background: rgba(255,255,255,0.03); color: var(--text-muted); font-weight: 700; font-size: 1rem;
  transition: all 0.15s;
}
.difficulty-row button.selected { background: var(--gold); border-color: var(--gold); color: #14110a; }

.setup-select {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--border2); background: rgba(255,255,255,0.03);
  color: var(--text); font-size: 0.95rem; font-weight: 600;
}
.lead-row { display: flex; gap: 9px; }
.lead-row button {
  flex: 1; padding: 10px 0; border-radius: 12px; border: 1px solid var(--border2);
  background: rgba(255,255,255,0.03); color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  transition: all 0.15s;
}
.lead-row button.selected { background: var(--gold); border-color: var(--gold); color: #14110a; }

/* 客戶卡 */
.customer-card {
  background: linear-gradient(150deg, rgba(201,168,106,0.10), var(--surface) 45%);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px;
  position: relative; backdrop-filter: blur(10px);
}
.customer-card .avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8a6f3e);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #14110a; margin-bottom: 16px;
  overflow: hidden;
}
/* Q 版小人頭像：SVG 填滿圓框 */
.avatar svg { width: 100%; height: 100%; display: block; }
.customer-card h2 { font-size: 1.22rem; margin-bottom: 3px; letter-spacing: 0.04em; }
.customer-card .meta { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 15px; }
.customer-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.customer-tags span {
  background: rgba(201,168,106,0.1); color: var(--gold-soft);
  border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem;
}
.customer-note { color: var(--text-muted); font-size: 0.84rem; line-height: 1.65; }
.mood-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  background: rgba(124,176,140,0.12); color: #9fd1ad;
  border: 1px solid rgba(124,176,140,0.32);
  padding: 5px 13px; border-radius: 999px; font-size: 0.82rem;
}
.interest-chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px 8px;
  background: rgba(168,148,214,0.12); color: #c3b0e6;
  border: 1px solid rgba(168,148,214,0.32);
  padding: 5px 13px; border-radius: 999px; font-size: 0.82rem;
}
/* 拉霸抽客戶：轉動中欄位模糊跳動、頭像旋轉 */
.customer-card.rolling #cc-name,
.customer-card.rolling #cc-meta,
.customer-card.rolling .customer-tags,
.customer-card.rolling #cc-emotion,
.customer-card.rolling #cc-note,
.customer-card.rolling #cc-stars { filter: blur(1.4px); opacity: 0.8; }
.customer-card.rolling .avatar { animation: avatarSpin 0.32s linear infinite; }
@keyframes avatarSpin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
/* 定格：彈一下 + 金光 */
@keyframes lockPop { 0% { transform: scale(1); } 35% { transform: scale(1.045); } 100% { transform: scale(1); } }
.customer-card.locked {
  animation: lockPop 0.5s ease;
  box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(201,168,106,0.5);
}
.reroll-btn {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border2); color: var(--text-muted);
  padding: 7px 15px; border-radius: 999px; font-size: 0.82rem;
}
.reroll-btn:hover { color: var(--gold-soft); border-color: var(--gold); }
.difficulty-stars { color: var(--gold); font-size: 0.92rem; letter-spacing: 3px; }

/* ── 客戶卡 v3.5 精品化：深底單金、清單排版、稀有度=金色濃淡 ── */
.customer-card.premium { background: #0d1017; padding: 24px 22px; }
.customer-card.premium .cc-top { padding-right: 104px; }
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cc-lead { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 0.72rem; letter-spacing: 0.14em; }
.cc-lead-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cc-roman {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border: 1px solid rgba(201,168,106,0.45); border-radius: 50%;
  color: var(--gold-soft); font-size: 0.8rem; font-family: Georgia, "Noto Serif TC", serif;
}
.cc-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 18px; }
.customer-card.premium .avatar { margin: 0 auto 12px; }
.customer-card.premium h2 { font-size: 1.18rem; letter-spacing: 0.05em; margin-bottom: 2px; }
.customer-card.premium .meta { margin-bottom: 0; letter-spacing: 0.03em; }
.cc-hairline { height: 1px; margin: 15px -2px; background: linear-gradient(90deg, transparent, rgba(201,168,106,0.32), transparent); }
.cc-list { display: flex; flex-direction: column; gap: 10px; }
.cc-row { display: flex; justify-content: space-between; gap: 14px; font-size: 0.8rem; }
.cc-k { color: var(--text-muted); flex-shrink: 0; letter-spacing: 0.06em; }
.cc-v { color: #d0cbbf; text-align: right; }
.cc-dim { color: #6a6f7c; }
.cc-title-zone { text-align: center; }
.cc-title { color: var(--gold-soft); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; }
.cc-subtitle { color: var(--text-muted); font-size: 0.72rem; margin-top: 3px; letter-spacing: 0.05em; }
.customer-card .customer-note { margin-top: 12px; text-align: center; font-size: 0.76rem; }

/* 稀有度＝金色濃淡（1 淡金細框 → 5 濃金厚框＋一絲暗紅） */
.customer-card.diff-1 { border: 1px solid rgba(201,168,106,0.18); }
.customer-card.diff-2 { border: 1px solid rgba(201,168,106,0.28); }
.customer-card.diff-3 { border: 1px solid rgba(201,168,106,0.42); }
.customer-card.diff-4 { border: 1.5px solid rgba(201,168,106,0.7); box-shadow: 0 0 18px rgba(201,168,106,0.12); }
.customer-card.diff-5 {
  border: 2px solid var(--gold);
  box-shadow: 0 0 22px rgba(201,168,106,0.2), inset 0 0 30px rgba(217,107,107,0.06);
}
.customer-card.diff-5 .cc-title { color: #e2a08a; }

/* 定格儀式：金光從左掃到右一次（疊在既有 lockPop 上） */
.customer-card { position: relative; overflow: hidden; }
.customer-card::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(226,203,150,0.16), transparent);
  transform: skewX(-18deg); pointer-events: none; opacity: 0;
}
.customer-card.locked::after { animation: sheen 0.7s ease 0.1s; }
@keyframes sheen { 0% { opacity: 1; left: -70%; } 100% { opacity: 0; left: 120%; } }

/* 任務導引面板 */
.task-guide { margin-bottom: 16px; padding: 16px 20px; }
.tg-head { display: flex; justify-content: space-between; align-items: center; }
.tg-title { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.08em; }
.tg-head .call-toggle { padding: 5px 12px; font-size: 0.74rem; }
.tg-purpose { color: var(--text-muted); font-size: 0.78rem; margin: 8px 0 0; line-height: 1.5; }
.tg-gist { color: var(--gold-soft); font-size: 0.86rem; margin: 10px 0 6px; line-height: 1.6; }
.tg-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tg-list li { color: var(--text-muted); font-size: 0.82rem; line-height: 1.55; padding-left: 18px; position: relative; }
.tg-list li::before { content: "◻"; position: absolute; left: 0; color: var(--gold); font-size: 0.7rem; top: 2px; }
.tg-solo { color: var(--text-muted); font-size: 0.82rem; margin-top: 6px; }
.tg-list .tg-extra { color: var(--gold-soft); opacity: 0.85; }
.tg-list .tg-extra::before { content: "💬"; font-size: 0.65rem; }

/* 客戶卡窄版（Fable5 修正一：現在就內建，v3.6 手機化不用回頭改） */
@media (max-width: 560px) {
  .customer-card.premium { padding: 20px 16px; }
  .cc-row { font-size: 0.78rem; gap: 10px; }
  .cc-v { max-width: 62%; }
  .cc-lead { letter-spacing: 0.08em; }
}

/* 任務達成對照（報告頁） */
.taskcheck-card { border-left: 3px solid var(--blue); }
.tc-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border2); font-size: 0.86rem; }
.tc-row:first-child { border-top: none; }
.tc-mark { flex-shrink: 0; }
.tc-task { color: var(--text); }
.tc-row.miss .tc-task { color: var(--orange); }
.tc-note { color: var(--text-muted); font-size: 0.78rem; margin-left: auto; text-align: right; }

.start-row { margin-top: 20px; display: flex; gap: 12px; }

/* ── Practice：live call ── */
#call-panel { display: none; }
#call-panel.active { display: block; }
#setup-panel.hidden { display: none; }

.call-header { display: flex; align-items: center; gap: 18px; padding: 20px 24px; margin-bottom: 16px; }
.call-header .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8a6f3e);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #14110a;
  overflow: hidden;
}
.call-info { flex: 1; }
.call-info .name { font-weight: 700; letter-spacing: 0.04em; }
.call-info .state { color: var(--text-muted); font-size: 0.84rem; margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.call-timer { font-variant-numeric: tabular-nums; color: var(--gold-soft); font-weight: 700; font-size: 1.15rem; }
.hangup-btn {
  background: var(--red); color: #fff; border: none;
  padding: 12px 24px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.06em;
}
.hangup-btn:hover { filter: brightness(1.1); }

/* 通話工具列：字幕/插話開關 */
.call-toolbar { display: flex; gap: 10px; margin-bottom: 14px; justify-content: flex-end; }
.call-toggle {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border2); color: var(--text-muted);
  padding: 8px 16px; border-radius: 999px; font-size: 0.82rem; letter-spacing: 0.04em;
  transition: all 0.15s;
}
.call-toggle:hover { border-color: var(--border); }
.call-toggle.on { color: var(--gold-soft); border-color: var(--gold); background: rgba(201,168,106,0.1); }

/* 客戶講話時頭像跟聲音脈動 */
.call-header .avatar { transition: transform 0.09s linear, box-shadow 0.09s linear; }

/* 練聽力模式提示 + 插話小提示 */
#listen-hint { text-align: center; color: var(--text-muted); padding: 46px 20px; font-size: 0.9rem; letter-spacing: 0.05em; }
.chat-note { text-align: center; color: var(--green); font-size: 0.82rem; padding: 4px 0; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #555; flex-shrink: 0; }
.dot-green  { background: var(--green);  box-shadow: 0 0 9px var(--green); }
.dot-yellow { background: var(--gold); }
.dot-blue   { background: var(--blue);   box-shadow: 0 0 9px var(--blue); }
.dot-red    { background: var(--red); }
.dot-grey   { background: #555; }

#chat-log {
  display: flex; flex-direction: column; gap: 11px;
  padding: 22px; min-height: 300px; max-height: 48vh; overflow-y: auto;
}
.chat-entry { display: flex; gap: 10px; align-items: flex-start; max-width: 85%; }
.chat-entry.chat-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-role-badge { flex-shrink: 0; padding: 4px 11px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.chat-role-badge.ai { background: rgba(125,167,217,0.13); color: var(--blue); }
.chat-role-badge.user { background: rgba(201,168,106,0.13); color: var(--gold-soft); }
.chat-content {
  background: var(--surface2); padding: 11px 15px; border-radius: 14px;
  font-size: 0.93rem; line-height: 1.6; border: 1px solid var(--border2);
}
.chat-entry.provisional .chat-content { opacity: 0.55; font-style: italic; border-style: dashed; }

/* 評分中 overlay */
.scoring-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,8,13,0.86); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.scoring-overlay[hidden] { display: none; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scoring-overlay h2 { letter-spacing: 0.14em; }
.scoring-overlay p { color: var(--text-muted); letter-spacing: 0.06em; }

/* ── Report ── */
.report-hero { display: flex; align-items: center; gap: 34px; padding: 32px 36px; margin-bottom: 20px; }
.report-hero .grade { font-size: 4.2rem; font-weight: 800; line-height: 1; }
.report-hero .score-block .total { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-hero .score-block .label { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.12em; margin-top: 2px; }
.report-hero .meta { margin-left: auto; text-align: right; color: var(--text-muted); font-size: 0.86rem; line-height: 1.9; }
.upsell-line { margin-top: 8px; font-size: 0.85rem; color: var(--gold-soft); }

.dim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.dim-card { padding: 18px 20px; }
.dim-head { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 0.9rem; }
.dim-head strong { color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.dim-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-bottom: 9px; }
.dim-bar div { height: 100%; background: linear-gradient(90deg, #8a6f3e, var(--gold)); border-radius: 3px; transition: width 0.8s ease; }
.dim-card p { color: var(--text-muted); font-size: 0.8rem; line-height: 1.6; }

.voice-card { margin-bottom: 20px; }
.voice-card h3 { margin-bottom: 4px; }
.voice-sub { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 16px; }
.voice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.voice-metric { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.vm-name { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 8px; }
.vm-val { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.vm-val .vu { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.vm-verdict { display: inline-block; font-size: 0.74rem; padding: 3px 10px; border: 1px solid; border-radius: 999px; }
@media (max-width: 640px) { .voice-grid { grid-template-columns: repeat(2, 1fr); } }

.report-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.report-list h3 { font-size: 0.95rem; margin-bottom: 13px; letter-spacing: 0.05em; }
.report-list ul { padding-left: 20px; }
.report-list li { color: var(--text-muted); font-size: 0.88rem; line-height: 1.85; margin-bottom: 7px; }

.coach-quote { border-left: 3px solid var(--gold); padding: 20px 22px; margin-bottom: 20px; }
.coach-quote .label { color: var(--gold-soft); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.16em; display: block; margin-bottom: 9px; }
.coach-quote p { font-size: 0.96rem; line-height: 1.8; }

.keymoment { margin-bottom: 20px; padding: 20px 22px; }
.keymoment h3 { font-size: 0.95rem; margin-bottom: 11px; letter-spacing: 0.05em; }
.keymoment p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.75; }

/* 完整錄音播放器 + 時刻標記 */
.player-card { padding: 22px 24px; margin-bottom: 20px; }
.player-card h3 { font-size: 0.95rem; margin-bottom: 14px; letter-spacing: 0.05em; }
.player-card audio { width: 100%; margin-bottom: 16px; }
.moment-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.moment-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 0.82rem;
  border: 1px solid var(--border2); background: rgba(255,255,255,0.03);
  color: var(--text); cursor: pointer; transition: all 0.15s;
}
.moment-chip .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.moment-chip.good .t { color: var(--green); }
.moment-chip.bad .t { color: var(--red); }
.moment-chip:hover { border-color: var(--gold); }

/* 逐字稿 */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-turn { display: flex; gap: 12px; align-items: flex-start; }
.timeline-turn .ts {
  flex-shrink: 0; width: 50px; color: var(--text-muted); font-size: 0.78rem;
  font-variant-numeric: tabular-nums; padding-top: 9px; cursor: pointer;
}
.timeline-turn .ts:hover { color: var(--gold-soft); }
.timeline-turn .who { flex-shrink: 0; width: 50px; text-align: center; padding: 5px 0; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.timeline-turn .who.ai { background: rgba(125,167,217,0.13); color: var(--blue); }
.timeline-turn .who.user { background: rgba(201,168,106,0.13); color: var(--gold-soft); }
.timeline-turn .bubble { flex: 1; background: var(--surface2); border: 1px solid var(--border2); border-radius: 12px; padding: 11px 15px; }
.timeline-turn .bubble .txt { font-size: 0.9rem; line-height: 1.65; }

.report-actions { display: flex; gap: 12px; margin-top: 28px; }

@media (max-width: 800px) {
  .practice-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dim-grid, .report-two-col, .growth-grid { grid-template-columns: 1fr; }
  .report-hero { flex-wrap: wrap; }
}

/* 手機 RWD 基礎（v3.4，為手機化鋪路）：窄螢幕不破版、通話頁可用 */
@media (max-width: 560px) {
  #topnav { padding: 0 14px; gap: 12px; }
  .nav-links a { padding: 7px 12px; font-size: 0.82rem; }
  .nav-user span { display: none; }
  .page { padding: 22px 14px 56px; }
  .page-title { font-size: 1.3rem; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .call-header { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .call-header .avatar { width: 42px; height: 42px; }
  .hangup-btn {
    width: 100%; order: 9; padding: 16px;
    font-size: 1rem;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  /* v3.7 手機化：通話中全螢幕高度，用 dvh 才不會被瀏覽器網址列擠壓（不動既有 display:block 排版） */
  #call-panel.active { min-height: 100dvh; }
  .call-toolbar { justify-content: stretch; }
  .call-toolbar .call-toggle { flex: 1; }
  #chat-log { padding: 14px; max-height: 52vh; }
  .chat-entry { max-width: 94%; }
  .rapport-bar { width: 90px; }
  .member-bar, .filter-row { gap: 8px; }
  .report-hero { padding: 22px 18px; gap: 18px; }
  .report-hero .grade { font-size: 3rem; }
  .report-hero .meta { margin-left: 0; text-align: left; }
  .timeline-turn .ts { width: 40px; font-size: 0.72rem; }
  .timeline-turn .who { width: 40px; font-size: 0.7rem; }
  .report-actions { flex-wrap: wrap; }
  .report-actions button { flex: 1 1 45%; }
}

/* 教練報告：語氣/技巧點評 + 調整方向 */
.review-card p { color: var(--text); line-height: 1.75; font-size: 0.92rem; margin-top: 6px; }
.nextsteps-card ol { margin: 8px 0 0 1.2em; }
.nextsteps-card li { color: var(--text); line-height: 1.8; font-size: 0.92rem; margin-bottom: 6px; }
.nextsteps-card { border-left: 3px solid var(--gold); }

/* 列印 / 另存 PDF：深色介面轉白底黑字，去掉不需要的元件 */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  #topnav, .report-actions, .player-card, #no-report, .no-print, .feedback-card { display: none !important; }
  .page { max-width: 100% !important; padding: 0 !important; }
  .page-title, .page-sub, h1, h2, h3, h4, p, li, span, strong, div,
  .review-card p, .nextsteps-card li { color: #1a1a1a !important; }
  .card {
    background: #fff !important; border: 1px solid #ccc !important;
    box-shadow: none !important; backdrop-filter: none !important;
    break-inside: avoid; page-break-inside: avoid;
  }
  .dim-bar { background: #eee !important; }
  .dim-bar div { background: #c9a86a !important; }
  .timeline { break-inside: auto; }
  .timeline-turn { break-inside: avoid; }
  .report-hero .grade { color: #b8902f !important; }
  /* 雷達圖 SVG 文字沿用深色主題色，列印轉白底時要跟著轉深色否則讀不到 */
  .radar-card svg text { fill: #1a1a1a !important; }
}

/* 客戶溫度計（軟化值） */
.rapport-meter { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.rapport-bar {
  width: 120px; height: 7px; border-radius: 4px;
  background: rgba(255,255,255,0.07); overflow: hidden;
}
#rapport-fill { height: 100%; width: 0%; border-radius: 4px; background: var(--gold); transition: width 0.6s ease, background 0.6s ease; }
#rapport-val { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 24px; }
#rapport-emoji { font-size: 0.95rem; }

/* 三行斃命診斷卡（報告頁頂部，v3.3） */
.diagnosis-card {
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(201,168,106,0.12), var(--surface) 55%);
  margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px;
}
.diag-row { display: flex; gap: 14px; align-items: flex-start; }
.diag-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.diag-label { color: var(--gold-soft); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.diag-row p { font-size: 1rem; line-height: 1.7; }
#diag-headline { font-size: 1.08rem; font-weight: 700; }
#diag-time { padding: 3px 10px; font-size: 0.76rem; }

/* 雷達圖卡 */
.radar-card { margin-bottom: 20px; }
.radar-card h3 { margin-bottom: 10px; }

/* 成長中心（儀表板） */
.growth-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 8px; }
.growth-card h3 { font-size: 0.95rem; margin-bottom: 14px; letter-spacing: 0.05em; }
.growth-sub { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; margin-left: 8px; }
.growth-card:last-child { grid-column: 1 / -1; }
.weak-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.weak-chip {
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem;
  background: rgba(217,107,107,0.1); border: 1px solid rgba(217,107,107,0.3); color: var(--text);
}
.headline-list { list-style: none; }
.headline-list li {
  padding: 10px 4px; border-top: 1px solid var(--border2); font-size: 0.9rem;
  line-height: 1.6; cursor: pointer; transition: background 0.15s;
}
.headline-list li:first-child { border-top: none; }
.headline-list li:hover { background: rgba(201,168,106,0.05); }
.hl-date { color: var(--text-muted); font-size: 0.78rem; margin-right: 10px; font-variant-numeric: tabular-nums; }

/* Toast（取代 alert） */
#toast-box { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 12px 22px; border-radius: 12px; font-size: 0.9rem; max-width: min(520px, 88vw);
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45); opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: var(--red); }
.toast-warn { border-color: var(--orange); }

/* 溫度曲線卡（報告頁） */
.rapport-card { border-left: 3px solid var(--blue); }
.rapport-summary { color: var(--text); font-size: 0.9rem; line-height: 1.75; margin-top: 10px; }

/* 暗牌揭曉卡（資訊蒐集） */
.discovery-card { border-left: 3px solid #c3b0e6; }
.discovery-item { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border2); }
.discovery-item:first-of-type { border-top: none; }
.disc-badge { flex-shrink: 0; font-size: 0.8rem; font-weight: 700; }
.discovery-item.found .disc-badge { color: var(--green); }
.discovery-item.missed .disc-badge { color: var(--red); }
.disc-name { font-weight: 700; color: #c3b0e6; }
.disc-comment { color: var(--text-muted); font-size: 0.86rem; line-height: 1.6; }
.discovery-review { color: var(--text); font-size: 0.9rem; line-height: 1.75; margin-top: 12px; border-top: 1px dashed var(--border2); padding-top: 12px; }

/* 王牌出招（報告頁聽高手示範） */
.ace-card { border-left: 3px solid var(--green); }
.ace-sub { color: var(--text-muted); font-size: 0.84rem; margin: 4px 0 14px; }
.ace-item { padding: 12px 0; border-top: 1px solid var(--border2); }
.ace-item:first-of-type { border-top: none; }
.ace-weak { color: var(--orange); font-size: 0.84rem; font-weight: 600; margin-bottom: 6px; }
.ace-demo { color: var(--text); line-height: 1.75; font-size: 0.95rem; margin-bottom: 10px; }
.ace-play { padding: 7px 16px; font-size: 0.85rem; }
@media print { .ace-play, .ace-shadow, .shadow-result { display: none !important; } }

/* v3.10 跟練模式 */
.ace-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ace-shadow { padding: 7px 16px; font-size: 0.85rem; }
.shadow-result { margin-top: 12px; padding: 10px 12px; background: rgba(255,255,255,0.02); border-radius: 10px; }
.shadow-tip { color: var(--gold-soft); font-size: 0.84rem; margin-top: 8px; }
.shadow-transcript { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }
.shadow-retry { margin-top: 8px; padding: 6px 14px; font-size: 0.8rem; }

/* 兩種 PDF 列印範圍：mode-report=不含逐字稿；mode-transcript=只印逐字稿 */
@media print {
  body.mode-report #transcript-section { display: none !important; }
  body.mode-transcript #report-area > :not(#transcript-section) { display: none !important; }
}

/* 篩選客戶條件 */
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.filter-label { color: var(--text-muted); font-size: 0.82rem; width: 34px; flex-shrink: 0; }
.filter-row .lead-row { flex: 1; }
.filter-row .lead-row button { padding: 7px 0; font-size: 0.82rem; }
.age-input {
  width: 58px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border2); background: rgba(255,255,255,0.04);
  color: var(--text); font-size: 0.9rem; font-family: inherit; text-align: center;
}
.age-input:focus { outline: none; border-color: var(--gold); }

/* 練習組員列 */
.member-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; padding: 16px 20px; }

/* v3.6 留言卡（report.html） */
.feedback-card { display: flex; flex-direction: column; gap: 10px; }
.fb-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.fb-row textarea {
  flex: 1; min-width: 200px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2); border-radius: 10px; color: var(--text);
  padding: 10px 12px; font-family: inherit;
}

/* v3.9 訓練閉環：上回教練說 / 今日建議 卡 */
.last-coach-card, .today-suggest-card {
  margin-bottom: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-left: 3px solid var(--gold);
}
.last-coach-card h3, .today-suggest-card h3 { font-size: 0.9rem; margin: 0; flex-shrink: 0; }
.last-coach-card p, .today-suggest-card p { flex: 1; min-width: 200px; margin: 0; color: var(--text); font-size: 0.88rem; line-height: 1.6; }

/* v3.9：難度通關徽章 */
.diff-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.diff-badge {
  flex: 1; min-width: 90px; text-align: center; padding: 10px 8px; border-radius: 12px;
  border: 1px solid var(--border2); background: rgba(255,255,255,0.02);
}
.diff-badge .db-roman { font-size: 1.1rem; color: var(--gold-soft); font-weight: 700; }
.diff-badge .db-stat { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.diff-badge.passed { border-color: var(--gold); background: rgba(201,168,106,0.08); }
.diff-badge .db-tag { font-size: 0.68rem; margin-top: 4px; color: var(--green); }
.diff-badge .db-tag.next { color: var(--gold-soft); }

/* v3.9：全隊暖性動態 */
.team-pulse { text-align: center; color: var(--text-muted); font-size: 0.86rem; margin-bottom: 14px; }
