html[data-demo-variant] {
  --demo-accent: #0b7a53;
  --demo-accent-soft: #edf8f3;
  --demo-strong: #17372e;
  --demo-secondary: #1f519e;
  --demo-border: #dce4e1;
}

html[data-demo-variant="chengfa"] {
  --demo-accent: #087f8c;
  --demo-accent-soft: #edf9fa;
  --demo-strong: #173f45;
  --demo-secondary: #2f6b45;
  --demo-border: #d7e5e6;
}

html[data-demo-variant] .brand-logo { display: block; }
html[data-demo-variant] .brand { gap: 10px; align-items: center; }
html[data-demo-variant] .brand-copy { min-width: 0; max-width: 124px; white-space: normal; }
html[data-demo-variant] .brand-copy strong { color: var(--demo-strong); font-size: 17px; }
html[data-demo-variant] .brand-copy small { color: #667085; font-size: 10px; line-height: 1.4; }
html[data-demo-variant] .nav-item.active { color: var(--demo-accent); background: var(--demo-accent-soft); }
html[data-demo-variant] .nav-item.active::before { background: var(--demo-accent); }
html[data-demo-variant] .dataset-page[data-dste-current-section="overview"] > .dste-loop-rail { display: none; }

html[data-demo-variant="chengfa"] .nav-item[data-view="dste"],
html[data-demo-variant="chengfa"] .nav-item[data-view="base"],
html[data-demo-variant="chengfa"] [data-dste-section="insight"],
html[data-demo-variant="chengfa"] [data-dste-section="execution"],
html[data-demo-variant="chengfa"] [data-dste-section="performance"] { display: none !important; }

.demo-variant-page {
  min-width: 0;
  color: #172033;
  display: grid;
  gap: 12px;
}

.demo-variant-header {
  min-height: 112px;
  padding: 20px 22px;
  border: 1px solid var(--demo-border);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.demo-variant-heading { min-width: 0; max-width: 780px; }
.demo-variant-kicker { margin-bottom: 5px; color: var(--demo-accent); font-size: 12px; font-weight: 800; }
.demo-variant-heading h1 { margin: 0; color: var(--demo-strong); font-size: 24px; line-height: 1.3; letter-spacing: 0; }
.demo-variant-heading p { margin: 7px 0 0; color: #5f6b7d; font-size: 13px; line-height: 1.65; }
.demo-variant-tools { flex: 0 0 auto; display: grid; justify-items: end; gap: 10px; }
.demo-actor-line { color: #667085; font-size: 11px; }
.demo-actor-line b { color: #344054; }


.demo-summary-band {
  overflow: hidden;
  border: 1px solid var(--demo-border);
  border-radius: 6px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.demo-summary-item {
  min-width: 0;
  min-height: 76px;
  padding: 13px 16px;
  border-right: 1px solid #e8edf2;
  display: grid;
  align-content: center;
  gap: 4px;
}

.demo-summary-item:last-child { border-right: 0; }
.demo-summary-item small { color: #667085; font-size: 11px; }
.demo-summary-item b { color: #172033; font-size: 18px; overflow-wrap: anywhere; }
.demo-summary-item span { color: #7a8493; font-size: 10px; }

.demo-scenario-tabs {
  min-height: 42px;
  border-bottom: 1px solid #dfe5ec;
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.demo-scenario-tab {
  position: relative;
  min-height: 42px;
  padding: 0 2px 10px;
  border: 0;
  background: transparent;
  color: #667085;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.demo-scenario-tab:hover { color: var(--demo-accent); }
.demo-scenario-tab.active { color: var(--demo-strong); }
.demo-scenario-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--demo-accent); }

.demo-flow-rail {
  overflow-x: auto;
  border: 1px solid var(--demo-border);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.demo-flow-track {
  min-width: 880px;
  display: grid;
  grid-template-columns: repeat(var(--demo-step-count), minmax(166px, 1fr));
}

.demo-flow-step {
  position: relative;
  min-width: 0;
  min-height: 76px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-right: 1px solid #e6ebf0;
  background: #fff;
  color: #475467;
  text-align: left;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.demo-flow-step:last-child { border-right: 0; }
.demo-flow-step:hover { background: #f8fafb; }
.demo-flow-step.selected { background: var(--demo-accent-soft); }
.demo-flow-step.current::after { content: ""; position: absolute; right: 8px; bottom: 0; left: 8px; height: 3px; background: var(--demo-accent); }
.demo-flow-no { width: 30px; height: 30px; border: 1px solid #c8d5d1; border-radius: 50%; background: #f6f9f8; color: var(--demo-accent); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.demo-flow-step.done .demo-flow-no { border-color: var(--demo-accent); background: var(--demo-accent); color: #fff; }
.demo-flow-copy { min-width: 0; display: grid; gap: 4px; }
.demo-flow-copy b { overflow: hidden; color: #243044; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.demo-flow-copy small { overflow: hidden; color: #7a8493; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }

.demo-work-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 12px; }
.demo-work-main, .demo-work-side { min-width: 0; display: grid; gap: 12px; }
.demo-panel { min-width: 0; border: 1px solid var(--demo-border); border-radius: 6px; background: #fff; }
.demo-panel-head { min-height: 62px; padding: 12px 15px; border-bottom: 1px solid #e8edf2; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.demo-panel-head h2, .demo-panel-head h3 { margin: 0; color: #172033; font-size: 15px; line-height: 1.35; letter-spacing: 0; }
.demo-panel-head p { margin: 5px 0 0; color: #667085; font-size: 11px; line-height: 1.55; }
.demo-panel-body { min-width: 0; padding: 14px 15px; }

.demo-task-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #e3e8ee; border-radius: 5px; overflow: hidden; }
.demo-task-context > div { min-width: 0; min-height: 66px; padding: 10px 12px; border-right: 1px solid #e8edf2; display: grid; align-content: center; gap: 5px; }
.demo-task-context > div:last-child { border-right: 0; }
.demo-task-context small { color: #7a8493; font-size: 10px; }
.demo-task-context b, .demo-task-context span { color: #344054; font-size: 12px; overflow-wrap: anywhere; }
.demo-task-context b { color: #172033; }
.demo-decision { margin-top: 12px; padding: 11px 12px; border-left: 3px solid var(--demo-accent); background: var(--demo-accent-soft); color: #344054; font-size: 12px; line-height: 1.65; }
.demo-actions { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.demo-actions .btn.primary { border-color: var(--demo-accent); background: var(--demo-accent); }
.demo-actions .btn.primary:hover { filter: brightness(.96); }

.demo-table-wrap { overflow: auto; }
.demo-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.demo-table th { padding: 9px 10px; border-bottom: 1px solid #dfe5ec; background: #f7f9fb; color: #526071; font-size: 10px; font-weight: 800; text-align: left; }
.demo-table td { padding: 10px; border-bottom: 1px solid #e8edf2; color: #344054; font-size: 11px; line-height: 1.5; vertical-align: top; overflow-wrap: anywhere; }
.demo-table tbody tr:last-child td { border-bottom: 0; }
.demo-table td b { display: block; color: #172033; font-size: 11px; }
.demo-table td small { display: block; margin-top: 3px; color: #7a8493; }
.demo-link { padding: 0; border: 0; background: transparent; color: var(--demo-secondary); font: inherit; font-size: 11px; font-weight: 700; }
.demo-link:hover { text-decoration: underline; }

.demo-check-list, .demo-audit-list, .demo-ai-chain { display: grid; gap: 8px; }
.demo-check-item { min-width: 0; padding: 9px 10px; border: 1px solid #e3e8ee; border-radius: 5px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.demo-check-item b { color: #344054; font-size: 11px; }
.demo-check-item small { grid-column: 1 / -1; color: #7a8493; font-size: 10px; line-height: 1.5; }
.demo-audit-item { position: relative; min-width: 0; padding: 2px 0 10px 17px; border-left: 1px solid #dfe5ec; display: grid; gap: 3px; }
.demo-audit-item::before { content: ""; position: absolute; top: 4px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--demo-accent); }
.demo-audit-item b { color: #344054; font-size: 11px; }
.demo-audit-item small, .demo-audit-item span { color: #7a8493; font-size: 10px; line-height: 1.45; }
.demo-empty { min-height: 72px; color: #8a94a2; font-size: 11px; display: grid; place-items: center; text-align: center; }

.demo-status { display: inline-flex; width: fit-content; min-height: 22px; padding: 2px 8px; border: 1px solid #d8dfe8; border-radius: 999px; background: #f7f9fb; color: #667085; font-size: 10px; font-weight: 800; align-items: center; }
.demo-status.green { border-color: #a9dfc2; background: #edf9f2; color: #087346; }
.demo-status.amber { border-color: #f2d393; background: #fff8e7; color: #966400; }
.demo-status.red { border-color: #efb3b3; background: #fff1f1; color: #b42318; }
.demo-status.blue { border-color: #b9cbea; background: #eff5ff; color: #24599f; }

.demo-ai-chain > div { padding: 9px 10px; border-left: 3px solid #cbd5e1; background: #f8fafb; display: grid; gap: 4px; }
.demo-ai-chain > div:nth-child(2) { border-left-color: var(--demo-secondary); background: #f2f6fc; }
.demo-ai-chain > div:nth-child(3) { border-left-color: var(--demo-accent); background: var(--demo-accent-soft); }
.demo-ai-chain small { color: #7a8493; font-size: 10px; }
.demo-ai-chain b, .demo-ai-chain span { color: #344054; font-size: 11px; line-height: 1.5; }

.demo-drawer-backdrop { position: fixed; inset: 0; z-index: 1190; background: rgba(16, 24, 40, .28); }
.demo-flow-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200; width: min(840px, 62vw); min-width: 680px; background: #fff; border-left: 1px solid #d5dde7; box-shadow: -12px 0 28px rgba(16, 24, 40, .14); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.demo-drawer-head { min-height: 76px; padding: 16px 18px; border-bottom: 1px solid #e2e7ed; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.demo-drawer-head h2 { margin: 0; color: #172033; font-size: 18px; letter-spacing: 0; }
.demo-drawer-head p { margin: 5px 0 0; color: #667085; font-size: 11px; }
.demo-icon-button { width: 34px; height: 34px; border: 1px solid #d6dde7; border-radius: 5px; background: #fff; color: #475467; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.demo-icon-button:hover { color: var(--demo-accent); border-color: var(--demo-accent); }
.demo-drawer-tabs { padding: 0 18px; border-bottom: 1px solid #e2e7ed; display: flex; gap: 22px; }
.demo-drawer-tab { position: relative; min-height: 42px; padding: 0; border: 0; background: transparent; color: #667085; font: inherit; font-size: 12px; font-weight: 700; }
.demo-drawer-tab.active { color: var(--demo-strong); }
.demo-drawer-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--demo-accent); }
.demo-drawer-body { overflow: auto; padding: 16px 18px; }
.demo-drawer-section { display: grid; gap: 12px; }
.demo-drawer-section h3 { margin: 0; color: #172033; font-size: 14px; }
.demo-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #e1e7ed; border-radius: 5px; overflow: hidden; }
.demo-detail-grid > div { min-width: 0; min-height: 68px; padding: 10px 12px; border-right: 1px solid #e8edf2; border-bottom: 1px solid #e8edf2; display: grid; align-content: center; gap: 5px; }
.demo-detail-grid > div:nth-child(2n) { border-right: 0; }
.demo-detail-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.demo-detail-grid small { color: #7a8493; font-size: 10px; }
.demo-detail-grid b, .demo-detail-grid span { color: #344054; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.demo-drawer-foot { min-height: 66px; padding: 12px 18px; border-top: 1px solid #e2e7ed; background: #f8fafb; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-role-required { color: #667085; font-size: 11px; }
.demo-drawer-foot .btn.primary { border-color: var(--demo-accent); background: var(--demo-accent); }

@media (max-width: 1280px) {
  .demo-variant-header { display: grid; }
  .demo-variant-tools { justify-items: start; }
  .demo-work-grid { grid-template-columns: 1fr; }
  .demo-work-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-task-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-task-context > div:nth-child(2) { border-right: 0; }
  .demo-task-context > div:nth-child(-n+2) { border-bottom: 1px solid #e8edf2; }
  .demo-flow-drawer { width: min(900px, 72vw); min-width: 660px; }
}
