:root {
  --ink: #0e1513;
  --paper: #f5f7f3;
  --surface: #ffffff;
  --line: #dce3dd;
  --muted: #6b7671;
  --teal: #0aa38f;
  --teal-dark: #087668;
  --mint: #d9f5ec;
  --orange: #f06432;
  --yellow: #efd457;
  --red: #c8443b;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.store-header { display: flex; width: min(1180px, calc(100% - 40px)); height: 76px; margin: 0 auto; align-items: center; justify-content: space-between; }
.store-brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 850; }
.brand-glyph { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 6px; background: var(--yellow); color: var(--ink); font-weight: 900; }
.store-header-actions { display: flex; align-items: center; gap: 14px; }
.secure-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.secure-line svg { width: 15px; color: var(--teal-dark); }
.outline-button, .buy-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 0 15px; background: #fff; color: var(--ink); font-weight: 750; }
.outline-button:hover { border-color: #9eaaa4; }
.outline-button svg, .buy-button svg, .icon-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.buy-button { border-color: var(--ink); background: var(--ink); color: #fff; }
.buy-button span { white-space: nowrap; }
.buy-button:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.wide { width: 100%; }
.icon-button { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: inherit; }
.icon-button:hover { background: rgba(14,21,19,0.06); }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-size: 10px; font-weight: 850; }

.store-hero { position: relative; width: min(1180px, calc(100% - 40px)); height: clamp(330px, 44vw, 470px); margin: 0 auto; overflow: hidden; border-radius: var(--radius); background: #14201d; color: #fff; }
.store-hero > img { width: 100%; height: 100%; object-fit: cover; }
.hero-scrim { position: absolute; inset: 0; background: rgba(8,16,14,0.18); }
.hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 5vw, 58px); }
.hero-content > p { display: flex; align-items: center; gap: 10px; margin: 0; color: #a7bbb4; font: 700 10px ui-monospace, monospace; }
.hero-content > p span { width: 8px; height: 8px; border-radius: 50%; background: #50dab5; box-shadow: 0 0 0 6px rgba(80,218,181,0.12); }
.hero-content h1 { width: min(650px, 82%); margin: auto 0; font-size: clamp(40px, 6.4vw, 78px); line-height: 1.1; font-weight: 860; }
.hero-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.hero-foot > p { width: min(520px, 58%); margin: 0; color: #d4dedb; font-size: 12px; line-height: 1.7; }
.hero-facts { display: flex; gap: 28px; }
.hero-facts span { display: grid; gap: 4px; color: #9daea9; font-size: 9px; }
.hero-facts b { color: #fff; font-size: 20px; }

.catalog-section { width: min(1180px, calc(100% - 40px)); margin: 48px auto 58px; }
.catalog-heading, .section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.catalog-heading h2, .section-title h2 { margin: 0; font-size: 24px; }
.catalog-heading > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; text-align: right; }
.category-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 26px 0 20px; padding-bottom: 4px; scrollbar-width: none; }
.category-tab { height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 5px; padding: 0 15px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 750; }
.category-tab:hover, .category-tab.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.store-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; min-height: 240px; }
.catalog-loading { grid-column: 1 / -1; display: grid; min-height: 240px; place-items: center; align-content: center; color: var(--muted); }
.catalog-loading span, .order-loading span { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin 800ms linear infinite; }
.catalog-loading p, .order-loading p { margin: 12px 0 0; font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform 180ms, box-shadow 180ms; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 14px 35px rgba(14,21,19,0.08); }
.product-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #192421; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 260ms; }
.product-card:hover .product-image img { transform: scale(1.025); }
.product-badge { position: absolute; left: 13px; top: 13px; min-height: 24px; border-radius: 4px; padding: 0 8px; background: var(--yellow); color: var(--ink); font-size: 9px; font-weight: 850; line-height: 24px; }
.product-card-body { padding: 18px; }
.product-card h3 { margin: 0; font-size: 16px; }
.product-card p { min-height: 42px; margin: 9px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.product-stock { display: flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 10px; }
.product-stock.low { color: var(--orange); }
.product-stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.product-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.product-price { font-size: 22px; font-weight: 850; }
.product-price small { font-size: 10px; font-weight: 600; }
.sold-out { opacity: 0.62; }
.sold-out .buy-button { cursor: not-allowed; background: #8a9590; border-color: #8a9590; }
.trust-band { display: grid; width: min(1180px, calc(100% - 40px)); grid-template-columns: repeat(3, 1fr); margin: 0 auto 58px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-band > div { display: flex; align-items: center; gap: 14px; padding: 24px; border-right: 1px solid var(--line); }
.trust-band > div:last-child { border-right: 0; }
.trust-band svg { width: 21px; color: var(--teal-dark); }
.trust-band strong, .trust-band small { display: block; }
.trust-band strong { font-size: 12px; }
.trust-band small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.store-footer { display: flex; width: min(1180px, calc(100% - 40px)); min-height: 110px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); }
.store-footer strong, .store-footer span { display: block; }
.store-footer strong { font-size: 13px; }
.store-footer span, .store-footer p { color: var(--muted); font-size: 9px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6,12,10,0.64); backdrop-filter: blur(5px); }
.purchase-modal { width: min(500px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: var(--radius); background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,0.24); }
.purchase-modal > header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.purchase-modal h2 { margin: 0; font-size: 20px; }
.purchase-product { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin: 20px 24px; padding: 12px; border-radius: 6px; background: #f2f5f1; }
.purchase-product img { width: 66px; height: 52px; border-radius: 5px; object-fit: cover; }
.purchase-product strong, .purchase-product span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-product strong { font-size: 12px; }
.purchase-product span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.purchase-product > b { font-size: 17px; }
.purchase-modal form { display: grid; gap: 18px; padding: 4px 24px 24px; }
.purchase-modal label, .support-form label { display: grid; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 750; }
.purchase-modal input, .support-form input, .support-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; outline: none; }
.purchase-modal input, .support-form input { height: 44px; padding: 0 13px; }
.support-form textarea { padding: 12px 13px; resize: vertical; line-height: 1.6; }
.purchase-modal input:focus, .support-form input:focus, .support-form textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10,163,143,0.12); }
.stepper { display: grid; width: 154px; grid-template-columns: 40px 1fr 40px; border: 1px solid var(--line); border-radius: 6px; }
.stepper button { display: grid; place-items: center; border: 0; background: #f4f6f3; }
.stepper button:first-child { border-radius: 5px 0 0 5px; }
.stepper button:last-child { border-radius: 0 5px 5px 0; }
.stepper input { height: 40px; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0; padding: 0; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.stepper svg { width: 15px; }
.checkout-note, .delivery-warning, .order-help { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.checkout-note svg, .delivery-warning svg, .order-help svg { width: 15px; flex: 0 0 15px; color: var(--teal-dark); }
.checkout-total { display: flex; align-items: flex-end; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); }
.checkout-total span { color: var(--muted); font-size: 11px; }
.checkout-total strong { font-size: 28px; }
.form-error { min-height: 18px; margin: -8px 0 0; color: var(--red); font-size: 11px; }

.order-header { border-bottom: 1px solid var(--line); }
.order-main { width: min(880px, calc(100% - 40px)); min-height: calc(100vh - 186px); margin: 44px auto 70px; }
.order-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.order-title h1 { margin: 0; font-size: 30px; }
.order-status { display: inline-flex; min-height: 30px; align-items: center; border-radius: 5px; padding: 0 11px; background: #e9eeeb; color: var(--muted); font-size: 11px; font-weight: 800; }
.order-status.paid { background: var(--mint); color: var(--teal-dark); }
.order-status.unpaid { background: #fff3c9; color: #816800; }
.order-status.refunded { background: #ffeadf; color: #a84421; }
.order-summary, .delivery-section, .support-section { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.order-loading { display: grid; min-height: 250px; place-items: center; align-content: center; color: var(--muted); }
.order-overview { padding: 26px; }
.order-overview-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.order-overview h2 { margin: 0 0 7px; font-size: 19px; }
.order-overview p { margin: 0; color: var(--muted); font-size: 10px; }
.order-amount { font-size: 28px; font-weight: 850; }
.order-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; padding-top: 23px; }
.order-facts span { display: block; color: var(--muted); font-size: 9px; }
.order-facts strong { display: block; overflow-wrap: anywhere; margin-top: 7px; font-size: 11px; }
.payment-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 26px; border-top: 1px solid var(--line); background: #fafbf8; }
.payment-action p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.payment-action strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 12px; }
.wechat-payment { align-items: stretch; background: #f6fbf8; }
.payment-copy { display: flex; align-items: center; gap: 13px; }
.wechat-mark { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 6px; background: #08b65f; color: #fff; }
.wechat-mark svg { width: 20px; }
.payment-qr { display: grid; width: 174px; flex: 0 0 174px; justify-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.payment-qr img { display: block; width: 154px; height: 154px; }
.payment-qr span { color: #56615d; font-size: 9px; }
.payment-launch { min-width: 150px; text-decoration: none; }
.mobile-payment { align-items: center; }
.countdown { color: var(--orange); font-weight: 800; }
.section-title { padding: 22px 24px 18px; }
.delivery-warning { margin: 0 24px 16px; padding: 11px 12px; border-radius: 5px; background: #fff7dd; color: #735e0e; }
.delivery-warning svg { color: #9e7f0b; }
.delivery-list { display: grid; gap: 9px; padding: 0 24px 24px; }
.delivery-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf7; }
.delivery-item > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 5px; background: var(--mint); color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.delivery-item code { overflow: hidden; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.support-copy { margin: 0; padding: 0 24px 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.support-section > .section-title > span { color: var(--muted); font-size: 10px; }
.support-form { display: grid; gap: 16px; padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.support-form .buy-button { justify-self: end; }
.buyer-chat { display: grid; gap: 13px; max-height: 430px; overflow-y: auto; padding: 18px 24px; border-top: 1px solid var(--line); background: #f8faf7; }
.buyer-message { display: flex; }
.buyer-message.buyer { justify-content: flex-end; }
.buyer-bubble { max-width: 72%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px 7px 7px 2px; background: #fff; line-height: 1.6; white-space: pre-wrap; }
.buyer-message.buyer .buyer-bubble { border-color: #a7ddd2; border-radius: 7px 7px 2px 7px; background: var(--mint); }
.buyer-bubble time { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.order-help { margin: 26px 6px 0; }
.toast-stack { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; padding: 13px 16px; border: 1px solid #a6ddd1; border-radius: 6px; background: #f3fffb; box-shadow: 0 18px 50px rgba(14,21,19,0.15); color: #176657; font-size: 12px; }
.toast.error { border-color: #f2c2b8; background: #fff4f1; color: #9e362d; }

/* Sidebar catalog: persistent brand panel beside a single product feed. */
body[data-template="minimal"] { --paper: #f7f8f5; --surface: #fff; --line: #dfe4df; --muted: #6c7571; --teal: #16866e; --teal-dark: #116b59; --mint: #e1f2eb; }
body[data-template="minimal"] .brand-glyph { background: #111815; color: #fff; }
body.store-page[data-template="minimal"] main { display: grid; width: min(1240px, calc(100% - 40px)); grid-template-columns: minmax(250px, 0.72fr) minmax(0, 2fr); gap: 28px 36px; margin: 0 auto 60px; align-items: start; }
body.store-page[data-template="minimal"] .store-hero { position: sticky; top: 18px; width: 100%; height: min(690px, calc(100vh - 96px)); min-height: 560px; margin: 0; border: 1px solid var(--line); background: #dfe8e2; color: var(--ink); }
body.store-page[data-template="minimal"] .store-hero > img { filter: saturate(0.4) brightness(1.16); }
body.store-page[data-template="minimal"] .hero-scrim { background: linear-gradient(to bottom, rgba(248,250,247,0.12), rgba(248,250,247,0.92)); }
body.store-page[data-template="minimal"] .hero-content { padding: 28px; }
body.store-page[data-template="minimal"] .hero-content h1 { width: 100%; margin-top: auto; margin-bottom: 30px; color: #111815; font-size: 42px; }
body.store-page[data-template="minimal"] .hero-content > p, body.store-page[data-template="minimal"] .hero-foot > p, body.store-page[data-template="minimal"] .hero-facts span { color: #45524d; }
body.store-page[data-template="minimal"] .hero-foot { align-items: flex-start; flex-direction: column; gap: 20px; }
body.store-page[data-template="minimal"] .hero-foot > p { width: 100%; }
body.store-page[data-template="minimal"] .hero-facts b { color: #111815; }
body.store-page[data-template="minimal"] .catalog-section { width: 100%; margin: 18px 0 0; }
body.store-page[data-template="minimal"] .catalog-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
body.store-page[data-template="minimal"] .catalog-heading > p { text-align: left; }
body.store-page[data-template="minimal"] .store-products { grid-template-columns: 1fr; }
body.store-page[data-template="minimal"] .product-card { display: grid; min-height: 188px; grid-template-columns: 210px minmax(0, 1fr); }
body.store-page[data-template="minimal"] .product-image { height: 100%; aspect-ratio: auto; }
body.store-page[data-template="minimal"] .product-card:hover { transform: none; border-color: #aeb8b1; box-shadow: none; }
body.store-page[data-template="minimal"] .product-card-body { display: flex; flex-direction: column; }
body.store-page[data-template="minimal"] .product-buy-row { margin-top: auto; }
body.store-page[data-template="minimal"] .trust-band { width: 100%; grid-column: 2; margin: 0; }

/* Operations terminal: categories become a command rail and products become rows. */
body[data-template="terminal"] { --ink: #eef7f3; --paper: #0a100e; --surface: #101916; --line: #263630; --muted: #8c9c96; --teal: #28d5ae; --teal-dark: #6de4c8; --mint: #153e34; --orange: #ff7042; --yellow: #e6d55f; background: var(--paper); }
body[data-template="terminal"] .store-header, body[data-template="terminal"] .store-footer { border-color: var(--line); }
body[data-template="terminal"] .brand-glyph { background: var(--teal); color: #07100d; }
body.store-page[data-template="terminal"] .store-hero { height: 240px; border: 1px solid #294038; background: #07100d; }
body.store-page[data-template="terminal"] .store-hero > img { opacity: 0.45; filter: saturate(0.65) contrast(1.2); }
body.store-page[data-template="terminal"] .hero-scrim { background: linear-gradient(90deg, rgba(3,10,8,0.94), rgba(3,10,8,0.32)); }
body.store-page[data-template="terminal"] .hero-content { padding: 30px 38px; }
body.store-page[data-template="terminal"] .hero-content h1 { width: 60%; margin: auto 0 18px; color: #f1faf7; font: 760 44px ui-monospace, SFMono-Regular, Consolas, monospace; }
body.store-page[data-template="terminal"] .hero-content h1::after { content: "_"; color: var(--teal); animation: terminal-blink 1s steps(1) infinite; }
@keyframes terminal-blink { 50% { opacity: 0; } }
body.store-page[data-template="terminal"] .hero-foot > p, body.store-page[data-template="terminal"] .hero-content > p, body.store-page[data-template="terminal"] .hero-facts span { color: #a7bbb4; }
body.store-page[data-template="terminal"] .catalog-section { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px 24px; }
body.store-page[data-template="terminal"] .catalog-heading { grid-column: 1 / -1; }
body.store-page[data-template="terminal"] .category-tabs { grid-column: 1; align-content: start; flex-direction: column; margin: 0; padding: 14px; border: 1px solid var(--line); background: #0d1513; }
body.store-page[data-template="terminal"] .category-tab { width: 100%; border-color: transparent; background: transparent; color: var(--muted); text-align: left; }
body.store-page[data-template="terminal"] .category-tab:hover, body.store-page[data-template="terminal"] .category-tab.active { border-color: var(--teal); background: var(--teal); color: #07100d; }
body.store-page[data-template="terminal"] .store-products { grid-column: 2; grid-template-columns: 1fr; }
body.store-page[data-template="terminal"] .product-card { display: grid; min-height: 156px; grid-template-columns: 170px minmax(0, 1fr); border-color: var(--line); background: var(--surface); }
body.store-page[data-template="terminal"] .product-card:hover { transform: translateX(3px); border-color: #3a6c5e; box-shadow: none; }
body.store-page[data-template="terminal"] .product-image { height: 100%; aspect-ratio: auto; background: #07100d; }
body.store-page[data-template="terminal"] .product-image img { opacity: 0.82; }
body[data-template="terminal"] .product-badge { background: var(--teal); color: #07100d; }
body[data-template="terminal"] .buy-button { border-color: var(--teal); background: var(--teal); color: #07100d; }
body[data-template="terminal"] .outline-button, body[data-template="terminal"] .purchase-modal, body[data-template="terminal"] .order-summary, body[data-template="terminal"] .delivery-section, body[data-template="terminal"] .support-section { border-color: var(--line); background: var(--surface); color: var(--ink); }
body[data-template="terminal"] .purchase-product, body[data-template="terminal"] .payment-action, body[data-template="terminal"] .delivery-item, body[data-template="terminal"] .buyer-chat { background: #0c1412; }
body[data-template="terminal"] .purchase-modal input, body[data-template="terminal"] .support-form input, body[data-template="terminal"] .support-form textarea { border-color: var(--line); background: #0c1412; color: var(--ink); }
body[data-template="terminal"] .payment-qr { border-color: #dce3dd; background: #fff; }
body[data-template="terminal"] .payment-qr span { color: #46514d; }

/* Visual gallery: full-bleed cover followed by an asymmetric merchandise wall. */
body[data-template="gallery"] { --paper: #f4f1ed; --surface: #fff; --line: #dcd6cf; --muted: #756f69; --teal: #2d7565; --teal-dark: #215b50; --mint: #dfeee7; --yellow: #e3c85c; }
body.store-page[data-template="gallery"] .store-header { position: absolute; z-index: 4; left: 50%; width: min(1180px, calc(100% - 40px)); color: #fff; transform: translateX(-50%); }
body.store-page[data-template="gallery"] .store-header .outline-button { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.12); color: #fff; backdrop-filter: blur(8px); }
body.store-page[data-template="gallery"] .secure-line { color: #e8efec; }
body.store-page[data-template="gallery"] .secure-line svg { color: #fff; }
body.store-page[data-template="gallery"] .store-hero { width: 100%; height: 560px; border-radius: 0; }
body.store-page[data-template="gallery"] .hero-scrim { background: linear-gradient(0deg, rgba(5,13,10,0.7), rgba(5,13,10,0.1)); }
body.store-page[data-template="gallery"] .hero-content { width: min(1180px, 100%); margin: 0 auto; padding-top: 112px; }
body.store-page[data-template="gallery"] .hero-content h1 { width: min(760px, 82%); margin-top: auto; font-size: 68px; }
body.store-page[data-template="gallery"] .catalog-section { margin-top: 64px; }
body.store-page[data-template="gallery"] .store-products { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
body.store-page[data-template="gallery"] .product-card { grid-column: span 4; }
body.store-page[data-template="gallery"] .product-card:nth-child(6n + 1) { grid-column: span 7; }
body.store-page[data-template="gallery"] .product-card:nth-child(6n + 2) { grid-column: span 5; }
body.store-page[data-template="gallery"] .product-card:nth-child(6n + 1) .product-image { aspect-ratio: 16 / 7; }
body.store-page[data-template="gallery"] .product-card:nth-child(6n + 2) .product-image { aspect-ratio: 16 / 10; }
body.store-page[data-template="gallery"] .trust-band { border: 0; background: #e9e4de; }

/* Compact shop: split introduction with a dense category-and-product workspace. */
body[data-template="compact"] { --paper: #eef1f2; --surface: #fff; --line: #d5dddc; --muted: #63706e; --teal: #087e78; --teal-dark: #07645f; --mint: #d9efec; --yellow: #f1cc52; }
body.store-page[data-template="compact"] .store-header { height: 64px; }
body.store-page[data-template="compact"] .store-hero { display: grid; height: 310px; grid-template-columns: 42% 58%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
body.store-page[data-template="compact"] .store-hero > img { height: 100%; grid-column: 1; filter: saturate(0.72); }
body.store-page[data-template="compact"] .hero-scrim { display: none; }
body.store-page[data-template="compact"] .hero-content { position: static; grid-column: 2; grid-row: 1; padding: 30px 34px; }
body.store-page[data-template="compact"] .hero-content h1 { width: 100%; margin: auto 0 20px; color: var(--ink); font-size: 38px; }
body.store-page[data-template="compact"] .hero-content > p, body.store-page[data-template="compact"] .hero-foot > p, body.store-page[data-template="compact"] .hero-facts span { color: var(--muted); }
body.store-page[data-template="compact"] .hero-foot { align-items: flex-start; flex-direction: column; gap: 15px; }
body.store-page[data-template="compact"] .hero-foot > p { width: 100%; }
body.store-page[data-template="compact"] .hero-facts b { color: var(--ink); }
body.store-page[data-template="compact"] .catalog-section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px 24px; margin-top: 32px; }
body.store-page[data-template="compact"] .catalog-heading { grid-column: 1; align-items: flex-start; flex-direction: column; justify-content: flex-start; }
body.store-page[data-template="compact"] .catalog-heading > p { text-align: left; }
body.store-page[data-template="compact"] .category-tabs { grid-column: 1; align-content: start; flex-direction: column; margin: 4px 0 0; }
body.store-page[data-template="compact"] .category-tab { width: 100%; text-align: left; }
body.store-page[data-template="compact"] .store-products { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; gap: 10px; }
body.store-page[data-template="compact"] .product-card { display: grid; min-height: 142px; grid-template-columns: 140px minmax(0, 1fr); }
body.store-page[data-template="compact"] .product-image { height: 100%; aspect-ratio: auto; }
body.store-page[data-template="compact"] .product-card-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 20px; align-content: center; }
body.store-page[data-template="compact"] .product-card h3, body.store-page[data-template="compact"] .product-card p, body.store-page[data-template="compact"] .product-stock { grid-column: 1; }
body.store-page[data-template="compact"] .product-card p { min-height: 0; margin-bottom: 8px; }
body.store-page[data-template="compact"] .product-buy-row { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; align-items: flex-end; justify-content: center; margin: 0; padding: 0 0 0 20px; border-top: 0; border-left: 1px solid var(--line); }
body.store-page[data-template="compact"] .trust-band { margin-bottom: 34px; background: var(--surface); }

.order-status.closed { background: #ecefed; color: #59645f; }
.closed-payment { background: #f3f5f3; }
.closed-mark { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 6px; background: #dfe4e1; color: #59645f; }
.closed-mark svg { width: 20px; }

@media (max-width: 800px) {
  .store-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-hero { height: 390px; }
  .hero-content h1 { width: 90%; }
  .hero-foot { align-items: flex-start; flex-direction: column; gap: 16px; }
  .hero-foot > p { width: 82%; }
  .trust-band { grid-template-columns: 1fr; }
  .trust-band > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-band > div:last-child { border-bottom: 0; }
  .order-facts { grid-template-columns: 1fr 1fr; }
  body.store-page[data-template="minimal"] main { display: block; width: auto; margin-bottom: 0; }
  body.store-page[data-template="minimal"] .store-hero { position: relative; top: auto; width: calc(100% - 40px); height: 420px; min-height: 0; margin: 0 auto; }
  body.store-page[data-template="minimal"] .catalog-section, body.store-page[data-template="minimal"] .trust-band { width: calc(100% - 40px); margin-right: auto; margin-left: auto; }
  body.store-page[data-template="terminal"] .catalog-section, body.store-page[data-template="compact"] .catalog-section { grid-template-columns: 1fr; }
  body.store-page[data-template="terminal"] .catalog-heading, body.store-page[data-template="terminal"] .category-tabs, body.store-page[data-template="terminal"] .store-products,
  body.store-page[data-template="compact"] .catalog-heading, body.store-page[data-template="compact"] .category-tabs, body.store-page[data-template="compact"] .store-products { grid-column: 1; grid-row: auto; }
  body.store-page[data-template="terminal"] .category-tabs, body.store-page[data-template="compact"] .category-tabs { flex-direction: row; overflow-x: auto; }
  body.store-page[data-template="terminal"] .category-tab, body.store-page[data-template="compact"] .category-tab { width: auto; }
  body.store-page[data-template="gallery"] .product-card, body.store-page[data-template="gallery"] .product-card:nth-child(n) { grid-column: span 6; }
}

@media (max-width: 560px) {
  .store-header { width: calc(100% - 28px); height: 66px; }
  .store-brand { min-width: 0; }
  .store-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .secure-line { display: none; }
  .store-header-actions .outline-button span { display: none; }
  .store-header-actions .outline-button { width: 40px; padding: 0; }
  .store-hero { width: calc(100% - 28px); height: 350px; }
  .hero-content { padding: 25px; }
  .hero-content h1 { width: 100%; font-size: 39px; }
  .hero-foot > p { width: 100%; }
  .hero-facts { gap: 20px; }
  .catalog-section { width: calc(100% - 28px); margin-top: 38px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .catalog-heading > p { text-align: left; }
  .store-products { grid-template-columns: 1fr; }
  .trust-band, .store-footer { width: calc(100% - 28px); }
  .store-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 10px; }
  .store-footer p { margin: 0; }
  .purchase-modal { max-height: calc(100vh - 20px); }
  .purchase-product { grid-template-columns: 58px minmax(0, 1fr); }
  .purchase-product img { width: 58px; }
  .purchase-product > b { grid-column: 2; }
  .order-main { width: calc(100% - 28px); margin-top: 30px; }
  .order-title h1 { font-size: 25px; }
  .order-overview-top, .payment-action { align-items: flex-start; flex-direction: column; }
  .wechat-payment { align-items: center; }
  .mobile-payment { width: 100%; align-items: stretch; }
  .mobile-payment .payment-copy { align-items: center; }
  .payment-launch { width: 100%; min-height: 48px; }
  .payment-copy { align-self: stretch; }
  .payment-qr { width: 174px; align-self: center; }
  .order-amount { font-size: 24px; }
  .order-facts { gap: 18px 12px; }
  .section-title { align-items: flex-start; }
  .section-title .outline-button span { display: none; }
  .section-title .outline-button { width: 40px; padding: 0; }
  .buyer-bubble { max-width: 88%; }
  body[data-template="minimal"] .store-hero { height: 310px; }
  body[data-template="minimal"] .hero-content { padding: 25px; }
  body[data-template="minimal"] .hero-content h1 { font-size: 38px; }
  body.store-page[data-template="minimal"] .product-card { grid-template-columns: 112px minmax(0, 1fr); min-height: 220px; }
  body.store-page[data-template="terminal"] .store-hero { height: 300px; }
  body.store-page[data-template="terminal"] .hero-content { padding: 24px; }
  body.store-page[data-template="terminal"] .hero-content h1 { width: 100%; font-size: 34px; }
  body.store-page[data-template="terminal"] .hero-foot { align-items: flex-start; flex-direction: column; gap: 12px; }
  body.store-page[data-template="terminal"] .hero-foot > p { width: 100%; }
  body.store-page[data-template="terminal"] .category-tabs { padding: 8px; }
  body.store-page[data-template="terminal"] .product-card { min-height: 188px; grid-template-columns: 112px minmax(0, 1fr); }
  body.store-page[data-template="gallery"] .store-header { width: calc(100% - 28px); }
  body.store-page[data-template="gallery"] .store-hero { width: 100%; height: 500px; }
  body.store-page[data-template="gallery"] .hero-content { padding: 92px 24px 28px; }
  body.store-page[data-template="gallery"] .hero-content h1 { width: 100%; font-size: 42px; }
  body.store-page[data-template="gallery"] .store-products { grid-template-columns: 1fr; }
  body.store-page[data-template="gallery"] .product-card, body.store-page[data-template="gallery"] .product-card:nth-child(n) { grid-column: 1; }
  body.store-page[data-template="gallery"] .product-card:nth-child(n) .product-image { aspect-ratio: 16 / 9; }
  body.store-page[data-template="compact"] .store-hero { display: block; height: 410px; }
  body.store-page[data-template="compact"] .store-hero > img { width: 100%; height: 42%; }
  body.store-page[data-template="compact"] .hero-content { position: absolute; inset: 42% 0 0; padding: 20px 22px; }
  body.store-page[data-template="compact"] .hero-content > p { display: none; }
  body.store-page[data-template="compact"] .hero-content h1 { margin: 0 0 auto; font-size: 30px; }
  body.store-page[data-template="compact"] .hero-foot { gap: 8px; }
  body.store-page[data-template="compact"] .product-card { min-height: 190px; grid-template-columns: 104px minmax(0, 1fr); }
  body.store-page[data-template="compact"] .product-card-body { display: flex; flex-direction: column; gap: 0; }
  body.store-page[data-template="compact"] .product-buy-row { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .product-card .buy-button { gap: 4px; padding: 0 10px; }
  .product-card .buy-button svg { display: none; }
  .toast-stack { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}
