@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=ZCOOL+QingKe+HuangYou&display=swap");

:root {
  --bg: #f2f6ff;
  --ink: #10203a;
  --muted: #66758d;
  --line: #dbe5f6;
  --card: #ffffff;
  --accent: #2563ff;
  --accent-soft: #eaf1ff;
  --ok: #047857;
  --danger: #b91c1c;
  --shadow: 0 14px 34px rgba(37, 99, 255, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html[data-device="mobile"],
html[data-device="desktop"] { background: var(--bg); }
body {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.workflow-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px 10px;
}
.sales-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sales-brand {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: "ZCOOL QingKe HuangYou", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0 6px;
}
.sales-home,
.sales-clear {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.header-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#progPercent {
  min-width: 2.6em;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  text-align: right;
}
.thick-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e7eefc;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6bff, #46b9ff 56%, #735cff);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.32, 1);
}
.progress-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.step {
  text-align: center;
  color: #90a0ba;
  font-size: 11px;
  font-weight: 800;
}
.step .num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid #cad8f6;
  background: #fff;
  margin-bottom: 3px;
  font-size: 11px;
}
.step.active { color: #1f4fd0; }
.step.active .num {
  background: #2f6bff;
  border-color: #2f6bff;
  color: #fff;
}
.step.done .num {
  background: #5cc0ff;
  border-color: #5cc0ff;
  color: #fff;
}

.admin-bar {
  display: none;
  background: #1f2b43;
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding: 7px 12px;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
body.admin .admin-bar { display: flex; }
.admin-bar button {
  border: 1px solid rgba(255,255,255,.7);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 3px 10px;
  cursor: pointer;
}

.wrap {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 40px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.main { min-width: 0; }
.step-panel { display: none; }
.step-panel.active { display: block; }
.st {
  margin: 0;
  font-family: "ZCOOL QingKe HuangYou", "Microsoft YaHei", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.04em;
  font-weight: 400;
}
.st-hint { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 校区：自适应；业务类型：两行两列（1·2 / 3·4） */
#campusCards {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
#typeCards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#campusCards .card,
#typeCards .card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 16px 16px 18px;
}
#campusCards .card.sel::after,
#typeCards .card.sel::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.32, 1), box-shadow 0.35s ease, border-color 0.25s ease, background 0.25s ease;
  transform-origin: center center;
}
.card:hover { border-color: #93c5fd; box-shadow: var(--shadow); }
.card.sel {
  border-color: #60a5fa;
  background: #e8f3ff;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 28px rgba(37, 99, 255, 0.14);
  z-index: 2;
}
.card .card-media {
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f3eb;
  margin-bottom: 10px;
}
.card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--img-pos, 50% 50%);
  transform: scale(var(--img-zoom, 1));
  transform-origin: var(--img-pos, 50% 50%);
  display: block;
}
.card .card-ph {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.card .card-media.photo-fallback .card-ph { display: flex; }
.card .card-media.photo-fallback .card-img { display: none; }
.card .card-media.card-media-logo {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .card-img.card-img-logo {
  width: auto;
  max-width: 72%;
  height: auto;
  max-height: 78%;
  object-fit: contain;
  transform: none;
}
.card .name { font-weight: 700; font-size: 15px; }
.card .price { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.45; }
.card .ctype {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1d4ed8;
  border: 1px solid #bfd3ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.card .ctype.both {
  color: #5b6478;
  background: #f3f5f9;
  border-color: #d7dde8;
}
.card .ctype.sijiao {
  color: #1d4ed8;
  background: #edf4ff;
  border-color: #bfd3ff;
}
.card .ctype.xiaozu {
  color: #0f766e;
  background: #ecfdf8;
  border-color: #99f6e4;
}
#instrumentGrid.view-grid .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#instrumentGrid.view-grid .card .card-media { order: 1; width: 100%; }
#instrumentGrid.view-grid .card .name { order: 2; width: 100%; margin-top: 2px; }
#instrumentGrid.view-grid .card .ctype { order: 3; margin-top: 8px; }
#instrumentGrid.view-grid .card .price { order: 4; }
.type-ic {
  height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  color: #1e3a5f;
}
.type-ic svg { width: 44px; height: 44px; }
#typeCards .card.sel .type-ic { color: #1d4ed8; }
#typeCards .card .name { margin-top: 0; }
#typeCards .card .price { margin-top: 8px; }

.nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.16, 1.18, 0.22, 1), box-shadow 0.35s ease, background 0.25s ease;
}
.btn:active { transform: scale(0.96); transition: transform 0.08s ease; }
.btn-primary { background: #111; color: #fff; }
.btn-ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn.block { width: 100%; }

.summary {
  position: sticky;
  top: calc(12px + 128px + 12px);
  background: #ffffff;
  color: var(--ink);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background-image:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 255, 0.12), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 40%);
}
.sum-head {
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
#sumBody { font-size: 13px; max-height: 48vh; overflow: auto; }
.srow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #dbe5f6;
}
.srow span { color: var(--muted); }
.srow b { color: var(--ink); font-weight: 700; }
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid #c7d7ff;
}
.total-row span { color: var(--muted); font-weight: 600; }
.total-row b {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.summary > .btn-primary {
  background: #111;
  color: #fff;
  box-shadow: none;
}
.status {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 12px;
  border: 1px solid #c7d7ff;
}
.status.error, .status.success, .status.loading { display: block; }
.status.error { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.status.success { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.vresult {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}
.vresult.show { display: block; }
.sum-empty { color: var(--muted); }

/* 换购：现价 + 原价划线 */
.addon-card .addon-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 8px;
}
.addon-card .addon-now-price {
  color: #c2410c;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.addon-card .addon-list-price {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #ef4444;
}
.addon-card.sel .addon-now-price { color: #9a3412; }
.addon-card.sel .addon-list-price { color: #94a3b8; }
.addon-multi-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.addon-card.sel .addon-multi-tag {
  background: #ffedd5;
  color: #9a3412;
}

.cart, .mode-pick, .addon-box, .gift-box, .stu-card {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.cart-empty, .sum-empty { color: var(--muted); text-align: center; padding: 16px 0; }
.addon-card .addon-now-price.peilian-zero,
.peilian-zero-inline {
  color: #ea580c;
  font-weight: 900;
}
.addon-card.sel .addon-now-price.peilian-zero { color: #c2410c; }
#peilianBox .mode-opt b .peilian-zero,
#peilianBox .mode-opt b { letter-spacing: 0.01em; }
.cart-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-row label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.cart-row input, .form2 input, .form2 select, .admin-edit input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
}
#planEdit.mode-pick {
  margin-top: 14px;
}
#planEdit .plan-edit-row {
  grid-template-columns: minmax(96px, 1.1fr) repeat(3, minmax(90px, 1fr)) auto;
  align-items: end;
}
#planEdit .ci-name b { display: block; margin-bottom: 6px; }
#planEdit .ci-sub {
  font-weight: 800;
  white-space: nowrap;
  padding-bottom: 8px;
  color: var(--accent);
}
.ci-lesson.seg {
  display: inline-flex;
  gap: 4px;
  margin-top: 4px;
}
.ci-lesson.seg button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.ci-lesson.seg button.on {
  background: #2563ff;
  border-color: #2563ff;
  color: #fff;
}
.ci-lesson.fixed {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 700;
}
@media (max-width: 720px) {
  #planEdit .plan-edit-row {
    grid-template-columns: 1fr 1fr;
  }
  #planEdit .ci-sub { grid-column: 1 / -1; }
}
.mode-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.mode-opt {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
  transition: transform 0.3s ease, border-color 0.25s ease, background 0.25s ease;
}
.mode-opt.sel { border-color: #60a5fa; background: #e8f3ff; transform: scale(1.03); }
.mode-opt b { display: block; margin-bottom: 4px; }
.mode-opt span { color: var(--muted); font-size: 12px; }
.mp-t { font-weight: 800; margin-bottom: 10px; }
.kebao-price { font-size: 24px; font-weight: 800; margin-top: 8px; }
.kebao-meta, .kebao-gift { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kebao-gift { color: #1d4ed8; }

/* 伴手礼：与换购同款卡片区（无大图） */
.gift-box { margin-top: 14px; }

.form2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form2 label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form2 label.full { grid-column: 1 / -1; }
.stu-head { font-weight: 800; margin-bottom: 10px; }
.toggle2 { margin-top: 12px; font-size: 13px; }
.hidden { display: none !important; }

.project-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.project-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  gap: 2px;
}
.view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, transform 0.18s ease;
}
.view-btn.on {
  background: #2563ff;
  color: #fff;
}
.view-btn:active { transform: scale(0.96); }

/* 宫格 ↔ 横条切换动效 */
#instrumentGrid {
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}
#instrumentGrid.view-switching {
  pointer-events: none;
}
#instrumentGrid.view-switching-out {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  filter: blur(2px);
}
#instrumentGrid.view-switching-in {
  animation: projectViewIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
