/* 决策沙盘 - 老张体验流程 demo v1
   规格: ux-spec-decision-sandbox-v1.md §3, §5.2 */

.sandbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
}

.sandbox-overlay.open { display: flex; }

.sandbox-modal {
  background: #ffffff;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sandbox-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.sandbox-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.sandbox-modal-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

.sandbox-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
}

.sandbox-close:hover { color: #1f2937; }

.sandbox-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.sandbox-stock-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.sandbox-stock-info .sb-code {
  font-family: 'SF Mono', Menlo, monospace;
  color: #6b7280;
  font-size: 13px;
}

.sandbox-stock-info .sb-name {
  font-weight: 600;
  color: #1f2937;
}

.sandbox-stock-info .sb-reason {
  color: #374151;
}

.sandbox-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sandbox-path {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sandbox-path:hover {
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.sandbox-path.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sandbox-path-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.sandbox-path-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sandbox-path-tag.aggressive {
  background: rgba(231, 111, 81, 0.12);
  color: #E76F51;
}

.sandbox-path-tag.conservative {
  background: rgba(107, 142, 127, 0.15);
  color: #4a6b5d;
}

.sandbox-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: 13px;
}

.sandbox-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sandbox-metric-label {
  color: #6b7280;
  font-size: 12px;
}

.sandbox-metric-value {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  font-family: 'SF Mono', Menlo, monospace;
}

.sandbox-metric-value.up { color: #d9534f; }
.sandbox-metric-value.down { color: #2f9e44; }

.sandbox-path-desc {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  border-top: 1px dashed #e5e7eb;
  padding-top: 10px;
}

.sandbox-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.sandbox-btn {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.sandbox-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.sandbox-btn.primary:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
}

.sandbox-btn:hover:not(:disabled) { filter: brightness(1.05); }

/* 确认子 modal */
.sandbox-confirm {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  padding: 24px;
}

.sandbox-confirm.open { display: flex; }

.sandbox-confirm-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.sandbox-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.sandbox-confirm-body {
  font-size: 14px;
  color: #374151;
  line-height: 1.55;
  margin: 0 0 18px 0;
}

.sandbox-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .sandbox-paths { grid-template-columns: 1fr; }
}

/* === 移动端: 沙盘全屏 + 双路径纵向 + touch 44px (增量) === */
@media (max-width: 768px) {
  .sandbox-overlay {
    padding: 0;
    align-items: stretch;
  }
  .sandbox-modal {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .sandbox-modal-header { padding: 14px 16px; }
  .sandbox-modal-body { padding: 16px; }
  .sandbox-paths { grid-template-columns: 1fr; gap: 12px; }
  .sandbox-path { padding: 14px; min-height: 44px; }
  .sandbox-btn { min-height: 44px; padding: 11px 18px; }
  .sandbox-modal-footer { padding: 12px 16px; gap: 8px; }
  .sandbox-modal-footer .sandbox-btn { flex: 1; }
  .sandbox-confirm { padding: 12px; }
  .sandbox-confirm-card { max-width: 100%; }
  .sandbox-confirm-actions { gap: 8px; }
  .sandbox-confirm-actions .sandbox-btn { flex: 1; min-height: 44px; }
}
