:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fafafc;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.16);
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --secondary: #f2f2f5;
  --danger: #c9342f;
  --good-bg: #edf8f1;
  --warn-bg: #fff7eb;
  --bad-bg: #fff0ef;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.08);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background: radial-gradient(circle at 80% -10%, #e9f2ff 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, #fff0e6 0%, transparent 35%), var(--bg);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  top: -42px;
  left: 14px;
  z-index: 99;
  padding: 8px 12px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 247, 0.74);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(var(--container), 100% - 32px);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.container {
  width: min(var(--container), 100% - 32px);
  margin: 30px auto 48px;
}

.hero {
  max-width: 760px;
  margin-bottom: 40px;
}

.hero h1 {
  margin: 0 0 16px 0;
  font-size: clamp(32px, 5.2vw, 54px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.5;
}

.view-nav {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.chip.active {
  border-color: #a5cbf7;
  background: #eef6ff;
  color: #0f62c9;
}

.stage {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
}

.view {
  display: none;
  animation: fade-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.view.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin: 0 0 16px 0;
  font-size: 30px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h3,
h4 {
  margin: 0 0 8px;
}

.muted {
  color: var(--text-secondary);
}

.panel > .muted {
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.one {
  grid-template-columns: 1fr;
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Onboarding 流程卡片 */
.process-cards {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
  position: relative;
  padding-left: 60px;
  text-align: left;
}

.process-card:first-child {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.process-card:last-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.process-card:not(:last-child) {
  border-bottom: none;
}

.process-badge {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-card .process-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.process-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text);
}

.process-card small {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
}

.process-connector {
  display: none;
}

/* 核心优势展示 */
.features-showcase {
  margin: 32px 0;
}

.features-showcase h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.features-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.feature-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.feature-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-box strong {
  display: block;
  font-size: 14px;
  margin: 0;
  color: var(--text);
}

.feature-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

/* 模板卡片新样式 */
.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 180ms ease;
  min-height: 170px;
  justify-content: center;
}

.template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.template-icon {
  font-size: 36px;
  margin-bottom: 8px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-card strong {
  display: block;
  margin: 4px 0 3px;
  font-size: 14px;
  color: var(--text);
}

.template-card small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.template-card:has(input:checked) {
  border-color: #9ec8f7;
  background: #eef6ff;
  box-shadow: 0 0 0 2px #e3f0ff inset, var(--shadow-sm);
}

.template-card:has(input:checked) strong {
  color: var(--primary);
}

.template-card:has(input:checked) small {
  color: var(--primary);
}

.template-card:has(input:checked) .template-icon {
  animation: bounce-icon 300ms ease;
}

@keyframes bounce-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.pill-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
}

.actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  appearance: none;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  cursor: pointer;
  transition: all 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.985);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.secondary {
  border-color: var(--line);
  background: var(--secondary);
  color: var(--text);
}

.btn.plain {
  border-color: var(--line);
  background: transparent;
  color: var(--text-secondary);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.selector-tools {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #d84a42;
  background: #fff8f8;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.template-card {
  position: relative;
}

.template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.template-card > span {
  display: block;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px;
  background: #fff;
  transition: all 180ms ease;
}

.template-card small,
.template-card em {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-style: normal;
}

.template-card input:checked + span {
  border-color: #9ec8f7;
  box-shadow: 0 0 0 2px #e3f0ff inset, var(--shadow-sm);
}

.summary-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.summary-bar p {
  margin: 0;
  color: var(--text-secondary);
}

.stepper {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.step.active {
  border-color: #9fc9f7;
  background: #eef6ff;
  color: #0f62c9;
}

.step.done {
  border-color: #bee4c8;
  background: #edf8f1;
  color: #1f7a3f;
}

.autosave {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.hint {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.error {
  display: block;
  min-height: 18px;
  margin-top: 4px;
  color: #b3261e;
  font-size: 13px;
}

.field-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.chips-wrap {
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.tag.active {
  border-color: #86b9f1;
  background: #eef6ff;
  color: #0f62c9;
}

.status-card .badge {
  margin: 0;
  color: var(--text-secondary);
}

.run-meta {
  margin: 4px 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.progress {
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #f2f2f5;
}

.progress > div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #0071e3, #28a0f0);
  transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.live {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}

.timeline {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.timeline li {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.timeline li.done {
  border-color: #b6dec0;
  background: var(--good-bg);
}

.timeline li.current {
  border-color: #9cc7f3;
  background: #eef6ff;
}

.progress-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.graph-workbench,
.timeline-workbench,
.history-detail-card {
  min-height: 100%;
}

.graph-workbench-head,
.timeline-workbench-head,
.history-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.graph-overlay-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}

.icon-btn:hover {
  border-color: #9cc7f3;
  color: #0f62c9;
  background: #ffffff;
}

.icon-btn.is-off {
  opacity: 0.72;
}

.graph-eye-icon {
  position: relative;
  width: 14px;
  height: 8px;
  border: 1.6px solid currentColor;
  border-radius: 100px / 70px;
}

.graph-eye-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.icon-btn.is-off .graph-eye-icon::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 3px;
  width: 18px;
  border-top: 1.6px solid currentColor;
  transform: rotate(-24deg);
}

.graph-summary {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-canvas-wrap {
  position: relative;
  margin-top: 14px;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
}

.graph-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
}

.graph-empty strong {
  color: var(--text);
  font-size: 18px;
}

.graph-empty p {
  margin: 0;
  max-width: 360px;
}

.graph-svg {
  width: 100%;
  height: 420px;
  display: none;
}

.graph-node-label,
.graph-link-label {
  fill: var(--text);
  font-size: 11px;
  pointer-events: none;
}

.graph-link-label {
  fill: var(--text-secondary);
}

.graph-svg.hide-edge-labels .graph-link-label {
  display: none;
}

.graph-detail {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.timeline-rich .timeline-item {
  overflow: hidden;
}

.timeline-head-button {
  width: 100%;
  border: 0;
  padding: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.timeline-head-button:disabled {
  cursor: default;
}

.timeline-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.timeline-index {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.timeline-item.done .timeline-index {
  background: var(--good-bg);
  color: #1f7a3f;
}

.timeline-item.current .timeline-index {
  background: #dcecff;
  color: #0f62c9;
}

.timeline-summary-text {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.timeline-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.timeline-status.status-done {
  background: var(--good-bg);
  color: #1f7a3f;
}

.timeline-status.status-current {
  background: #e7f1ff;
  color: #0f62c9;
}

.timeline-status.status-pending {
  background: #f2f2f5;
  color: var(--text-secondary);
}

.timeline-body {
  display: none;
  padding: 0 16px 16px;
}

.timeline-item.expanded .timeline-body {
  display: block;
}

.result-summary {
  min-height: 72px;
}

.history-detail-actions {
  margin-top: 0;
}

.history-interaction-hint {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  background: #f8fbff;
  color: var(--text-secondary);
}

.history-interaction-hint.is-info {
  border-color: var(--line);
  background: #f8fbff;
  color: var(--text-secondary);
}

.history-interaction-hint.is-loading {
  border-color: #9cc7f3;
  background: #eef6ff;
  color: #0f62c9;
}

.history-interaction-hint.is-success {
  border-color: #b6dec0;
  background: var(--good-bg);
  color: #1f7a3f;
}

.history-interaction-hint.is-error {
  border-color: #efb4b0;
  background: #fff0ef;
  color: #a7342e;
}

.history-detail-content {
  margin-top: 14px;
}

.history-detail-card {
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.history-detail-card.is-focus-pulse {
  border-color: #9cc7f3;
  box-shadow: 0 0 0 3px #e7f1ff inset, var(--shadow-sm);
}

.history-view-btn {
  min-height: 34px;
  padding: 0 12px;
}

.history-row {
  cursor: pointer;
}

.history-row:hover {
  background: #f7fbff;
}

.history-row.is-loading {
  opacity: 0.74;
}

tbody tr.is-selected {
  background: #eef6ff;
}

.artifact-section {
  margin-top: 12px;
}

.artifact-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.artifact-section-head .muted {
  margin: 4px 0 0;
}

.artifact-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.artifact-empty,
.artifact-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.artifact-empty {
  padding: 18px;
  color: var(--text-secondary);
  text-align: center;
}

.artifact-item {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.artifact-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.artifact-step,
.artifact-status,
.artifact-meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.artifact-step {
  background: #eef6ff;
  color: #0f62c9;
}

.artifact-status {
  background: var(--good-bg);
  color: #1f7a3f;
}

.artifact-item h4 {
  margin: 0;
  font-size: 16px;
}

.artifact-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.artifact-actions {
  margin-top: auto;
}

.artifact-dialog {
  width: min(920px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.artifact-dialog::backdrop {
  background: rgba(10, 14, 20, 0.42);
  backdrop-filter: blur(4px);
}

.artifact-dialog-shell {
  padding: 22px;
  background: #fff;
}

.artifact-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.artifact-kicker {
  margin: 0 0 6px;
}

.artifact-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artifact-meta-chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.artifact-content {
  margin: 16px 0 0;
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfbfd;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.artifact-detail-section + .artifact-detail-section {
  margin-top: 18px;
}

.artifact-detail-title {
  margin: 0 0 10px;
  font-size: 15px;
}

.artifact-detail-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.artifact-detail-row + .artifact-detail-row {
  margin-top: 8px;
}

.artifact-detail-label {
  color: var(--text-secondary);
  flex: 0 0 120px;
}

.artifact-detail-value {
  flex: 1;
  text-align: right;
  word-break: break-word;
}

.artifact-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.artifact-metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.artifact-metric-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.artifact-metric-card span {
  color: var(--text-secondary);
  font-size: 12px;
}

.report-chat-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-chat-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.report-chat-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 34px;
  padding: 0 10px;
}

.report-chat-refresh {
  min-height: 34px;
}

.report-chat-log {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-chat-empty {
  margin: auto;
  color: var(--text-secondary);
}

.report-chat-msg {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfbfe;
}

.report-chat-msg.user {
  border-color: #b8d7fa;
  background: #eef6ff;
}

.report-chat-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.report-chat-text {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.report-chat-input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 40px;
  font: inherit;
}

.report-chat-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.artifact-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.ontology-pane-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 2px;
}

.ontology-pane-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ontology-pane-btn.active {
  color: var(--primary);
  border-color: #7ca8d8;
  background: #eef6ff;
}

.artifact-chip-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.artifact-chip-card.compact {
  min-height: 0;
}

.artifact-chip-card strong {
  font-size: 14px;
}

.artifact-clickable {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button.artifact-clickable {
  text-align: left;
  width: 100%;
}

.artifact-clickable:hover {
  border-color: #9cc7f3;
  background: #f8fbff;
}

.artifact-clickable:focus-visible {
  outline: none;
  border-color: #0f62c9;
  box-shadow: 0 0 0 2px #e7f1ff;
}

.artifact-clickable.active {
  border-color: #7ca8d8;
  background: #eef6ff;
}

.artifact-chip-card span {
  color: var(--text-secondary);
  font-size: 12px;
}

/* 图谱样例节点详情面板 */
.graph-node-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.graph-node-detail-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.graph-node-detail-labels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.graph-node-label-badge {
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--text-secondary);
}

.graph-node-detail-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  word-break: break-word;
}

.graph-node-detail-uuid {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
  opacity: 0.7;
}

.artifact-relation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artifact-relation-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.rel-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
  word-break: break-all;
}

.rel-item-endpoints {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  line-height: 1.4;
}

.rel-ep-source,
.rel-ep-target {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rel-ep-arrow {
  color: var(--primary);
  font-size: 13px;
  flex-shrink: 0;
}

.artifact-type-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ontology-scroll-list {
  max-height: 34vh;
  overflow: auto;
  padding-right: 2px;
}

.ontology-scroll-list.artifact-chip-list {
  grid-template-columns: 1fr;
}

.relation-detail-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.relation-detail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.relation-detail-card-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.relation-detail-card .artifact-detail-row {
  border-radius: 10px;
}

/* 关系类型详情 - 新布局 */
.rel-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.rel-detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.rel-detail-raw-badge {
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--text-secondary);
  font-family: monospace;
  word-break: break-all;
}

.rel-detail-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rel-flow-box {
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  flex: 1;
  min-width: 60px;
  word-break: break-all;
}

.rel-flow-source,
.rel-flow-target {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-primary);
}

.rel-flow-rel {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.rel-flow-arrow {
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 700;
}

.rel-detail-desc-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}

.rel-detail-desc-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rel-detail-desc-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  word-break: break-word;
}

@media (max-width: 920px) {
  .relation-detail-split {
    grid-template-columns: 1fr;
  }
}

.ontology-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.ontology-list-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ontology-list-pane .artifact-detail-section {
  margin-top: 0;
}

.ontology-detail-pane {
  min-width: 0;
}

.ontology-detail-panel {
  position: sticky;
  top: 2px;
  margin-top: 0;
}

.ontology-detail-panel .artifact-detail-title {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfbfd;
  padding: 4px 0 8px;
}

.artifact-detail-value {
  text-align: left;
}

@media (max-width: 920px) {
  .ontology-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ontology-detail-panel {
    position: static;
  }

  .ontology-scroll-list {
    max-height: 28vh;
  }
}

.artifact-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

/* 自定义上传区域样式 */
.custom-upload-zone {
  margin: 20px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafafc;
}

.upload-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e7f1ff;
  color: #0f62c9;
  font-weight: 600;
  font-size: 14px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.section-meta {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 13px;
}

.upload-zone {
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 180ms ease;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: #f8fbff;
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: #e7f1ff;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.upload-icon {
  font-size: 32px;
  opacity: 0.6;
}

.upload-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.upload-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-icon {
  font-size: 18px;
}

.file-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.remove-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 100ms ease;
}

.remove-btn:hover {
  background: var(--secondary);
  color: var(--text);
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.upload-divider::before,
.upload-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.input-section {
  margin-bottom: 20px;
}

.input-wrapper {
  position: relative;
  margin-top: 10px;
}

.code-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px #e7f1ff;
}

.model-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: var(--primary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
}

.artifact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.artifact-table th,
.artifact-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ececf1;
  text-align: left;
  vertical-align: top;
}

.artifact-table th {
  color: var(--text-secondary);
  background: #f6f8fb;
}

.artifact-text-block,
.artifact-markdown-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artifact-text-block p,
.artifact-markdown-block p,
.artifact-markdown-block ul {
  margin: 0;
}

.artifact-markdown-block h3,
.artifact-markdown-block h4,
.artifact-markdown-block h5 {
  margin: 0;
}

.artifact-markdown-block ul {
  padding-left: 18px;
}

.log-panel {
  margin-top: 12px;
}

.log-panel summary {
  cursor: pointer;
  font-weight: 600;
}

#logWindow {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-soft);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}

#logWindow p {
  margin: 0 0 7px;
}

.hero-card h3 {
  margin: 8px 0;
  font-size: clamp(28px, 4.8vw, 42px);
  letter-spacing: -0.02em;
}

.hero-card h3 span {
  color: #0f62c9;
}

.positive {
  background: var(--good-bg);
}

.neutral {
  background: var(--warn-bg);
}

.danger-soft {
  background: var(--bad-bg);
}

.table-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #ececf1;
  padding: 10px;
  text-align: left;
}

th {
  color: var(--text-secondary);
  font-size: 13px;
}

.selection {
  margin: 10px 0;
}

.placeholder {
  border-style: dashed;
  color: var(--text-secondary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(20, 20, 24, 0.95);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

:where(button, [href], input, textarea, select, summary):focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

.member-dialog {
  width: min(860px, calc(100% - 24px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.member-dialog::backdrop {
  background: rgba(12, 16, 25, 0.42);
  backdrop-filter: blur(3px);
}

.member-dialog-shell {
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.member-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
}

.member-nav {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fafcff 0%, #f6f9ff 100%);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-nav-item {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  color: var(--text-secondary);
}

.member-nav-item[hidden] {
  display: none !important;
}

.member-nav-item strong {
  color: var(--text);
  font-size: 14px;
}

.member-nav-item small {
  font-size: 12px;
}

.member-nav-item.active {
  border-color: #9ac7f4;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px #d7e9fb;
}

.member-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-panel-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.member-panel-head {
  margin-bottom: 12px;
}

.member-panel-head h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.member-panel-head p {
  margin: 0;
  font-size: 13px;
}

.member-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.member-kicker {
  margin: 0 0 4px;
}

.member-dialog-title {
  margin: 0 0 6px;
  font-size: 22px;
}

.member-tabs {
  display: none;
}

.member-tab {
  display: none;
}

.member-tab.active {
  display: none;
}

.member-message {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fbff;
  color: #0f62c9;
  font-size: 14px;
}

.member-message.error {
  background: #fff0ef;
  color: #b93833;
}

.member-panel {
  display: none;
}

.member-panel[hidden] {
  display: none !important;
}

.member-panel.active {
  display: block;
}

.member-form {
  display: grid;
  gap: 12px;
}

.member-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.member-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 38px;
  padding: 0 10px;
  font: inherit;
}

.member-inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.member-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.member-plan-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.member-plan-btn.recommended {
  border-color: #69aef0;
  box-shadow: 0 8px 18px rgba(84, 151, 230, 0.16);
}

.member-plan-btn:hover {
  border-color: #97c3f0;
  background: #f8fbff;
}

.member-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #0f62c9;
  background: #e8f3ff;
  border: 1px solid #bfdcff;
}

.member-plan-btn strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.member-plan-btn small {
  display: block;
  color: var(--text-secondary);
}

.member-plan-efficiency {
  margin-top: 4px;
  color: #0f62c9;
}

.member-pay-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
  text-align: center;
}

.member-pay-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
}

#memberQrImage {
  width: 220px;
  height: 220px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.member-pay-amount {
  margin: 8px 0 4px;
  font-weight: 600;
}

.member-profile-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.member-profile-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

@keyframes token-pulse {
  0%   { background: #d4f7e5; }
  40%  { background: #a8eecb; }
  100% { background: transparent; }
}

.member-token-row {
  border-radius: 8px;
  padding: 2px 6px;
  margin: 0 -6px;
  transition: background 0.3s;
}

.member-token-row.token-increased {
  animation: token-pulse 1.6s ease forwards;
}

.member-token-val {
  font-weight: 700;
  font-size: 1.05em;
}

.member-token-diff {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #d4f7e5;
  color: #177a46;
  border: 1px solid #9fe8c2;
  animation: token-pulse 1.6s ease forwards;
}

@media (max-width: 980px) {
  .topbar-inner,
  .container {
    width: calc(100% - 24px);
  }

  .grid.three,
  .grid.two,
  .grid.four,
  .selector-tools {
    grid-template-columns: 1fr;
  }

  .process-card {
    padding-left: 50px;
  }

  .process-badge {
    width: 32px;
    height: 32px;
    font-size: 14px;
    left: 12px;
  }

  .features-items {
    grid-template-columns: 1fr;
  }

  .summary-bar,
  .autosave,
  .progress-shell,
  .graph-workbench-head,
  .timeline-workbench-head,
  .history-detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-shell {
    grid-template-columns: 1fr;
  }

  .artifact-dialog-shell {
    padding: 18px;
  }

  .artifact-dialog-head {
    flex-direction: column;
  }

  .artifact-detail-row {
    flex-direction: column;
  }

  .artifact-detail-value {
    text-align: left;
  }

  .timeline-head-button {
    flex-direction: column;
    align-items: stretch;
  }

  .report-chat-composer {
    grid-template-columns: 1fr;
  }

  .report-chat-composer .btn.primary {
    width: 100%;
  }

  .report-chat-select {
    width: 100%;
  }

  .member-dialog-shell {
    padding: 14px;
  }

  .member-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .member-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-dialog-head {
    flex-direction: column;
  }

  .member-inline-field {
    grid-template-columns: 1fr;
  }

  .member-profile-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
