:root {
  --bg: #f4f6f8;
  --paper: #fff;
  --ink: #172331;
  --muted: #667789;
  --line: #d9e1e8;
  --soft: #eef3f7;
  --blue: #2469b8;
  --green: #15845b;
  --amber: #b06c00;
  --red: #bd3d31;
  --shadow: 0 12px 28px rgba(23, 35, 49, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 25px; font-weight: 760; }
h2 { margin-bottom: 4px; font-size: 18px; }
h3 { margin-bottom: 8px; font-size: 15px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 30px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.96);
  backdrop-filter: blur(12px);
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.user-badge span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.nav a {
  min-width: 88px;
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}
.nav a.active, .nav a:hover { background: var(--ink); color: #fff; }

.shell { max-width: 1440px; margin: 0 auto; padding: 22px 30px 46px; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-panel h1 { margin-bottom: 18px; }
.login-form { display: grid; gap: 14px; }
.login-form .btn { width: 100%; }
.mobile-body {
  min-height: 100vh;
  background: #f6f8fb;
}
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 251, 0.96);
  backdrop-filter: blur(12px);
}
.mobile-header h1 {
  font-size: 22px;
}
.mobile-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.mobile-text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
}
.mobile-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 16px;
}
.mobile-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.mobile-login-card,
.mobile-card,
.mobile-modal {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.mobile-login-card h1 {
  margin-bottom: 20px;
  font-size: 24px;
}
.mobile-form {
  display: grid;
  gap: 12px;
}
.mobile-form .field {
  margin-bottom: 0;
}
.mobile-primary {
  width: 100%;
  min-height: 44px;
}
.mobile-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-toolbar .btn {
  min-height: 40px;
  padding-right: 8px;
  padding-left: 8px;
}
.mobile-status,
.mobile-file-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.mobile-list {
  display: grid;
  gap: 10px;
}
.mobile-customer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(23, 35, 49, 0.05);
}
.mobile-customer-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}
.mobile-customer-card p,
.mobile-card p {
  margin-bottom: 0;
  color: var(--muted);
}
.mobile-card-meta {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.mobile-card-meta span {
  color: var(--blue);
}
.mobile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mobile-section-head h2 {
  margin-bottom: 0;
  font-size: 16px;
}
.mobile-section-head span {
  color: var(--muted);
  font-size: 12px;
}
.mobile-progress {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}
.mobile-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.18s ease;
}
.mobile-record-list {
  display: grid;
  gap: 8px;
}
.mobile-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.mobile-record strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-record p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}
.mobile-record span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.mobile-empty {
  padding: 18px;
  border: 1px dashed #aab8c6;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.mobile-back {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
}
.mobile-card + .mobile-card {
  margin-top: 12px;
}
.mobile-modal {
  width: min(420px, 100%);
}
.hero-panel, .panel, .role-card, .toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.hero-panel { padding: 24px; margin-bottom: 16px; }
.hero-panel h2 { max-width: 940px; margin-bottom: 0; font-size: 24px; line-height: 1.35; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-grid.slim { margin-bottom: 16px; }
.role-card { display: block; min-height: 210px; padding: 20px; }
.role-grid.slim .role-card { min-height: 128px; }
.role-card.active { border-color: var(--blue); background: #f7fbff; }
.role-card span { color: var(--blue); font-size: 12px; }
.role-card p { color: var(--muted); }

.two-col { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.two-col.wide-left { grid-template-columns: 430px minmax(0, 1fr); }
.panel { padding: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-head > div:first-child { min-width: 0; }
.panel-head p, .hint, .note-box p, .upload-box p, .card-note { margin-bottom: 0; color: var(--muted); font-size: 12px; }

.field { display: grid; gap: 6px; margin-bottom: 13px; color: var(--muted); }
.field.inline { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.field.full { grid-column: 1 / -1; }
select, input, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
select[multiple] { min-height: 92px; }
textarea { min-height: 116px; resize: vertical; }

.upload-box, .note-box {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px dashed #aab8c6;
  border-radius: 8px;
  background: #f8fafc;
}
.upload-box.compact { margin-bottom: 0; }
.upload-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}
.note-box { border-style: solid; }
.btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.btn.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.btn.secondary { background: var(--soft); }
.btn.danger { border-color: #efc2bd; color: var(--red); }
.btn.copied { border-color: var(--green); color: var(--green); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.session-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 256px;
  gap: 6px;
}
.session-toolbar .btn {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 6px;
  white-space: nowrap;
}
.button-row.bottom { margin-top: 14px; }
.report-editor-head {
  align-items: stretch;
  flex-direction: column;
}
.report-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.report-actions .btn {
  width: 100%;
  padding-right: 6px;
  padding-left: 6px;
}
#customerReportText {
  min-height: 620px;
  height: clamp(520px, 68vh, 780px);
  line-height: 1.6;
}
body.modal-open { overflow: hidden; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 14px 16px; }
.tab-shell { margin-bottom: 16px; padding: 8px; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.tabs button.active {
  background: var(--ink);
  color: #fff;
}
.tab-page { display: none; }
.tab-page.active { display: block; }
.kb-page { display: none; }
.kb-page.active { display: block; }
.coach-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.coach-shortcuts,
.coach-chat {
  min-width: 0;
}
.coach-shortcuts h3 {
  margin-bottom: 12px;
}
.coach-shortcut-grid {
  display: grid;
  gap: 8px;
}
.coach-shortcut {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.coach-shortcut:hover {
  border-color: var(--blue);
  background: #f7fbff;
}
.coach-shortcut span {
  color: var(--muted);
  font-size: 12px;
}
.coach-chat {
  display: grid;
  gap: 12px;
}
.coach-messages {
  display: grid;
  gap: 10px;
  min-height: 420px;
  max-height: 68vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.coach-message {
  max-width: 88%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.coach-message.user {
  justify-self: end;
  border-color: #b8d1ed;
  background: #f2f8ff;
}
.coach-message.user p {
  margin-bottom: 0;
}
.coach-message.assistant {
  justify-self: start;
}
.coach-reply-block {
  display: grid;
  gap: 10px;
}
.coach-reply-block > strong {
  font-size: 15px;
}
.coach-reply-block span {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.coach-reply-block ul {
  margin: 0;
  padding-left: 18px;
}
.coach-reply-block p {
  margin-bottom: 0;
  color: var(--muted);
}
.coach-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.coach-sources span {
  width: 100%;
}
.coach-sources small {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
}
.coach-actions {
  margin-top: 10px;
}
.coach-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: end;
}
.coach-input-row textarea {
  min-height: 72px;
}
.tuning-data-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.tuning-side,
.tuning-editor {
  min-width: 0;
}
.tuning-type-row {
  margin-bottom: 10px;
}
.tuning-record-list {
  display: grid;
  gap: 8px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}
.tuning-record {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.tuning-record.active {
  border-color: var(--blue);
  background: #f7fbff;
}
.tuning-record span,
.tuning-record small {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}
.compact-head {
  margin-bottom: 10px;
}
.json-editor {
  min-height: 560px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}
.lessons-editor {
  min-height: 460px;
  margin: 14px 0 12px;
}
.metric-grid.compact {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.mini-metric {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.mini-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.mini-metric strong {
  font-size: 18px;
  line-height: 1.2;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}
.tag.good { background: #eaf7f1; color: var(--green); }
.tag.weak { background: #fff5df; color: var(--amber); }
.tag.missed { background: #fff1ee; color: var(--red); }
.tag.excellent { background: #edf5ff; color: var(--blue); }

.checklist { display: grid; gap: 10px; }
.category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.category-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
}
.item-list { display: grid; gap: 8px; padding: 12px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 120px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.item-row.active { border-color: var(--blue); background: #f7fbff; }
.item-row:hover { border-color: #9bbce0; background: #fbfdff; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.bar span.weak { background: var(--amber); }
.bar span.missed { background: var(--red); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evidence, .reason-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.evidence { border-left: 4px solid var(--blue); background: #f7fbff; }
.reason-box.good { border-color: #b9dfd0; }
.reason-box.bad { border-color: #efc2bd; }
ul { margin: 0; padding-left: 18px; }
li { margin: 6px 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 35, 49, 0.48);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(23, 35, 49, 0.24);
}
.transcript-modal { width: min(920px, 100%); }
.modal-head {
  position: sticky;
  top: -18px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -18px 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}
.modal-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.modal-summary p { margin-bottom: 0; color: var(--muted); }
.quality-section { margin-bottom: 14px; }
.quality-point-list { display: grid; gap: 10px; }
.quality-point {
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
}
.quality-point.hit { border-left-color: var(--green); }
.quality-point.miss { border-left-color: var(--red); }
.quality-point-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.quality-point p { margin-bottom: 6px; color: var(--muted); }
.quality-point p:last-child { margin-bottom: 0; }
.quality-point b { color: var(--ink); }
.remedy-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #9bbce0;
  border-radius: 8px;
  background: #f7fbff;
}
.remedy-box p { white-space: pre-line; margin-bottom: 0; color: var(--muted); }

.table { display: grid; gap: 10px; }
.table-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.7fr 0.7fr 0.7fr 110px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.table-row.profile-table { grid-template-columns: 1.2fr 0.7fr 0.7fr 0.5fr 0.5fr 0.5fr 0.9fr 0.6fr 120px; }
.table-row.user-table { grid-template-columns: 1fr 0.8fr 0.7fr 0.9fr 0.5fr 180px; }
.table-row.team-table { grid-template-columns: 1.1fr 1.2fr 0.5fr 0.5fr 0.5fr 170px; }
.table-row.header { background: #f8fafc; color: var(--muted); font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.summary-card strong { display: block; margin-top: 6px; font-size: 24px; }
.session-list { display: grid; gap: 8px; }
.session-card {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  overflow: hidden;
}
.session-card.active { border-color: var(--blue); background: #f7fbff; }
.session-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.session-actions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.session-card .card-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-card .audio-name {
  color: var(--ink);
  font-weight: 650;
}
.chat-transcript {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding-right: 4px;
}
.transcript-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.chat-message.customer {
  grid-template-columns: minmax(0, 1fr) 34px;
}
.chat-message.customer .chat-avatar { grid-column: 2; }
.chat-message.customer .chat-bubble {
  grid-column: 1;
  grid-row: 1;
  background: #eef7ff;
}
.chat-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8edf3;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.chat-bubble {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.chat-line-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.chat-line-head strong { color: var(--ink); }
.chat-bubble p {
  margin: 0;
  line-height: 1.7;
}

.knowledge-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 16px; }
.tree { display: grid; gap: 10px; }
.tree-category { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.tree-category > button {
  width: 100%;
  padding: 12px;
  border: 0;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
}
.tree-category > button.active {
  background: #f7fbff;
  color: var(--blue);
}
.tree-items { display: grid; gap: 6px; padding: 10px; }
.tree-items button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.tree-items button.active { border-color: var(--blue); background: #f7fbff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.compact { gap: 10px; }

.tag-groups { display: grid; gap: 12px; }
.tag-group {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.profile-field-list { display: grid; gap: 8px; }
.profile-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft);
}
.profile-field:last-child { border-bottom: 0; }
.profile-field span { color: var(--muted); }
.ai-profile { display: grid; gap: 12px; }
.ai-summary {
  padding: 14px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f7fbff;
  font-size: 15px;
}
.demand-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.demand-board.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demand-card {
  min-height: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.demand-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--soft);
}
.demand-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.design-principle {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #cddff1;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff, #fff);
}
.design-principle h3 {
  max-width: 980px;
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.45;
}
.design-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.design-source-row span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1c5e9c;
  font-size: 12px;
}
.panel-head.compact { margin-bottom: 10px; }
.design-section { margin-top: 16px; }
.design-space-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.design-space-card, .design-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.design-space-card {
  border-top: 4px solid var(--blue);
}
.design-space-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.design-space-head strong {
  font-size: 17px;
}
.design-space-card p {
  margin-bottom: 8px;
  color: var(--muted);
}
.design-space-card b {
  color: var(--ink);
}
.design-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.design-card.risk {
  border-color: #efc2bd;
  background: #fffafa;
}
.design-list {
  display: grid;
  gap: 10px;
}
.design-list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
}
.design-list-item span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.design-list-item p {
  margin-bottom: 0;
  color: #3b4652;
}
.quote-principle {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #b9dfd0;
  border-radius: 8px;
  background: linear-gradient(135deg, #f3fbf7, #fff);
}
.quote-principle h3 {
  max-width: 980px;
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.45;
}
.quote-strategy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
  margin: 14px 0;
}
.quote-strategy-card {
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
}
.quote-strategy-card ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #3b4652;
  line-height: 1.55;
}
.quote-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.quote-required-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #b9dfd0;
  border-radius: 8px;
  background: #f3fbf7;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.quote-section { margin-top: 16px; }
.quote-checklist {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.quote-checklist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.quote-checklist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.quote-checklist-head h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}
.quote-checklist-table {
  display: grid;
  border: 1px solid var(--soft);
  border-radius: 8px;
  overflow: hidden;
}
.quote-checklist-row {
  display: grid;
  grid-template-columns: 100px minmax(150px, 1fr) minmax(240px, 1.5fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-top: 1px solid var(--soft);
  background: #fff;
}
.quote-checklist-row:first-child {
  border-top: 0;
}
.quote-checklist-row.head {
  background: #f6f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quote-checklist-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.quote-checklist-row strong small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.quote-category {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.quote-tree {
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}
.quote-tree-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.quote-tree-item.active {
  border-color: var(--blue);
  background: #f7fbff;
}
.quote-tree-item strong {
  font-size: 13px;
  line-height: 1.35;
}
.quote-tree-item span,
.quote-tree-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}
.quote-tree-item em {
  color: var(--green);
  font-weight: 800;
}
.quote-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quote-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.quote-talk-list, .quote-advantage-list {
  display: grid;
  gap: 10px;
}
.quote-talk-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
}
.quote-talk-item span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.quote-talk-item p {
  margin-bottom: 0;
  color: #3b4652;
}
.quote-advantage-item {
  display: grid;
  grid-template-columns: 100px 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fff;
}
.quote-advantage-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}
.report-preview-panel { background: #eef3f7; }
#customerReportPreview { display: flex; justify-content: center; }
.report-url-box {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b9dfd0;
  border-radius: 8px;
  background: #f3fbf7;
}
.report-url-box span { color: var(--muted); font-size: 12px; }
.report-url-box strong { color: var(--green); font-size: 12px; word-break: break-all; }
.report-body {
  min-height: 100vh;
  background: #e8edf2;
}
#reportPage {
  display: flex;
  justify-content: center;
  padding: 28px 12px;
}
.h5-report {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(217, 225, 232, 0.9);
  border-radius: 8px;
  background: #f5f7f9;
  box-shadow: 0 24px 70px rgba(23, 35, 49, 0.18);
}
.h5-report.standalone { min-height: calc(100vh - 56px); }
.h5-hero {
  position: relative;
  min-height: 330px;
  padding: 34px 26px 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.62)),
    linear-gradient(135deg, #edf0ed 0%, #fbfbfa 56%, #dfe8ef 100%);
}
.h5-hero::before {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 28px;
  width: 126px;
  height: 92px;
  border-radius: 8px 8px 5px 5px;
  background: linear-gradient(135deg, #a7b2b9, #dae0e4);
  box-shadow: 0 18px 28px rgba(23, 35, 49, 0.14);
}
.h5-hero::after {
  content: "";
  position: absolute;
  right: 72px;
  bottom: 112px;
  width: 58px;
  height: 92px;
  border-radius: 999px 999px 8px 8px;
  border: 8px solid #263442;
  border-bottom: 0;
  opacity: 0.28;
}
.h5-hero-copy { position: relative; z-index: 1; max-width: 300px; }
.h5-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.h5-hero h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 850;
}
.h5-hero p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}
.h5-meta {
  display: grid;
  gap: 8px;
  color: #536272;
  font-size: 13px;
}
.h5-meta span {
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(217, 225, 232, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}
.h5-hero-panel {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 1;
  width: 160px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(10px);
}
.h5-hero-panel span { color: var(--muted); font-size: 11px; }
.h5-hero-panel strong { display: block; margin: 4px 0; font-size: 22px; }
.h5-hero-panel p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.h5-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}
.h5-metric {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(217, 225, 232, 0.9);
  border-radius: 8px;
  background: #fff;
}
.h5-metric span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.h5-metric strong { font-size: 17px; line-height: 1.35; word-break: break-word; }
.h5-card {
  margin: 0 14px 14px;
  padding: 18px;
  border: 1px solid rgba(217, 225, 232, 0.9);
  border-radius: 8px;
  background: #fff;
}
.h5-ai-card {
  border-color: #cddff1;
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.h5-section-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: #ff3d1f;
  font-size: 13px;
  font-weight: 800;
}
.h5-card h2 {
  margin-bottom: 10px;
  font-size: 22px;
}
.h5-card p { color: #384655; }
.h5-chip-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.h5-chip-row span {
  padding: 9px 10px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1c5e9c;
  font-size: 12px;
}
.h5-section-list { display: grid; gap: 14px; }
.h5-section-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--soft);
}
.h5-section-item:last-child { padding-bottom: 0; border-bottom: 0; }
.h5-section-item i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #172331;
  color: #fff;
  font-style: normal;
  font-weight: 800;
}
.h5-section-item h3 {
  margin-bottom: 6px;
  color: #ff3d1f;
  font-size: 17px;
}
.h5-section-item p { margin-bottom: 0; color: #3b4652; word-break: break-word; }
.h5-demand-grid { display: grid; gap: 10px; }
.h5-demand {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}
.h5-demand span { display: inline-flex; margin-bottom: 6px; font-weight: 800; }
.h5-demand p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.h5-demand b { display: block; color: var(--ink); }
.h5-demand.must { border-color: #cddff1; background: #f7fbff; }
.h5-demand.unsure { border-color: #f2d3a4; background: #fffaf0; }
.h5-demand.highlight { border-color: #b9dfd0; background: #f3fbf7; }
.h5-demand.reject { border-color: #efc2bd; background: #fff6f4; }
.h5-footer-note {
  margin: 0 14px 18px;
  padding: 16px;
  border-radius: 8px;
  background: #172331;
  color: #fff;
}
.h5-footer-note p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.78); }

@media (max-width: 1100px) {
  .topbar, .panel-head, .toolbar { align-items: stretch; flex-direction: column; }
  .nav { overflow-x: auto; }
  .role-grid, .two-col, .two-col.wide-left, .summary-grid, .knowledge-layout, .form-grid, .detail-grid, .upload-row, .design-space-grid, .design-two-col, .quote-strategy-grid, .quote-two-col, .coach-shell, .tuning-data-layout, .metric-grid.compact { grid-template-columns: 1fr; }
  .table-row, .table-row.profile-table, .table-row.user-table, .table-row.team-table, .category-head, .item-row, .profile-field, .demand-board, .demand-board.compact, .design-list-item, .quote-checklist-row, .quote-talk-item, .quote-advantage-item { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  #reportPage { padding: 0; }
  .h5-report {
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .h5-card, .h5-footer-note { break-inside: avoid; }
}
