:root {
  --bg: #f6f7fb;
  --text: #1f2430;
  --muted: #666d80;
  --line: rgba(18, 24, 40, 0.08);
  --card: rgba(255, 255, 255, 0.75);
  --card-strong: rgba(255, 255, 255, 0.9);
  --orange: #ee4d2d;
  --orange-dark: #d53b1d;
  --green: #1f8f5a;
  --red: #c93f36;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-lg: 0 18px 50px rgba(31, 36, 48, 0.12);
  --shadow-sm: 0 8px 22px rgba(31, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(150deg, #f7f9ff 0%, #f3f5fc 35%, #f7f7fb 100%);
}

.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  filter: blur(70px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-a {
  top: -100px;
  right: -120px;
  background: #ff9f7f;
}

.bg-glow-b {
  left: -120px;
  bottom: -120px;
  background: #7db8ff;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(18px);
  background: rgba(247, 249, 255, 0.82);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: 1.2rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.2rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(1560px, calc(100vw - 24px));
  margin: 0 auto;
  padding: clamp(18px, 2vw, 28px);
}

.auth-wrap {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  color: var(--muted);
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 11px 12px;
  color: var(--text);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  box-shadow: 0 10px 20px rgba(238, 77, 45, 0.28);
}

.btn-secondary {
  color: #fff;
  background: #2f405f;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--text);
}

.inline-link {
  color: var(--orange-dark);
  cursor: pointer;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(246, 247, 251, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.busy-dialog {
  width: min(460px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  text-align: center;
}

.busy-dialog h3 {
  margin-bottom: 10px;
}

.busy-dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.busy-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 4px solid rgba(238, 77, 45, 0.16);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.view-grid {
  display: grid;
  gap: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 24px;
}

.hero-main {
  display: grid;
  gap: 12px;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.hero-training-shell {
  border: 1px solid rgba(18, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 16px;
  min-height: 270px;
}

.assessment-hero {
  align-items: start;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--card-strong);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.kpi strong {
  display: block;
  font-size: 1.7rem;
  margin-top: 6px;
}

.list-card {
  padding: 18px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.record-item:hover {
  border-color: rgba(238, 77, 45, 0.35);
  transform: translateY(-1px);
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ops-workbench {
  display: grid;
  gap: 16px;
}

.ops-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(238, 77, 45, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 255, 0.84));
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.ops-hero h3 {
  margin: 4px 0 8px;
  font-size: clamp(1.35rem, 1vw + 1rem, 2rem);
}

.ops-hero p {
  max-width: 780px;
  line-height: 1.6;
}

.ops-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ops-hero-stats span {
  border: 1px solid rgba(47, 64, 95, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #2f405f;
  font-weight: 700;
  padding: 7px 11px;
  white-space: nowrap;
}

.scenario-editor-card {
  align-self: start;
}

.scenario-editor-form {
  gap: 16px;
}

.scenario-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.scenario-command-card,
.scenario-evidence-card,
.scenario-list-card,
.knowledge-upload-panel,
.knowledge-diagnostic-panel,
.knowledge-ledger-card {
  border-color: rgba(18, 24, 40, 0.08);
}

.scenario-config-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.section-title {
  display: grid;
  gap: 4px;
}

.field-help {
  display: block;
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.scenario-binding-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 249, 255, 0.78)),
    #fff;
}

.scenario-binding-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.scenario-binding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.binding-lane {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.binding-lane-head {
  display: grid;
  gap: 3px;
}

.binding-lane-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.availability-toolbar label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  width: auto;
  color: var(--text);
}

.availability-toolbar input {
  width: auto;
}

.scenario-kb-list {
  margin-top: 8px;
}

.knowledge-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.knowledge-option:hover {
  border-color: rgba(238, 77, 45, 0.35);
  transform: translateY(-1px);
}

.knowledge-option.is-blocked {
  opacity: 0.58;
}

.knowledge-option input {
  margin-top: 3px;
}

.knowledge-option-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.knowledge-option-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.knowledge-option-copy strong {
  overflow-wrap: anywhere;
}

.knowledge-option-copy .muted {
  line-height: 1.5;
}

.diagnostic-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.diagnostic-chip.is-ok,
.diagnostic-chip.is-selectable {
  border-color: rgba(31, 143, 90, 0.18);
  background: rgba(31, 143, 90, 0.12);
  color: #0b6a42;
}

.diagnostic-chip.is-waiting {
  border-color: rgba(238, 77, 45, 0.2);
  background: rgba(238, 77, 45, 0.1);
  color: var(--orange-dark);
}

.diagnostic-chip.is-risk {
  border-color: rgba(201, 63, 54, 0.2);
  background: rgba(201, 63, 54, 0.1);
  color: var(--red);
}

.diagnostic-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-evidence-card {
  position: sticky;
  top: 96px;
}

.evidence-panel,
.evidence-panel-empty {
  display: grid;
  gap: 14px;
}

.evidence-panel h3,
.evidence-panel-empty h3 {
  margin-top: -4px;
}

.evidence-panel > .muted,
.evidence-panel-empty > .muted {
  line-height: 1.6;
}

.evidence-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-check {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
}

.evidence-check span {
  color: var(--muted);
  font-size: 0.78rem;
}

.evidence-check strong {
  font-size: 0.95rem;
}

.evidence-check.is-ok {
  border-color: rgba(31, 143, 90, 0.18);
  background: rgba(31, 143, 90, 0.07);
}

.evidence-check.is-risk {
  border-color: rgba(238, 77, 45, 0.22);
  background: rgba(238, 77, 45, 0.07);
}

.evidence-source-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.evidence-source-list {
  display: grid;
  gap: 8px;
}

.evidence-source-item {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
}

.evidence-source-item.is-ok {
  border-color: rgba(31, 143, 90, 0.2);
}

.evidence-source-item.is-waiting {
  border-color: rgba(238, 77, 45, 0.22);
}

.evidence-source-item.is-risk {
  border-color: rgba(201, 63, 54, 0.22);
}

.evidence-source-item span {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.evidence-source-item small {
  color: var(--muted);
  line-height: 1.45;
}

.evidence-note {
  border-radius: 14px;
  background: rgba(47, 64, 95, 0.08);
  border: 1px solid rgba(47, 64, 95, 0.12);
  padding: 12px;
}

.evidence-note p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.88rem;
}

.knowledge-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.58fr);
  gap: 16px;
  align-items: stretch;
}

.knowledge-diagnostic-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(47, 64, 95, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.78);
}

.format-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.format-guide-card {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
  font-weight: 900;
  color: #2f405f;
}

.format-guide-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
}

.format-guide-card.is-best {
  border-color: rgba(31, 143, 90, 0.2);
  background: rgba(31, 143, 90, 0.07);
}

.preview-diagnostic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.persona-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.persona-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
}

.persona-option input {
  margin-top: 3px;
}

.persona-option span {
  display: grid;
  gap: 4px;
}

.persona-option small {
  color: var(--muted);
  line-height: 1.5;
}

.persona-console {
  overflow: hidden;
  border: 1px solid rgba(238, 77, 45, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(238, 77, 45, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(31, 36, 48, 0.98), rgba(47, 64, 95, 0.94));
  box-shadow: 0 18px 42px rgba(31, 36, 48, 0.12);
}

.persona-console-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  color: #fff;
}

.persona-console-head strong {
  display: block;
  margin: 4px 0;
  font-size: 1.08rem;
}

.persona-console-head span {
  display: block;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
  font-size: 0.88rem;
}

.persona-console-head .eyebrow {
  color: rgba(255, 255, 255, 0.55);
}

.persona-console-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.persona-console-stats span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  padding: 5px 9px;
  font-size: 0.78rem;
}

.persona-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: rgba(246, 247, 251, 0.94);
  border-radius: 18px 18px 0 0;
}

.persona-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 260px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 247, 0.92)),
    #fff;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(31, 36, 48, 0.08);
}

