:root {
  color-scheme: light;
  --page: #f5f5f5;
  --canvas: #f4f4f4;
  --paper: #fff;
  --white: #fff;
  --ink: #333;
  --muted: #666;
  --jade: #ff5142;
  --sage: #ffebe7;
  --line: #eee;
  --warning: #775225;
  --warning-bg: #f6ecda;
  --red: #a33430;
  --radius: 10px;
  --serif: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --ui: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img, svg { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #38856d; outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
#app { width: min(100%, 520px); min-height: 100vh; min-height: 100svh; margin-inline: auto; background: var(--page); }
.page { display: grid; gap: 15px; padding: 17px 17px 36px; }
.tab-page { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: calc(55px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: var(--page); border-bottom: 1px solid #e5e7de; }
.mainbar { justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; letter-spacing: .07em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--white); background: var(--jade); }
.brand-mark svg { width: 20px; height: 20px; }
.top-account, .back { display: grid; place-items: center; min-width: 42px; min-height: 42px; border-radius: 12px; }
.top-account { background: var(--sage); }
.subpage strong { font-size: 15px; }
.subpage .back { margin-left: -7px; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 5; transform: translateX(-50%); width: min(100%, 520px); padding: 7px 9px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); }
.bottom-nav a { min-height: 49px; border-radius: 13px; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 12px; }
.bottom-nav a[aria-current='page'] { background: var(--sage); font-weight: 650; color: var(--jade); }
.bottom-nav svg { width: 22px; height: 22px; }
.hero { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--sage); }
.hero-slide { position: relative; }
.hero-slide img { width: 100%; aspect-ratio: 1.68; object-fit: cover; object-position: 55% 50%; }
.hero-default::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0b2a23ad 1%, #102c222e 57%, transparent); pointer-events: none; }
.hero-caption { position: absolute; inset: 0 auto 0 7%; z-index: 1; display: grid; align-content: center; justify-items: start; gap: 14px; color: var(--white); }
.hero-caption h1 { font: 700 clamp(27px, 7vw, 39px)/1.2 var(--serif); letter-spacing: .08em; text-shadow: 0 1px 10px #13312955; }
.hero-caption a { min-height: 42px; display: flex; align-items: center; gap: 4px; border: 1px solid #ffffffa0; padding: 7px 13px; border-radius: 25px; font-size: 13px; background: #10251c55; }
.hero-caption svg { width: 15px; height: 15px; }
.carousel-dots { position: absolute; inset: auto 0 5px; display: flex; justify-content: center; gap: 2px; }
.carousel-dots button { padding: 0; border: 0; width: 30px; height: 28px; background: transparent; display: grid; place-items: center; }
.carousel-dots button::after { content: ''; width: 7px; height: 7px; border-radius: 6px; background: #fff9; }
.carousel-dots button[aria-pressed='true']::after { width: 17px; background: white; }
.notice { display: flex; align-items: flex-start; gap: 10px; border-radius: 13px; background: var(--sage); padding: 12px; }
.notice svg { width: 20px; flex: 0 0 20px; }
.notice p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.home-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 12px 4px; }
.home-links a { min-height: 68px; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; font-size: 12px; white-space: nowrap; }
.home-links a > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--sage); color: var(--jade); }
.home-links a svg { width: 20px; height: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 33px; margin: 2px 0 10px; gap: 8px; }
.section-heading h2 { font-family: var(--serif); font-size: 20px; }
.section-heading > span { font-size: 13px; color: var(--muted); }
.text-link { color: var(--jade); text-decoration: underline; text-decoration-color: #8ba99a; text-underline-offset: 4px; font-size: 13px; }
.page-title { padding: 4px 0 1px; }
.page-title h1 { font: 700 27px/1.25 var(--serif); }
.page-title p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.form-panel, .review-summary, .article { padding: 15px; }
.form-panel { display: grid; gap: 13px; }
.form-panel h2 { font-size: 17px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 14px; }
.field > span { font-weight: 600; }
.field input, .field textarea { width: 100%; min-width: 0; min-height: 45px; padding: 10px 11px; border: 1px solid #cbd8cc; border-radius: 10px; color: var(--ink); background: var(--white); font-size: 16px; }
.field input:disabled { background: var(--page); opacity: 1; }
.field input[type='file'] { font-size: 13px; padding: 8px; }
.field input[type='file']::file-selector-button { margin-right: 9px; color: var(--jade); background: var(--sage); border: 0; padding: 5px 9px; border-radius: 5px; }
.field textarea { resize: vertical; }
fieldset { display: grid; min-width: 0; margin: 0; padding: 0; border: 0; gap: 13px; }
.auth-heading { display: flex; gap: 13px; align-items: center; padding: 8px 0 2px; }
.auth-heading > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--white); background: var(--jade); }
.form-links { display: flex; justify-content: center; gap: 28px; }
.check-line { display: flex; align-items: center; gap: 8px; min-height: 31px; font-size: 14px; color: var(--muted); }
.check-line input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--jade); }
.check-line a { color: var(--jade); text-decoration: underline; text-underline-offset: 3px; }
.check-line.spread strong { margin-left: auto; color: var(--ink); }
.code-field { display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 9px 14px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; line-height: 1.35; font-weight: 650; text-align: center; text-decoration: none; }
.btn.primary { color: var(--white); background: var(--jade); }
.btn.secondary { color: var(--jade); border-color: #bfcfc0; background: var(--paper); }
.btn.subtle { color: var(--jade); background: var(--sage); }
.btn:disabled { color: #52675b; background: #e4e9e2; border-color: #dbe4d9; }
.full { width: 100%; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.market-hero, .account-hero { display: flex; align-items: center; gap: 12px; padding: 17px; border-radius: var(--radius); color: var(--white); background: linear-gradient(120deg, #164437, #356958); }
.market-hero div, .account-hero div:nth-child(2) { flex: 1; min-width: 0; }
.market-hero h1, .account-hero h1 { font: 700 25px/1.25 var(--serif); overflow-wrap: anywhere; }
.market-hero p, .account-hero p { color: #e1ede4; font-size: 13px; margin: 4px 0; overflow-wrap: anywhere; }
.avatar { width: 46px; height: 46px; border: 1px solid #ffffff55; background: #ffffff15; display: grid; place-items: center; border-radius: 50%; flex: 0 0 46px; }
.scene-info, .tally { display: flex; padding: 12px 3px; }
.scene-info > div, .tally > div { flex: 1 1 0; display: grid; text-align: center; gap: 3px; border-right: 1px solid var(--line); padding-inline: 4px; min-width: 0; }
.scene-info > div:last-child, .tally > div:last-child { border: 0; }
.scene-info span, .tally span { color: var(--muted); font-size: 12px; }
.scene-info strong, .tally strong { font-size: clamp(13px, 4vw, 17px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.product-card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.product-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.product-copy { display: grid; gap: 7px; padding: 10px; }
.product-copy h3 { font-size: 14px; overflow-wrap: anywhere; }
.product-copy strong, .amount { color: var(--jade); font-variant-numeric: tabular-nums; }
.product-detail { overflow: hidden; }
.detail-photo { width: 100%; aspect-ratio: 1.1; object-fit: cover; }
.product-detail-copy { display: grid; gap: 10px; padding: 15px; }
.image-fallback { display: grid; place-items: center; background: var(--sage); color: var(--jade); }
.image-fallback svg { width: 27px; height: 27px; }
.amount { font-size: 23px; line-height: 1.2; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 16px; color: var(--jade); background: var(--sage); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status.warning { color: var(--warning); background: var(--warning-bg); }
.action-bar { position: sticky; bottom: 0; z-index: 4; background: var(--page); padding: 9px 0 calc(9px + env(safe-area-inset-bottom)); }
.action-bar:not(.pair) .btn { width: 100%; }
.empty { display: grid; min-height: 135px; place-items: center; align-content: center; gap: 6px; padding: 16px 10px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed #d6e0d4; border-radius: var(--radius); }
.empty h2 { color: var(--ink); font-size: 15px; }
.empty p { font-size: 13px; }
.empty .btn { margin-top: 5px; }
.empty-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; background: var(--sage); color: var(--jade); }
.empty-icon svg { width: 19px; height: 19px; }
.center-page { display: grid; justify-items: center; align-content: center; text-align: center; gap: 12px; padding: 18px; min-height: 100vh; min-height: 100svh; }
.center-page .empty { width: 100%; max-width: 330px; }
.loading { min-height: 150px; display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.loading span { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--jade); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; justify-content: space-between; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); padding: 3px; }
.tabs a { min-width: 0; flex: 1; display: grid; place-items: center; min-height: 41px; padding: 4px 1px; font-size: 13px; white-space: nowrap; border-radius: 8px; }
.tabs a[aria-current='page'] { font-weight: 700; color: var(--jade); background: var(--sage); }
.stack { display: grid; gap: 10px; }
.order-card, .warehouse-card, .payment-card, .order-shortcuts { padding: 12px; }
.order-card header, .warehouse-card footer, .order-actions, .payment-card header { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.order-card header, .warehouse-card footer, .order-actions { font-size: 12px; color: var(--muted); }
.order-card header, .warehouse-card footer { padding-block: 4px; }
.warehouse-card footer { border-top: 1px solid var(--line); margin-top: 7px; }
.order-card .item { margin-top: 9px; }
.item { display: grid; align-items: center; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; }
.item h3 { font-size: 14px; overflow-wrap: anywhere; }
.item span { font-size: 12px; color: var(--muted); }
.item strong { text-align: right; font-size: 13px; }
.item-photo { width: 52px; aspect-ratio: 1; border-radius: 9px; object-fit: cover; }
.item-photo svg { width: 18px; }
.inline-actions { display: flex; gap: 7px; }
.inline-actions .btn { padding-inline: 9px; }
.order-actions { margin-top: 11px; }
.pagination { display: flex; gap: 9px; justify-content: center; }
.payment-card { display: grid; gap: 8px; }
.payment-card header div > span { color: var(--muted); font-size: 12px; }
.payment-card h3 { font-size: 15px; overflow-wrap: anywhere; }
.value-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 14px; }
.value-row > span { color: var(--muted); flex-shrink: 0; }
.value-row strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.value-row.total { padding: 9px 0 1px; border-top: 1px solid var(--line); }
.value-row.total strong { color: var(--jade); font-size: 19px; }
.review-summary { display: grid; gap: 7px; }
.message { padding: 10px; border-radius: 9px; color: var(--jade); background: var(--sage); font-size: 13px; overflow-wrap: anywhere; }
.message.warning { color: var(--warning); background: var(--warning-bg); }
.muted { color: var(--muted); font-size: 13px; }
summary { cursor: pointer; padding: 6px 0; color: var(--jade); font-size: 14px; font-weight: 620; }
.compact-form { display: grid; gap: 8px; margin-top: 6px; }
.protected-image { max-height: 300px; max-width: 100%; object-fit: contain; border-radius: 7px; }
.qr-pair { display: flex; gap: 10px; flex-wrap: wrap; }
.qr-pair figure { width: 120px; }
.form-panel figure { justify-self: center; max-width: 180px; }
figcaption { text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.menu { padding-inline: 11px; }
.menu-row { display: flex; align-items: center; min-height: 51px; gap: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.menu-row > span:nth-child(2) { flex: 1; }
.menu-row:last-child { border-bottom: none; }
.menu-row small { color: var(--muted); }
.row-icon { color: var(--jade); background: var(--sage); border-radius: 8px; display: grid; place-items: center; width: 31px; height: 31px; }
.row-icon svg { width: 17px; height: 17px; }
.chevron svg { width: 17px; height: 17px; color: var(--muted); }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shortcuts a { min-height: 55px; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center; font-size: 12px; }
.shortcuts a svg { width: 19px; height: 19px; color: var(--jade); }
.article { overflow-wrap: anywhere; }
.article :is(p, ul, ol, blockquote) + :is(p, ul, ol, blockquote) { margin-top: 9px; }
.article-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.upload-field { display: grid; gap: 9px; }
.signature { width: 100%; display: block; aspect-ratio: 48 / 19; touch-action: none; background: var(--white); border: 1px dashed #9db2a3; border-radius: 12px; }
.invite { padding: 21px 13px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.invite strong { font-size: 24px; letter-spacing: .065em; user-select: all; }
.address-preview { border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-wrap: anywhere; }
.address-preview p { font-size: 13px; color: var(--muted); }
dialog { margin: auto; padding: 0; max-width: min(420px, calc(100vw - 30px)); border: 0; border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 20px 70px #091e1670; }
dialog::backdrop { background: #1b322bb0; }
.dialog-content { min-width: min(340px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 17px; }
.dialog-content h2 { font-size: 19px; }
.dialog-content .article, .dialog-content .article-text { max-height: 52vh; padding: 2px; overflow-y: auto; }
.dialog-actions { margin-top: 3px; }
.dialog-actions button:only-child { grid-column: 1 / -1; }
.snackbar { position: fixed; z-index: 9; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); width: max-content; max-width: min(440px, calc(100vw - 30px)); color: var(--white); background: #333; border-radius: 11px; padding: 10px 15px; text-align: center; transform: translateX(-50%); overflow-wrap: anywhere; }
.snackbar.error { background: var(--red); }
.snackbar:has(~ dialog[open]) { bottom: 13px; }
.dialog-error { color: var(--red); font-size: 13px; }
@media (max-width: 350px) {
  .page { padding-inline: 12px; }
  .tabs a { font-size: 12px; }
  .shortcuts a, .home-links a { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading span { animation: none; }
}
