:root {
  --brand: #1768ed;
  --brand-deep: #0f4fc8;
  --brand-pale: #eaf2ff;
  --ink: #10213d;
  --muted: #6c7c96;
  --line: #e8edf5;
  --surface: #ffffff;
  --page: #f5f8fd;
  --success: #12ad74;
  --danger: #e44f5f;
  --warning: #f19532;
  --shadow: 0 18px 45px rgba(29, 72, 141, .12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--page); }
button, input { font: inherit; }
button { cursor: pointer; }
button, input { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }

.app-shell { width: 100%; min-height: 100vh; overflow-x: hidden; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: max(20px, env(safe-area-inset-top)) 18px 28px;
  color: #fff;
  background: linear-gradient(145deg, #2285f5 0%, #1767ec 48%, #144fd1 100%);
  border-radius: 0 0 30px 30px;
}
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 80%); pointer-events: none; }
.hero-orb { position: absolute; border-radius: 999px; background: rgba(255,255,255,.11); filter: blur(2px); }
.hero-orb-one { width: 210px; height: 210px; top: -105px; right: -60px; }
.hero-orb-two { width: 150px; height: 150px; bottom: 10px; left: -90px; }
.topbar, .notice-card, .hero-actions { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 auto; background: #fff; color: var(--brand); border-radius: 18px; box-shadow: 0 12px 24px rgba(4, 49, 137, .22); }
.brand-mark svg { width: 32px; stroke-width: 2.2; }
.brand-copy { min-width: 0; flex: 1; }
.eyebrow, .section-kicker { margin: 0 0 3px; font-size: 10px; font-weight: 800; letter-spacing: .18em; opacity: .72; }
.brand-copy h1 { overflow: hidden; margin: 0; font-size: 20px; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.status-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: rgba(255,255,255,.78); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; }
.status-dot.online { border: 0; background: #60eeae; box-shadow: 0 0 0 4px rgba(96,238,174,.13); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 14px; }
.hero-button { flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.14); backdrop-filter: blur(12px); }
.hero-button svg { width: 22px; }
.notice-card { display: flex; width: 100%; align-items: center; gap: 12px; margin-top: 28px; padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: inherit; background: rgba(7, 55, 160, .22); text-align: left; backdrop-filter: blur(12px); }
.notice-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; background: rgba(255,255,255,.14); }
.notice-copy { min-width: 0; }
.notice-copy { flex: 1; }
.notice-copy span { font-size: 11px; color: rgba(255,255,255,.65); }
.notice-copy p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; font-size: 13px; line-height: 1.7; color: rgba(255,255,255,.92); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notice-arrow { width: 18px; flex: 0 0 auto; color: rgba(255,255,255,.7); }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; }
.hero-action { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 10px; border: 0; border-radius: 15px; background: #fff; color: var(--brand-deep); font-size: 13px; font-weight: 700; box-shadow: 0 10px 24px rgba(7, 51, 139, .2); }

main { width: min(100%, 1180px); margin: 0 auto; }
.catalog { padding: 30px 17px 10px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 19px; }
.section-kicker { color: var(--brand); opacity: 1; }
.section-heading h2, .sheet-title h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.product-count { padding: 6px 10px; border-radius: 999px; color: var(--brand); background: var(--brand-pale); font-size: 12px; font-weight: 700; }
.search-box { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 15px; border: 1px solid transparent; border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(35, 69, 121, .07); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: #a9c7ff; box-shadow: 0 10px 28px rgba(23,104,237,.12); }
.search-box svg { flex: 0 0 auto; color: #8290a6; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #9ba6b7; }
.search-box button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: #75849b; background: #eef2f7; }
.search-box button svg { width: 15px; }
.category-list { display: flex; overflow-x: auto; gap: 9px; margin: 17px -17px 0; padding: 0 17px 4px; scrollbar-width: none; }
.category-list::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; color: #66758c; background: var(--surface); font-size: 13px; font-weight: 650; }
.category-chip.active { border-color: var(--brand); color: #fff; background: var(--brand); box-shadow: 0 7px 18px rgba(23,104,237,.22); }
.refresh-row { display: flex; align-items: center; justify-content: space-between; margin: 17px 2px 11px; color: #8b98aa; font-size: 11px; }
.refresh-row button { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 0; color: var(--brand); background: transparent; font-size: 12px; }
.refresh-row button svg { width: 15px; }
.refresh-row button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.product-grid { display: grid; gap: 13px; }
.product-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; padding: 16px; overflow: hidden; border: 1px solid rgba(224,231,241,.85); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(36, 71, 126, .07); }
.product-card:active { transform: scale(.99); }
.product-visual { display: grid; place-items: center; width: 52px; height: 52px; color: var(--brand); border-radius: 16px; background: linear-gradient(145deg, #edf5ff, #dceaff); }
.product-visual svg { width: 27px; }
.product-body { min-width: 0; }
.product-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-type { display: inline-flex; padding: 4px 8px; color: var(--brand); border-radius: 7px; background: var(--brand-pale); font-size: 10px; font-weight: 750; }
.stock-badge { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 10px; font-weight: 700; white-space: nowrap; }
.stock-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock-badge.low { color: var(--warning); }
.stock-badge.empty { color: #9aa5b6; }
.product-title { margin: 9px 0 12px; color: #21304a; font-size: 14px; line-height: 1.58; font-weight: 650; overflow-wrap: anywhere; }
.product-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.price { color: #ef683c; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.price small { margin-right: 2px; font-size: 12px; }
.buy-button { min-width: 74px; padding: 9px 14px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #287cf4, #1458d8); font-size: 12px; font-weight: 750; box-shadow: 0 7px 16px rgba(23,104,237,.2); }
.buy-button:disabled { cursor: not-allowed; color: #9aa5b6; background: #eef1f5; box-shadow: none; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; color: #8eaeeb; border-radius: 24px; background: #e9f1ff; }
.empty-icon svg { width: 34px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.trust-strip { display: grid; gap: 10px; margin: 20px 17px 22px; padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.74); }
.trust-strip > div { display: flex; align-items: center; gap: 12px; }
.trust-strip > div > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--brand); border-radius: 11px; background: var(--brand-pale); font-size: 10px; font-weight: 800; }
.trust-strip p { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.trust-strip strong { font-size: 12px; }
.trust-strip small { color: var(--muted); font-size: 11px; }

.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(65px + env(safe-area-inset-bottom)); padding: 7px 20px env(safe-area-inset-bottom); border-top: 1px solid rgba(226,232,240,.85); background: rgba(255,255,255,.92); box-shadow: 0 -9px 30px rgba(31, 58, 102, .08); backdrop-filter: blur(18px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; color: #8e99aa; background: transparent; font-size: 10px; }
.bottom-nav button.active { color: var(--brand); font-weight: 750; }
.bottom-nav svg { width: 21px; }

.modal-layer { position: fixed; z-index: 50; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(8, 20, 42, .53); backdrop-filter: blur(4px); animation: fade-in .2s ease; }
.sheet { position: relative; z-index: 1; width: 100%; max-height: 91vh; overflow-y: auto; padding: 22px 19px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(5, 22, 53, .2); animation: sheet-in .25s ease; }
.sheet-handle { width: 38px; height: 4px; margin: -10px auto 19px; border-radius: 5px; background: #dce2eb; }
.sheet-close { position: absolute; top: 20px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; color: #6f7e93; background: #f0f3f7; }
.sheet-close svg { width: 18px; }
.purchase-heading { padding-right: 43px; }
.purchase-heading h2 { margin: 10px 0 7px; font-size: 20px; line-height: 1.4; }
.purchase-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.purchase-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 19px 0; }
.purchase-meta > div { padding: 13px; border-radius: 14px; background: #f5f8fc; }
.purchase-meta span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.purchase-meta strong { color: var(--ink); font-size: 16px; }
.purchase-meta > div:first-child strong { color: #ed673d; }
.form-group { margin-top: 17px; }
.form-group > label { display: block; margin-bottom: 8px; color: #34435c; font-size: 12px; font-weight: 700; }
.stepper { display: inline-grid; grid-template-columns: 42px 58px 42px; height: 42px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.stepper button { border: 0; color: var(--brand); background: #f0f5ff; font-size: 20px; }
.stepper input { width: 100%; border: 0; outline: 0; text-align: center; color: var(--ink); background: #fff; font-weight: 750; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.text-field { display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; }
.text-field:focus-within { border-color: #9dbfff; box-shadow: 0 0 0 3px rgba(23,104,237,.08); }
.text-field svg { flex: 0 0 auto; width: 19px; color: #8291a8; }
.text-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.field-tip { margin: 7px 2px 0; color: #8a97a9; font-size: 10px; }
.order-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 21px; padding: 15px 0 13px; border-top: 1px dashed #dce3ed; }
.order-total span { color: var(--muted); font-size: 13px; }
.order-total strong { color: #ed6136; font-size: 26px; }
.primary-button, .secondary-button { width: 100%; min-height: 48px; border: 0; border-radius: 14px; font-weight: 750; }
.primary-button { color: #fff; background: linear-gradient(135deg, #2b81f5, #1457d7); box-shadow: 0 11px 24px rgba(23,104,237,.25); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
.secondary-button { color: var(--brand); background: var(--brand-pale); }
.form-message { min-height: 16px; margin: 8px 2px 0; color: var(--danger); font-size: 11px; text-align: center; }
.sheet-title { padding-right: 45px; }
.sheet-title > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.order-search { display: flex; gap: 8px; margin-top: 20px; }
.order-search input { min-width: 0; flex: 1; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); }
.order-search input:focus { border-color: #9dbfff; }
.order-search button { width: 70px; border: 0; border-radius: 12px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 750; }
.order-query-message { text-align: left; }
.recent-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 11px; }
.recent-heading h3 { margin: 0; font-size: 14px; }
.recent-heading span { color: var(--muted); font-size: 11px; }
.recent-orders { display: grid; gap: 10px; }
.order-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fafcff; }
.order-card-head, .order-card-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-card-head strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.order-card-head span { flex: 0 0 auto; color: var(--success); font-size: 10px; font-weight: 750; }
.order-card-title { margin: 10px 0; color: #4c5b70; font-size: 12px; line-height: 1.5; }
.order-card-total { color: #8a97a9; font-size: 10px; }
.order-card-total strong { color: #ec663d; font-size: 14px; }
.order-card button { width: 100%; margin-top: 10px; padding: 8px; border: 0; border-radius: 9px; color: var(--brand); background: var(--brand-pale); font-size: 11px; font-weight: 700; }
.orders-empty { padding: 29px 10px; color: var(--muted); text-align: center; font-size: 12px; }

.dialog { position: relative; z-index: 1; width: calc(100% - 34px); max-width: 430px; padding: 27px 20px 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); animation: dialog-in .22s ease; }
.success-dialog, .support-dialog { text-align: center; }
.success-mark { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 21px; color: #fff; background: linear-gradient(145deg, #25c68b, #0ca86f); box-shadow: 0 12px 24px rgba(18,173,116,.23); }
.success-mark svg { width: 33px; stroke-width: 2.5; }
.success-dialog h2, .support-dialog h2 { margin: 4px 0 7px; font-size: 23px; }
.success-dialog > p:not(.section-kicker), .support-dialog > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.order-number-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 18px; padding: 12px; border-radius: 13px; background: #f3f6fa; text-align: left; }
.order-number-row span { color: var(--muted); font-size: 10px; }
.order-number-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-number-row button, .delivery-heading button { padding: 5px 8px; border: 0; border-radius: 7px; color: var(--brand); background: #e5efff; font-size: 10px; font-weight: 700; }
.delivery-box { margin: 11px 0 17px; padding: 13px; border: 1px solid #bcd4ff; border-radius: 14px; background: #f4f8ff; text-align: left; }
.delivery-heading { display: flex; align-items: center; justify-content: space-between; color: #4f6079; font-size: 10px; }
.delivery-box pre { max-height: 150px; overflow: auto; margin: 12px 0 0; padding: 11px; border-radius: 10px; color: #18335d; background: #fff; font: 600 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.support-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 8px auto 15px; color: var(--brand); border-radius: 20px; background: var(--brand-pale); }
.support-mark svg { width: 30px; }
.support-dialog .secondary-button { margin-top: 20px; }
.support-dialog .sheet-close { top: 14px; right: 14px; }
.notice-dialog { max-height: calc(100vh - 34px); overflow-y: auto; text-align: center; }
.notice-dialog .sheet-close { top: 14px; right: 14px; }
.notice-dialog-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 8px auto 15px; color: var(--brand); border-radius: 20px; background: var(--brand-pale); }
.notice-dialog-mark svg { width: 30px; }
.notice-dialog h2 { margin: 4px 0 14px; font-size: 23px; }
.notice-dialog-content { max-height: min(34vh, 260px); overflow-y: auto; padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: #43526a; background: #f8faff; font-size: 13px; line-height: 1.8; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-dialog-actions { display: grid; gap: 9px; margin-top: 17px; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: calc(83px + env(safe-area-inset-bottom)); left: 18px; width: fit-content; max-width: calc(100% - 36px); margin: auto; padding: 11px 16px; border-radius: 11px; color: #fff; background: rgba(15, 31, 58, .92); box-shadow: 0 12px 30px rgba(8,21,45,.22); font-size: 12px; text-align: center; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes dialog-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }

@media (min-width: 680px) {
  body { padding: 26px 0; }
  .app-shell { width: min(100% - 36px, 1120px); margin: auto; overflow: hidden; border: 1px solid rgba(224,231,241,.9); border-radius: 32px; background: #f7f9fd; box-shadow: 0 28px 80px rgba(29,60,109,.13); }
  .hero { min-height: 340px; padding: 28px 34px 31px; border-radius: 0 0 32px 32px; }
  .topbar, .notice-card, .hero-actions { max-width: 850px; margin-right: auto; margin-left: auto; }
  .notice-card { margin-top: 30px; }
  .hero-actions { grid-template-columns: 180px 180px; justify-content: center; }
  .catalog { padding: 35px 34px 14px; }
  .category-list { margin-right: -34px; margin-left: -34px; padding-right: 34px; padding-left: 34px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-strip { grid-template-columns: repeat(3, 1fr); margin-right: 34px; margin-left: 34px; }
  .bottom-nav { right: 50%; left: auto; width: 360px; bottom: 18px; height: 62px; padding: 6px 15px; border: 1px solid rgba(226,232,240,.9); border-radius: 20px; transform: translateX(50%); box-shadow: 0 14px 35px rgba(27,59,108,.18); }
  .modal-layer { align-items: center; padding: 24px; }
  .sheet { width: min(100%, 520px); max-height: calc(100vh - 48px); padding: 25px 27px 24px; border-radius: 26px; }
  .sheet-handle { display: none; }
  .sheet-close { top: 18px; right: 20px; }
}

@media (max-width: 679px) {
  .hero-button, .notice-card, .bottom-nav, .modal-backdrop { backdrop-filter: none; }
  .bottom-nav { background: #fff; }
  .icon-button, .sheet-close { width: 44px; height: 44px; }
  .category-chip { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .refresh-row button { min-width: 64px; min-height: 44px; justify-content: flex-end; }
  .search-box button { width: 44px; height: 44px; margin-right: -11px; }
  .search-box input, .text-field input { min-height: 44px; }
  .buy-button, .hero-action, .order-search button, .order-card button,
  .order-number-row button, .delivery-heading button { min-height: 44px; }
  .stepper { grid-template-columns: 44px 58px 44px; min-height: 44px; }
  .bottom-nav button { min-height: 44px; }
}

@media (min-width: 1050px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