.persona-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--orange), #ffb199);
}

.persona-card.is-disabled {
  opacity: 0.62;
  filter: grayscale(0.25);
}

.persona-card-top,
.persona-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.persona-pick {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.persona-pick input {
  width: auto;
}

.persona-status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.persona-status.on {
  color: #0b6a42;
  background: rgba(31, 143, 90, 0.12);
}

.persona-status.off {
  color: #7b8192;
  background: rgba(102, 109, 128, 0.12);
}

.persona-card-title {
  display: grid;
  gap: 5px;
}

.persona-card-title strong {
  font-size: 1.08rem;
}

.persona-card-title small {
  width: fit-content;
  border-radius: 999px;
  background: rgba(238, 77, 45, 0.1);
  color: var(--orange-dark);
  padding: 4px 8px;
  font-weight: 700;
}

.persona-card p {
  min-height: 42px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.persona-meter-list {
  display: grid;
  gap: 8px;
}

.persona-meter {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

.persona-meter span {
  font-weight: 800;
}

.persona-meter-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(18, 24, 40, 0.08);
  overflow: hidden;
}

.persona-meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffb199);
}

.persona-meter em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
}

.persona-rule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.persona-rule-row span {
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.76rem;
}

.persona-card-actions {
  align-self: end;
  justify-content: flex-start;
}