#instrumentGrid.view-switching-in .card {
  animation: projectCardIn 0.36s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
#instrumentGrid.view-switching-in .card:nth-child(1) { animation-delay: 0.02s; }
#instrumentGrid.view-switching-in .card:nth-child(2) { animation-delay: 0.05s; }
#instrumentGrid.view-switching-in .card:nth-child(3) { animation-delay: 0.08s; }
#instrumentGrid.view-switching-in .card:nth-child(4) { animation-delay: 0.11s; }
#instrumentGrid.view-switching-in .card:nth-child(5) { animation-delay: 0.14s; }
#instrumentGrid.view-switching-in .card:nth-child(6) { animation-delay: 0.17s; }
#instrumentGrid.view-switching-in .card:nth-child(n+7) { animation-delay: 0.2s; }
@keyframes projectViewIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes projectCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #instrumentGrid,
  #instrumentGrid.view-switching-out,
  #instrumentGrid.view-switching-in,
  #instrumentGrid.view-switching-in .card {
    transition: none !important;
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
.project-counter {
  min-width: 84px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}
.project-counter strong { display: block; font-size: 26px; color: var(--accent); }

/* 横条模式：参考旧版整行票根式项目卡 */
#instrumentGrid.view-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#instrumentGrid.view-row .card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 128px;
  height: 128px;
  padding: 20px 72px 20px 18px;
  border-radius: 16px;
  overflow: hidden;
  transform-origin: center center;
}
#instrumentGrid.view-row .card.sel {
  transform: translateY(-3px) scale(1.015);
  background: #e8f3ff;
}
#instrumentGrid.view-row .card .card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 16px;
  z-index: 0;
}
#instrumentGrid.view-row .card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--img-pos, 50% 50%);
  transform: scale(var(--img-zoom, 1));
  transform-origin: var(--img-pos, 50% 50%);
}
#instrumentGrid.view-row .card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.84) 0%,
    rgba(255, 255, 255, 0.5) 34%,
    rgba(255, 255, 255, 0.16) 64%,
    rgba(255, 255, 255, 0.02) 100%
  );
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 30%, rgba(0,0,0,.5) 60%, transparent 90%);
  mask-image: linear-gradient(90deg, #000 0%, #000 30%, rgba(0,0,0,.5) 60%, transparent 90%);
}
#instrumentGrid.view-row .card .name {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  margin: 0;
  padding: 14px 0 34px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: "ZCOOL QingKe HuangYou", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #111;
  white-space: nowrap;
  background:
    radial-gradient(circle at 0 10px, transparent 5px, rgba(255, 255, 255, 0.34) 5.5px);
  background-size: 100% 20px;
  background-repeat: repeat-y;
  border-radius: 0 16px 16px 0;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  pointer-events: none;
}
#instrumentGrid.view-row .card .name::after {
  content: "已选";
  position: absolute;
  writing-mode: horizontal-tb;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%) translateY(8px) scale(0.72);
  padding: 3px 7px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #fff;
  background: #2563eb;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
