:root {
  --ink: #16211e;
  --muted: #63716d;
  --paper: #f6f2e8;
  --panel: #fffaf0;
  --line: #d9d0bf;
  --green: #1f7a5a;
  --green-dark: #0d4f3b;
  --amber: #d4942f;
  --red: #b64f3d;
  --blue: #2d6478;
  --shadow: 0 20px 55px rgba(38, 45, 42, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(31, 122, 90, 0.08), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(212, 148, 47, 0.18), transparent 28%),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(330px, 420px) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.82);
  backdrop-filter: blur(18px);
  transition:
    opacity 160ms ease,
    padding 180ms ease,
    transform 180ms ease;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  padding-right: 0;
  padding-left: 0;
  overflow: hidden;
  border-right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-16px);
}

.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 8px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 8px 8px 0 rgba(31, 122, 90, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.1;
}

.control-stack {
  display: grid;
  gap: 16px;
}

.panel,
.report-card,
.scoreboard article {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  border-radius: 8px;
}

.panel-heading,
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--amber);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.panel-heading h2,
.card-heading h3 {
  margin: 0;
  font-size: 16px;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: #33413d;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9beab;
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffcf6;
  outline: none;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.13);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.batch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sample-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.prompt-generator {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.intent-picker {
  display: grid;
  gap: 10px;
}

.intent-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #33413d;
}

.intent-heading strong {
  font-size: 13px;
}

.intent-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.intent-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid #c9beab;
  border-radius: 6px;
  color: #33413d;
  background: #fff8ed;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.intent-grid label:has(input:checked) {
  border-color: rgba(31, 122, 90, 0.62);
  color: var(--green-dark);
  background: rgba(31, 122, 90, 0.08);
}

.intent-grid input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  accent-color: var(--green-dark);
}

.generator-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.generator-actions button {
  flex: 0 0 auto;
}

.generator-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.secondary-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.secondary-tools span {
  margin-right: auto;
}

