:root {
  --ink: #102b58;
  --muted: #61718a;
  --line: #d7e3f2;
  --blue: #0b55d8;
  --bg: #f4f8ff;
  --panel: rgba(255, 255, 255, .9);
}
* { box-sizing: border-box; }
body.purchase-shell {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 84% 4%, rgba(87, 153, 232, .2), transparent 28rem),
    linear-gradient(180deg, #f8fbff, #eef5ff);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 76px;
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid #dbe6f3;
  backdrop-filter: blur(18px);
}
.nav, .shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 850;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #357bf0, #0d4cc6);
  box-shadow: 0 0 24px rgba(21, 88, 216, .23);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #61718a;
  font-size: 14px;
}
.nav-links a:hover { color: var(--ink); }
.nav-buy {
  padding: 10px 16px;
  border: 1px solid #8db0ed;
  border-radius: 999px;
  color: #1458d8;
  background: #f7faff;
  font-weight: 750;
}
main { padding: 48px 0 80px; }
.flash {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}
.flash.ok { background: #e8f8ee; color: #146c3c; }
.flash.err { background: #fdecec; color: #9b1c1c; }
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.eyebrow {
  color: #1458d8;
  font-size: 12px;
  letter-spacing: .16em;
  font-weight: 850;
}
.page-head h1 {
  margin: 10px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -.05em;
}
.page-head p {
  max-width: 410px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .78fr);
  align-items: start;
  gap: 24px;
}
.catalog, .side-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(50, 97, 157, .08);
}
.catalog { padding: 16px; }
.product {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dbe7f5;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f6faff);
}
.product + .product { margin-top: 14px; }
.product img,
.product .product-photo {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 15px;
  background: #e8f1ff;
}
.product .placeholder {
  display: grid;
  place-items: center;
  color: #8aa0c0;
  font-size: 13px;
}
.product h2 { margin: 0; font-size: 25px; }
.product p {
  margin: 9px 0 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f1ff;
  color: #1458d8;
  font-size: 12px;
  font-weight: 750;
}
.stock i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e79ef;
}
.product-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.price {
  color: #0b4fc9;
  font-size: 25px;
  font-weight: 850;
}
.qty {
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid #c8d9f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty button, .qty output {
  width: 42px;
  height: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: var(--ink);
}
.qty button { font-size: 23px; cursor: pointer; }
.qty output {
  display: grid;
  place-items: center;
  border-inline: 1px solid #dbe7f5;
  font-size: 16px;
}
.add, .checkout {
  height: 42px;
  padding: 0 23px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #2c75ee, #0b4fc9);
  font-weight: 800;
  cursor: pointer;
}
.side-card { padding: 24px; }
.side-card + .side-card { margin-top: 18px; }
.side-card h2 { margin: 0 0 18px; font-size: 23px; }
.summary-empty {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border-radius: 15px;
  background: #f4f8ff;
  color: var(--muted);
  font-size: 14px;
}
.summary-empty[hidden] { display: none; }
.summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f1ff;
  color: #1458d8;
  font-size: 20px;
}
.summary-lines { display: grid; gap: 13px; margin: 20px 0; }
.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #36557f;
  font-size: 14px;
}
.line.total {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}
.line.total strong { color: #0b4fc9; font-size: 26px; }
.checkout {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 850;
}
.methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.method {
  position: relative;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #c9dbf2;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}
.method.active {
  border-color: #2c75ee;
  box-shadow: 0 0 0 2px rgba(44, 117, 238, .14);
}
.method.blank {
  cursor: default;
  background: linear-gradient(145deg, #fff, #f8fbff);
}
.method .radio {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border: 1px solid #cbd9ec;
  border-radius: 50%;
}
.method.active .radio { border: 5px solid #2c75ee; }
.pay-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 24px;
  font-weight: 850;
}
.alipay { background: #1d83ea; }
.wxpay { background: #07c160; }
.payment-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.status {
  min-height: 20px;
  margin-top: 12px;
  color: #1458d8;
  font-size: 13px;
  font-weight: 700;
}
.footer {
  padding: 26px 0 38px;
  text-align: center;
  color: #6c7e99;
  font-size: 12px;
}
.catalog-loading, .empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty-state {
  border: 1px dashed #cbdcf0;
  border-radius: 16px;
  background: #f8fbff;
}
.add:disabled { cursor: not-allowed; opacity: .45; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .page-head { display: block; }
  .page-head p { margin-top: 12px; }
  .side-card { position: static; }
}
@media (max-width: 620px) {
  .nav, .shell { width: min(100% - 28px, 1180px); }
  .topbar { height: auto; }
  .nav { min-height: 68px; }
  .nav-links { gap: 10px; font-size: 12px; }
  .nav-links a:not(.nav-buy) { display: none; }
  .page-head h1 { font-size: 40px; }
  .product {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 14px;
  }
  .product img,
  .product .product-photo { width: 105px; height: 105px; }
  .product-actions {
    grid-column: 1 / -1;
    align-items: center;
  }
  .product h2 { font-size: 20px; }
  .methods { grid-template-columns: 1fr; }
  .method.blank { display: flex; }
}
