/* ==========================================================================
   B2B Factory OnePage - 30 项微交互与高阶动效专属样式表
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 首屏模块与 360° CAD 线框检视器 (Hero & 3D Viewer)
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 60px 0 80px;
  background: radial-gradient(circle at 70% 30%, rgba(14, 165, 233, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(30, 41, 59, 0.6) 0%, transparent 50%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-content h2 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
  color: var(--text-white);
  margin: 16px 0;
}

.hero-content h2 span.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

/* 核心指标计数器网格 */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--cyan-hover);
}

.stat-suffix {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 3D 零件 / CAD 线框检视容器 */
.viewer-3d-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.viewer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-mode-switch {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--cyan-primary);
  color: #fff;
}

.canvas-viewport {
  width: 100%;
  height: 340px;
  background: radial-gradient(circle at center, #1a2538 0%, #0d1424 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.canvas-viewport:active {
  cursor: grabbing;
}

#partCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 检视器操作提示与热点引线 */
.rotate-hint-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-dim);
  pointer-events: none;
  white-space: nowrap;
}

/* 机床参数交互热点 (Hotspots) */
.hotspot-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.25);
  border: 2px solid var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease;
  z-index: 10;
}

.hotspot-dot:hover {
  transform: scale(1.2);
  background: var(--cyan-primary);
}

.hotspot-popup {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 11px;
  color: var(--text-main);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.hotspot-dot:hover .hotspot-popup {
  opacity: 1;
  visibility: visible;
  bottom: 32px;
}

/* --------------------------------------------------------------------------
   2. 材质×工艺×公差实时匹配器 (Processing Matrix Matcher)
   -------------------------------------------------------------------------- */
.matcher-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 40px;
}

.matcher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 24px;
}

.selector-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  text-align: left;
}

.pill-btn:hover {
  border-color: var(--cyan-hover);
  color: var(--text-main);
}

.pill-btn.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--cyan-primary);
  color: var(--cyan-hover);
  font-weight: 600;
  box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.2);
}

.pill-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-dim);
}

/* 匹配结果展示面板 */
.match-result-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(30, 41, 59, 0.4));
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.match-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 13px;
}

.match-spec-row:last-child {
  border-bottom: none;
}

.spec-key {
  color: var(--text-muted);
}

.spec-val-highlight {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan-hover);
}

.spec-val-extreme {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. 毛坯 vs 阳极氧化前后滑动对比器 (Before/After Slider)
   -------------------------------------------------------------------------- */
.slider-compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 40px;
}

.comparison-box {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  background: #000;
}

.comparison-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.layer-before {
  z-index: 1;
}

.layer-after {
  z-index: 2;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--cyan-hover);
}

.comparison-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cyan-primary);
  border: 3px solid #ffffff;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
}

.layer-label {
  position: absolute;
  top: 14px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  pointer-events: none;
  z-index: 5;
}

.label-before {
  right: 14px;
}

.label-after {
  left: 14px;
}

/* --------------------------------------------------------------------------
   4. 行业案例与无刷新秒筛 (Filter & Cases)
   -------------------------------------------------------------------------- */
.filter-tabs-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--cyan-primary);
}

.filter-tab-btn.active {
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
  color: #ffffff;
  box-shadow: 0 0 16px var(--cyan-glow);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* 翻转卡片 (Flip Card) */
.flip-card-outer {
  perspective: 1000px;
  height: 380px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.flip-card-outer:hover .flip-card-inner,
.flip-card-outer.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-active);
  padding: 24px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flip-card-back {
  background: linear-gradient(145deg, #162032, #0d1522);
  transform: rotateY(180deg);
  border-color: var(--cyan-primary);
}

.flip-hint {
  font-size: 11px;
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   5. 6 步工程流程与交互抽屉 (Process & Deliverables)
   -------------------------------------------------------------------------- */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  position: relative;
  margin-top: 30px;
}

.process-step-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.process-step-node:hover, .process-step-node.active {
  border-color: var(--cyan-primary);
  background: rgba(14, 165, 233, 0.08);
  transform: translateY(-3px);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan-primary);
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin: 8px 0 4px;
}

.step-time-badge {
  font-size: 10px;
  color: var(--gold-primary);
  font-weight: 600;
}

/* 交付物展示抽屉卡片 */
.deliverable-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deliverable-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.deliverable-icon {
  width: 48px;
  height: 48px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* --------------------------------------------------------------------------
   6. 在线初步估价与交期计算器 (Instant Estimator - V3.0 Flagship)
   -------------------------------------------------------------------------- */
.estimator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.estimator-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-range-slider {
  width: 100%;
  height: 6px;
  background: var(--border-active);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
}

.form-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan-primary);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

/* 估价输出结算大卡 */
.estimator-result-panel {
  background: linear-gradient(145deg, #132238, #0a1120);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.price-display-box {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.price-currency {
  font-size: 20px;
  color: var(--gold-primary);
  font-weight: 700;
}

.price-amount {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 800;
  color: #ffffff;
}

.lead-time-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   7. 2.5D 等轴测数字化车间导览沙盘 (Isometric 2.5D Tour - V3.0 Flagship)
   -------------------------------------------------------------------------- */
.sandbox-container {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.sandbox-viewport {
  width: 100%;
  height: 480px;
  background: radial-gradient(circle at 50% 50%, #152238 0%, #080d17 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.iso-zone-interactive {
  cursor: pointer;
  transition: all 0.3s ease;
}

.iso-zone-interactive:hover {
  filter: drop-shadow(0 0 12px var(--cyan-primary));
}

.zone-detail-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 300px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 20;
}

/* --------------------------------------------------------------------------
   8. 质量 CPK 曲线与防盗水印灯箱 (Quality & Watermark Lightbox)
   -------------------------------------------------------------------------- */
.cpk-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

.watermark-lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.watermark-lightbox-modal.active {
  display: flex;
}

.cert-preview-box {
  position: relative;
  max-width: 680px;
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 40px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

/* 动态防盗水印层 (斜向重复水印) */
.watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -35deg,
    rgba(220, 38, 38, 0.08) 0,
    rgba(220, 38, 38, 0.08) 120px,
    transparent 120px,
    transparent 240px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.watermark-text-grid {
  transform: rotate(-30deg);
  font-size: 16px;
  font-weight: 800;
  color: rgba(220, 38, 38, 0.18);
  user-select: none;
  text-align: center;
  line-height: 2.8;
  letter-spacing: 2px;
}

/* --------------------------------------------------------------------------
   9. 通用 Modal 与 Toast 提示
   -------------------------------------------------------------------------- */
.toast-notice {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--cyan-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10001;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 响应式调整 */
@media (max-width: 900px) {
  .hero-grid,
  .matcher-grid,
  .estimator-grid,
  .cases-grid {
    grid-template-columns: 1fr;
  }
  .process-timeline {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