.persona-editor-modal {
  z-index: 18;
}

.persona-editor-dialog {
  width: min(760px, calc(100vw - 28px));
}

.persona-editor-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(238, 77, 45, 0.22), transparent 42%),
    linear-gradient(135deg, #1f2430, #32405b);
  color: #fff;
  padding: 18px;
}

.persona-editor-hero .muted,
.persona-editor-hero .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.persona-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.persona-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mode-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-switch-grid.compact .mode-option {
  min-height: 100%;
}

.mode-option {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.mode-option.active {
  border-color: rgba(238, 77, 45, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 239, 0.92));
  box-shadow: 0 12px 26px rgba(238, 77, 45, 0.12);
}

.mode-option-title {
  font-size: 1rem;
}

.mode-option-copy {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-mode-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 118px;
}

.mode-config-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.mode-placeholder {
  display: grid;
  gap: 12px;
}

.assessment-inline-panel {
  border: 1px dashed rgba(18, 24, 40, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.mode-config-grid-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  display: grid;
  gap: 6px;
  min-height: 72px;
}

.mode-preview-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 2px;
}

.exam-group-head {
  padding: 0 2px;
}

.identity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.identity-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.identity-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.identity-actions {
  gap: 8px;
}

.identity-actions .btn {
  padding-inline: 14px;
}

.meta-code,
.identity-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  color: #2f405f;
  word-break: break-all;
}

.training-workstation {
  width: min(1420px, 100%);
  margin: 0 auto;
}

.workstation-shell {
  overflow: hidden;
  border-color: rgba(18, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.workstation-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid rgba(18, 24, 40, 0.06);
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.95), rgba(255, 255, 255, 0.86));
}

.workstation-statusbar h3 {
  font-size: 1.22rem;
}

.workstation-actions {
  justify-content: flex-end;
}

.workstation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(18, 24, 40, 0.06);
  color: #6f7b91;
  font-size: 0.84rem;
}

.workstation-meta span {
  border-radius: 999px;
  background: rgba(245, 247, 252, 0.9);
  padding: 5px 9px;
}

.workstation-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(18, 24, 40, 0.08);
  background: #f7f8fb;
}

.workstation-tab {
  min-width: 210px;
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.workstation-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 64, 95, 0.18);
}

.workstation-tab.active {
  background: #fff;
  border-color: rgba(34, 92, 202, 0.34);
  box-shadow: inset 0 3px 0 #3976e8;
}

.workstation-tab.seller-alert {
  border-color: rgba(238, 77, 45, 0.74);
  animation: sellerAlertPulse 1.05s ease-in-out infinite;
  box-shadow: inset 0 3px 0 var(--orange), 0 0 0 3px rgba(238, 77, 45, 0.1);
}

.workstation-tab.done {
  opacity: 0.76;
}

.workstation-tab .tab-title,
.workstation-tab small,
.workstation-tab em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.tab-clock-stack {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.tab-clock-stack.waiting small:last-child,
.workstation-chat-header.seller-alert .seller-waiting {
  color: var(--orange-dark);
  font-weight: 700;
}

.knowledge-evidence-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.knowledge-evidence-card {
  border: 1px solid rgba(18, 24, 40, 0.08);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(247, 250, 255, 0.96), rgba(255, 251, 247, 0.96));
  padding: 12px;
}

.knowledge-evidence-card p {
  margin: 6px 0 0;
}

.window-evidence {
  border: 1px dashed rgba(47, 64, 95, 0.18);
  border-radius: 14px;
  margin: 10px 0;
  padding: 10px 12px;
}

.record-item.compact {
  padding: 10px;
}

.timing-evidence-list {
  margin-top: 10px;
}

.timing-ok,
.evidence-empty {
  margin-top: 10px;
}

.workstation-tab strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workstation-chat-panel {
  min-height: min(760px, calc(100vh - 220px));
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  background: #fff;
}

