/**
 * GoxEDGE model replica v4
 * Namespace: v4-model-
 */

.v4-model-replica {
  min-width: 1180px;
}

.v4-model-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.v4-model-ctrl {
  border: 1px solid var(--v4-line);
  background: var(--v4-paper);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--v4-muted);
  cursor: pointer;
  font-family: inherit;
}

.v4-model-ctrl.is-active,
.v4-model-ctrl:hover {
  color: var(--v4-ink);
  border-color: var(--v4-navy);
}

.v4-model-ctrl-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--v4-navy);
  margin-left: auto;
  text-decoration: none;
}

.v4-model-scroll-hint {
  display: none;
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--v4-soft);
}

.v4-model-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--v4-line);
  border-radius: var(--v4-radius-sm);
  background: var(--v4-white);
  box-shadow: var(--v4-shadow-soft);
}

.v4-model-canvas {
  min-width: 1180px;
  display: flex;
  flex-direction: column;
}

.v4-model-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 0;
}

.v4-model-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: #fff;
  padding: 12px 8px;
}

.v4-model-row-label--mechanism {
  background: linear-gradient(180deg, #f04a23 0%, #d63a18 100%);
}

.v4-model-row-label--path {
  background: linear-gradient(180deg, #062f4f 0%, #041f35 100%);
}

.v4-model-row-label--capability {
  background: linear-gradient(180deg, #0f6674 0%, #062f4f 100%);
}

.v4-model-row-label--judgment {
  background: linear-gradient(180deg, #2f7d32 0%, #1f6b2c 100%);
}

.v4-model-row-label--note {
  background: var(--v4-white);
  color: var(--v4-blue);
  border: 1px solid rgba(7, 90, 168, 0.35);
  font-size: 1rem;
}

.v4-model-row-content {
  min-width: 0;
  border-left: 1px solid var(--v4-line);
}

.v4-model-row--mechanism { height: 120px; }
.v4-model-row--path { height: 300px; }
.v4-model-row--capability { height: 112px; }
.v4-model-row--judgment { height: 92px; }
.v4-model-row--note { height: 54px; }

/* Mechanism */
.v4-model-mechanism-band {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 24px;
  border: 2px solid rgba(240, 74, 35, 0.4);
  border-radius: 0;
  background: rgba(240, 74, 35, 0.04);
}

.v4-model-mechanism-loop {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 6px;
  height: 32px;
  pointer-events: none;
}

.v4-model-mechanism-nodes {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 2px;
}

.v4-model-mechanism-node {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  max-width: 140px;
}

.v4-model-mechanism-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f04a23, #d63a18);
  box-shadow: 0 2px 8px rgba(240, 74, 35, 0.25);
}

.v4-model-mechanism-circle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.v4-model-mechanism-node.is-selected .v4-model-mechanism-circle {
  box-shadow: 0 0 0 3px rgba(240, 74, 35, 0.35);
}

.v4-model-mechanism-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--v4-ink);
  margin-bottom: 2px;
}

.v4-model-mechanism-sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--v4-muted);
  line-height: 1.35;
}

.v4-model-mechanism-arrow {
  color: var(--v4-red);
  font-size: 1.25rem;
  font-weight: 700;
  align-self: center;
  padding-top: 12px;
}

.v4-model-mechanism-footnote {
  margin: 0;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--v4-muted);
}

/* Path */
.v4-model-path-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
}

.v4-model-path-track {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 2px;
}

.v4-model-stage-arrow {
  align-self: center;
  flex-shrink: 0;
  color: var(--v4-blue);
  font-size: 0.65rem;
  padding: 0 2px;
}

.v4-model-stage-card {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--v4-line);
  border-top: 3px solid var(--stage-color, var(--v4-blue));
  background: #fff;
  border-radius: 4px;
  padding: 6px 7px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

.v4-model-stage-card.is-selected {
  box-shadow: inset 0 0 0 2px var(--stage-color, var(--v4-blue));
}

.v4-model-stage-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stage-color, var(--v4-blue));
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.v4-model-stage-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.v4-model-stage-en {
  display: block;
  font-size: 0.5625rem;
  color: var(--v4-soft);
  margin-bottom: 4px;
}

.v4-model-stage-divider {
  display: block;
  height: 1px;
  background: var(--v4-line);
  margin: 2px 0 4px;
}

.v4-model-stage-list {
  margin: 0;
  padding: 0 0 0 0.9em;
  font-size: 0.5625rem;
  color: var(--v4-muted);
  line-height: 1.4;
  overflow-y: auto;
  flex: 1;
}

.v4-model-stage-list li {
  margin-bottom: 1px;
}

.v4-model-iteration {
  flex: 0 0 30px;
  position: relative;
  margin-top: 4px;
}

.v4-model-iteration-svg {
  width: 100%;
  height: 10px;
}

.v4-model-iteration-label {
  display: block;
  text-align: center;
  font-size: 0.625rem;
  color: var(--v4-blue);
  font-weight: 600;
}

/* Capability */
.v4-model-capability-band {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(6, 47, 79, 0.28);
  background: linear-gradient(180deg, rgba(6, 47, 79, 0.06) 0%, rgba(15, 102, 116, 0.04) 100%);
}

.v4-model-capability-head {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(6, 47, 79, 0.15);
  font-size: 0.6875rem;
}

.v4-model-capability-head strong {
  color: var(--v4-navy);
}

.v4-model-capability-head span {
  color: var(--v4-muted);
}

.v4-model-capability-cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 0;
}

.v4-model-capability-cell {
  border: 0;
  border-right: 1px solid rgba(6, 47, 79, 0.12);
  background: transparent;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
}

.v4-model-capability-cell:last-child {
  border-right: 0;
}

.v4-model-capability-cell.is-selected {
  background: rgba(6, 47, 79, 0.08);
}

.v4-model-capability-cell strong {
  display: block;
  font-size: 0.625rem;
  margin-bottom: 2px;
}

.v4-model-capability-cell p {
  margin: 0;
  font-size: 0.5rem;
  color: var(--v4-muted);
  line-height: 1.35;
}

/* Judgment */
.v4-model-judgment-band {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(47, 125, 50, 0.32);
  background: rgba(47, 125, 50, 0.04);
  padding: 6px 12px;
}

.v4-model-judgment-head {
  text-align: center;
  font-size: 0.625rem;
  margin-bottom: 4px;
}

.v4-model-judgment-head strong {
  color: var(--v4-green);
}

.v4-model-judgment-head span {
  display: block;
  color: var(--v4-muted);
  font-size: 0.5625rem;
}

.v4-model-judgment-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  flex: 1;
}

.v4-model-judgment-cell {
  border: 1px solid rgba(47, 125, 50, 0.22);
  background: var(--v4-white);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.5rem;
  color: var(--v4-ink);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  font-family: inherit;
}

.v4-model-judgment-cell.is-selected {
  background: rgba(47, 125, 50, 0.1);
  border-color: var(--v4-green);
}

/* Note */
.v4-model-note-row .v4-model-row-content {
  display: flex;
  align-items: center;
  border: 1px solid rgba(7, 90, 168, 0.3);
  background: rgba(7, 90, 168, 0.03);
}

.v4-model-note-text {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.625rem;
  color: var(--v4-muted);
  line-height: 1.45;
  text-align: center;
  width: 100%;
}

@media (max-width: 1180px) {
  .v4-model-scroll-hint {
    display: block;
  }
}