.secondary-tools button {
  padding: 0;
  border-bottom: 1px solid rgba(31, 122, 90, 0.35);
  color: var(--green-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.secondary-tools button:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

.provider-box {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.provider-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.provider-heading strong {
  flex: 0 0 auto;
  font-size: 13px;
  white-space: nowrap;
}

.provider-heading span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sampling-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(76px, 0.58fr) minmax(108px, 0.82fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(31, 122, 90, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(248, 241, 228, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sampling-field {
  margin: 0;
  gap: 5px;
  min-width: 0;
}

.sampling-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.sampling-field input,
.sampling-field select {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border-color: transparent;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: 0 0 0 1px rgba(201, 190, 171, 0.72);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.sampling-field input {
  text-align: center;
}

.sampling-field select {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--green-dark) 50%),
    linear-gradient(135deg, var(--green-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.sampling-field input:focus,
.sampling-field select:focus {
  border-color: transparent;
  box-shadow:
    0 0 0 1px var(--green),
    0 0 0 4px rgba(31, 122, 90, 0.12);
}

.sampling-field.compact span {
  text-align: center;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f1e4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.provider-option input {
  width: auto;
}

.provider-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.provider-option.disabled {
  opacity: 0.52;
}

.full-width {
  width: 100%;
}

.primary,
.ghost,
.report-actions button {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--green-dark);
}

.ghost,
.report-actions button:not(.primary) {
  color: var(--green-dark);
  border: 1px solid var(--line);
  background: #fffaf0;
}

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

.panel-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  padding: 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar > div:not(.report-actions) {
  min-width: 0;
}

.layout-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(13, 79, 59, 0.18);
  border-radius: 6px;
  color: var(--green-dark);
  background: rgba(255, 250, 240, 0.76);
  box-shadow: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.layout-toggle:hover {
  border-color: rgba(13, 79, 59, 0.42);
  background: #f8f1e4;
  transform: translateY(-1px);
}

.layout-toggle:focus-visible {
  outline: 3px solid rgba(31, 122, 90, 0.18);
  outline-offset: 2px;
}

.layout-toggle-icon {
  position: relative;
  width: 20px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.layout-toggle-icon::before {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 6px;
  border-left: 2px solid currentColor;
}

.layout-toggle-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  left: -8px;
  width: 5px;
  height: 5px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

body.sidebar-collapsed .layout-toggle-icon::after {
  right: -8px;
  left: auto;
  transform: rotate(225deg);
}

.topbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-actions button {
  padding: 0 16px;
}

.report-actions .primary {
  color: #fff;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
}

.report-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.scoreboard article {
  min-height: 126px;
  padding: 18px;
  border-radius: 8px;
}

.scoreboard p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.scoreboard strong {
  display: block;
  margin-bottom: 8px;
  font-family: Georgia, serif;
  font-size: 42px;
  line-height: 0.95;
}

.scoreboard span {
  color: var(--muted);
  font-size: 13px;
}

.hero-score {
  color: #fff;
  border-color: transparent !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent),
    var(--green-dark) !important;
}

.hero-score p,
.hero-score span {
  color: rgba(255, 255, 255, 0.78);
}

.hero-score strong {
  font-size: 58px;
}

.history-strip {
  display: grid;
  grid-template-columns: 0.9fr 0.8fr 1.5fr 1.5fr;
  gap: 14px;
  margin-bottom: 14px;
}

.history-strip article {
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.history-strip p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-strip strong {
  display: block;
  margin-bottom: 8px;
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 0.95;
}

.history-strip span {
  color: var(--muted);
  font-size: 13px;
}

.trend-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trend-heading p {
  margin: 0;
}

.trend-card canvas {
  display: block;
  width: 100%;
  height: 76px;
}

.citation-domain-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.citation-domain-trend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(45, 100, 120, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(45, 100, 120, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.citation-domain-trend b {
  color: var(--ink);
  font-family: Georgia, serif;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

.report-card {
  min-width: 0;
  padding: 20px;
  border-radius: 8px;
}

.span-2 {
  grid-column: 1 / -1;
}

.radar-card canvas {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  margin: 0 auto;
}

.card-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.diagnostics {
  display: grid;
  gap: 10px;
}

.diagnostic-item {
  padding: 12px;
  border-left: 4px solid var(--green);
  background: #f8f1e4;
  border-radius: 4px;
}

.diagnostic-item.warning {
  border-left-color: var(--amber);
}

.diagnostic-item.risk {
  border-left-color: var(--red);
}

.diagnostic-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.diagnostic-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dimension-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.dimension-item {
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.dimension-item strong {
  display: block;
  margin-bottom: 8px;
  font-family: Georgia, serif;
  font-size: 28px;
}

.dimension-item h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.dimension-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #33413d;
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 99px;
  background: #eadfcb;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.evidence-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.evidence-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffcf6;
}

.evidence-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.evidence-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.source-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  min-width: 0;
}

.source-links-title {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.source-links a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(45, 100, 120, 0.28);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(45, 100, 120, 0.08);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-links a em {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #fffcf6;
  background: var(--blue);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.source-links a span {
  min-width: 0;
}

.source-links a strong,
.source-links a small {
  display: block;
  min-width: 0;
}

.source-links a strong {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11px;
}

.source-links a small {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-empty {
  margin-top: 8px !important;
  color: #9a6b3a !important;
  font-style: italic;
}

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

.citation-metrics,
.domain-list,
.brand-source-list,
.provider-citation-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.citation-metric,
.domain-row,
.brand-source-row,
.provider-citation-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.citation-metric span,
.domain-row span,
.brand-source-row span,
.provider-citation-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.citation-metric strong {
  display: block;
  margin: 5px 0;
  font-family: Georgia, serif;
  font-size: 28px;
}

.domain-row strong,
.brand-source-row strong,
.provider-citation-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.citation-metric p,
.domain-row p,
.brand-source-row p,
.provider-citation-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.provider-citation-row em {
  display: block;
  margin-top: 8px;
  color: #554b41;
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
}

.provider-citation-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.provider-citation-row {
  border-left: 4px solid var(--blue);
}

.provider-citation-row span {
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
}

.prompt-intel-list {
  display: grid;
  gap: 8px;
}

.prompt-intel-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 92px 70px 70px 70px 110px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #fffcf6;
}

.prompt-intel-row.warning {
  border-left-color: var(--amber);
}

.prompt-intel-row.risk {
  border-left-color: var(--red);
}

.prompt-intel-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.prompt-intel-row p,
.prompt-intel-row em {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.prompt-intel-row span,
.prompt-intel-row b {
  min-width: 0;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #f8f1e4;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.prompt-intel-row b::before {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.prompt-intel-row b:nth-of-type(1)::before {
  content: "提及";
}

.prompt-intel-row b:nth-of-type(2)::before {
  content: "推荐";
}

.prompt-intel-row b:nth-of-type(3)::before {
  content: "引用";
}

.model-benchmark-list {
  display: grid;
  gap: 8px;
}

.model-benchmark-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(130px, 0.7fr) minmax(0, 1.6fr) 64px;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fffcf6;
}

.model-benchmark-row strong,
.model-benchmark-row p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-benchmark-row strong {
  white-space: nowrap;
  font-size: 13px;
}

.model-benchmark-row span {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.model-benchmark-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.model-benchmark-row b {
  display: grid;
  place-items: center;
  width: 48px;
  height: 36px;
  border-radius: 8px;
  color: var(--green-dark);
  background: #f8f1e4;
  font-family: Georgia, serif;
  font-size: 20px;
}

.batch-compare-panel {
  display: grid;
  gap: 12px;
}

.batch-summary {
  padding: 12px 14px;
  border: 1px solid rgba(31, 122, 90, 0.24);
  border-radius: 8px;
  color: var(--green-dark);
  background: rgba(31, 122, 90, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.batch-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.batch-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: #fffcf6;
}

.batch-metric.good {
  border-left-color: var(--green);
}

.batch-metric.risk {
  border-left-color: var(--red);
}

.batch-metric span,
.batch-delta-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.batch-metric strong {
  display: block;
  margin: 5px 0;
  font-family: Georgia, serif;
  font-size: 26px;
}

.batch-metric p,
.batch-delta-row p,
.batch-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.batch-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.batch-compare-grid h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.batch-delta-row {
  min-width: 0;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.batch-delta-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.verify-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 2px 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.verify-badge.verified {
  color: #fff;
  background: var(--green);
}

.verify-badge.partial {
  color: #4f3611;
  background: rgba(212, 148, 47, 0.32);
}

.verify-badge.unverified {
  color: #5f594e;
  background: #eadfcb;
}

.verify-badge.hallucination_risk {
  color: #fff;
  background: var(--red);
}

.verify-note {
  margin: 8px 0 0 !important;
  color: #6d6257 !important;
  font-size: 12px !important;
}

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

.sample-table {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.sample-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.55fr) minmax(108px, 0.5fr) minmax(170px, 0.95fr) minmax(220px, 1.35fr) minmax(138px, 0.65fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.sample-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.sample-row strong,
.sample-row p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.sample-row strong {
  font-size: 13px;
}

.match-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0;
  max-height: 44px;
  overflow: hidden;
}

.match-chips em {
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(31, 122, 90, 0.1);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.match-empty {
  margin-top: 7px !important;
  color: var(--muted) !important;
  font-size: 11px !important;
}

.raw-ref {
  margin-top: 8px !important;
  color: var(--blue) !important;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px !important;
  word-break: break-all;
}

.raw-response-button {
  width: 100%;
  margin: 8px 0 0;
  padding: 7px 9px;
  border: 1px solid rgba(45, 100, 120, 0.28);
  border-radius: 7px;
  color: var(--blue);
  background: rgba(45, 100, 120, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.raw-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.raw-dialog::backdrop {
  background: rgba(22, 33, 30, 0.52);
}

.raw-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.raw-dialog-head h3 {
  margin: 2px 0 0;
}

.raw-dialog-head button {
  padding: 8px 12px;
  border-radius: 7px;
  color: #fff;
  background: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

#rawResponseOutput {
  max-height: calc(100vh - 160px);
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #22302c;
  background: #fffcf6;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.history-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
}

.history-metric {
  padding: 8px;
  border-radius: 6px;
  background: #f8f1e4;
}

.history-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.history-metric b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-size: 20px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  background: #fffaf0;
  font-size: 12px;
  font-weight: 800;
}

.view-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f1e4;
}

.view-toggle button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.view-toggle button.active {
  color: #fff;
  background: var(--green-dark);
}

.report-preview {
  max-height: 720px;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: #22302c;
  line-height: 1.72;
}

.report-preview h1 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 38px);
}

.report-preview h2 {
  margin: 28px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.report-preview p,
.report-preview li {
  color: #33413d;
  font-size: 14px;
}

.report-preview ul {
  margin: 0 0 10px 20px;
  padding: 0;
}

.report-preview blockquote {
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--green);
  border-radius: 4px;
  background: #f8f1e4;
}

.report-preview blockquote p {
  margin: 0 0 8px;
  font-size: 13px;
}

.report-preview a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.report-preview a:hover {
  text-decoration: underline;
}

.report-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-preview table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  min-width: 720px;
}

.report-preview th,
.report-preview td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.report-preview th {
  color: var(--green-dark);
  background: #f8f1e4;
  font-weight: 900;
}

.report-table-wrap.cols-3 table {
  min-width: 560px;
}

.report-table-wrap.cols-4 table,
.report-table-wrap.cols-5 table {
  min-width: 760px;
}

.report-table-wrap.cols-5 th:nth-child(1),
.report-table-wrap.cols-5 td:nth-child(1) {
  width: 18%;
}

.report-table-wrap.cols-5 th:nth-child(2),
.report-table-wrap.cols-5 td:nth-child(2),
.report-table-wrap.cols-5 th:nth-child(3),
.report-table-wrap.cols-5 td:nth-child(3),
.report-table-wrap.cols-5 th:nth-child(4),
.report-table-wrap.cols-5 td:nth-child(4) {
  width: 12%;
}

.report-table-wrap.cols-5 th:nth-child(5),
.report-table-wrap.cols-5 td:nth-child(5) {
  width: 46%;
}

.report-table-wrap.cols-6 table,
.report-table-wrap.cols-9 table {
  min-width: 980px;
}

.report-preview tr:last-child td {
  border-bottom: 0;
}

.report-output {
  min-height: 360px;
  max-height: 620px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #22302c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  background: #fffcf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

[hidden] {
  display: none !important;
}

.pdf-export-stage {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  width: 794px;
  pointer-events: none;
}

.pdf-export-stage .report-preview {
  width: 794px;
  max-height: none;
  overflow: visible;
  padding: 48px;
  border: 0;
  border-radius: 0;
  background: #fffdf8;
}

.pdf-export-stage .report-table-wrap {
  overflow: visible;
}

.pdf-export-stage .report-preview table {
  min-width: 0;
}

.pdf-export-stage .report-preview th,
.pdf-export-stage .report-preview td {
  padding: 8px;
  font-size: 11px;
}

.pdf-export-stage .report-table-wrap.cols-6 th,
.pdf-export-stage .report-table-wrap.cols-6 td,
.pdf-export-stage .report-table-wrap.cols-9 th,
.pdf-export-stage .report-table-wrap.cols-9 td {
  padding: 6px 4px;
  font-size: 9px;
}



@media (max-width: 1180px) {
  .shell,
  .main-grid,
  .scoreboard,
  .history-strip,
  .citation-grid,
  .batch-metric-grid,
  .batch-compare-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .sidebar {
    display: none;
  }

  .dimension-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .sidebar,
  .workspace {
    padding: 18px;
  }

  .topbar,
  .actions,
  .batch-actions,
  .sample-actions,
  .provider-list,
  .sampling-controls,
  .sample-row,
  .history-item,
  .history-metrics,
  .prompt-intel-row {
    grid-template-columns: 1fr;
  }

  .intent-grid {
    grid-template-columns: 1fr;
  }

  .model-benchmark-row {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout-toggle {
    width: 40px;
  }

  .report-actions {
    width: 100%;
  }

  .report-actions button {
    flex: 1;
  }

  .dimension-list {
    grid-template-columns: 1fr;
  }
}

/* ─── 采样任务管理面板 ─── */

.task-manager-panel {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, auto) minmax(140px, auto) minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

.task-row.completed {
  border-left: 4px solid var(--green);
}

.task-row.running,
.task-row.queued {
  border-left: 4px solid var(--blue);
}

.task-row.partial {
  border-left: 4px solid var(--amber);
}

.task-row.failed {
  border-left: 4px solid var(--red);
}

.task-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.task-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.task-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.task-status.completed {
  color: #fff;
  background: var(--green);
}

.task-status.running {
  color: #fff;
  background: var(--blue);
}

.task-status.queued {
  color: var(--ink);
  background: rgba(99, 113, 109, 0.15);
}

.task-status.partial {
  color: #4f3611;
  background: rgba(212, 148, 47, 0.28);
}

.task-status.failed {
  color: #fff;
  background: var(--red);
}

.task-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-progress-bar {
  flex-basis: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(99, 113, 109, 0.14);
}

.task-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.task-error-badge {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--red);
  background: rgba(182, 79, 61, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.task-time p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.task-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  background: #fffaf0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.task-actions button:hover {
  background: #f8f1e4;
}

.task-refresh-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  background: #fffaf0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.task-refresh-btn:hover {
  background: #f8f1e4;
}


/* answer column overflow fix */
.sample-row > div:nth-child(3),
.sample-row > div:nth-child(4) {
  min-width: 0;
  overflow: hidden;
}

.sample-row > div:nth-child(3) p,
.sample-row > div:nth-child(4) p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-row > div:nth-child(4) .verify-note {
  display: block;
  overflow: visible;
  text-overflow: initial;
}

@media (max-width: 1180px) {
  .sample-row,
  .task-row {
    grid-template-columns: 1fr;
  }
}
