/* ============ 跑马灯 ============ */
.marquee {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 28px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: mq-scroll 40s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
/* 两组宽度完全一致（每组末尾自带分隔符 + 右侧留白 = 组内间距），平移 -50% 正好无缝 */
.marquee-group {
  --mq-gap: clamp(28px, 4vw, 56px);
  display: flex;
  align-items: center;
  flex: none;
  gap: var(--mq-gap);
  padding-right: var(--mq-gap);
}
.marquee-group span {
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-3);
  white-space: nowrap;
}
/* 分隔符：45° 指向右上的蓝色短线，呼应 Logo 箭头 */
.marquee-group i {
  flex: none;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
  transform: rotate(-45deg);
}
@keyframes mq-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ============ 产品网格 ============ */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
}
.card-image { grid-column: 1 / -1; }
.card-erp { grid-column: 1 / span 6; }
.card-price { grid-column: 7 / span 6; }

/* ============ 卡片 ============ */
.card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--line);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: opacity 1s var(--ease), transform 0.7s var(--ease), border-color 0.3s, background-color 0.5s var(--ease);
}
/* 带 .reveal 时：未入场沿用 base.css 的位移；入场后换成倾斜，优先级 (0,4,0) 高于 .js .reveal.in */
.js .card.reveal {
  transition: opacity 1s var(--ease), transform 0.7s var(--ease), border-color 0.3s, background-color 0.5s var(--ease);
}
.js .card.reveal.in {
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.card:hover { border-color: var(--line-2); }
/* 亮色主题：纯白卡片在浅灰底上更清晰 */
html[data-theme="light"] .card { background: var(--solid); }

/* 跟随光标的径向高光 */
.card::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), var(--blue-soft), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; min-width: 0; }

.card-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
}
.card-erp, .card-price { display: flex; flex-direction: column; }