#instrumentGrid.view-row .card.sel .name {
  color: #0b3a6b;
  background:
    radial-gradient(circle at 0 10px, transparent 5px, rgba(216, 236, 255, 0.5) 5.5px);
  background-size: 100% 20px;
  background-repeat: repeat-y;
}
#instrumentGrid.view-row .card.sel .name::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
#instrumentGrid.view-row .card .price {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  margin: 0;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}
#instrumentGrid.view-row .card .ctype {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  margin: 0;
  padding: 6px 12px;
  border-radius: 4px;
  border: 0;
  background: #2563eb;
  color: #fff;
  font-family: "ZCOOL QingKe HuangYou", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
  pointer-events: none;
}
#instrumentGrid.view-row .card .ctype.both {
  background: #334155;
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.22);
}
#instrumentGrid.view-row .card .ctype.sijiao {
  background: #2563eb;
  color: #fff;
}
#instrumentGrid.view-row .card .ctype.xiaozu {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.28);
}
#instrumentGrid.view-row .card .ctype + .price {
  top: 48px;
}
#instrumentGrid.view-row .card .card-ph {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
}

@media (max-width: 520px) {
  #instrumentGrid.view-row .card {
    height: 108px;
    min-height: 108px;
    padding: 14px 60px 14px 14px;
  }
  #instrumentGrid.view-row .card .name {
    width: 52px;
    font-size: 18px;
  }
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  text-align: center;
}
.modal img {
  width: min(280px, 100%);
  height: auto;
  border-radius: 12px;
  margin: 12px 0;
  background: #f3f4f6;
}
.modal .hint { color: var(--muted); font-size: 12px; }
.pay-modal .pay-route-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}
.pay-route-btn {
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.pay-route-btn.on {
  background: #111;
  border-color: #111;
  color: #fff;
}
.pay-route-btn:active { transform: scale(0.98); }
.pay-modal #payShowStep {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pay-modal #payShowStep.hidden { display: none !important; }
.pay-modal #payQrImg {
  width: min(280px, 86vw);
  height: auto;
  aspect-ratio: 1;
  margin: 8px 0 12px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}
