:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-soft: #f8f9f6;
  --ink: #1f2925;
  --muted: #67716c;
  --line: #dce1dc;
  --line-strong: #c8d0ca;
  --green: #176b50;
  --green-dark: #0f523d;
  --green-soft: #e5f2ec;
  --amber: #a96312;
  --amber-soft: #fbefdc;
  --red: #a33c38;
  --red-soft: #fae9e7;
  --blue: #356d9a;
  --blue-soft: #e8f0f7;
  --violet: #72538f;
  --violet-soft: #f0eaf5;
  --shadow: 0 12px 34px rgba(28, 42, 34, 0.12);
  --topbar-height: 58px;
  --audit-panel-head-height: 116px;
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  display: block;
}

.is-hidden {
  display: none !important;
}

.login-view {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  background-color: #eef1ed;
}

.login-panel {
  width: min(400px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 8px;
  font-size: 22px;
}

.login-heading {
  margin-bottom: 28px;
}

.product-kicker,
.dialog-kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.login-heading h1,
.dialog h2,
.chain-toolbar h2,
.inspector h2,
.inspector h3 {
  margin: 0;
  line-height: 1.35;
}

.login-heading h1 {
  font-size: 25px;
}

.login-form,
.admin-form,
.form-stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label > span,
.field-label,
.select-label {
  color: #4f5b55;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 107, 80, 0.12);
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.button img,
.icon-button img,
.search-control img,
.empty-state img,
.dialog-alert-icon,
.inline-icon {
  width: 17px;
  height: 17px;
}

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

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  color: var(--green-dark);
  border-color: #b9d6ca;
  background: var(--green-soft);
}

.button-ghost {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.button-danger {
  color: var(--red);
  border-color: #e8c7c4;
  background: var(--red-soft);
}

.danger-icon-button {
  color: var(--red);
  border-color: #e8c7c4;
  background: var(--red-soft);
}

.login-submit {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button-small {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.app-view {
  height: 100%;
}

.topbar {
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.return-industry-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px 0 9px;
  border-color: var(--amber);
  color: #fff;
  background: var(--amber);
  box-shadow: 0 2px 0 rgba(169, 99, 18, 0.16);
  font-weight: 800;
}

.return-industry-button:hover {
  border-color: #8e500d;
  background: #8e500d;
}

.return-industry-button img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.app-brand {
  display: inline-flex;
  min-width: 250px;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.app-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
}

.app-brand strong {
  display: block;
  font-size: 14px;
}

.topbar-context {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-context span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-divider {
  width: 1px;
  height: 18px;
  flex: 0 0 1px;
  background: var(--line);
}

.topbar-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 10px;
}

.topbar-user {
  position: relative;
}

.user-avatar {
  display: inline-flex;
  width: auto;
  min-width: 34px;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 9px 0 3px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.user-avatar:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.cartoon-avatar {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  overflow: hidden;
  border-radius: 50%;
  background: #dceee6;
}

.cartoon-avatar-face {
  position: absolute;
  left: 6px;
  top: 7px;
  width: 16px;
  height: 18px;
  border-radius: 45% 45% 50% 50%;
  background: #f0c7a6;
}

.cartoon-avatar-hair {
  position: absolute;
  z-index: 2;
  left: 5px;
  top: 4px;
  width: 18px;
  height: 9px;
  border-radius: 10px 10px 5px 4px;
  background: #35433c;
  transform: rotate(-4deg);
}

.cartoon-avatar-eyes::before,
.cartoon-avatar-eyes::after {
  position: absolute;
  top: 7px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #35433c;
  content: "";
}

.cartoon-avatar-eyes::before {
  left: 4px;
}

.cartoon-avatar-eyes::after {
  right: 4px;
}

.cartoon-avatar-smile {
  position: absolute;
  left: 6px;
  top: 11px;
  width: 5px;
  height: 3px;
  border-bottom: 1px solid #8b5143;
  border-radius: 50%;
}

.user-account-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .user-avatar {
    width: 34px;
    padding: 0 3px;
  }

  .user-account-name {
    display: none;
  }
}

.user-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 2px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu-name {
  overflow: hidden;
  max-width: 200px;
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  gap: 8px;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--bg);
}

.user-menu-item img {
  width: 15px;
  height: 15px;
}

.top-progress {
  display: grid;
  width: 118px;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.progress-track {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7eae7;
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.workspace {
  display: grid;
  height: calc(100% - var(--topbar-height));
  grid-template-columns: 320px minmax(420px, 1fr) clamp(500px, 38vw, 600px);
  overflow: hidden;
}

.chain-sidebar,
.inspector {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.chain-sidebar {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
}

.sidebar-head,
.queue-tools,
.queue-summary {
  padding: 14px;
}

.sidebar-head {
  position: relative;
  display: grid;
  height: var(--audit-panel-head-height);
  align-content: center;
  gap: 8px;
  padding: 14px 14px 14px 62px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-head::before,
.chain-toolbar::before {
  content: "";
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 6px;
  background-color: var(--green-soft);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.sidebar-head::before {
  position: absolute;
  top: 50%;
  left: 14px;
  background-image: url("/assets/icons/list-filter.svg");
  transform: translateY(-50%);
}

.sidebar-head .select-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.industry-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.queue-tools {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.search-control {
  position: relative;
  display: block;
}

.search-control img {
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0.52;
}

.search-control input {
  padding-left: 34px;
}

.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented-control button {
  min-height: 32px;
  padding: 5px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.is-active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 8px;
}

.queue-summary strong {
  font-size: 12px;
}

.chain-list {
  overflow: auto;
  padding: 0 8px 16px;
}

.chain-queue-pagination {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.chain-list-section + .chain-list-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chain-list-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 7px;
  color: var(--muted);
  font-size: 10px;
}

.chain-list-section-head strong {
  color: var(--ink);
  font-size: 11px;
}

.chain-list-section-head span {
  font-variant-numeric: tabular-nums;
}

.chain-list-item {
  display: grid;
  width: 100%;
  min-height: 78px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 4px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  background: transparent;
}

.chain-list-item:hover {
  background: var(--surface-soft);
}

.chain-list-item.is-active {
  border-color: #a9cdbf;
  background: var(--green-soft);
}

.chain-list-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.chain-list-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.chain-list-copy > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-list-copy > strong {
  display: -webkit-box;
  white-space: normal;
  line-height: 1.45;
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chain-route-name > span {
  display: inline;
  margin: 0 4px 0 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.chain-route-name.is-isolated > span {
  color: var(--amber);
}

.chain-route-name b {
  margin: 0 4px;
  color: var(--green);
}

.chain-list-meta {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
}

.mini-status,
.status-chip,
.group-chip,
.value-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 750;
}

.mini-status {
  padding: 3px 6px;
  color: var(--muted);
  background: #eef0ee;
}

.mini-status.is-completed {
  color: var(--green-dark);
  background: #dceee6;
}

.mini-status.has-issue {
  color: #a52f2f;
  background: #fdeaea;
  white-space: normal;
}

.mini-time {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  white-space: normal;
}

.mini-weight {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border: 1px solid #a9cdbf;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mini-weight.is-unconfirmed {
  border-color: #e1bf8d;
  color: #87500f;
  background: var(--amber-soft);
}

.required-mark {
  margin-left: 3px;
  color: #c83232;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.missing-required-state {
  display: grid;
  gap: 5px;
  border: 1px solid #efb4b4;
  color: var(--muted);
  background: #fff7f7;
}

.missing-required-state strong {
  color: #a52f2f;
  font-size: 12px;
}

.chain-workbench {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.chain-toolbar {
  display: flex;
  height: var(--audit-panel-head-height);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.chain-toolbar::before {
  background-image: url("/assets/icons/route.svg");
}

.path-nav,
.chain-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.path-nav {
  flex: 1;
  min-width: 0;
}

.chain-actions {
  flex: 0 0 auto;
}

.path-nav > div {
  min-width: 0;
}

.path-position {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.chain-toolbar h2 {
  max-width: 100%;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  min-height: 28px;
  padding: 5px 9px;
}

.status-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.chain-canvas {
  min-width: 0;
  overflow: auto;
  padding: 16px;
  background-color: var(--bg);
}

.chain-track {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
}

.chain-row {
  display: flex;
  width: min(100%, calc(var(--factor-width) + var(--factor-width) + var(--factor-width) + var(--edge-width) + var(--edge-width)));
  min-width: 0;
  margin: 0 auto;
  align-items: center;
  justify-content: flex-start;
}

.chain-row.is-reverse {
  flex-direction: row-reverse;
}

.chain-row.is-reverse .edge-arrow img {
  margin-right: -2px;
  margin-left: 0;
  transform: rotate(180deg);
}

.chain-turn {
  display: flex;
  width: min(100%, calc(var(--factor-width) + var(--factor-width) + var(--factor-width) + var(--edge-width) + var(--edge-width)));
  height: 48px;
  margin: 0 auto;
  padding: 0 calc((var(--factor-width) - var(--edge-width)) / 2);
}

.chain-turn.is-left {
  justify-content: flex-start;
}

.chain-turn.is-right {
  justify-content: flex-end;
}

.chain-turn .edge-node {
  min-height: 48px;
  flex-basis: var(--edge-width, 34px);
}

.chain-turn .edge-node-inner {
  height: 100%;
  gap: 0;
  padding: 0 2px;
}

.chain-turn .edge-arrow {
  height: 30px;
  flex-direction: column;
}

.chain-turn .edge-arrow::before {
  width: 2px;
  height: auto;
}

.chain-turn .edge-arrow img,
.chain-turn.is-left .edge-arrow img,
.chain-turn.is-right .edge-arrow img {
  width: 16px;
  height: 16px;
  margin: -2px 0 0;
  transform: rotate(90deg);
}

.factor-node {
  display: grid;
  width: var(--factor-width, 154px);
  height: 104px;
  flex: 0 0 var(--factor-width, 154px);
  grid-template-rows: auto 1fr auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--group-color, var(--green));
  border-radius: 7px;
  text-align: left;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(34, 49, 40, 0.06);
}

.factor-node:hover {
  border-color: var(--group-color, var(--green));
}

.factor-node.is-selected {
  outline: 3px solid rgba(23, 107, 80, 0.2);
  border-color: var(--green);
}

.factor-node.is-missing {
  border-bottom-color: #d9a04f;
}

.node-topline,
.edge-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.node-sequence {
  display: grid;
  width: 23px;
  height: 21px;
  flex: 0 0 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.group-chip {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  text-overflow: ellipsis;
  color: var(--group-color, var(--green));
  background: var(--group-bg, var(--green-soft));
}

.node-history-badge {
  flex: 0 0 auto;
  padding: 2px 4px;
  border: 1px solid #cfd8d3;
  border-radius: 4px;
  color: #53635b;
  background: #f3f6f4;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.factor-node h3 {
  display: -webkit-box;
  margin: 5px 0 2px;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.factor-node p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.edge-node {
  display: grid;
  width: var(--edge-width, 36px);
  min-height: 82px;
  flex: 0 0 var(--edge-width, 36px);
  place-items: center stretch;
  padding: 2px;
  border: 0;
  background: transparent;
}

.edge-node-inner {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.edge-node:hover .edge-node-inner,
.edge-node.is-selected .edge-node-inner {
  border-color: var(--line-strong);
  background: var(--surface);
}

.edge-arrow {
  display: flex;
  align-items: center;
}

.edge-arrow::before {
  content: "";
  height: 2px;
  flex: 1;
  background: var(--edge-color, var(--green));
}

.edge-arrow img {
  width: 18px;
  height: 18px;
  margin-left: -2px;
  filter: var(--edge-filter, none);
}

.edge-node.is-negative {
  --edge-color: var(--red);
}

.edge-node.is-neutral {
  --edge-color: #7b8580;
}

.edge-node.is-conditional {
  --edge-color: var(--amber);
}

.source-fields {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px;
}

.source-fields dt {
  font-weight: 700;
}

.source-fields dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.edge-meta {
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--muted);
  font-size: 10px;
}

.edge-meta strong {
  color: var(--ink);
  font-size: 12px;
}

.density-compact .factor-node {
  height: 98px;
  min-height: 98px;
  padding: 8px;
}

.density-compact .factor-node p {
  -webkit-line-clamp: 1;
}

.density-tight .factor-node p,
.density-tight .edge-meta {
  display: none;
}

.density-tight .factor-node {
  height: 92px;
  min-height: 92px;
  padding: 7px 5px;
}

.density-tight .group-chip {
  padding: 2px 4px;
  font-size: 9px;
}

.density-tight .node-history-badge {
  padding: 2px 3px;
  font-size: 7px;
}

.density-tight .factor-node h3 {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  -webkit-line-clamp: 4;
}

.node-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.node-weight {
  color: var(--ink);
  font-weight: 800;
}

.empty-state,
.inspector-empty,
.panel-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  height: 100%;
}

.empty-state img,
.inspector-empty img {
  width: 28px;
  height: 28px;
  opacity: 0.48;
}

.footer-tools,
.dynamic-field-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector {
  position: relative;
  border-left: 1px solid var(--line);
}

.inspector-shell {
  --inspector-accent: var(--green);
  --inspector-soft: var(--green-soft);
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.inspector-atom {
  --inspector-accent: var(--violet);
  --inspector-soft: var(--violet-soft);
}

.inspector-link {
  --inspector-accent: var(--blue);
  --inspector-soft: var(--blue-soft);
}

.inspector-chain {
  --inspector-accent: var(--amber);
  --inspector-soft: var(--amber-soft);
}

.inspector-relation {
  --inspector-accent: var(--amber);
  --inspector-soft: var(--amber-soft);
}

.inspector-head {
  display: flex;
  height: var(--audit-panel-head-height);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.inspector-type-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--inspector-soft);
}

.inspector-type-icon img {
  width: 18px;
  height: 18px;
}

.inspector-head-copy {
  flex: 1;
  min-width: 0;
}

.inspector-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.inspector-delete-factor {
  color: var(--red);
}

.inspector-delete-factor:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.danger-icon-button img {
  filter: brightness(0) saturate(100%) invert(28%) sepia(18%) saturate(2520%) hue-rotate(326deg) brightness(89%) contrast(88%);
}

.inspector-history-back:disabled {
  cursor: default;
  opacity: 0.3;
}

.inspector-head-copy span {
  color: var(--inspector-accent);
  font-size: 10px;
  font-weight: 800;
}

.inspector-head h2 {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.inspector-version {
  display: inline-flex;
  margin-top: 4px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.inspector-version:hover {
  color: var(--inspector-accent);
  text-decoration: underline;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 3), minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.inspector-tabs button {
  min-height: 40px;
  padding: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

.inspector-tabs button.is-active {
  color: var(--inspector-accent);
  border-bottom-color: var(--inspector-accent);
}

.inspector-body {
  overflow: auto;
  padding: 16px;
}

.inspector-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.inspector-footer > .button-primary {
  margin-left: auto;
}

/* 因子信息页签整体缩小一号，其他页签与对象类型保持全局字号 */
#inspectorBody.factor-info-compact label > span,
#inspectorBody.factor-info-compact .tag-editor-label {
  font-size: 12px;
}

#inspectorBody.factor-info-compact input,
#inspectorBody.factor-info-compact select,
#inspectorBody.factor-info-compact textarea,
#inspectorBody.factor-info-compact .tag-editor-input {
  font-size: 12px;
}

#inspectorBody.factor-info-compact .section-heading h3 {
  font-size: 12px;
}

#inspectorFooter.factor-info-compact .button {
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}

.section-heading h3 {
  font-size: 13px;
}

.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.connection-overview,
.connection-list {
  display: grid;
  gap: 8px;
}

.connection-section + .current-factor-strip,
.current-factor-strip + .connection-section {
  margin-top: 14px;
}

.connection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.connection-main {
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
}

.connection-factor-name,
.connection-factor-name strong,
.connection-meta {
  display: block;
}

.connection-factor-name small {
  margin-right: 6px;
  color: var(--inspector-accent);
  font-size: 9px;
  font-weight: 800;
}

.connection-factor-name strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.connection-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.current-factor-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-left: 3px solid var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.current-factor-strip img {
  width: 16px;
  height: 16px;
}

.current-factor-strip span {
  font-size: 9px;
  font-weight: 800;
}

.current-factor-strip strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.connection-footer-note {
  color: var(--muted);
  font-size: 10px;
}

.form-grid {
  display: grid;
  gap: 13px;
}

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

.full-width {
  grid-column: 1 / -1;
}

.weight-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
}

.weight-control input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--green);
  box-shadow: none;
}

.chain-weight-level-control {
  display: grid;
  gap: 8px;
}

.chain-weight-level-control input[type="range"] {
  width: 100%;
  min-height: 28px;
  padding: 0;
  accent-color: var(--blue);
  box-shadow: none;
}

.chain-weight-level-labels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.chain-weight-level-label {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 3px;
  padding: 5px 3px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.chain-weight-level-label small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.chain-weight-level-index {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.chain-weight-level-critical .chain-weight-level-index {
  background: var(--red);
}

.chain-weight-level-high .chain-weight-level-index {
  background: var(--amber);
}

.chain-weight-level-medium .chain-weight-level-index {
  background: var(--blue);
}

.chain-weight-level-low .chain-weight-level-index {
  background: var(--violet);
}

.chain-weight-level-none .chain-weight-level-index {
  background: var(--muted);
}

.chain-weight-level-label.is-selected {
  color: var(--ink);
  font-weight: 700;
}

.chain-weight-level-label.chain-weight-level-critical.is-selected {
  border-color: color-mix(in srgb, var(--red) 36%, transparent);
  background: var(--red-soft);
}

.chain-weight-level-label.chain-weight-level-high.is-selected {
  border-color: color-mix(in srgb, var(--amber) 36%, transparent);
  background: var(--amber-soft);
}

.chain-weight-level-label.chain-weight-level-medium.is-selected {
  border-color: color-mix(in srgb, var(--blue) 36%, transparent);
  background: var(--blue-soft);
}

.chain-weight-level-label.chain-weight-level-low.is-selected {
  border-color: color-mix(in srgb, var(--violet) 36%, transparent);
  background: var(--violet-soft);
}

.chain-weight-level-label.chain-weight-level-none.is-selected {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.chain-score-control {
  display: block;
}

.chain-weight-validation.is-error {
  color: var(--red);
  font-weight: 700;
}

.chain-score-control input[type="number"] {
  width: 100%;
}

.link-weight-editor {
  display: grid;
  gap: 13px;
}

.field-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.dynamic-fields {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dynamic-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.atom-list,
.history-list,
.observation-list,
.user-list {
  display: grid;
  gap: 8px;
}

.atom-row,
.history-row,
.observation-row,
.user-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.atom-row {
  padding: 12px;
}

.atom-row-head,
.observation-row-head,
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.observation-row-head > div:first-child {
  min-width: 0;
}

.observation-value {
  display: block;
  margin-top: 4px;
}

.atom-row h4,
.observation-row strong,
.user-row strong {
  margin: 0;
  font-size: 12px;
}

.atom-formula {
  margin: 9px 0;
  padding: 8px;
  border-left: 3px solid #b8c9c0;
  color: #405048;
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.55;
}

.atom-actions,
.row-actions {
  display: flex;
  gap: 6px;
}

.small-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.observation-row {
  padding: 10px;
}

.observation-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.observation-value {
  color: var(--green-dark);
  font-weight: 800;
}

.history-row {
  padding: 11px;
}

.history-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.history-audit-meta {
  display: grid;
  gap: 3px;
}

.history-row strong {
  color: var(--ink);
}

.change-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #eef0ee;
  font-size: 10px;
}

.change-values {
  overflow-wrap: anywhere;
}

.change-old {
  color: var(--red);
  text-decoration: line-through;
}

.change-new {
  color: var(--green-dark);
}

.empty-inline {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(25, 32, 28, 0.38);
}

.dialog > form,
.dialog > .admin-layout,
.dialog > .dialog-copy,
.dialog > .dialog-actions {
  margin: 0;
}

.dialog form {
  margin: 0;
}

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

.dialog h2 {
  font-size: 17px;
}

.dialog .form-grid {
  padding: 18px 20px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

/* 对话框左下角的独立操作按钮（例如「还原行业数据」） */
.dialog-actions-leading {
  margin-right: auto;
}

.dialog-actions .is-restoring img {
  animation: button-spin 0.9s linear infinite;
}

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

.dialog-wide {
  width: min(850px, calc(100% - 32px));
}

#relationDialog {
  overflow: hidden;
}

#relationDialog[open] {
  display: flex;
  max-height: calc(100dvh - 40px);
  flex-direction: column;
}

#relationDialog .dialog-head,
#relationDialog .dialog-actions {
  flex: none;
  background: #fff;
}

#relationDialog #relationForm {
  min-height: 0;
  overflow-y: auto;
}

#relationDialog .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.dialog-compact {
  width: min(460px, calc(100% - 32px));
}

.dialog-copy {
  padding: 20px;
  color: var(--muted);
  line-height: 1.7;
}

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

.factor-delete-body {
  padding: 18px 20px;
}

.factor-delete-body .dialog-copy {
  margin: 0 0 14px;
  padding: 0;
}

.reconnect-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b9d6ca;
  border-radius: 6px;
  background: var(--green-soft);
}

.reconnect-option input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.reconnect-option strong,
.reconnect-option small {
  display: block;
}

.reconnect-option strong {
  color: var(--green-dark);
  font-size: 12px;
}

.reconnect-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.dialog-mode {
  width: max-content;
  margin: 16px 20px 0;
}

.dialog-notice {
  margin: 0;
  padding: 0 20px 16px;
  color: var(--amber);
  font-size: 11px;
  line-height: 1.6;
}

.form-subgrid {
  display: contents;
}

.existing-atom-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.existing-atom-search .button {
  min-height: 36px;
}

.existing-atom-status {
  min-height: 18px;
  margin: -4px 0 0;
}

.dialog-alert-icon {
  width: 24px;
  height: 24px;
}

.admin-layout {
  display: grid;
  min-height: 370px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.user-list {
  align-content: start;
  padding: 16px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.user-row {
  padding: 11px;
}

.user-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.admin-form {
  align-content: start;
  padding: 18px;
}

.admin-form h3 {
  margin: 0;
  font-size: 14px;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-control input {
  width: 16px;
  min-height: 16px;
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: toast-in 160ms ease-out;
}

.toast.is-error {
  border-left-color: var(--red);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.industry-tree-view {
  height: calc(100% - var(--topbar-height));
  overflow: auto;
  padding: 24px clamp(16px, 3vw, 42px) 36px;
  background: var(--bg);
}

.news-view { height: calc(100% - var(--topbar-height)); overflow: auto; padding: 20px clamp(14px, 2.4vw, 36px) 32px; background: #f4f7fb; }
.news-page-heading, .news-page-actions { display: flex; align-items: center; }
.news-page-heading { width: min(1600px, 100%); margin: 0 auto 16px; justify-content: space-between; gap: 18px; }
.news-page-heading h1 { margin: 3px 0 4px; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; }
.news-page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.news-page-actions { gap: 10px; }
.news-sub-tabs { display: flex; width: min(1600px, 100%); gap: 0; margin: 0 auto 12px; border-bottom: 1px solid var(--line); }
.news-sub-tab { position: relative; min-width: 108px; padding: 10px 16px; border: 0; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.news-sub-tab:hover { color: var(--green-dark); background: #f7faf7; }
.news-sub-tab.is-active { color: var(--green-dark); font-weight: 600; }
.news-sub-tab.is-active::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--green); content: ""; }
.news-source-strip { display: flex; align-items: center; gap: 9px; width: min(1600px, 100%); margin: 0 auto 12px; padding: 9px 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; }
.news-source-strip strong { color: #354039; font-weight: 600; }
.news-source-indicator { width: 7px; height: 7px; border-radius: 50%; background: #a9afa9; }
.news-source-indicator.is-live { background: #2c8b64; box-shadow: 0 0 0 3px #e8f4ed; }

.news-analysis-heading,
.news-analysis-actions,
.news-list-toolbar,
.news-row-main,
.news-section-heading,
.news-graph-card > div:first-child {
  display: flex;
  align-items: center;
}

.news-analysis-heading { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.news-analysis-heading h2 { margin: 2px 0 3px; font-size: 22px; }
.news-analysis-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.news-analysis-actions { gap: 12px; }
.news-status { color: var(--muted); font-size: 12px; }
.news-analysis-grid { display: block; width: min(1600px, 100%); margin: 0 auto; }
.news-workbench { display: flex; width: min(1600px, 100%); flex-direction: column; gap: 14px; margin: 0 auto; }
.news-news-tab-panel { width: 100%; }
.news-impact-selector { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.news-impact-selector-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.news-impact-selector-body select { min-width: 0; flex: 1; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #354039; font-size: 12px; }
.news-impact-selector-hint { color: var(--muted); font-size: 11px; }
.news-list-pane, .news-detail { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.news-list-toolbar { justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.news-list-toolbar strong { white-space: nowrap; font-size: 12px; }
.news-list-toolbar input { width: min(100%, 170px); min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; }
.news-list { min-height: 0; max-height: 620px; overflow-y: auto; }
.news-list-pane { display: flex; flex-direction: column; min-height: 0; }
.news-detail { min-height: 0; overflow: visible; padding: 22px clamp(16px, 2vw, 30px); }
.news-module-header, .news-module-empty, .news-result-header { display: flex; align-items: center; gap: 10px; }
.news-module-header { padding: 13px 14px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.news-module-header strong, .news-result-header strong, .news-module-empty strong { display: block; color: #354039; font-size: 13px; }
.news-module-header small, .news-result-header small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.news-module-index { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border: 1px solid #9db8a3; border-radius: 50%; color: var(--green-dark); font: 10px ui-monospace, monospace; }
.news-module-empty { min-height: 150px; padding: 22px; color: var(--muted); }
.news-module-empty p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; }
.news-result-header { justify-content: space-between; margin: -2px 0 14px; padding: 0 0 12px; border-bottom: 1px solid #e8ebe7; }
.news-result-header > div { display: flex; align-items: center; gap: 9px; }
.news-result-header > div > div { display: block; }
.news-report-summary-panel { margin-top: 17px; padding: 14px; border: 1px solid #dbe7dc; border-left: 3px solid var(--green); background: #f7fbf7; }
.news-report-summary-panel .news-section-heading { margin-bottom: 8px; }
.news-report-summary-panel .news-section-heading > div:first-child { display: flex; align-items: center; gap: 9px; }
.news-report-summary-panel h3 { margin: 0; font-size: 14px; }
.news-summary-actions { display: flex; align-items: center; gap: 10px; }
.news-summary-actions .button { min-height: 28px; padding: 4px 10px; font-size: 11px; }
.news-report-summary-panel p { margin: 6px 0 0; color: #536058; font-size: 11px; line-height: 1.7; }
.news-report-summary-panel .news-summary-conclusion { color: #354039; font-size: 12px; }
.news-report-summary-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.news-report-summary-meta > div { padding: 8px 9px; border: 1px solid #e1eae1; background: #fff; }
.news-report-summary-meta small { display: block; color: var(--muted); font-size: 10px; }
.news-report-summary-meta strong { display: block; margin-top: 3px; color: #354039; font-size: 11px; }
.news-filter-toolbar { display: flex; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.news-filter-toolbar select { min-width: 0; width: 50%; padding: 6px 7px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #536058; font-size: 11px; }
.news-pagination { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.news-pagination .button { min-height: 27px; padding: 3px 8px; font-size: 10px; }
.news-row { display: flex; align-items: stretch; border-bottom: 1px solid #edf0ed; }
.news-row:last-child { border-bottom: 0; }
.news-row.is-selected { background: #f0f6f1; box-shadow: inset 3px 0 var(--green); }
.news-row-main { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; padding: 10px 12px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.news-row-main strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 1.45; }
.news-row-meta, .news-row-status, .news-muted { color: var(--muted); font-size: 11px; }
.news-row-status.is-error { color: var(--red); }
.news-retry-button { align-self: center; flex: 0 0 auto; margin-right: 9px; padding: 5px 8px; border: 1px solid #e4c7c4; border-radius: 5px; color: var(--red); background: #fff; font-size: 11px; }
.news-list-table-head, .news-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px 90px 86px 90px; gap: 12px; align-items: center; }
.news-list-table-head { min-height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f7faff; color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .06em; }
.news-row { padding: 10px 14px; border-bottom: 1px solid #edf0ed; }
.news-row-source { min-width: 0; }
.news-row-source strong, .news-row-source span, .news-row-source em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-row-source strong { color: #354039; font: 11px ui-monospace, monospace; }
.news-row-source span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.news-row-source em { margin-top: 4px; color: #a87422; font-size: 10px; font-style: normal; }
.news-row-main { display: block; width: 100%; min-width: 0; padding: 0; }
.news-row-main strong, .news-row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-row-main strong { color: #354039; font-size: 12px; line-height: 1.45; }
.news-row-main span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.news-row-theme { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.news-row-theme span { max-width: 100%; overflow: hidden; padding: 3px 5px; border: 1px solid #dfe8df; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.news-row-impact { width: fit-content; }
.news-row-status { white-space: nowrap; }
.news-row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.news-row-detail { height: 27px; padding: 0 8px; border: 1px solid #9bb8ee; color: #3b70c9; background: #f6f9ff; font-size: 10px; cursor: pointer; }
.news-row-detail:hover { background: #edf4ff; }
.news-list-empty, .news-empty { padding: 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.news-detail { padding: 16px 18px; }
.news-article-meta { color: var(--muted); font-size: 11px; }
.news-article-meta a { color: var(--green); }
.news-detail > h2 { margin: 7px 0 10px; font-size: 18px; line-height: 1.5; }
.news-detail-topline { display: flex; justify-content: space-between; margin: -4px 0 15px; padding-bottom: 9px; border-bottom: 1px solid #e8ebe7; color: var(--green-dark); font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .08em; }
.news-impact-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 13px 0; border: 1px solid var(--line); background: var(--line); }
.news-impact-summary > div { display: flex; min-height: 68px; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 12px; background: #fff; }
.news-impact-summary small, .news-impact-chain small { color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .06em; }
.news-impact-summary strong { width: fit-content; color: #354039; font-size: 13px; font-weight: 600; }
.news-impact-chain { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.news-impact-chain > div { display: flex; min-height: 82px; flex-direction: column; gap: 8px; padding: 11px; background: #fff; }
.news-impact-chain strong { color: #354039; font-size: 11px; font-weight: 500; line-height: 1.6; }
.news-impact-result { margin-top: 20px; }
.news-impact-result .news-section-heading { margin-bottom: 10px; }
.news-impact-graph { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.news-impact-layer { flex: 1 0 145px; min-width: 145px; border: 1px solid #dfe8df; border-radius: 8px; background: #f8fbf8; }
.news-impact-layer-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-bottom: 1px solid #e4ebe4; color: var(--green-dark); }
.news-impact-layer-title small { font: 11px ui-monospace, monospace; letter-spacing: .04em; }
.news-impact-layer-title span { color: var(--muted); font-size: 10px; }
.news-impact-layer-nodes { display: flex; min-height: 75px; flex-direction: column; gap: 7px; padding: 9px; }
.news-impact-node { display: flex; flex-direction: column; gap: 5px; padding: 8px; border: 1px solid #e3e9e3; border-radius: 6px; background: #fff; }
.news-impact-node.is-factor { border-left: 3px solid #8ab39a; }
.news-impact-node.is-empty { border-style: dashed; color: var(--muted); background: #fbfcfb; }
.news-impact-node strong { color: #354039; font-size: 11px; line-height: 1.45; }
.news-impact-node small { color: var(--muted); font-size: 10px; }
.news-impact-arrow { display: flex; align-items: center; align-self: center; color: #86a08d; font-size: 20px; }
.news-impact-empty { margin: 3px 0 0; padding: 9px 11px; color: #68746c; background: #f4f7f4; font-size: 11px; line-height: 1.6; }
.news-report-dialog { width: min(960px, calc(100vw - 32px)); height: min(86vh, 900px); max-height: min(86vh, 900px); overflow: hidden; padding: 0; border: 1px solid #cfdacf; border-radius: 10px; background: #fff; color: inherit; box-shadow: 0 18px 60px rgba(28, 46, 34, .22); }
.news-report-dialog[open] { display: flex; flex-direction: column; }
.news-report-dialog::backdrop { background: rgba(30, 42, 34, .35); }
.news-report-dialog-head { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid #e4eae4; background: #f8fbf8; }
.news-report-dialog-head small { color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .08em; }
.news-report-dialog-head h3 { margin: 5px 0 0; font-size: 17px; }
.news-report-layout { display: flex; min-height: 0; flex: 1; }
.news-report-toc { display: flex; width: 150px; flex: 0 0 150px; flex-direction: column; gap: 3px; overflow-y: auto; padding: 14px 10px; border-right: 1px solid #e4eae4; background: #f7faf8; }
.news-report-toc a { display: block; padding: 8px 9px; border-left: 2px solid transparent; border-radius: 4px; color: #718078; font-size: 11px; line-height: 1.35; text-decoration: none; transition: color .15s, background .15s, border-color .15s; }
.news-report-toc a:hover { color: #176b50; background: #e9f3ed; }
.news-report-toc a.is-active { border-left-color: var(--green); color: #176b50; background: #e5f2ec; font-weight: 700; }
.news-report-scroll { min-width: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.news-report-anchor-section, .news-report-section { scroll-margin-top: 18px; }
.news-report-scroll .news-report > section:last-child { min-height: calc(min(86vh, 900px) - 90px); }

/* Reference impact workbench: compact blue-gray cards with an actual edge layer. */
.is-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.news-impact-combobox { position: relative; padding: 12px 14px 14px; }
.news-impact-combobox input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 3px; background: #fff; color: #111827; font-size: 12px; }
.news-impact-options { display: grid; max-height: 220px; gap: 1px; margin-top: 6px; overflow: auto; border: 1px solid #d9e1eb; border-radius: 3px; background: #f8fafc; }
.news-impact-option { display: flex; min-height: 45px; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 10px; border: 0; border-bottom: 1px solid #e8eef6; background: #fff; color: #111827; text-align: left; cursor: pointer; }
.news-impact-option:hover, .news-impact-option.is-selected { background: #eef4fb; }
.news-impact-option strong { overflow: hidden; width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.news-impact-option span { color: #64748b; font-size: 10px; }
.news-impact-option-heading { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; }
.news-impact-option-heading strong { flex: 1; width: auto; min-width: 0; }
.news-impact-option-heading > span { flex-shrink: 0; }
.news-impact-option-tag { padding: 2px 7px; border: 1px solid #dbe3eb; border-radius: 4px; background: #f1f5f9; }
.news-impact-options-empty { padding: 12px; color: #64748b; font-size: 11px; }
.news-impact-filters { align-items: center; background: #fbfdff; }
.news-impact-filters select { width: auto; min-width: 125px; }
.news-impact-filters .button { min-height: 28px; padding: 4px 10px; font-size: 11px; }
.news-impact-graph-v2 { position: relative; display: block; min-height: var(--news-graph-height); overflow-x: auto; padding: 0 0 10px; background: #f8fafc; border: 1px solid #d9e1eb; }
.news-impact-columns { position: relative; z-index: 1; display: flex; width: var(--news-graph-width); min-height: var(--news-graph-height); }
.news-impact-column { position: relative; flex: 0 0 230px; min-height: var(--news-graph-height); padding: 10px 18px; border-right: 1px solid #e5ebf3; }
.news-impact-column:last-child { border-right: 0; }
.news-impact-column-title { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 4px; color: #475569; }
.news-impact-column-title small { font: 11px ui-monospace, monospace; letter-spacing: .04em; }
.news-impact-column-title span { color: #94a3b8; font-size: 10px; }
.news-impact-columns .news-impact-node { position: absolute; left: 18px; width: 194px; min-height: 58px; align-items: flex-start; border: 1px solid #cbd5e1; border-radius: 3px; background: #fff; box-shadow: 0 2px 5px rgba(15, 23, 42, .05); text-align: left; cursor: pointer; }
.news-impact-columns .news-impact-node:hover, .news-impact-columns .news-impact-node.is-focused { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.news-impact-columns .news-impact-node.is-event { border-left: 3px solid #2563eb; }
.news-impact-columns .news-impact-node.is-industry { border-left: 3px solid #d97706; }
.news-impact-columns .news-impact-node.is-factor { border-left: 3px solid #10b981; }
.news-impact-columns .news-impact-node.is-empty { border-style: dashed; color: #64748b; cursor: default; }
.news-impact-columns .news-impact-node strong { color: #111827; font-size: 11px; line-height: 1.4; }
.news-impact-columns .news-impact-node small { color: #64748b; font-size: 10px; }
.news-impact-columns .news-impact-node { overflow: hidden; }
.news-impact-columns .news-impact-node.is-expanded { border-style: dashed; border-left-color: #0ea5e9; background: #f8fbff; }
.news-impact-columns .news-impact-node .news-impact-node-relation { display: block; width: 100%; overflow: hidden; color: #0369a1; font-size: 10px; font-style: normal; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.news-impact-edge.is-factor { color: #10b981; }
.news-impact-edge.is-chain { color: #94a3b8; stroke-dasharray: 4 3; }
.news-impact-edges { position: absolute; z-index: 0; top: 0; left: 0; width: var(--news-graph-width); height: var(--news-graph-height); color: #94a3b8; pointer-events: none; }
.news-impact-edge { fill: none; stroke: currentColor; stroke-width: 1.5; marker-end: url(#news-impact-arrow); opacity: .7; transition: stroke .15s, stroke-width .15s, opacity .15s; }
.news-impact-edge.is-structure { color: #64748b; }
.news-impact-edge.is-highlighted { color: #2563eb; stroke-width: 2.8; opacity: 1; }
.news-impact-node-explanation { display: flex; min-height: 40px; flex-direction: column; gap: 3px; margin-top: 8px; padding: 9px 11px; border-left: 2px solid #9a6b2f; background: #fff; color: #475569; font-size: 11px; line-height: 1.5; }
.news-impact-node-explanation strong { color: #111827; font-size: 12px; }
#newsImpactPanel .news-detail > .news-evidence-audit, #newsImpactPanel .news-detail > .news-detail-section:not(.news-impact-result), #newsImpactPanel .news-detail > .news-coverage-gaps, #newsImpactPanel .news-detail > .news-article-content { display: none; }
.news-report-dialog .news-report { margin: 0; padding: 18px 20px 24px; border-top: 0; }
.news-evidence-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.news-evidence-columns > div { padding: 10px; border: 1px solid #e7ebe7; background: #fcfdfb; }
.news-evidence-columns > div > strong { font-size: 11px; }
.news-evidence-columns p { margin: 6px 0 0; color: #536058; font-size: 11px; line-height: 1.6; }
.news-article-content { margin: 0; white-space: pre-wrap; color: #44514a; font-size: 12px; line-height: 1.75; }
.news-processing, .news-no-match, .news-failure, .news-final-decision, .news-coverage-gaps { margin-top: 12px; padding: 11px 12px; border-radius: 7px; font-size: 12px; line-height: 1.7; }
.news-processing { color: #356d9a; background: #e8f0f7; }
.news-no-match, .news-final-decision { color: #41564a; background: #edf4ef; }
.news-failure { color: var(--red); background: var(--red-soft); }
.news-coverage-gaps { color: #785217; background: #fff8e8; }
.news-detail-section { margin-top: 17px; }
.news-detail-section > h3, .news-section-heading h3 { margin: 0 0 9px; font-size: 14px; }
.news-match-card, .news-graph-card, .news-report-case { margin-top: 7px; padding: 10px 11px; border: 1px solid #e7ebe7; border-radius: 7px; background: #fcfdfb; }
.news-match-card > div, .news-graph-card > div:first-child, .news-section-heading { justify-content: space-between; gap: 10px; }
.news-match-card strong, .news-graph-card strong { font-size: 12px; }
.news-match-card p, .news-report p, .news-report-case p { margin: 6px 0 0; color: #536058; font-size: 11px; line-height: 1.65; }
.news-direction { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.news-direction.positive { color: #176b50; background: #e5f2ec; }
.news-direction.negative { color: #a33c38; background: #fae9e7; }
.news-direction.neutral { color: #59645d; background: #ecefec; }
.news-confidence { color: var(--muted); font-size: 10px; }
.news-graph-nodes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.news-graph-nodes > span { padding: 6px 8px; border: 1px solid #e2e8e2; border-radius: 6px; background: #fff; font-size: 11px; }
.news-graph-nodes i { margin-left: 4px; font-style: normal; }
.news-graph-edge { margin: 8px 0 0; color: #536058; font-size: 10px; line-height: 1.6; }
.news-report { margin-top: 18px; padding-top: 15px; border-top: 2px solid #e6ebe6; }
.news-section-heading h3 { margin: 0; font-size: 15px; }
.news-report-summary { color: #37443c !important; font-size: 12px !important; }
.news-report-section { margin-top: 13px; }
.news-report-section h4 { margin: 0 0 6px; font-size: 12px; }
.news-report-case blockquote, .news-match-card blockquote { margin: 8px 0 0; padding: 7px 9px; border-left: 2px solid #98b8a1; color: #47534a; background: #f4f7f3; font-size: 10px; line-height: 1.6; }
.news-report-case blockquote small, .news-match-card blockquote small { display: block; margin-bottom: 3px; color: var(--muted); }

@media (max-width: 800px) {
  .news-view { padding: 14px 12px 24px; }
  .news-page-heading { align-items: flex-start; flex-direction: column; }
  .news-page-actions { width: 100%; flex-wrap: wrap; }
  .news-sub-tabs { margin-bottom: 10px; }
  .news-impact-selector-body { align-items: stretch; flex-direction: column; }
  .news-list-table-head { display: none; }
  .news-row { display: block; padding: 12px; }
  .news-row-source, .news-row-main, .news-row-theme, .news-row-impact, .news-row-status, .news-row-actions { margin-top: 7px; }
  .news-row-source { margin-top: 0; }
  .news-row-actions { justify-content: flex-start; }
  .news-analysis-grid { height: auto; min-height: 0; }
  .news-list-pane { min-height: 240px; }
  .news-detail { min-height: 45vh; }
  .news-impact-summary, .news-impact-chain { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .news-report-summary-meta { grid-template-columns: 1fr; }
  .news-impact-graph { margin-right: -8px; }
  .news-impact-arrow { font-size: 16px; }
  .news-report-layout { flex-direction: column; }
  .news-report-toc { width: auto; flex: 0 0 auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; border-right: 0; border-bottom: 1px solid #e4eae4; }
  .news-report-toc a { flex: 0 0 auto; border-left: 0; border-bottom: 2px solid transparent; padding: 7px 9px; }
  .news-report-toc a.is-active { border-bottom-color: var(--green); }
  .news-report-dialog .news-report { padding: 16px 15px 22px; }
}

.industry-tree-head {
  display: flex;
  max-width: 1600px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 16px;
}

.industry-tree-head h1 {
  margin: 2px 0 6px;
  font-size: 24px;
}

.industry-tree-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.industry-tree-status,
.industry-tree-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.industry-tree-status {
  min-height: 28px;
  flex-wrap: wrap;
}

.industry-tree-tools {
  justify-content: flex-end;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.text-button img {
  width: 14px;
  height: 14px;
}

.page-kicker {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.industry-tree-search {
  width: min(300px, 34vw);
}

.industry-root-tabs {
  display: flex;
  max-width: 1600px;
  gap: 4px;
  margin: 0 auto 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-strong);
}

.industry-root-tab {
  display: flex;
  min-width: 190px;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 9px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
}

.industry-root-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.industry-root-tab.is-active {
  color: var(--green-dark);
  border-bottom-color: var(--green);
  background: #fff;
}

.industry-root-tab strong {
  font-size: 14px;
}

.industry-root-tab small {
  color: var(--muted);
  font-size: 10px;
}

.industry-tree {
  max-width: 1600px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.industry-graph-scroll {
  width: 100%;
  /* 高度收缩到原值的约 85%，保证行业树容器完整落在首屏内 */
  max-height: calc(85vh - 148px);
  min-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

.industry-graph-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  background-color: #fbfcfa;
  background-image: linear-gradient(#edf0ec 1px, transparent 1px);
  background-size: 100% 86px;
}

.industry-level-headings {
  position: sticky;
  z-index: 6;
  top: 0;
  height: 44px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 10px rgba(31, 41, 37, 0.05);
}

.industry-level-heading {
  position: absolute;
  top: 0;
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.industry-level-heading span {
  display: grid;
  width: 26px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.industry-level-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.industry-graph-lines,
.industry-graph-nodes {
  position: absolute;
  inset: 0;
}

.industry-graph-lines {
  z-index: 1;
  pointer-events: none;
}

.industry-graph-nodes {
  z-index: 2;
  pointer-events: none;
}

.industry-graph-edge {
  fill: none;
  stroke: #b8c2bc;
  stroke-width: 1.4;
  transition: opacity 120ms ease, stroke 120ms ease, stroke-width 120ms ease;
}

.industry-graph-edge.is-path {
  stroke: var(--green);
  stroke-width: 2.4;
}

.industry-graph-edge.is-dimmed {
  opacity: 0.12;
}

.industry-node-card {
  position: absolute;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(31, 41, 37, 0.07);
  pointer-events: auto;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.industry-node-card:hover,
.industry-node-card.is-path {
  border-color: #78a896;
  box-shadow: 0 5px 16px rgba(23, 107, 80, 0.13);
}

.industry-node-card.is-dimmed {
  opacity: 0.22;
}

.industry-node-card.is-selected {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.industry-node-card.is-draft {
  border-style: dashed;
  background: #fffdf6;
}

.industry-node-card.level-1 {
  border-left-color: var(--blue);
  background: #f7fafc;
}

.industry-node-card.level-2 {
  border-left-color: #287c7a;
}

.industry-node-card.level-3 {
  border-left-color: var(--amber);
}

.industry-node-card.level-4 {
  border-left-color: var(--red);
  background: #fffdfd;
}

.industry-node-card.is-generating {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.industry-node-card.is-generating .industry-generation-state {
  color: #8b5a12;
  font-weight: 800;
}

.industry-node-card.has-generation-error {
  border-color: #d9a4a0;
  border-left-color: var(--red);
  background: #fff7f6;
}

.industry-node-card.has-generation-error .industry-generation-state {
  color: var(--red);
  font-weight: 800;
}

.industry-level-mark {
  display: grid;
  width: 30px;
  height: 28px;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
}

.industry-node-copy {
  min-width: 0;
  padding-right: 2px;
}

.industry-node-copy strong,
.industry-node-copy small {
  display: block;
}

.industry-node-copy strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.3;
}

.industry-node-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.industry-node-actions {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 5px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 1;
  transition: opacity 100ms ease;
}

.industry-node-card:hover .industry-node-actions,
.industry-node-card:focus-within .industry-node-actions,
.industry-node-card.is-selected .industry-node-actions {
  opacity: 1;
}

.industry-audit-button {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.industry-generation-retry {
  color: var(--red);
  border-color: #d9a4a0;
  background: #fff;
}

.industry-factors-button {
  color: var(--blue);
  border-color: #c7d8e8;
  background: #fff;
}

.industry-factors-button:hover {
  background: #e8f0f7;
}

.industry-node-select {
  display: inline-flex;
  width: 26px;
  height: 26px;
  place-items: center;
  margin: 0;
  padding: 5px;
}

.industry-node-select input {
  width: 15px;
  min-height: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.merge-source-list {
  display: flex;
  max-height: 116px;
  flex-wrap: wrap;
  gap: 6px;
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.merge-source-list span {
  padding: 5px 7px;
  border: 1px solid #bfd3ca;
  border-radius: 4px;
  color: var(--green-dark);
  background: #fff;
  font-size: 10px;
}

.industry-version-dialog {
  width: min(1180px, calc(100% - 48px));
  height: min(760px, calc(100% - 48px));
}

.version-list-item > em {
  color: var(--green-dark);
  font-size: 9px;
  font-style: normal;
}

.industry-version-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 150px)) minmax(180px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}

.industry-version-summary > div,
.industry-version-summary > p {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}

.industry-version-summary span,
.industry-version-summary strong {
  display: block;
}

.industry-version-summary span {
  color: var(--muted);
  font-size: 9px;
}

.industry-version-summary strong {
  margin-top: 3px;
  font-size: 18px;
}

.industry-version-summary > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.industry-version-columns {
  display: grid;
  min-width: 900px;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 10px;
}

.industry-version-columns section {
  min-width: 0;
}

.industry-version-columns h3 {
  position: sticky;
  top: -18px;
  z-index: 1;
  margin: 0 0 7px;
  padding: 8px;
  border-bottom: 2px solid var(--green);
  background: #fff;
  font-size: 11px;
}

.industry-version-node {
  margin-bottom: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}

.industry-version-node strong,
.industry-version-node small {
  display: block;
  overflow-wrap: anywhere;
}

.industry-version-node strong {
  font-size: 11px;
}

.industry-version-node small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.version-dialog,
.connection-picker-dialog {
  height: min(720px, calc(100% - 48px));
}

.version-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 210px minmax(0, 1fr);
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.version-list {
  overflow: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.version-list-item {
  display: grid;
  width: 100%;
  gap: 4px;
  margin-bottom: 5px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
  background: transparent;
}

.version-list-item:hover,
.version-list-item.is-active {
  border-color: #a9cdbf;
  background: var(--green-soft);
}

.version-list-item > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.version-list-item > small {
  color: var(--muted);
  font-size: 9px;
}

.current-version-mark {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--green-dark);
  background: #fff;
  font-size: 9px;
}

.version-snapshot {
  overflow: auto;
  padding: 18px;
}

.version-snapshot-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.version-snapshot-head span,
.version-snapshot-head strong {
  display: block;
}

.version-snapshot-head span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.version-snapshot-head strong {
  margin-top: 3px;
  font-size: 14px;
}

.version-snapshot-head time {
  color: var(--muted);
  font-size: 10px;
}

.version-comment {
  margin: 12px 0;
  padding: 9px 10px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  background: var(--amber-soft);
  font-size: 11px;
}

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

.version-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.version-field span {
  color: var(--muted);
  font-size: 10px;
}

.version-field strong {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 11px;
  font-weight: 650;
}

.connection-picker-dialog form {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.connection-picker-search {
  margin: 0 18px 12px;
}

.connection-picker-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 0 18px 18px;
}

.connection-picker-card {
  position: relative;
  display: grid;
  min-height: 76px;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.connection-picker-card:hover,
.connection-picker-card.is-selected {
  border-color: #8ebdac;
  background: var(--green-soft);
}

.connection-picker-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.connection-picker-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.connection-picker-check img {
  width: 13px;
  opacity: 0;
}

.connection-picker-card.is-selected .connection-picker-check {
  border-color: var(--green);
  background: var(--green);
}

.connection-picker-card.is-selected .connection-picker-check img {
  opacity: 1;
  filter: brightness(0) invert(1);
}

.connection-picker-card small,
.connection-picker-card strong {
  display: block;
}

.connection-picker-card small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.connection-picker-card strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.4;
}

.dialog-selection-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.mobile-only,
.mobile-backdrop,
.inspector-mobile-close {
  display: none;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 260px minmax(380px, 1fr) clamp(480px, 40vw, 560px);
  }

  .app-brand {
    min-width: 210px;
  }

  .top-progress {
    display: none;
  }
}

@media (max-width: 900px) {
  .news-analysis { padding: 15px 12px; }
  .news-analysis-heading { align-items: flex-start; }
  .news-analysis-actions { align-items: flex-end; flex-direction: column; gap: 6px; }
  .news-list, .news-detail { max-height: 34vh; }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .inspector {
    position: fixed;
    z-index: 80;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    width: min(520px, calc(100% - 48px));
    border-left: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateX(102%);
    transition: transform 180ms ease;
  }

  .inspector.is-open {
    transform: translateX(0);
  }

  .inspector-mobile-close {
    display: inline-grid;
  }

  .topbar-context {
    display: none;
  }

  .app-brand {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 680px) {
  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    gap: 9px;
    padding: 0 10px;
  }

  .app-brand strong {
    font-size: 12px;
  }

  .workspace {
    display: block;
  }

  .industry-tree-view {
    padding: 18px 10px 36px;
  }

  .industry-tree-head {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
  }

  .industry-tree-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .industry-tree-search {
    width: 100%;
    grid-column: 1 / -1;
  }

  .industry-tree {
    width: 100%;
  }

  .industry-root-tabs {
    margin-bottom: 8px;
  }

  .industry-root-tab {
    min-width: 0;
    flex: 1 0 46%;
    padding-inline: 10px;
  }

  .industry-graph-scroll {
    max-height: calc(85vh - 223px);
    min-height: 460px;
  }

  .industry-graph-stage {
    min-width: 0;
  }

  .industry-node-actions {
    opacity: 1;
  }

  .industry-version-dialog {
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }

  .industry-version-dialog .version-layout {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .industry-version-summary {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
  }

  .industry-version-summary > p {
    grid-column: 1 / -1;
  }

  .chain-sidebar {
    position: fixed;
    z-index: 100;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: min(92vw, 344px);
    border-right: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .chain-sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    z-index: 90;
    inset: var(--topbar-height) 0 0;
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    background: rgba(25, 32, 28, 0.34);
  }

  .chain-workbench {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chain-toolbar {
    display: grid;
    height: auto;
    min-height: 72px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 10px;
  }

  .chain-toolbar::before {
    display: none;
  }

  .path-nav {
    min-width: 0;
    gap: 6px;
  }

  .path-nav > div {
    flex: 1;
  }

  .chain-toolbar h2 {
    max-width: none;
    font-size: 13px;
  }

  .chain-actions {
    gap: 6px;
  }

  #editChainWeightButton,
  #addStructureButton,
  #completeChainButton {
    width: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    gap: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .chain-actions .status-chip {
    display: none;
  }

  .desktop-label {
    display: none;
  }

  .button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .complete-label-compact {
    display: none;
  }

  .chain-canvas {
    padding: 22px 16px 80px;
  }

  .chain-track {
    width: 100%;
    min-width: 0;
    align-content: start;
  }

  .chain-turn {
    width: 100%;
    height: 58px;
    justify-content: center;
    padding: 0;
  }

  .chain-row {
    width: 100%;
    justify-content: center;
  }

  .factor-node {
    width: min(100%, 360px);
    height: auto;
    min-height: 148px;
    flex: 0 0 auto;
  }

  .chain-turn .edge-node {
    width: 64px;
    min-height: 58px;
    flex-basis: 64px;
  }

  .inspector {
    top: var(--topbar-height);
    width: 100%;
  }

  .two-columns,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .user-list {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dialog {
    width: calc(100% - 20px);
    max-height: calc(100% - 20px);
  }

  .version-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 140px minmax(0, 1fr);
  }

  .version-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .version-fields {
    grid-template-columns: 1fr;
  }

  .connection-picker-grid {
    grid-template-columns: 1fr;
  }

  .toast-region {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 价值链审计页交互重构（REQ-016/017） */
.queue-summary-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#chainWeightSortButton {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  padding: 0 7px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* 按价值链编号排序按钮 */
#chainIndexSortButton {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  padding: 0 7px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

#chainIndexSortButton .chain-index-arrow {
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  transition: color 0.15s ease;
}

#chainIndexSortButton.is-active,
#chainWeightSortButton.is-active {
  color: var(--primary, #1f6feb);
  border-color: var(--primary, #1f6feb);
  background: var(--primary-soft, #e8f0fe);
}

#chainIndexSortButton.is-active .chain-index-arrow,
#chainWeightSortButton.is-active .chain-weight-arrow {
  color: var(--primary, #1f6feb);
}

#chainWeightForm {
  align-content: start;
}

.mini-time {
  font-variant-numeric: tabular-nums;
}

.relation-builder {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.relation-builder .section-heading {
  margin: 0 0 10px;
}

.relation-builder .section-heading h3 {
  margin: 0;
  font-size: 13px;
}

#relationRows {
  display: grid;
  gap: 8px;
}

.relation-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) 96px 84px 30px;
  gap: 8px;
  align-items: center;
}

.relation-row select,
.relation-row input {
  width: 100%;
}

.relation-builder .field-hint {
  margin: 8px 0 0;
}

.relation-position-preview {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.relation-position-preview.is-error {
  border-color: var(--danger, #d93026);
  background: var(--danger-soft, #fdeceb);
  color: var(--danger, #b42318);
}

.relation-position-preview .pos-role {
  display: inline-block;
  min-width: 42px;
  font-weight: 700;
}

.relation-position-preview .pos-factor {
  color: var(--primary, #1f6feb);
  font-weight: 600;
}

.chain-draft-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--blue-soft);
  font-size: 13px;
}

.chain-draft-banner img {
  width: 18px;
  height: 18px;
}

.chain-draft-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.chain-draft-list .draft-factor-node {
  flex: 1 1 200px;
  max-width: 280px;
}

.draft-factor-node {
  cursor: pointer;
  text-align: left;
}

.draft-connector {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 46px;
  padding: 0 2px;
  color: var(--muted);
}

.draft-connector .edge-arrow {
  display: flex;
}

.draft-connector.is-backward .edge-arrow {
  transform: scaleX(-1);
}

.draft-connector small {
  font-size: 10px;
  white-space: nowrap;
}

.draft-connector.is-gap {
  opacity: 0.45;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.edge-node.is-empty {
  opacity: 0.35;
  pointer-events: none;
}

.draft-factor-node [data-draft-remove] {
  margin-left: auto;
}

.atom-row-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.atom-row-main:hover h4 {
  color: var(--green-dark);
  text-decoration: underline;
}

.atom-row-main:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .inspector-body .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

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

/* 价值链画布版本区（左上角悬浮） */
.chain-canvas-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.chain-canvas-wrap .chain-canvas {
  flex: 1;
  min-height: 0;
}

.chain-version-bar {
  position: absolute;
  z-index: 6;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgb(15 23 18 / 10%);
  transition: top 0.2s ease;
}

/* 查看历史版本时历史横幅展开：版本栏换行（标签独占一行，下拉/按钮换到下一行） */
.chain-version-bar.is-lowered {
  top: 8px;
  flex-wrap: wrap;
  max-width: calc(100% - 24px);
}

.chain-version-bar.is-lowered .chain-version-label {
  flex-basis: 100%;
}

.chain-version-bar.is-lowered .chain-version-select {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.chain-version-bar .has-unsaved {
  box-shadow: 0 0 0 2px rgb(23 107 80 / 12%);
}

.chain-version-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.version-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.version-badge.is-latest {
  color: var(--green);
  background: var(--green-soft);
}

.version-badge.is-history {
  color: var(--amber);
  background: var(--amber-soft);
}

.chain-version-select {
  max-width: 200px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.chain-history-banner {
  position: absolute;
  top: 86px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgb(15 23 18 / 10%);
}

.chain-history-banner img {
  width: 15px;
  height: 15px;
}

.chain-history-banner span {
  flex: 1;
  min-width: 0;
}

.factor-node.is-history-view,
.edge-node.is-history-view {
  cursor: default;
}

.chain-track.is-history-view {
  opacity: 0.88;
}

/* 数据渠道标签编辑器 */
.tag-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag-editor-label {
  color: #4f5b55;
  font-size: 13px;
  font-weight: 700;
}

.tag-editor-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.tag-chip-remove {
  display: grid;
  width: 16px;
  height: 16px;
  padding: 0;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tag-chip-remove:hover {
  background: rgb(23 107 80 / 16%);
}

.tag-chip-remove img {
  width: 10px;
  height: 10px;
}

.tag-editor-input {
  min-width: 140px;
  flex: 1;
  padding: 4px 2px;
  border: none;
  outline: none;
  font-size: 13px;
}

/* 新增因子关联：已有因子下拉与搜索区等宽 */
.existing-factor-search {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 8px;
}

.existing-factor-search label {
  flex: 1;
  min-width: 0;
}

/* 合并修改记录的对象标签 */
.history-entity-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

/* 原子编辑弹窗内的关系字段分区 */
.atom-relation-fields .section-heading {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 900px) {
  .chain-version-bar {
    position: static;
    margin: 8px 10px 0;
    flex-wrap: wrap;
  }

  .chain-version-select {
    max-width: none;
    flex: 1;
  }
}

/* ---------- 顶栏主导航 ---------- */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-nav-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.topbar-nav-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.topbar-nav-button.is-active {
  color: var(--green-dark);
  background: var(--green-soft);
}

/* ---------- 因子管理页 ---------- */
.factor-manage-view {
  display: grid;
  height: calc(100% - var(--topbar-height));
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px clamp(16px, 3vw, 42px) 24px;
  background: var(--bg);
}

.factor-manage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

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

.rebuild-progress-dialog progress {
  display: block;
  width: calc(100% - 40px);
  height: 10px;
  margin: 0 20px;
  accent-color: var(--green-dark);
}

.rebuild-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.rebuild-progress-result {
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .factor-manage-head { flex-wrap: wrap; }
  .factor-manage-actions { width: 100%; justify-content: flex-start; }
}

.factor-manage-head h1 {
  margin: 2px 0 4px;
  font-size: 24px;
}

.factor-manage-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.factor-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-field {
  display: grid;
  gap: 4px;
}

.filter-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.filter-field select {
  min-width: 150px;
}

.industry-search {
  position: relative;
  display: grid;
  gap: 4px;
}

.industry-search .search-control {
  width: min(280px, 40vw);
}

.industry-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  width: min(380px, 60vw);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.industry-suggest-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  text-align: left;
  background: transparent;
}

.industry-suggest-item:hover,
.industry-suggest-item.is-active {
  background: var(--green-soft);
}

.industry-suggest-item strong {
  font-size: 13px;
}

.industry-suggest-item small {
  color: var(--muted);
  font-size: 11px;
}

.industry-suggest-empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.factor-matrix {
  display: grid;
  min-height: 0;
  grid-auto-flow: column;
  grid-auto-columns: minmax(198px, 1fr);
  align-items: start;
  gap: 10px;
  overflow: auto;
  padding-bottom: 8px;
}

.factor-matrix-column {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-top: 3px solid var(--group-color, var(--green));
  border-radius: 8px;
  background: var(--surface-soft);
}

.factor-column-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--group-bg, var(--green-soft));
}

.factor-column-level {
  color: var(--group-color, var(--green));
  font-size: 12px;
  font-weight: 800;
}

.factor-column-count {
  display: grid;
  min-width: 22px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.factor-column-body {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 10px;
}

.factor-column-empty {
  margin: 4px 2px;
  color: var(--muted);
  font-size: 12px;
}

.factor-manage-card {
  width: 100%;
  height: auto;
  min-height: 104px;
  flex: initial;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.factor-manage-card-main {
  display: grid;
  flex: 1;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  padding: 8px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.factor-manage-card-main:hover h3 {
  color: var(--green-dark);
}

.factor-manage-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 4px 6px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

/* ---------- 因子详情抽屉 ---------- */
.factor-drawer {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(1400px, 100%);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -14px 0 34px rgba(28, 42, 34, 0.16);
}

.factor-drawer-backdrop {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 55;
  background: rgba(24, 38, 30, 0.26);
}

.drawer-industry {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

/* 抽屉去掉 tab 后，shell 为 head / body / footer 三行 */
.factor-drawer .inspector-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-history-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  color: var(--green-dark);
}

.factor-drawer-body {
  display: flex;
  overflow: hidden;
  padding: 14px;
}

.factor-drawer-grid {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.factor-drawer-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

/* 因子详情编辑态：左侧 1/5 因子信息，中间 3/5 关联原子，右侧 1/5 全局上下游关系 */
.factor-drawer-grid.is-edit {
  grid-template-columns: 1fr 3fr 1fr;
}

.factor-drawer-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: 8px;
  background: var(--surface-soft);
}

.factor-drawer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--green-soft);
}

.factor-drawer-card-head h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.factor-card-kicker {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
}

.factor-drawer-card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: auto;
  padding: 12px;
}

/* 卡片内因子信息表单为单列，避免三栏中过度挤压 */
.factor-info-form {
  grid-template-columns: 1fr;
}

/* 关联原子：每个原子一个独立内联编辑卡片 */
.atom-edit-list {
  display: grid;
  gap: 12px;
}

.atom-edit-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  border-radius: 8px;
  background: #fff;
}

.atom-edit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--violet-soft);
}

.atom-edit-card-head h4 {
  margin: 2px 0 0;
  font-size: 13px;
}

.atom-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
}

.atom-edit-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

/* 修改记录弹窗 */
.factor-history-dialog {
  max-height: 82vh;
}

.factor-history-body {
  max-height: calc(82vh - 64px);
  overflow: auto;
  padding: 16px 20px;
}

@media (max-width: 900px) {
  .topbar-nav-button {
    padding: 0 8px;
    font-size: 11px;
  }

  .factor-drawer {
    width: 100%;
  }

  .factor-drawer-grid {
    grid-template-columns: 1fr;
  }

  .factor-drawer-card {
    min-height: 220px;
  }

  .filter-field select {
    min-width: 120px;
  }
}
