/* ===== 港口操作台 3D 选配平台 - 样式（沿用 winve-ac 官网风格） ===== */
:root {
  --deep: #0b2a52;
  --cyan: #0ea5e9;
  --grad: linear-gradient(120deg, #2563eb 0%, #0ea5e9 55%, #22d3ee 100%);
  --ink: #0f2740;
  --muted: #5b6b82;
  --card: #ffffff;
  --grid: #e6f2ff;
  --tint: #f4f9ff;
  --line: #e2ecf7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 42, 82, 0.08);
  --orange: #ea7a1f;
  --orange-bg: #fff6ec;
  --font: 'Outfit', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--tint);
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶部导航 ===== */
.topbar {
  background: var(--deep);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(11,42,82,.15);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 32px; width: auto; border-radius: 6px; }
.brand-name { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.topnav { display: flex; gap: 4px; }
.topnav-link {
  color: #c9d8ee;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .2s;
}
.topnav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.topnav-link.is-active { color: #fff; background: rgba(255,255,255,.14); }
.topbar-cta { color: #fff !important; border-color: rgba(255,255,255,.4) !important; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14,165,233,.3);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: #c3d3e8;
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); background: #f0f9ff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ===== 主布局 ===== */
.layout {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

/* ===== 3D 舞台 ===== */
.stage {
  background: radial-gradient(1200px 600px at 50% 0%, #eef7ff 0%, #dceafb 60%, #cddff5 100%);
  background-image:
    radial-gradient(circle at 50% 0%, #eef7ff 0%, #e4f1ff 60%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
}
.stage-hint { font-size: 12px; color: var(--muted); }
.stage-actions { display: flex; gap: 8px; }
.stage-canvas { flex: 1; min-height: 540px; position: relative; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; }
.stage-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(11,42,82,.82);
  color: #fff;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ===== 左列容器：3D 预览 + HPL 样册入口 ===== */
.stage-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ===== HPL 台面纹路样册入口（左列，3D 预览下方） ===== */
.hpl-catalog-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.hpl-catalog-info { display: flex; flex-direction: column; gap: 3px; }
.hpl-catalog-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .2px;
}
.hpl-catalog-sub { font-size: 11px; color: var(--muted); }
.hpl-catalog-btn {
  background: linear-gradient(120deg, #ea7a1f 0%, #f59e0b 100%);
  color: #fff;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(234,122,31,.3);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  transition: all .2s;
}
.hpl-catalog-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234,122,31,.4);
}

/* ===== 配置面板 ===== */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.panel-body { padding: 6px 20px; max-height: 560px; overflow-y: auto; }

.cfg-group { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cfg-group:last-child { border-bottom: none; }
.cfg-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.cfg-row { display: flex; gap: 10px; }
.cfg-3col > .cfg-field { flex: 1; }
.cfg-field { display: flex; flex-direction: column; gap: 6px; }
.cfg-field span { font-size: 12px; color: var(--muted); }
.cfg-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  outline: none;
  transition: border .2s;
}
.cfg-field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }

.cfg-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-choice {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
}
.cfg-choice:hover { border-color: var(--cyan); color: var(--cyan); }
.cfg-choice.is-active { background: var(--grad); color: #fff; border-color: transparent; }

.cfg-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  min-width: 64px;
}
.cfg-swatch span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  display: block;
}
.cfg-swatch.is-active { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(14,165,233,.25); color: var(--ink); font-weight: 600; }

.cfg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cfg-tip { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.cfg-sub {
  font-size: 12px; font-weight: 700; color: var(--ink);
  margin: 10px 0 6px;
}
.cfg-sub:first-child { margin-top: 0; }
.cfg-plc-cpu { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-plc-cpu .cfg-choice {
  padding: 6px 10px; font-size: 12px; border-radius: 8px;
  border: 1px solid #d5e2f2; background: #fff; color: var(--ink); cursor: pointer;
  transition: all .15s;
}
.cfg-plc-cpu .cfg-choice.is-active {
  background: var(--grad); color: #fff; border-color: transparent;
}
/* 扩展模块数量步进 */
.cfg-ext-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 4px 0;
}
.cfg-ext-row .cfg-check { margin: 0; }
.cfg-qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid #d5e2f2; border-radius: 8px; overflow: hidden;
  opacity: .35; pointer-events: none;
  transition: opacity .15s;
}
.cfg-qty.is-on { opacity: 1; pointer-events: auto; }
.cfg-qty-btn {
  width: 26px; height: 26px; line-height: 1;
  border: none; background: #eef5ff; color: var(--ink);
  font-size: 16px; cursor: pointer;
}
.cfg-qty-btn:active { background: #d8e8ff; }
.cfg-qty-val {
  min-width: 28px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.cfg-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  transition: all .2s;
}
.cfg-check:hover { border-color: var(--cyan); }
.cfg-check input { accent-color: var(--cyan); width: 15px; height: 15px; }

/* ===== 报价栏 ===== */
.quote {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 16px 20px 18px;
}
.quote-lines { margin-bottom: 10px; }
.quote-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
}
.quote-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: var(--orange-bg);
  border: 1px solid #f5d9b8;
  border-radius: 10px;
}
.quote-total-label { font-size: 13px; color: #9a6a32; font-weight: 600; }
.quote-total-value { font-size: 26px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; }
.quote-note { font-size: 11px; color: #b0a69a; text-align: center; margin-top: 8px; }

/* ===== 信息区块 ===== */
.section { padding: 56px 0; }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); }
.section-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.section-title { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 28px; color: var(--ink); }
.faq-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.faq-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.faq-card h4 { font-size: 14px; margin-bottom: 8px; color: var(--ink); }
.faq-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.contact-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; margin: 0 auto; }
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.contact-card h4 { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.contact-card p { font-size: 18px; font-weight: 700; color: var(--ink); }
.contact-card a { color: var(--cyan); text-decoration: none; }

.footer { background: var(--deep); color: #8fa8c8; text-align: center; padding: 22px 0; font-size: 13px; }

/* ===== 询价弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 42, 82, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(11, 42, 82, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.modal-sub { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.modal-quote {
  background: var(--orange-bg);
  border: 1px solid #f5d9b8;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  max-height: 180px;
  overflow-y: auto;
}
.modal-quote .quote-line { font-size: 12px; }
.modal-quote .quote-total-inline {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #f0c999;
  font-weight: 700;
  color: var(--orange);
  font-size: 15px;
}
.modal-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.modal-form .cfg-field input,
.modal-form .cfg-field textarea {
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  resize: vertical;
}
.modal-form .cfg-field input:focus,
.modal-form .cfg-field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.modal-msg { margin-top: 10px; font-size: 13px; text-align: center; }
.modal-msg.ok { color: #15803d; }
.modal-msg.err { color: #dc2626; }

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .stage { min-height: 480px; }
  .stage-canvas { min-height: 400px; }
  .panel-body { max-height: none; }
}

/* 移动端抽屉元素默认隐藏（仅移动端显示） */
.panel-handle, .panel-close, .mob-fab { display: none; }

/* ===== 移动端：配置面板 → 底部抽屉 ===== */
@media (max-width: 640px) {
  .topnav { display: none; }
  .layout { padding: 0; margin: 0; }
  .stage {
    min-height: 0;
    height: calc(100vh - 56px); /* 3D 舞台占满首屏 */
    border-radius: 0; border-left: none; border-right: none;
  }
  .stage-canvas { min-height: 0; flex: 1; }
  .stage-hint { font-size: 11px; }
  .stage-badge { bottom: 60px; }

  /* HPL 样册入口窄屏适配 */
  .hpl-catalog-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 12px;
  }
  .hpl-catalog-sub { display: none; }
  .hpl-catalog-btn { font-size: 12px; padding: 7px 12px; }

  /* 面板固定为底部抽屉 */
  .panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(11,42,82,.22);
    max-height: 74vh;
    transform: translateY(105%);
    transition: transform .32s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .panel.is-open { transform: translateY(0); }
  .panel-body { max-height: none; overflow-y: auto; flex: 1; }
  .quote { flex: 0 0 auto; }

  /* 抽屉顶部把手 + 关闭按钮 */
  .panel-handle { display: flex; justify-content: center; padding: 8px 0 2px; }
  .panel-handle span {
    width: 44px; height: 4px; border-radius: 4px;
    background: #ccd9ea;
  }
  .panel-close {
    display: block;
    position: absolute; top: 10px; right: 14px;
    border: none; background: none;
    font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer;
  }
  .panel-close:hover { color: var(--ink); }
  .panel-head { padding: 2px 20px 12px; }

  /* 悬浮配置按钮（仅在移动端显示） */
  .mob-fab {
    display: inline-flex;
    position: absolute;
    right: 16px; bottom: 16px;
    z-index: 60;
    background: var(--grad);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 11px 20px;
    font-size: 14px; font-weight: 600;
    font-family: var(--font);
    box-shadow: 0 8px 20px rgba(14,165,233,.35);
    cursor: pointer;
    transition: transform .2s;
  }
  .mob-fab:active { transform: scale(.96); }

  /* 弹窗移动端全屏 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 24px 20px;
  }
  .faq-grid, .contact-row { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
}

/* ===== 配置单样式（PDF 生成） ===== */
.quote-sheet {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 794px; /* A4 @96dpi */
  background: #fff;
  color: #0f2740;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  padding: 40px 44px;
  line-height: 1.5;
}
.quote-sheet .qs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #0b2a52;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.quote-sheet .qs-brand { font-size: 22px; font-weight: 800; color: #0b2a52; }
.quote-sheet .qs-title { font-size: 15px; color: #0ea5e9; font-weight: 700; text-align: right; }
.quote-sheet .qs-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 12px; color: #5b6b82; margin-bottom: 16px; }
.quote-sheet .qs-meta b { color: #0f2740; }
.quote-sheet h3 { font-size: 15px; color: #0b2a52; margin: 14px 0 8px; }
.quote-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.quote-sheet table th, .quote-sheet table td {
  border: 1px solid #dfe9f5;
  padding: 7px 9px;
  text-align: left;
}
.quote-sheet table th { background: #eef5ff; color: #0b2a52; font-weight: 700; }
.quote-sheet .qs-total td {
  background: #fff6ec;
  border: 1px solid #f5d9b8;
  color: #ea7a1f;
  font-weight: 800;
  font-size: 16px;
}
.quote-sheet .qs-foot {
  margin-top: 22px;
  font-size: 11px;
  color: #8a97aa;
  border-top: 1px dashed #dfe9f5;
  padding-top: 12px;
  text-align: center;
}
