/* ============================================
   HNXX印务智能排产 Demo - 专属样式表
   ============================================ */

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Background Grid Pattern (Subtle light grey) */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

/* Minimalist Navbar */
.navbar-tianwen {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-tianwen .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.25rem;
}

.navbar-brand span {
  color: var(--text-primary);
}

/* Dashboard Widgets */
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.oee-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Sliders */
.slider-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.slider-val {
  font-family: var(--font-mono);
  color: var(--accent-blue-light);
}

/* Gantt Chart Container */
.gantt-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.gantt-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.gantt-timeline-labels {
  display: flex;
  justify-content: space-between;
  padding-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gantt-row-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gantt-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  position: relative;
  min-height: 54px;
}

.gantt-machine-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gantt-machine-label i {
  color: var(--accent-blue-light);
}

.gantt-track {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  height: 48px;
  border-radius: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 异常停机遮罩样式 */
.gantt-track.row-failed {
  background: var(--accent-red-glow);
  border-color: rgba(200, 16, 46, 0.4);
}

.gantt-track.row-failed::after {
  content: '⚠️ 非计划停机故障';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 2px;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(200, 16, 46, 0.05) 10px, rgba(200, 16, 46, 0.05) 20px);
}

.gantt-block {
  position: absolute;
  top: 4px;
  height: 40px;
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.gantt-block:hover {
  transform: scaleY(1.05);
  filter: brightness(1.15);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.gantt-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-block-info {
  font-size: 0.65rem;
  opacity: 0.85;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
}

/* Comparison Cards */
.compare-metrics-container {
  display: none;
  gap: 1.5rem;
  margin-top: 2rem;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.compare-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.compare-title-manual {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid oklch(56% 0.025 240 / 0.2);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.compare-title-ai {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.compare-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.compare-row span:first-child {
  color: var(--text-secondary);
}

.compare-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Decision tree nodes */
.decision-container {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.decision-node {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.decision-node--highlight {
  border-color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.decision-badge {
  position: absolute;
  top: -10px;
  left: 1.25rem;
  background: var(--text-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.canvas-imposition-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Button override */
.btn-portal-primary {
  background: var(--text-primary);
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: var(--radius-full);
}

.btn-portal-primary:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
  color: white;
}

.btn-portal-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: var(--radius-full);
}

.btn-portal-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-portal-disabled {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  border-radius: var(--radius-full);
}

/* Active sidebar orders */
.order-list-box {
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* Custom scrollbar for order list box */
.order-list-box::-webkit-scrollbar {
  width: 4px;
}
.order-list-box::-webkit-scrollbar-track {
  background: transparent;
}
.order-list-box::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}