.workstation-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(18, 24, 40, 0.08);
  background: #fff;
}

.workstation-chat-header.seller-alert {
  background: linear-gradient(90deg, rgba(238, 77, 45, 0.09), #fff 42%);
}

.seller-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf0f5;
  color: #7c8798;
  font-weight: 800;
}

.seller-identity {
  min-width: 0;
  flex: 1;
}

.seller-identity p,
.chat-status-stack small {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-status-stack {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.seller-alert-badge {
  border-radius: 999px;
  background: rgba(238, 77, 45, 0.12);
  color: var(--orange-dark);
  font-size: 0.76rem;
  padding: 4px 8px;
}

.workstation-chat-log {
  min-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 28px 30px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(-18deg, transparent 0 120px, rgba(47, 64, 95, 0.035) 120px 122px);
}

.msg {
  max-width: min(620px, 72%);
  display: grid;
  gap: 5px;
  animation: messageIn 0.18s ease both;
}

.message-bubble {
  width: fit-content;
  max-width: 100%;
  border-radius: 2px;
  padding: 9px 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(18, 24, 40, 0.04);
}

.message-time {
  display: flex;
  gap: 8px;
  color: #8a98ad;
  font-size: 0.74rem;
}

.msg.user {
  align-self: flex-end;
  justify-items: end;
}

.msg.user .message-bubble {
  background: #dce8ff;
  color: #111827;
}

.msg.user .message-time {
  justify-content: flex-end;
}

.msg.seller {
  align-self: flex-start;
  justify-items: start;
}

.msg.seller .message-bubble {
  background: #f0f2f5;
  color: #111827;
}

.msg.latest-seller-alert .message-bubble {
  border: 1px solid rgba(238, 77, 45, 0.68);
  animation: latestSellerBubblePulse 1.05s ease-in-out infinite;
}

.typing-message .message-bubble {
  border: 1px dashed rgba(64, 94, 145, 0.2);
  background: #f7f8fb;
  color: #536076;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--orange);
  animation: typingPulse 0.9s ease-in-out infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.24s;
}

.window-end-note {
  display: grid;
  gap: 4px;
  margin: 10px;
  border: 1px solid rgba(47, 64, 95, 0.12);
  border-radius: 14px;
  background: rgba(47, 64, 95, 0.06);
  padding: 10px 12px;
  color: var(--muted);
}

.window-end-note strong {
  color: var(--text);
}

.window-end-note small {
  line-height: 1.5;
}

.conversation-timeline {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.conversation-timeline summary {
  cursor: pointer;
  font-weight: 800;
}

.timeline-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 76px 44px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(246, 247, 251, 0.72);
}

.timeline-row.seller {
  background: #f1ede7;
}

.timeline-row.agent {
  background: rgba(238, 77, 45, 0.08);
}

.timeline-row time {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-row strong {
  font-size: 0.82rem;
}

.timeline-row span {
  line-height: 1.5;
  white-space: pre-wrap;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingPulse {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes sellerAlertPulse {
  0%, 100% {
    background: #fff;
    transform: translateY(0);
  }
  50% {
    background: #fff4ef;
    transform: translateY(-1px);
  }
}

@keyframes latestSellerBubblePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(238, 77, 45, 0.16);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(238, 77, 45, 0.13);
  }
}

.chat-system-event {
  align-self: center;
  display: grid;
  gap: 5px;
  justify-items: center;
  max-width: 560px;
  color: #8aa0bf;
  font-size: 0.8rem;
  text-align: center;
}

.chat-system-event small {
  color: #8a98ad;
}

.workstation-empty {
  align-self: center;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.workstation-composer {
  background: #fff;
  padding: 12px 18px 14px;
}

.workstation-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
  color: #9aa7ba;
  font-size: 0.72rem;
}

.workstation-tools span {
  border: 1px solid rgba(47, 64, 95, 0.12);
  border-radius: 6px;
  background: rgba(247, 248, 251, 0.82);
  padding: 4px 6px;
}

.workstation-composer textarea {
  min-height: 92px;
  border-radius: 6px;
  background: #fff;
}

.workstation-composer.disabled textarea {
  background: #f8f9fb;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #a3acba;
  font-size: 0.78rem;
}

.result-hero {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 20px;
}

.score-dial {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 46%, transparent 48%),
    conic-gradient(var(--orange) 0 var(--score-angle), rgba(18, 24, 40, 0.08) 0 360deg);
}

.score-dial strong {
  font-size: 2.2rem;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.status {
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 4px 10px;
}

.status.uploaded {
  background: rgba(18, 24, 40, 0.08);
}

.status.parsing {
  background: rgba(238, 77, 45, 0.14);
  color: var(--orange-dark);
}

.status.ready {
  background: rgba(31, 143, 90, 0.16);
  color: var(--green);
}

.status.failed {
  background: rgba(201, 63, 54, 0.16);
  color: var(--red);
}

.status.opening,
.status.clarifying {
  background: rgba(57, 118, 232, 0.12);
  color: #275bb8;
}

.status.resolving {
  background: rgba(238, 77, 45, 0.12);
  color: var(--orange-dark);
}

.status.resolved,
.status.completed {
  background: rgba(31, 143, 90, 0.13);
  color: var(--green);
}

.status.escalated,
.status.timeout {
  background: rgba(201, 63, 54, 0.12);
  color: var(--red);
}

.status.parsed,
.status.active {
  background: rgba(31, 143, 90, 0.16);
  color: var(--green);
}

.status.inactive,
.status.candidate {
  background: rgba(18, 24, 40, 0.08);
}

.status.archived,
.status.ended {
  background: rgba(18, 24, 40, 0.14);
}

.status.in_progress,
.status.opening,
.status.clarifying,
.status.resolving,
.status.escalated {
  background: rgba(238, 77, 45, 0.14);
  color: var(--orange-dark);
}

.badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.86rem;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs .btn.active {
  background: #222b3c;
  color: #fff;
}

.hint {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(238, 77, 45, 0.12);
  border: 1px solid rgba(238, 77, 45, 0.28);
  color: var(--orange-dark);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.issue-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.4);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-dialog {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
}

.preview-dialog pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(18, 24, 40, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.user-admin-card {
  padding: clamp(18px, 1.6vw, 24px);
}

.user-admin-head {
  gap: 16px;
  margin-bottom: 14px;
}

.user-filter-row {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(150px, 0.9fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.user-filter-group {
  display: grid;
  gap: 6px;
}

.user-filter-short {
  min-width: 0;
}

.user-filter-actions {
  justify-content: flex-end;
}

.user-summary {
  margin-bottom: 10px;
}

.user-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.user-table {
  width: max(100%, 1320px);
  min-width: 1320px;
  table-layout: auto;
  font-size: clamp(0.84rem, 0.18vw + 0.78rem, 0.95rem);
}

.user-table thead th {
  font-size: clamp(0.75rem, 0.12vw + 0.72rem, 0.84rem);
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.user-table tbody tr:hover {
  background: rgba(238, 77, 45, 0.03);
}

.user-primary {
  font-weight: 700;
  word-break: normal;
  overflow-wrap: anywhere;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
  min-width: 190px;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
  min-width: 150px;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3),
.user-table th:nth-child(4),
.user-table td:nth-child(4),
.user-table th:nth-child(5),
.user-table td:nth-child(5),
.user-table th:nth-child(6),
.user-table td:nth-child(6),
.user-table th:nth-child(7),
.user-table td:nth-child(7) {
  white-space: nowrap;
}

.user-table th:nth-child(8),
.user-table td:nth-child(8),
.user-table th:nth-child(9),
.user-table td:nth-child(9),
.user-table th:nth-child(10),
.user-table td:nth-child(10) {
  min-width: 78px;
}

.user-table th:nth-child(11),
.user-table td:nth-child(11) {
  min-width: 180px;
}

.admin-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.admin-table {
  width: max(100%, 1120px);
  min-width: 1120px;
  table-layout: auto;
  font-size: clamp(0.84rem, 0.18vw + 0.78rem, 0.94rem);
}

.admin-table thead th {
  font-size: clamp(0.75rem, 0.12vw + 0.72rem, 0.84rem);
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: rgba(238, 77, 45, 0.03);
}

.cell-main {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.cell-inline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cell-warn {
  color: var(--orange-dark);
}

.cell-danger {
  color: var(--red);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 160px;
}

.scenario-table {
  width: max(100%, 1240px);
  min-width: 1240px;
}

.knowledge-table {
  width: max(100%, 1420px);
  min-width: 1420px;
}

.exam-table {
  width: max(100%, 1240px);
  min-width: 1240px;
}

.scenario-table th:nth-child(1),
.scenario-table td:nth-child(1) {
  min-width: 240px;
}

.scenario-table th:nth-child(2),
.scenario-table td:nth-child(2),
.scenario-table th:nth-child(3),
.scenario-table td:nth-child(3),
.scenario-table th:nth-child(4),
.scenario-table td:nth-child(4),
.scenario-table th:nth-child(8),
.scenario-table td:nth-child(8) {
  white-space: nowrap;
}

.scenario-table th:nth-child(9),
.scenario-table td:nth-child(9),
.knowledge-table th:nth-child(8),
.knowledge-table td:nth-child(8),
.exam-table th:nth-child(7),
.exam-table td:nth-child(7) {
  min-width: 210px;
}

.knowledge-table th:nth-child(1),
.knowledge-table td:nth-child(1) {
  min-width: 220px;
}

.knowledge-table th:nth-child(4),
.knowledge-table td:nth-child(4),
.knowledge-table th:nth-child(7),
.knowledge-table td:nth-child(7) {
  white-space: nowrap;
}

.knowledge-table th:nth-child(2),
.knowledge-table td:nth-child(2),
.knowledge-table th:nth-child(3),
.knowledge-table td:nth-child(3),
.knowledge-table th:nth-child(5),
.knowledge-table td:nth-child(5),
.knowledge-table th:nth-child(6),
.knowledge-table td:nth-child(6) {
  min-width: 150px;
}

.exam-table th:nth-child(1),
.exam-table td:nth-child(1) {
  min-width: 180px;
}

.exam-table th:nth-child(2),
.exam-table td:nth-child(2),
.exam-table th:nth-child(4),
.exam-table td:nth-child(4) {
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill-on {
  background: rgba(31, 143, 90, 0.12);
  color: var(--green);
}

.status-pill-off {
  background: rgba(201, 63, 54, 0.12);
  color: var(--red);
}

.user-op-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 180px;
  align-items: center;
}

.user-link-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: #3560d4;
  cursor: pointer;
}

.user-link-btn:hover {
  text-decoration: underline;
}

.user-editor-modal {
  width: min(620px, 100%);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  border-radius: 12px;
  background: rgba(34, 43, 60, 0.95);
  color: #fff;
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
}

.toast.error {
  background: rgba(201, 63, 54, 0.95);
}

.hidden {
  display: none !important;
}

@media (max-width: 1000px) {
  .hero,
  .grid-two,
  .scenario-ops-grid,
  .scenario-binding-grid,
  .knowledge-ops-grid,
  .format-guide-grid,
  .mode-switch-grid,
  .mode-config-grid,
  .persona-option-grid,
  .persona-card-grid,
  .persona-param-grid,
  .kpi-grid,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .persona-console-head,
  .persona-editor-hero {
    display: grid;
  }

  .ops-hero,
  .scenario-binding-toolbar {
    display: grid;
    align-items: start;
  }

  .ops-hero-stats {
    justify-content: flex-start;
  }

  .scenario-evidence-card {
    position: static;
  }

  .user-filter-row {
    grid-template-columns: 1fr;
  }

  .user-filter-actions {
    justify-content: flex-start;
  }

  .app-header {
    padding: 12px 16px;
  }

  .app-container {
    padding: 16px;
    max-width: 100%;
  }

  .workstation-statusbar,
  .workstation-chat-header,
  .composer-footer {
    align-items: flex-start;
    display: grid;
  }

  .chat-status-stack {
    justify-items: start;
    text-align: left;
  }

  .workstation-chat-panel {
    min-height: calc(100vh - 180px);
  }

  .msg {
    max-width: 88%;
  }
}

@media (max-width: 700px) {
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .workstation-statusbar,
  .workstation-meta,
  .workstation-chat-header,
  .workstation-composer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .workstation-tab {
    min-width: 170px;
  }

  .workstation-chat-log {
    padding: 16px 12px 22px;
  }

  .msg {
    max-width: 94%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg,
  .typing-dots i,
  .workstation-tab.seller-alert,
  .msg.latest-seller-alert .message-bubble {
    animation: none;
  }
}

@media (min-width: 1280px) {
  .user-table th,
  .user-table td,
  .admin-table th,
  .admin-table td {
    padding: 12px 10px;
  }
}

@media (min-width: 1440px) {
  .user-table,
  .scenario-table,
  .exam-table {
    width: 100%;
    min-width: 0;
  }

  .knowledge-table {
    width: max(100%, 1420px);
    min-width: 1420px;
  }
}
