:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1b1d22;
  --muted: #8a8f99;
  --line: #e8e9ed;
  --accent: #2f55e8;
  --accent-soft: #eef1ff;
  --accent-line: #aab8ff;
  --danger: #d63a3a;
  --radius: 9px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.shop-body { min-height: 100vh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.shop-shell { width: min(760px, 100%); margin: 0 auto; overflow-x: clip; }
.shop-header {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center;
  height: 56px; padding: 0 14px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(0,0,0,.045);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.shop-header h1 { margin: 0; font-size: 16px; font-weight: 650; text-align: center; letter-spacing: .01em; }
.back-button { justify-self: start; width: 38px; height: 38px; border: 0; background: transparent; color: #333; font-size: 30px; line-height: 1; padding: 0 0 5px; }
.header-link { justify-self: end; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600; }
.header-link.is-muted { color: var(--muted); }

.shop-main { padding: 12px 12px 24px; }
.shop-intro {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 10px; padding: 15px 16px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.brand-mark {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, #fff4d8, #f9dfad);
  box-shadow: inset 0 0 0 1px rgba(144,100,31,.08);
  flex: 0 0 auto;
}
.brand-mark::before {
  content: ""; position: absolute; width: 20px; height: 27px; border-radius: 5px;
  background: #d98a2b; box-shadow: 0 2px 5px rgba(120,72,15,.28);
}
.brand-phone {
  position: relative; z-index: 1; width: 13px; height: 19px; border-radius: 2.5px;
  background: linear-gradient(180deg, #fff8e9 0%, #f4d7a2 100%);
}
.brand-phone::before { content: ""; position: absolute; left: 4px; top: 3px; width: 5px; height: 8px; border-radius: 1px; background: #fff; }
.brand-copy { min-width: 0; flex: 1; }
.brand-copy h2 { margin: 0 0 4px; font-size: 15px; font-weight: 650; line-height: 1.25; }
.brand-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.intro-service { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #3d4149; font-size: 12px; }

.notice-strip {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 10px; padding: 9px 13px;
  border: 1px solid #dce4ff; border-radius: var(--radius);
  background: #f6f8ff; color: #53617f; font-size: 12px; line-height: 1.5;
}
.notice-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }

.panel {
  margin-bottom: 10px; padding: 15px 16px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.panel-title { display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.panel-title h3 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
.step-index { color: var(--accent); font-size: 13px; font-weight: 700; }
.panel-count { margin-left: auto; color: #a0a4ad; font-size: 12px; }
.panel-title.no-index { margin-bottom: 11px; }

.device-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.device-tab {
  height: 38px; border: 1px solid #dfe1e6; border-radius: 5px;
  background: #fff; color: #454a53; font-size: 13px; font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
}
.device-tab.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(47,85,232,.06); }

.product-list { display: grid; gap: 8px; }
.product-card {
  display: flex; align-items: center; gap: 10px;
  min-height: 53px; padding: 9px 13px;
  border: 1px solid #dfe1e6; border-radius: 5px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.product-card:hover { border-color: #b8c3f7; }
.product-card.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(47,85,232,.04); }
.product-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot { width: 14px; height: 14px; border: 1.5px solid #b9bec8; border-radius: 50%; background: #fff; flex: 0 0 auto; }
.product-card.is-selected .radio-dot { border: 4px solid var(--accent); }
.product-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.product-copy strong { font-size: 13px; font-weight: 600; line-height: 1.15; }
.product-copy small { color: #9297a1; font-size: 11px; line-height: 1.15; }
.product-price { color: var(--accent); font-size: 15px; font-weight: 650; flex: 0 0 auto; }
.empty-products { padding: 18px 0 6px; color: var(--muted); text-align: center; font-size: 13px; }

.field-label { display: block; margin: 0 0 7px; color: #5d626c; font-size: 12px; }
.field-label span { color: var(--danger); }
.udid-field { display: flex; overflow: hidden; border: 1px solid #dfe1e6; border-radius: 5px; background: #fff; }
.udid-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47,85,232,.09); }
.udid-field input { min-width: 0; height: 38px; flex: 1; padding: 0 11px; border: 0; outline: 0; color: var(--text); font-size: 13px; letter-spacing: .02em; }
.udid-field input::placeholder { color: #b2b6be; letter-spacing: 0; }
.get-udid { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 0 12px; border: 0; border-left: 1px solid #e3e5e9; background: #fafbfc; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.field-help { margin: 7px 0 0; color: #a0a4ad; font-size: 11px; }

.pay-panel { padding-bottom: 15px; }
.pay-option { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent-soft); color: #30343d; font-size: 12px; font-weight: 500; }
.pay-option input { display: none; }
.alipay-logo { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #1677ff; color: #fff; font-size: 10px; font-weight: 700; }
.pay-hint { margin: 8px 0 0; color: #b87a20; font-size: 11px; }

.checkout-bar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 760px; margin: 0 auto; padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(255,255,255,.97); border-top: 1px solid rgba(0,0,0,.055);
  box-shadow: 0 -5px 20px rgba(20,30,60,.04);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.checkout-summary { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.checkout-summary small { overflow: hidden; color: #8e939d; font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.checkout-summary strong { color: var(--accent); font-size: 20px; font-weight: 650; line-height: 1; }
.checkout-button { flex: 0 0 142px; height: 42px; border: 0; border-radius: 5px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; transition: opacity .15s, transform .15s; }
.checkout-button:active { transform: scale(.985); }
.checkout-button:disabled { opacity: .45; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(18,22,34,.34); backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal-card { width: min(400px, 100%); padding: 18px; border-radius: 12px; background: #fff; box-shadow: 0 18px 60px rgba(10,20,50,.22); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f3f4f6; color: #737983; font-size: 20px; line-height: 1; }
.modal-steps { margin: 0 0 16px; padding-left: 19px; color: #606671; font-size: 13px; line-height: 1.7; }
.modal-primary, .modal-secondary { display: flex; align-items: center; justify-content: center; width: 100%; height: 40px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.modal-primary { background: var(--accent); color: #fff; }
.modal-secondary { margin-top: 8px; border: 1px solid #e1e3e8; background: #fff; color: #4a505a; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 112px; max-width: calc(100vw - 48px); padding: 10px 15px; border-radius: 7px; background: rgba(25,29,38,.92); color: #fff; font-size: 13px; line-height: 1.45; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 761px) {
  .shop-body { padding-top: 0; }
  .shop-header { margin-top: 0; }
  .shop-main { padding: 14px 0 24px; }
}
@media (max-width: 380px) {
  .shop-main { padding-left: 9px; padding-right: 9px; }
  .panel { padding-left: 13px; padding-right: 13px; }
  .checkout-button { flex-basis: 124px; }
}
+.error-panel { padding: 36px 24px; text-align: center; }
+.error-symbol { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; background: #fff0f0; color: #d33a3a; font-size: 23px; font-weight: 700; }
+.error-panel h2 { margin: 0 0 8px; font-size: 18px; }
+.error-panel p { margin: 0 auto 20px; max-width: 360px; color: #8b909a; font-size: 13px; line-height: 1.6; }
+.error-panel .modal-primary { width: 160px; margin: 0 auto; }
[hidden] { display: none !important; }
.shop-shell, .shop-main, .panel { min-width: 0; }
.notice-text { min-width: 0; overflow-wrap: anywhere; }

.udid-body { padding-bottom: 28px; }
.udid-hero { padding: 24px 18px 20px; text-align: center; }
.udid-hero-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(145deg, #eef2ff, #dfe6ff); color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.udid-hero h2 { margin: 0 0 7px; font-size: 18px; font-weight: 700; }
.udid-hero p { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.udid-steps { display: grid; gap: 13px; margin: 0 0 17px; padding: 0; list-style: none; }
.udid-steps li { display: flex; gap: 10px; }
.udid-steps li > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.udid-steps strong { display: block; margin: 1px 0 3px; font-size: 13px; font-weight: 650; }
.udid-steps p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.udid-install { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 650; text-decoration: none; }
.udid-install:active { opacity: .88; }
.udid-note { margin: 11px 2px 0; color: #a0a4ad; font-size: 11px; line-height: 1.55; }
.udid-waiting { padding: 27px 18px; text-align: center; }
.udid-spinner { width: 24px; height: 24px; margin: 0 auto 11px; border: 2.5px solid #e4e8f7; border-top-color: var(--accent); border-radius: 50%; animation: udid-spin .8s linear infinite; }
@keyframes udid-spin { to { transform: rotate(360deg); } }
.udid-waiting strong { display: block; margin-bottom: 5px; font-size: 14px; }
.udid-waiting p { margin: 0; color: var(--muted); font-size: 12px; }
.udid-value { padding: 13px 14px; border: 1px solid #dfe3f4; border-radius: 6px; background: #f8f9ff; color: #25304f; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; user-select: all; }
.udid-actions { display: flex; gap: 9px; margin-top: 12px; }
.udid-copy, .udid-back-shop { display: flex; align-items: center; justify-content: center; min-height: 39px; flex: 1; border-radius: 5px; font-size: 13px; font-weight: 600; text-decoration: none; }
.udid-copy { border: 0; background: var(--accent); color: #fff; }
.udid-back-shop { border: 1px solid #dfe1e6; background: #fff; color: #454a53; }
.udid-success, .udid-error { padding: 27px 18px 22px; text-align: center; }
.udid-success-icon, .udid-error-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 50%; font-size: 25px; font-weight: 700; }
.udid-success-icon { background: #eaf8f0; color: #168451; }
.udid-error-icon { background: #fff0f0; color: #d33a3a; }
.udid-success h2, .udid-error h2 { margin: 0 0 6px; font-size: 18px; }
.udid-success p, .udid-error p { max-width: 390px; margin: 0 auto 17px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.udid-meta { display: grid; gap: 0; margin: 16px 0 0; padding: 0; border-top: 1px solid #f0f1f4; }
.udid-meta div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid #f0f1f4; font-size: 12px; }
.udid-meta dt { color: var(--muted); }
.udid-meta dd { margin: 0; color: #333842; text-align: right; overflow-wrap: anywhere; }