.pay-show-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.pay-show-actions .btn { width: 100%; justify-content: center; }
.download-modal { text-align: left; }
.download-modal h3 { margin: 0 0 6px; text-align: center; }
.download-modal > .hint { text-align: center; margin: 0 0 12px; }
.download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  max-height: min(52vh, 420px);
  overflow: auto;
}
.download-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}
.download-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.download-item-main b {
  font-size: 14px;
  color: var(--ink);
}
.download-item-main span {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.35;
}
.download-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.download-item-actions .btn {
  width: 100%;
  justify-content: center;
}
.download-tip {
  margin: 0 0 14px !important;
  text-align: left !important;
  line-height: 1.45;
}
.admin-pwd-modal { text-align: left; }
.admin-pwd-modal h3 { margin: 0 0 8px; }
.admin-pwd-input {
  width: 100%;
  margin: 12px 0 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
}
.admin-pwd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-pwd-err {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.admin-pwd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

html[data-device="mobile"] .layout {
  grid-template-columns: 1fr;
}
html[data-device="mobile"] .wrap { padding-bottom: 120px; }
html[data-device="mobile"] .summary {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(8px, env(safe-area-inset-bottom));
  top: auto;
  z-index: 80;
  max-height: none;
  overflow: hidden;
}
html[data-device="mobile"] .summary:not(.quote-open) #sumBody,
html[data-device="mobile"] .summary:not(.quote-open) > .btn,
html[data-device="mobile"] .summary:not(.quote-open) > .status,
html[data-device="mobile"] .summary:not(.quote-open) > .vresult {
  display: none !important;
}
html[data-device="mobile"] .summary .sum-head { cursor: pointer; }
html[data-device="mobile"] .summary.quote-open {
  top: max(8px, env(safe-area-inset-top));
  overflow: auto;
}
html[data-device="mobile"] .cards.two { grid-template-columns: 1fr; }
html[data-device="mobile"] #typeCards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html[data-device="mobile"] #typeCards .card {
  min-height: 118px;
  padding: 12px;
}
html[data-device="mobile"] #typeCards .card .name { font-size: 15px; }
html[data-device="mobile"] #typeCards .card .price { font-size: 11px; }
html[data-device="mobile"] .cart-row { grid-template-columns: 1fr 1fr; }
html[data-device="mobile"] .form2 { grid-template-columns: 1fr; }
html[data-device="mobile"] .progress-steps .num { display: none; }

body.admin .sales-brand { color: #f59e0b; }

/* 生成凭证后的本单清单 */
.order-sheet {
  margin-top: 22px;
  margin-bottom: 28px;
}
.order-sheet-inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
}
.order-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.order-sheet-head h2 {
  margin: 0;
  font-family: "ZCOOL QingKe HuangYou", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  letter-spacing: 0.06em;
  font-weight: 400;
  color: #0f2a5c;
}
.order-sheet-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.order-sheet-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.os-block {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7faff;
  border: 1px solid #e4eefc;
}
.os-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #1d4ed8;
  letter-spacing: 0.04em;
}
.os-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(37, 99, 255, 0.12);
  font-size: 13px;
}
.os-row:last-child { border-bottom: 0; }
.os-row span { color: var(--muted); flex: 0 0 7.5em; }
.os-row b {
  flex: 1;
  text-align: right;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}
.os-pre {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 8px;
}
.os-pre-soft {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
.os-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #15233f;
  color: #fff;
}
.os-total span { font-size: 13px; color: #9fb0d0; }
.os-total strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
html[data-device="mobile"] .order-sheet {
  padding-bottom: 100px;
}
@media print {
  body.printing-order-sheet .workflow-shell,
  body.printing-order-sheet .layout,
  body.printing-order-sheet .modal-mask,
  body.printing-order-sheet .admin-bar {
    display: none !important;
  }
  body.printing-order-sheet .order-sheet {
    display: block !important;
    margin: 0;
  }
  body.printing-order-sheet .order-sheet-inner {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  body.printing-order-sheet .order-sheet-actions {
    display: none !important;
  }
}