/* ============ 卡片文字 ============ */
.card-text .card-index {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.card-text .card-index::first-letter { color: var(--blue-ink); }
.card-text h3 {
  margin: 14px 0 12px;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.card-text p {
  max-width: 54ch;
  font-size: 15.5px;
  color: var(--text-2);
  text-wrap: pretty;
}
.ticks { display: grid; gap: 10px; margin-top: 24px; }
.ticks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
}
.ticks svg {
  flex: none;
  width: 16px; height: 16px;
  margin-top: 4px;
  color: var(--blue-ink);
}

/* ============ 前后对比 ============ */
/* 两个 pane 是「模拟照片」，颜色不随主题变化，故使用固定色值 */
.compare {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}
.compare-pane { position: absolute; inset: 0; }

/* 商品：两侧完全相同的定位规则，拖动时像素级重合；容器 4:3，宽 42% = 高 56%，即正方形 */
.compare .prod {
  position: absolute;
  z-index: 2;
  left: 29%;
  top: 18%;
  width: 42%;
  height: 56%;
}

/* 原图：摄影棚白底 */
.compare-before {
  background:
    radial-gradient(ellipse 80% 70% at 50% 38%, #fbfbfa 0%, transparent 70%),
    linear-gradient(180deg, #f6f6f4 0%, #eeeeeb 100%);
}
.compare-before .prod { color: #1a1a1d; }
/* 地面投影：商品底边约在 68% 高度 */
.compare-before::after {
  content: "";
  position: absolute; z-index: 1;
  left: 31%; width: 38%;
  top: 65.5%; height: 7%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
  filter: blur(6px);
}

/* AI 场景：深色展台 */
.compare-after {
  clip-path: inset(0 0 0 var(--pos, 50%));
  background:
    radial-gradient(90% 70% at 78% 6%, var(--blue-glow), transparent 62%),
    radial-gradient(70% 60% at 18% 100%, rgba(10, 95, 214, 0.28), transparent 70%),
    linear-gradient(165deg, #05060a 0%, #0a1426 58%, var(--blue-deep) 160%);
  background-color: #05060a;
}
.compare-after .prod {
  color: #f5f5f7;
  filter: drop-shadow(0 0 22px var(--blue-glow)) drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55));
}
.compare-after::after {
  content: "";
  position: absolute; z-index: 1;
  left: 27%; width: 46%;
  top: 64.5%; height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(92, 176, 255, 0.34) 0%, rgba(0, 0, 0, 0.4) 45%, transparent 72%);
  filter: blur(6px);
}
.scene-sun {
  position: absolute; z-index: 0;
  right: -10%; top: -16%;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, var(--blue-2) 22%, var(--blue) 42%, transparent 70%);
  filter: blur(18px);
  opacity: 0.75;
}
.scene-floor {
  position: absolute; z-index: 0;
  left: 0; right: 0; bottom: 0;
  height: 35%;
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(92, 176, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(31, 143, 255, 0.16) 0%, rgba(8, 12, 22, 0.92) 42%, #040507 100%);
}
/* 展台顶部细高光线 */
.scene-floor::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
}

/* 角标 */
.compare-label {
  position: absolute; z-index: 3;
  top: 14px;
  max-width: calc(50% - 20px);
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.compare-before .compare-label {
  left: 14px;
  color: #1a1a1d;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(10, 10, 12, 0.08);
}
.compare-after .compare-label {
  right: 14px;
  color: #f5f5f7;
  background: rgba(10, 12, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* 分割线与把手 */
.compare-handle {
  position: absolute; z-index: 4;
  top: 0; bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.compare-handle span {
  position: absolute;
  left: 50%; top: 50%;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease), box-shadow 0.3s var(--ease);
}
/* 左右小三角 */
.compare-handle span::before,
.compare-handle span::after {
  content: "";
  position: absolute; top: 50%;
  width: 0; height: 0;
  margin-top: -5px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.compare-handle span::before { left: 10px; border-right: 6px solid #1a1a1d; }
.compare-handle span::after { right: 10px; border-left: 6px solid #1a1a1d; }
.compare:hover .compare-handle span { transform: translate(-50%, -50%) scale(1.06); }
.compare:has(.compare-range:focus-visible) .compare-handle span {
  box-shadow: 0 0 0 3px var(--blue), 0 0 0 8px var(--blue-soft), 0 8px 22px rgba(0, 0, 0, 0.35);
}

/* 真正的控件：透明铺满，拇指放大到 44px 便于触控 */
.compare-range {
  position: absolute; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  background: transparent;
  touch-action: pan-y;
  -webkit-appearance: none;
  appearance: none;
}
.compare-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px; height: 44px;
  cursor: ew-resize;
}
.compare-range::-moz-range-thumb {
  width: 44px; height: 44px;
  border: 0;
  cursor: ew-resize;
}

/* ============ 上架日志 ============ */
.console {
  margin-top: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--solid);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
}
.card-erp .card-text { margin-bottom: 28px; }
html[data-theme="dark"] .console { background: #0d0d10; }
html[data-theme="light"] .console { background: var(--bg); }

.console-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.console-bar i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}
.console-bar span {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.console-body { padding: 4px 0; }
.console-body li {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px dashed var(--line);
  color: var(--text-2);
  transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
}
.console-body li:last-child { border-bottom: 0; }
.console-body li > span:not(.st) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.console-body em {
  margin-left: auto;
  flex: none;
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  transition: color 0.4s var(--ease);
}
/* 运行行的扫光层 */
.console-body li::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, transparent 0%, var(--blue-soft) 50%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

/* 状态点 */
.console-body .st {
  position: relative;
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

/* done：绿色对勾圆点 */
.console-body li.done .st {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}
.console-body li.done .st::before {
  content: "";
  position: absolute;
  left: 50%; top: 45%;
  width: 3px; height: 6px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* run：蓝色旋转环 + 扫光高亮 */
.console-body li.run { color: var(--text); }
.console-body li.run em { color: var(--blue-ink); }
.console-body li.run::before {
  opacity: 1;
  animation: con-sweep 1.8s var(--ease-io) infinite;
}
.console-body li.run .st { border-color: var(--blue-soft); }
.console-body li.run .st::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--blue);
  transform: translate(-50%, -50%);
}
.console-body li.run .st::after {
  content: "";
  position: absolute; inset: -1.5px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--blue);
  border-right-color: var(--blue);
  animation: con-spin 0.9s linear infinite;
}

/* wait：整体淡出 */
.console-body li.wait { opacity: 0.45; }

@keyframes con-spin { to { transform: rotate(360deg); } }
@keyframes con-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ============ 核价 ============ */
.card-text .formula {
  max-width: none;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.calc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.calc label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.calc label span {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.calc input::-webkit-outer-spin-button,
.calc input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc input:hover { border-color: var(--line-2); }
/* 用边框 + 外发光代替全局 outline，键盘焦点依旧清晰可见 */
.calc input:focus,
.calc input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.calc-out {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.calc-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s, background-color 0.3s;
}
.calc-cell small { font-size: 12px; color: var(--text-3); }
.calc-cell b {
  font-size: clamp(28px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.calc-cell.hl {
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
  background: var(--blue-soft);
}
.calc-cell.hl b { color: var(--blue-ink); }

.calc-err {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 1.5;
  color: #f59e0b;
}
html[data-theme="light"] .calc-err { color: #a3500a; }
.calc-note {
  grid-column: 1 / -1;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ============ 响应式：产品区 ============ */
@media (max-width: 960px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .card-image, .card-erp, .card-price { grid-column: 1 / -1; }
  .card-image { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .calc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-text .formula { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .console { font-size: 12.5px; }
  .console-body li { gap: 10px; padding: 10px 12px; }
  .console-bar { padding: 11px 12px; }
  .calc-cell { padding: 12px; }
  /* 375px 下单格内宽约 113px，"$ 10.59" 等宽 26px ≈ 109px，28px 会折行，故此档降到 26px */
  .calc-cell b { font-size: 26px; }
  .compare-label { top: 10px; font-size: 10.5px; padding: 4px 8px; }
  .compare-before .compare-label { left: 10px; }
  .compare-after .compare-label { right: 10px; }
}
